:root {
  /* Monochrome — white, black, gray */
  --bg: #EDE8DC;
  --bg-soft: #E4DECE;
  --paper: #F5F1E8;
  --ink: #0A0A0A;
  --ink-soft: #2A2A2A;
  --muted: #5C5C5C;
  --muted-2: #8A8A8A;
  --line: #E0E0E0;
  --line-soft: #F5F5F5;

  --blue: #0A0A0A;
  --blue-deep: #000000;
  --blue-soft: #E8E8E8;
  --green: #0A0A0A;
  --green-deep: #000000;
  --green-soft: #E8E8E8;
  --coral: #0A0A0A;
  --coral-deep: #000000;
  --coral-soft: #E8E8E8;
  --mint: #0A0A0A;

  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 6px 18px -10px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-lg: 22px;
  --container: 1180px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 17.6px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  isolation: isolate;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(0, 0, 0, 0.03), transparent 45%),
    radial-gradient(circle at 88% 8%, rgba(0, 0, 0, 0.025), transparent 50%);
}

/* ======================================
   INK WASH ON PAPER (subtle animated theme)
====================================== */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* paper grain */
body::before {
  opacity: 0.55;
  background:
    radial-gradient(circle at 18% 22%, rgba(0, 0, 0, 0.02), transparent 55%),
    radial-gradient(circle at 82% 12%, rgba(0, 0, 0, 0.016), transparent 60%),
    repeating-linear-gradient(
      115deg,
      rgba(0, 0, 0, 0.012) 0px,
      rgba(0, 0, 0, 0.012) 1px,
      transparent 1px,
      transparent 6px
    );
  mix-blend-mode: multiply;
}

/* animated ink wash */
body::after {
  opacity: 0.14;
  background:
    radial-gradient(1400px 820px at 12% 26%, rgba(0, 0, 0, 0.16), transparent 58%),
    radial-gradient(1100px 720px at 78% 18%, rgba(0, 0, 0, 0.12), transparent 60%),
    radial-gradient(900px 640px at 62% 76%, rgba(0, 0, 0, 0.10), transparent 62%),
    radial-gradient(700px 520px at 28% 78%, rgba(0, 0, 0, 0.08), transparent 64%);
  filter: blur(10px);
  transform: translate3d(0, 0, 0);
  animation: inkWashDrift 18s var(--ease) infinite alternate;
  mix-blend-mode: multiply;
}

@keyframes inkWashDrift {
  0%   { transform: translate3d(-1.5%, -1%, 0) scale(1.02) rotate(-0.6deg); }
  50%  { transform: translate3d(1.2%, 0.6%, 0) scale(1.04) rotate(0.35deg); }
  100% { transform: translate3d(2.3%, -0.4%, 0) scale(1.06) rotate(0.8deg); }
}

/* keep content above the wash */
body > * { position: relative; z-index: 1; }

/* Custom cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.12s var(--ease);
}

.cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
  opacity: 0.7;
}

.cursor-ring.hover { transform: translate(-50%, -50%) scale(1.6); opacity: 1; }

@media (max-width: 900px) {
  .cursor-dot, .cursor-ring { display: none; }
  body { cursor: auto; }
}

@media (min-width: 901px) {
  body, a, button { cursor: none; }
}

/* Layout */
.container {
  width: min(var(--container), 92%);
  margin: 0 auto;
}

.section {
  padding: 9rem 0 4rem;
  scroll-margin-top: 80px;
}

#skills {
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}

.section-divider {
  padding: 0;
}

.section-divider-line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--ink);
  opacity: 0.15;
}

.section-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--coral);
  margin: 0 0 1.4rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--coral);
  border-radius: 999px;
}

.section-eyebrow.center { display: block; text-align: center; margin-left: auto; margin-right: auto; width: max-content; }

.section-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.section-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}

.section-sub {
  color: var(--muted);
  margin: 0 0 3rem;
  font-size: 1.02rem;
  max-width: 600px;
}

.mono { font-family: 'JetBrains Mono', monospace; }
.small { font-size: 0.86rem; }
.muted { color: var(--muted); }

/* ======================================
   HEADER
====================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(237, 232, 220, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-header.scrolled {
  background: rgba(237, 232, 220, 0.97);
  border-bottom-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 8px 28px -16px rgba(0, 0, 0, 0.10);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-sf {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  transition: opacity 0.2s var(--ease);
}

.brand-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  transition: opacity 0.2s var(--ease);
}

.brand:hover .brand-sf,
.brand:hover .brand-name {
  opacity: 0.65;
}

.nav-links {
  display: flex;
  gap: 2.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  transition: color 0.2s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--ink);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  text-decoration: none;
  background: transparent;
  transition: all 0.25s var(--ease);
}

.btn-resume:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.15);
}

/* ======================================
   BUTTONS
====================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 0.25s var(--ease);
  cursor: none;
}

.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn.primary:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.18);
}

.btn.ghost {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.btn.ghost:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-3px);
}

.btn.big {
  padding: 1.3rem 2.2rem;
  font-size: 1.1rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ======================================
   HERO
====================================== */
.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  padding: clamp(3.5rem, 8vh, 5.5rem) 0 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  grid-template-areas:
    "title    portrait"
    "text     portrait";
  column-gap: clamp(2rem, 5vw, 4rem);
  row-gap: 0;
  align-items: start;
  max-width: min(72rem, 92%);
  width: 100%;
  margin: 0 auto;
}

.hero-text {
  grid-area: text;
  min-width: 0;
  padding-top: 0;
}

.hero-portrait {
  grid-area: portrait;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 0;
}

.hero-portrait .portrait-frame {
  width: 100%;
  max-width: min(360px, 100%);
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 0 0 2rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.pulse {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
  animation: ping 2s infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.25); }
  70%  { box-shadow: 0 0 0 12px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.hero-title {
  grid-area: title;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0 0 1.6rem;
  padding-bottom: 1.6rem;
  border-bottom: 1.5px solid var(--line);
  color: var(--ink);
}

.hero-tagline {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.55rem, 2.9vw, 2.05rem);
  line-height: 1.38;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  max-width: 46ch;
}

.hero-focus {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.9rem;
}

.hero-focus .sep {
  opacity: 0.55;
  margin: 0 0.35rem;
}

.hero-greet {
  display: block;
  font-size: clamp(2.8rem, 6.8vw, 4.8rem);
  line-height: 1.05;
}

.hero-line {
  display: block;
  margin-top: 0.75rem;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  line-height: 1.38;
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 38ch;
}

.hero-title em { font-style: italic; font-weight: 500; }

.hero-title .hl {
  position: relative;
  display: inline-block;
  color: var(--ink);
  font-style: italic;
  font-weight: 600;
  box-decoration-break: clone;
  box-shadow: inset 0 -0.28em 0 rgba(0, 0, 0, 0.09);
}

.hero-title .hl-2 {
  color: var(--ink);
  font-style: italic;
  font-weight: 600;
  box-shadow: inset 0 -0.28em 0 rgba(0, 0, 0, 0.18);
}

.hero-title .hl::before,
.hero-title .hl-2::before { display: none; }

/* old hero-prose styles removed (now uses .hero-focus) */

.hero-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  width: auto;
}

.hero-actions-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.hero-btn-contact {
  width: auto;
}

.hero-actions .btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 1.85rem;
  text-align: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.22s var(--ease), font-weight 0.15s ease;
}

.hero-btn-dark {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-weight: 600;
}

.hero-btn-dark:hover {
  transform: scale(1.04);
  font-weight: 700;
}

.hero-btn-light {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
  font-weight: 600;
}

.hero-btn-light:hover {
  transform: scale(1.04);
  font-weight: 700;
}

.btn-full {
  flex: 1;
  min-width: 140px;
}

@media (min-width: 480px) {
  .hero-actions-row .hero-btn-dark,
  .hero-actions-row .hero-btn-light {
    flex: 1 1 0;
    min-width: 0;
  }
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  animation: bounce 2.4s ease-in-out infinite;
}

.scroll-cue:hover { color: var(--blue-deep); }

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ======================================
   STATS
====================================== */
.stats {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.03) 0%, transparent 45%),
    var(--paper);
  color: var(--ink);
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem 2rem;
}

.stat {
  text-align: left;
  border-left: 3px solid var(--green);
  padding-left: 1.25rem;
  padding-top: 0.25rem;
}
.stat:nth-child(2) { border-left-color: var(--blue); }
.stat:nth-child(3) { border-left-color: var(--green); }
.stat:nth-child(4) { border-left-color: var(--blue); }

.stat-num {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  display: flex;
  align-items: baseline;
}

.stat-num .plus { color: var(--blue); margin-left: 2px; }

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 0.55rem;
  line-height: 1.35;
  max-width: 12rem;
}

/* ======================================
   ABOUT
====================================== */
/* About: copy left, sensor viz right */
.about-split {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 38%);
  gap: 2.5rem 3rem;
  align-items: stretch;
}

.about-copy .section-eyebrow {
  margin-bottom: 1rem;
}

.about-viz {
  display: flex;
  align-items: stretch;
}

.about-viz .sense-viz {
  flex: 1;
  min-height: 100%;
}

/* PORTRAIT */
.about-portrait {
  display: flex;
  justify-content: center;
}

.portrait-frame {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4/5;
  margin: 0;
  isolation: isolate;
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  background: #1a1a1a;
  border-radius: var(--radius-lg);
  z-index: -1;
  transition: inset 0.5s var(--ease), background 0.5s var(--ease);
}

.portrait-frame:hover::before {
  inset: 10px -10px -10px 10px;
  background: #404040;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
  filter: contrast(1.04) saturate(0.92);
  transition: transform 0.5s var(--ease), filter 0.5s var(--ease);
  border: 1.5px solid var(--ink);
}

.portrait-frame:hover img {
  transform: translate(-4px, -4px);
  filter: contrast(1.06) saturate(1);
}

.portrait-tag {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(11, 18, 32, 0.85);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}

/* ======================================
   ROBOTIC ARM ENTRY ANIMATION
====================================== */
.robo-stage {
  position: relative;
  width: 100%;
  max-width: min(360px, 100%);
  margin: 0;
}

.robo-arm {
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: -35px;
  width: 560px;
  height: auto;
  z-index: 3;
  pointer-events: none;
  transform: translate(70vw, -50%);
  animation: roboArmSequence 5s cubic-bezier(0.55, 0.05, 0.3, 0.98) 0.5s both;
  will-change: transform;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
}

.hero-portrait .portrait-frame {
  animation: photoArrival 5s cubic-bezier(0.55, 0.05, 0.3, 0.98) 0.5s both;
  will-change: transform, opacity;
}

@keyframes roboArmSequence {
  0%   { transform: translate(55vw, calc(-50% - 22vh)) rotate(-10deg); }
  45%  { transform: translate(0, -50%) rotate(0deg); }
  62%  { transform: translate(0, -50%) rotate(0deg); }
  100% { transform: translate(50vw, calc(-50% - 16vh)) rotate(8deg); }
}

@keyframes photoArrival {
  0%   { transform: translate(55vw, -22vh) rotate(-12deg); opacity: 0; }
  8%   { opacity: 0; }
  20%  { opacity: 1; }
  45%  { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
}

.joint-shoulder {
  transform-origin: 654px 155px;
  transform-box: view-box;
  animation: jointShoulder 5s cubic-bezier(0.55, 0.05, 0.3, 0.98) 0.5s both;
}

.joint-elbow {
  transform-origin: 412px 155px;
  transform-box: view-box;
  animation: jointElbow 5s cubic-bezier(0.55, 0.05, 0.3, 0.98) 0.5s both;
}

.joint-wrist {
  transform-origin: 226px 155px;
  transform-box: view-box;
  animation: jointWrist 5s cubic-bezier(0.55, 0.05, 0.3, 0.98) 0.5s both;
}

@keyframes jointShoulder {
  0%   { transform: rotate(8deg); }
  35%  { transform: rotate(-3deg); }
  45%  { transform: rotate(0deg); }
  62%  { transform: rotate(0deg); }
  100% { transform: rotate(-12deg); }
}

@keyframes jointElbow {
  0%   { transform: rotate(-18deg); }
  35%  { transform: rotate(5deg); }
  45%  { transform: rotate(0deg); }
  62%  { transform: rotate(0deg); }
  100% { transform: rotate(20deg); }
}

@keyframes jointWrist {
  0%   { transform: rotate(15deg); }
  45%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.gripper-finger-top {
  transform-origin: 100% 50%;
  transform-box: fill-box;
  animation: gripperReleaseTop 5s cubic-bezier(0.55, 0.05, 0.3, 0.98) 0.5s both;
}

.gripper-finger-bottom {
  transform-origin: 100% 50%;
  transform-box: fill-box;
  animation: gripperReleaseBottom 5s cubic-bezier(0.55, 0.05, 0.3, 0.98) 0.5s both;
}

@keyframes gripperReleaseTop {
  0%, 48% { transform: rotate(0deg); }
  58%     { transform: rotate(42deg); }
  100%    { transform: rotate(42deg); }
}

@keyframes gripperReleaseBottom {
  0%, 48% { transform: rotate(0deg); }
  58%     { transform: rotate(-42deg); }
  100%    { transform: rotate(-42deg); }
}

.big-headline {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
  max-width: 34ch;
}

.big-headline em {
  font-style: italic;
  color: var(--blue);
  font-weight: 500;
}

.big-headline em:nth-of-type(2) { color: var(--green); }
.big-headline em:nth-of-type(3) { color: var(--blue); }

.about-text p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 0 0 0.95rem;
  line-height: 1.62;
  max-width: 52ch;
}

.about-text strong { color: var(--ink); font-weight: 600; }
.about-text em { font-style: italic; color: var(--blue); font-weight: 500; }
.about-text { margin-top: 0; }

/* SENSE / SENSOR MESH VIZ */
.sense-viz {
  position: relative;
  margin-top: 0;
  min-height: 340px;
  height: auto;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 35%, rgba(0, 0, 0, 0.06), transparent 55%),
    radial-gradient(circle at 80% 65%, rgba(0, 0, 0, 0.05), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.04), transparent 60%),
    var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sense-viz::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(11, 18, 32, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11, 18, 32, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.sense-viz canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.sense-corner {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  z-index: 2;
}

.sense-corner .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
  animation: ping 2.4s infinite;
}

.sense-corner.top-left { top: 14px; left: 14px; }
.sense-corner.top-right {
  top: 14px;
  right: 14px;
  flex-direction: row-reverse;
}
.sense-corner.bottom-left { bottom: 52px; left: 14px; }

.dot-move { background: var(--blue) !important; animation: none; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); }
.dot-sense { background: var(--green) !important; animation: none; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); }
.dot-respond {
  background: #404040 !important;
  animation: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.sense-legend {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: linear-gradient(to top, rgba(255, 255, 255, 0.97) 40%, rgba(255, 255, 255, 0));
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  z-index: 2;
}

.sense-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sense-legend .lg {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lg-move { background: var(--blue); }
.lg-sense { background: var(--green); }
.lg-respond { background: #404040; }

/* Legacy quick-cards styles kept harmless (unused now) */
.quick-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 2rem;
}

.qcard {
  padding: 1.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.3s var(--ease);
}

.qcard:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.qcard-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--c) 14%, transparent);
  color: var(--c);
  margin-bottom: 1rem;
}

.qcard h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.qcard p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* ======================================
   HEARTBEAT DIVIDER
====================================== */
.pulse-divider {
  padding: 2.5rem 0 2.25rem;
  color: var(--ink);
  position: relative;
}

.pulse-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
}

.pulse-ecg {
  display: block;
  width: 100%;
  height: 64px;
  color: var(--ink);
  opacity: 0.55;
}

.pulse-base {
  opacity: 0.32;
}

.pulse-trace {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: pulseSweep 3.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.18));
}

.pulse-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.35);
  animation: pulseBeat 1.7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes pulseSweep {
  0%   { stroke-dashoffset: 1200; }
  60%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1200; }
}

@keyframes pulseBeat {
  0%   { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.35); }
  35%  { transform: scale(1.25); box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
  55%  { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.25); }
  75%  { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); }
  100% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* ======================================
   WORK / PROJECTS
====================================== */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.75rem;
}

.work-filter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.work-filter:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

.work-filter.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.work-empty {
  margin: 0;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.98rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}

.work-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: none;
  transition: all 0.4s var(--ease);
  text-align: left;
  font-family: inherit;
  color: inherit;
  padding: 0;
}

.work-card:hover {
  transform: translateY(-6px);
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.work-card.flip { grid-template-columns: 1fr 1.1fr; }
.work-card.flip .work-art { order: 2; }

.work-art {
  position: relative;
  align-self: start;
  width: 100%;
  /* Same frame on every card — row height from text must not stretch this taller */
  aspect-ratio: 16 / 10;
  min-height: 200px;
  background: var(--art-bg, var(--bg-soft));
  overflow: hidden;
}

.work-art .art-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.045) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.7;
}

.work-art svg.art-illu {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(70%, 320px);
  height: auto;
  max-height: 78%;
  transform: translate(-50%, -50%);
  color: var(--art-fg, var(--ink));
  transition: transform 0.6s var(--ease);
}

.work-art .work-cover-img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s var(--ease);
}

.work-card:hover .work-cover-img {
  transform: scale(1.05);
}

.work-card:hover .art-illu {
  transform: translate(-50%, -50%) scale(1.05) rotate(-2deg);
}

.work-body {
  padding: 1.9rem 1.9rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.work-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 0.8rem;
  font-weight: 500;
}

.work-card h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
  line-height: 1.1;
  color: var(--ink);
}

.work-card .work-summary {
  color: var(--muted);
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}

.work-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink);
  padding: 0.32rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.work-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.work-card:hover .work-cta { color: var(--ink); }
.work-cta svg { transition: transform 0.3s var(--ease); }
.work-card:hover .work-cta svg { transform: translate(4px, -4px); }

/* Project art-specific colors via CSS vars set inline by JS */

/* ======================================
   EXPERIENCE
====================================== */
.experience { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.xp-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-top: 2rem;
}

.xp-grid--single {
  grid-template-columns: 1fr;
  max-width: 720px;
}

.xp-sticky { position: sticky; top: 100px; align-self: start; }

.xp-list { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); }

.xp-item {
  position: relative;
  padding: 2rem 0 2rem 2rem;
  border-bottom: 1px dashed var(--line);
}

.xp-item:last-child { border-bottom: none; }

.xp-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 2.6rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--ink);
  transition: all 0.3s var(--ease);
}

.xp-item:hover::before {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.3);
}

.xp-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.xp-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.xp-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

.xp-item h3,
.xp-item-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  margin: 0 0 0.2rem;
  line-height: 1.2;
}

.xp-co { color: var(--muted); font-style: italic; font-weight: 500; }

.xp-loc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.xp-item ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.xp-item li { margin-bottom: 0.4rem; }

/* ======================================
   SKILLS
====================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.skill-card {
  position: relative;
  padding: 2rem 1.8rem 1.8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.15);
}

.skill-card:hover::before {
  transform: scaleX(1);
}

.skill-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.skill-card-num {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
}

.skill-card-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chips span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  cursor: default;
  transition: all 0.18s var(--ease);
}

.chips span:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* ======================================
   CONTACT END — minimal closing
====================================== */
.contact-end {
  margin-top: 3rem;
  padding: 4rem 0 3.5rem;
  background: var(--ink);
  color: var(--paper);
  scroll-margin-top: 80px;
}

.contact-end-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 35rem;
  max-width: var(--container);
}

.contact-end-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--paper);
  margin: 0;
}

.contact-end-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--paper);
}

.contact-end-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
}

.contact-end-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: all 0.2s var(--ease);
}

.contact-end-links a:hover {
  color: var(--paper);
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.contact-end-sep {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

@media (max-width: 600px) {
  .contact-end {
    padding: 3rem 0 2.5rem;
  }
}

/* ======================================
   MODAL
====================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 14, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s var(--ease);
}

.modal-panel {
  position: relative;
  width: min(880px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: rise 0.35s var(--ease);
}

.modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem;
  cursor: none;
  transition: all 0.2s var(--ease);
  z-index: 2;
  display: grid;
  place-items: center;
}

.modal-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: rotate(90deg); }

.modal-content { padding: 3rem 3rem 2.4rem; }

.modal-art {
  margin: 0 -3rem 2rem;
  height: 220px;
  background: var(--art-bg, var(--bg-soft));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.modal-art .art-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.modal-art svg {
  position: relative;
  width: 50%;
  max-width: 280px;
  height: auto;
  color: var(--art-fg, var(--ink));
}

.modal-art .modal-cover-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.modal-art--static {
  display: grid;
  place-items: center;
}

.modal-art--gallery {
  display: block;
  padding: 0;
}

.modal-art--gallery .modal-gallery {
  position: relative;
  z-index: 1;
  height: 220px;
  width: 100%;
  overflow: hidden;
}

.modal-art--gallery .modal-gallery-track {
  display: flex;
  width: max-content;
  height: 100%;
  align-items: stretch;
  will-change: transform;
  backface-visibility: hidden;
  animation: modalGalleryMarquee var(--modal-gallery-duration, 48s) linear infinite;
}

.modal-art--gallery .modal-gallery-track:hover {
  animation-play-state: paused;
}

.modal-art--gallery .modal-gallery-track.is-paused {
  animation-play-state: paused;
}

.modal-gallery-img {
  height: 220px;
  width: auto;
  min-width: 260px;
  max-width: 520px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  display: block;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
}

@keyframes modalGalleryMarquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* Full-size photo (modal filmstrip click) */
body.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 110000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 1.75rem);
  box-sizing: border-box;
}

.gallery-lightbox[hidden] {
  display: none !important;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.88);
  cursor: pointer;
  border: none;
  padding: 0;
}

.gallery-lightbox-inner {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(96vw, 1120px);
  max-height: 90vh;
}

.gallery-lightbox-img {
  display: block;
  max-width: min(96vw, 1120px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.06);
}

.m-tagline {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}

.modal-content h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 2rem;
  margin: 0 0 0.7rem;
  letter-spacing: -0.02em;
}

.modal-content .m-summary {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.8rem;
  line-height: 1.6;
}

.modal-section { margin-bottom: 1.6rem; }

.modal-section h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.modal-section p, .modal-section li { color: var(--ink-soft); }
.modal-section ul { margin: 0; padding-left: 1.2rem; }
.modal-section li { margin-bottom: 0.4rem; }

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.modal-tags span {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.78rem;
  padding: 0.32rem 0.72rem;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ======================================
   REVEAL ON SCROLL
====================================== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-line { overflow: hidden; }
.reveal-line > * {
  display: block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease);
}
.reveal-line.in > * { transform: translateY(0); }

/* ======================================
   SUBPAGES (work archive, experience)
====================================== */
.page-main {
  padding-top: 5.5rem;
}

.page-title {
  margin-top: 0.35rem;
}

.page-lead {
  margin-bottom: 2rem;
  max-width: 42rem;
}

.work-more-wrap {
  margin: 2.5rem 0 0;
  text-align: center;
}

.work-more-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.work-more-link:hover {
  border-bottom-color: var(--ink);
  color: var(--ink-soft);
}

.back-link-wrap {
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.back-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.back-link:hover {
  color: var(--ink);
}

/* ======================================
   RESPONSIVE
====================================== */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "portrait"
      "title"
      "text";
    gap: 1.5rem;
    max-width: min(var(--container), 92%);
  }
  .hero-title {
    font-size: clamp(3rem, 13vw, 5.5rem);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .hero-text {
    width: 100%;
    max-width: 44rem;
    padding-top: 0;
  }
  .hero-portrait {
    width: 100%;
    justify-content: center;
    padding-top: 0;
  }
  .hero-portrait .portrait-frame {
    max-width: min(280px, 70vw);
    margin: 0 auto;
  }
  .hero-actions {
    flex-wrap: wrap;
  }
  .hero { min-height: auto; padding: 2rem 0 3.5rem; }
  .about-split { grid-template-columns: 1fr; gap: 2rem; }
  .about-viz { order: 1; }
  .about-copy { order: 0; }
  .sense-viz { min-height: 280px; }
  .quick-cards { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; }
  .work-card, .work-card.flip { grid-template-columns: 1fr; }
  .work-card.flip .work-art { order: 0; }
  .work-art { min-height: 180px; aspect-ratio: 16 / 10; }
  .skills-grid { grid-template-columns: 1fr; }
  .xp-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .xp-sticky { position: static; }
  .section { padding: 6rem 0 2rem; }
  .modal-content { padding: 2rem 1.5rem 1.5rem; }
  .modal-art { margin: 0 -1.5rem 1.5rem; height: 180px; }
  .modal-art--gallery .modal-gallery,
  .modal-gallery-img { height: 180px; }
  .modal-gallery-img { min-width: 200px; max-width: 100%; }
  .work-body { padding: 2rem 1.6rem; }
}

@media (max-width: 520px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .stat { padding-left: 1rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .pulse-trace,
  .pulse-dot { animation: none !important; }
  .pulse-trace { stroke-dashoffset: 0; }
  .hero-actions .btn:hover {
    transform: none;
  }
  body::after { animation: none !important; }
  .robo-arm { display: none; }
  .hero-portrait .portrait-frame { animation: none !important; }
  .modal-art--gallery .modal-gallery {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .modal-art--gallery .modal-gallery-track {
    animation: none !important;
    transform: none;
  }
  .modal-gallery-img { scroll-snap-align: start; }
}
