/* ==========================================================================
   AYHAN YALCIN — personal site
   Design system: "Signal" — near-black canvas, one accent, hairline grid.
   --------------------------------------------------------------------------
   01  Tokens
   02  Reset & base
   03  Layout primitives
   04  Atmosphere (glows, grain, grid lines, progress)
   05  Typography components
   06  Buttons, chips, tags
   07  Masthead & navigation
   08  Hero & system diagram
   09  Metrics
   10  Positioning & chain
   11  Expertise panels
   12  Selected work
   13  Tech stack
   14  Experience timeline
   15  Working style
   16  Availability
   17  Contact & footer
   18  Reveal animations
   19  Responsive
   20  Reduced motion & print
   ========================================================================== */

/* ── 01  Tokens ─────────────────────────────────────────────────────────── */

:root {
  /* Surface */
  --bg:            #08090A;
  --bg-soft:       #0B0D0F;
  --bg-raised:     #101316;
  --bg-hover:      rgba(255, 255, 255, .022);
  /* Fill of a cell inside a hairline grid. Matches the ground in the dark
     theme; the light theme lifts it to white. */
  --surface:       #08090A;

  /* Lines */
  --line:          rgba(255, 255, 255, .075);
  --line-soft:     rgba(255, 255, 255, .045);
  --line-strong:   rgba(255, 255, 255, .14);

  /* Text */
  --text:          #EDEEF0;
  --text-2:        #9CA3AC;
  --text-3:        #7A818A;

  /* Accent — a single colour, used sparingly */
  --accent:        #4D7EFF;
  --accent-soft:   #93B0FF;
  --accent-glow:   rgba(77, 126, 255, .16);
  --accent-line:   rgba(77, 126, 255, .38);

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
               Menlo, Consolas, monospace;

  /* Layout */
  --shell:   1280px;
  --gutter:  clamp(20px, 5vw, 56px);
  --section: clamp(88px, 12vw, 168px);
  --header-h: 72px;

  /* Solid fills — the primary button inverts against the ground */
  --on-solid:      #08090A;
  --on-accent:     #05070C;

  /* Translucent veils */
  --veil-1:        rgba(255, 255, 255, .012);
  --veil-2:        rgba(255, 255, 255, .014);
  --veil-header:   rgba(8, 9, 10, .68);
  --veil-menu:     rgba(8, 9, 10, .93);

  /* Rings, shadows, highlights */
  --ring:          rgba(255, 255, 255, .10);
  --ring-hover:    rgba(255, 255, 255, .16);
  --shadow-btn:    0 8px 24px -12px rgba(0, 0, 0, .9);
  --shadow-panel:  0 40px 90px -50px rgba(0, 0, 0, 1);
  --panel-top:     rgba(255, 255, 255, .04);
  --portrait-scrim: rgba(8, 9, 10, .45);
  /* Dimmed so a lit face doesn't outshout the headline on a black ground */
  --portrait-filter: grayscale(1) contrast(1.05) brightness(.9);

  /* Accent washes — every tint derives from the one accent hue */
  --glow-a:        rgba(77, 126, 255, .13);
  --glow-b:        rgba(77, 126, 255, .085);
  --accent-wash:   rgba(77, 126, 255, .07);
  --accent-bloom:  rgba(77, 126, 255, .13);
  --accent-sheen:  rgba(77, 126, 255, .35);
  --accent-shadow: rgba(77, 126, 255, .55);
  --accent-spot:   rgba(77, 126, 255, .10);
  --accent-spot-2: rgba(77, 126, 255, .075);
  --accent-pulse:  rgba(77, 126, 255, .8);

  /* System diagram */
  --node-fill:     rgba(255, 255, 255, .028);
  --node-stroke:   rgba(255, 255, 255, .11);
  --node-fill-hi:  rgba(77, 126, 255, .12);
  --wire:          rgba(255, 255, 255, .12);
  --dot:           rgba(255, 255, 255, .06);
  --grain-op:      .16;

  /* Motion */
  --ease:      cubic-bezier(.22, .68, .28, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --dur:       .45s;
}

/* ── 02  Reset & base ───────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ── 03  Layout primitives ──────────────────────────────────────────────── */

main { position: relative; z-index: 1; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section);
  scroll-margin-top: calc(var(--header-h) + 8px);
}

.section + .section { border-top: 1px solid var(--line-soft); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

/* ── 04  Atmosphere ─────────────────────────────────────────────────────── */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.glow--a {
  top: -22vh; right: -8vw;
  width: 62vw; height: 62vw;
  max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, var(--glow-a), transparent 68%);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.glow--b {
  bottom: -28vh; left: -14vw;
  width: 58vw; height: 58vw;
  max-width: 820px; max-height: 820px;
  background: radial-gradient(circle, var(--glow-b), transparent 70%);
  animation: drift-b 32s var(--ease) infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-5%, 6%, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.06); }
  to   { transform: translate3d(7%, -5%, 0) scale(.94); }
}

/* Fine grain — kills gradient banding and adds texture */
.grain {
  position: absolute;
  inset: -100%;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Architectural hairlines behind the whole page.
   They sit mid-gutter rather than on the content edge — a rule running directly
   under the first character of a column reads as a clipped glyph. */
.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: calc(var(--gutter) * .5);
}
.grid-lines span {
  width: 1px;
  background: linear-gradient(180deg,
    transparent, var(--line-soft) 14%, var(--line-soft) 86%, transparent);
}

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1.5px;
  z-index: 90;
  pointer-events: none;
}
.progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent));
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ── 05  Typography components ──────────────────────────────────────────── */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow i { font-style: normal; color: var(--accent); opacity: .85; }
.eyebrow-num {
  color: var(--accent);
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(44px, 6vw, 80px);
}

.section-title {
  margin-top: 22px;
  font-size: clamp(34px, 5.2vw, 62px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -.038em;
  color: var(--text);
  text-wrap: balance;
}

.section-sub {
  margin-top: 22px;
  max-width: 56ch;
  font-size: clamp(15px, 1.35vw, 17.5px);
  line-height: 1.65;
  color: var(--text-2);
}

.lead {
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.45;
  letter-spacing: -.022em;
  color: var(--text);
  text-wrap: pretty;
}

.prose {
  margin-top: 22px;
  max-width: 58ch;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.72;
  color: var(--text-2);
  text-wrap: pretty;
}
.lead + .prose { margin-top: 26px; }

/* Masked line reveal for display headlines */
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line-in { display: block; }

/* ── 06  Buttons, chips, tags ───────────────────────────────────────────── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding-inline: 22px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 550;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease),
              background-color .3s var(--ease), border-color .3s var(--ease),
              color .3s var(--ease);
}
.btn svg { width: 15px; height: 15px; transition: transform .35s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }
.btn:active { transform: translateY(0) scale(.985); }

.btn--primary {
  background: var(--text);
  color: var(--on-solid);
  box-shadow: 0 0 0 1px var(--ring), var(--shadow-btn);
}
/* Sheen sweep */
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%,
              var(--accent-sheen) 45%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease-out);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--ring-hover),
              0 14px 40px -14px var(--accent-shadow);
}
.btn--primary:hover::after { transform: translateX(120%); }

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--veil-1);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--bg-hover);
}

.btn--lg {
  height: 58px;
  padding-inline: 30px;
  font-size: 16px;
  border-radius: 10px;
}
.btn--lg svg { width: 17px; height: 17px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--veil-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -.005em;
  color: var(--text-2);
  transition: color .3s var(--ease), border-color .3s var(--ease),
              background-color .3s var(--ease), transform .3s var(--ease-out);
}
.chips li:hover {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-glow);
  transform: translateY(-2px);
}
.chips--lg { gap: 10px; margin-top: 40px; }
.chips--lg li { padding: 9px 18px; font-size: 13px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .01em;
  color: var(--text-3);
}
.tags li { position: relative; }
.tags li + li::before {
  content: "";
  position: absolute;
  left: -8px; top: 50%;
  width: 2px; height: 2px;
  margin-top: -1px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

/* ── 07  Masthead & navigation ──────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color .35s var(--ease), border-color .35s var(--ease),
              backdrop-filter .35s var(--ease);
}
.masthead.is-scrolled {
  background: var(--veil-header);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line-soft);
}

.masthead-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--text);
  transition: border-color .3s var(--ease), color .3s var(--ease),
              box-shadow .3s var(--ease);
}
.brand:hover .brand-mark {
  border-color: var(--accent);
  color: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.brand-name {
  font-size: 14.5px;
  font-weight: 550;
  letter-spacing: -.015em;
}

.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text-2);
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .35s var(--ease-out);
}
.nav a:hover { color: var(--text); background: var(--bg-hover); }
.nav a[aria-current="true"] { color: var(--text); }
.nav a[aria-current="true"]::after { transform: scaleX(1); }

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: -.005em;
  color: var(--text-2);
  white-space: nowrap;
}

.status-dot {
  position: relative;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: ping 2.6s var(--ease) infinite;
}
@keyframes ping {
  0%   { opacity: .8; transform: scale(.6); }
  70%  { opacity: 0;  transform: scale(1.7); }
  100% { opacity: 0;  transform: scale(1.7); }
}

.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  margin-right: -8px;
  border-radius: 8px;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 11px;
  width: 18px; height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .35s var(--ease-out), opacity .2s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 17px; }
.menu-toggle span:nth-child(2) { top: 23px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

.mobile-nav[hidden] { display: none; }

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 79;
  padding: 28px var(--gutter) 40px;
  background: var(--veil-menu);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: menu-in .3s var(--ease-out) both;
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.mobile-nav nav { display: flex; flex-direction: column; }
.mobile-nav a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 24px;
  font-weight: 550;
  letter-spacing: -.03em;
}
.mobile-nav-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

/* ── 08  Hero & system diagram ──────────────────────────────────────────── */

.hero {
  position: relative;
  padding-block: clamp(64px, 10vw, 120px) clamp(72px, 10vw, 128px);
  scroll-margin-top: var(--header-h);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  gap: clamp(40px, 5vw, 72px);
  align-items: center;
}

.hero-eyebrow { animation: rise .8s var(--ease-out) .05s both; }

.hero-title {
  margin-top: 30px;
  font-size: clamp(28px, 8.6vw, 70px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -.045em;
  color: var(--text);
}

/* The two-column hero gives the headline a narrower measure, so it scales
   against the column rather than the viewport. Each line must stay unwrapped —
   the masked reveal clips anything that falls to a second line. */
@media (min-width: 961px) {
  .hero-title { font-size: clamp(44px, 4.9vw, 70px); }
}
.hero-title .line-in { animation: line-up 1s var(--ease-out) both; }
.hero-title .line:nth-child(1) .line-in { animation-delay: .12s; }
.hero-title .line:nth-child(2) .line-in { animation-delay: .22s; }
.hero-title .line:nth-child(3) .line-in { animation-delay: .32s; }

@keyframes line-up {
  from { transform: translateY(108%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes rise {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.hero-sub {
  margin-top: 28px;
  max-width: 52ch;
  font-size: clamp(16px, 1.5vw, 18.5px);
  line-height: 1.65;
  color: var(--text-2);
  text-wrap: pretty;
  animation: rise .9s var(--ease-out) .48s both;
}

.hero-chips { margin-top: 34px; animation: rise .9s var(--ease-out) .58s both; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  animation: rise .9s var(--ease-out) .68s both;
}

/* Portrait + system panel — two cards of equal width, read as one stack */
.hero-visual {
  perspective: 1400px;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.8vw, 24px);
  animation: rise 1.1s var(--ease-out) .4s both;
}

/* Carries the source's own 1200x630 ratio, so the photo is shown whole —
   nothing cropped. Radius matches the system panel below it. */
.portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 630;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: var(--shadow-panel);
  transition: transform .5s var(--ease-out), border-color .4s var(--ease);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: var(--portrait-filter);
  transition: transform .7s var(--ease-out);
}
/* Settles the photo into the palette without tinting the face */
.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, var(--portrait-scrim));
  pointer-events: none;
}
.portrait:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}
.portrait:hover img { transform: scale(1.06); }

.system {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--accent-wash), transparent 62%),
    linear-gradient(180deg, var(--bg-raised), var(--bg-soft));
  box-shadow: var(--shadow-panel),
              inset 0 1px 0 var(--panel-top);
  overflow: hidden;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .5s var(--ease-out);
}

.system-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.system-live { display: inline-flex; align-items: center; gap: 7px; }
.system-live i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2.4s var(--ease) infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .28; } }

.system-svg { width: 100%; height: auto; }

.dot-mark { fill: var(--dot); }

.wire { stroke: var(--wire); stroke-width: 1.25; }

.pulse {
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-dasharray: 30 460;
  stroke-dashoffset: 490;
  filter: drop-shadow(0 0 5px var(--accent-pulse));
  animation: flow 7s linear infinite;
  animation-delay: calc(var(--i) * 1.4s);
}
@keyframes flow {
  0%   { stroke-dashoffset: 490; opacity: 0; }
  6%   { opacity: 1; }
  22%  { stroke-dashoffset: 0; opacity: 1; }
  30%  { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

.node-box {
  fill: var(--node-fill);
  stroke: var(--node-stroke);
  stroke-width: 1;
  transition: fill .3s var(--ease), stroke .3s var(--ease);
}
.node-tick { fill: var(--accent); opacity: .35; }
.node-label {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
}
.node-idx {
  fill: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-anchor: end;
}
.node { animation: node-live 7s var(--ease) infinite; animation-delay: calc(var(--i) * 1.4s); }
@keyframes node-live {
  0%, 14%  { opacity: .62; }
  20%      { opacity: 1; }
  34%, 100%{ opacity: .62; }
}
.node:hover .node-box { fill: var(--node-fill-hi); stroke: var(--accent-line); }
.node:hover .node-tick { opacity: 1; }

/* ── 09  Metrics ────────────────────────────────────────────────────────── */

.metrics {
  position: relative;
  border-block: 1px solid var(--line-soft);
  padding-block: clamp(44px, 5vw, 68px);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
}
/* Every cell carries the same inset — zeroing the outer ones made the edge
   columns hug the container while the inner ones had room. */
.metric {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  padding: 8px clamp(18px, 2.4vw, 34px);
}

.metric-value {
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -.045em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.metric-value em {
  font-style: normal;
  color: var(--accent);
}
.metric-value--word {
  font-size: clamp(26px, 3.1vw, 38px);
  letter-spacing: -.035em;
}

/* Pushed to the cell floor so all four labels share a baseline, even when a
   value wraps to two lines. */
.metric-label {
  margin-top: auto;
  padding-top: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-3);
}

/* ── 10  Positioning & chain ────────────────────────────────────────────── */

.chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(56px, 7vw, 96px);
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.chain-step {
  position: relative;
  background: var(--surface);
  padding: clamp(22px, 2.6vw, 34px) clamp(16px, 2vw, 28px);
  transition: background-color .35s var(--ease);
}
.chain-step::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .5s var(--ease-out);
}
.chain-step:hover { background: var(--bg-hover); }
.chain-step:hover::before { transform: scaleX(1); }

.chain-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--accent);
  opacity: .75;
}
.chain-label {
  display: block;
  margin-top: 14px;
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 550;
  letter-spacing: -.02em;
  color: var(--text);
}

/* ── 11  Expertise panels ───────────────────────────────────────────────── */

.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.panel {
  position: relative;
  background: var(--surface);
  padding: clamp(28px, 3.4vw, 52px);
  overflow: hidden;
  transition: background-color .4s var(--ease);
}
/* Cursor-tracked spotlight */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
              var(--accent-spot), transparent 62%);
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
}
.panel:hover { background: var(--bg-hover); }
.panel:hover::before { opacity: 1; }

.panel-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--text-3);
  transition: color .35s var(--ease);
}
.panel:hover .panel-num { color: var(--accent); }

.panel-title {
  margin-top: 26px;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.03em;
}

.panel-text {
  margin-top: 16px;
  max-width: 42ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
}

.panel .tags {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

/* ── 12  Selected work ──────────────────────────────────────────────────── */

.section--work { padding-bottom: calc(var(--section) + 10px); }

.work-list { border-top: 1px solid var(--line); }

.work {
  position: relative;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(36px, 4.6vw, 64px) clamp(12px, 1.6vw, 28px);
  border-bottom: 1px solid var(--line);
  transition: background-color .45s var(--ease);
}
.work::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(620px circle at var(--mx, 50%) var(--my, 50%),
              var(--accent-spot-2), transparent 60%);
  opacity: 0;
  transition: opacity .45s var(--ease);
  pointer-events: none;
}
.work::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .6s var(--ease-out);
}
.work:hover { background: var(--veil-2); }
.work:hover::before { opacity: 1; }
.work:hover::after { transform: scaleX(1); }

.work-index {
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: relative;
  z-index: 1;
}
.work-num {
  font-family: var(--font-mono);
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--text-3);
  opacity: .5;
  transition: color .4s var(--ease), opacity .4s var(--ease);
}
.work:hover .work-num { opacity: 1; }
.work:hover .work-num { color: var(--accent); }

.work-glyph {
  width: 84px; height: 84px;
  color: var(--text-3);
  opacity: .55;
  transition: color .5s var(--ease), opacity .5s var(--ease),
              transform .7s var(--ease-out);
}
.work:hover .work-glyph {
  color: var(--accent);
  opacity: 1;
  transform: translateY(-3px) rotate(-4deg);
}

.work-body { position: relative; z-index: 1; }

.work-title {
  font-size: clamp(23px, 3.1vw, 40px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -.035em;
  transition: transform .5s var(--ease-out);
}
.work:hover .work-title { transform: translateX(6px); }

.tags--work { margin-top: 20px; }

.work-text {
  margin-top: 24px;
  max-width: 62ch;
  font-size: clamp(15px, 1.3vw, 16.5px);
  line-height: 1.72;
  color: var(--text-2);
  text-wrap: pretty;
}

.work-result {
  position: relative;
  margin-top: 26px;
  padding-left: 20px;
  max-width: 58ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}
.work-result::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), transparent);
}
.work-result-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── 13  Tech stack ─────────────────────────────────────────────────────── */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.stack-col {
  background: var(--surface);
  padding: clamp(26px, 2.6vw, 38px) clamp(18px, 1.8vw, 28px);
}

.stack-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: .9;
}
.stack-list { margin-top: 22px; }
.stack-list li {
  padding: 7px 0;
  font-size: 14.5px;
  color: var(--text-2);
  transition: color .25s var(--ease), transform .25s var(--ease-out);
}
.stack-list li:hover { color: var(--text); transform: translateX(4px); }

/* ── 14  Experience timeline ────────────────────────────────────────────── */

.timeline { position: relative; }

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(30px, 3.4vw, 44px) 0 clamp(30px, 3.4vw, 44px) 34px;
  border-top: 1px solid var(--line-soft);
}
.tl-item:last-child { border-bottom: 1px solid var(--line-soft); }

/* Rail */
.tl-item::before {
  content: "";
  position: absolute;
  left: 4px; top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-item:first-child::before { top: 50%; }
.tl-item:last-child::before  { bottom: 50%; }

/* Node */
.tl-item::after {
  content: "";
  position: absolute;
  left: 0; top: calc(50% - 4.5px);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.tl-item--current::after {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.tl-item:hover::after { border-color: var(--accent); }

.tl-period {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text-3);
  padding-top: 4px;
}
.tl-item--current .tl-period { color: var(--accent); }

.tl-role {
  font-size: clamp(18px, 1.9vw, 23px);
  font-weight: 600;
  letter-spacing: -.028em;
  line-height: 1.25;
}
.tl-org {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--text-2);
}
.tl-text {
  margin-top: 16px;
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-3);
}

/* ── 15  Working style ──────────────────────────────────────────────────── */

.method {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(56px, 7vw, 96px);
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.method-step {
  position: relative;
  background: var(--surface);
  padding: clamp(26px, 3vw, 40px);
  transition: background-color .35s var(--ease);
}
.method-step:hover { background: var(--bg-hover); }

.method-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--accent);
  opacity: .8;
}
.method-word {
  margin-top: 20px;
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 600;
  letter-spacing: -.032em;
}
.method-text {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-3);
}

/* ── 16  Availability ───────────────────────────────────────────────────── */

.availability { max-width: 760px; }
.availability-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

/* ── 17  Contact & footer ───────────────────────────────────────────────── */

.section--contact {
  position: relative;
  padding-block: clamp(104px, 15vw, 200px);
  overflow: hidden;
}
.section--contact::before {
  content: "";
  position: absolute;
  left: 50%; top: 10%;
  width: min(1100px, 120vw); height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-bloom), transparent 76%);
  pointer-events: none;
  filter: blur(20px);
}

.contact { position: relative; }

.contact-title {
  margin-top: 26px;
  font-size: clamp(38px, 7vw, 96px);
  line-height: .98;
  font-weight: 600;
  letter-spacing: -.05em;
}

.contact-sub {
  margin-top: 30px;
  max-width: 46ch;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--text-2);
}

.section--contact .btn--lg { margin-top: 44px; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 36px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--text-2);
  transition: color .3s var(--ease);
}
.contact-links svg {
  width: 13px; height: 13px;
  opacity: .55;
  transition: transform .35s var(--ease-out), opacity .3s var(--ease);
}
.contact-links a:hover { color: var(--text); }
.contact-links a:hover svg { transform: translate(3px, -3px); opacity: 1; }

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-soft);
  padding-block: 40px 48px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
}
.footer-brand {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.015em;
}
.footer-tag {
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--text-3);
}
.footer-tag i { font-style: normal; color: var(--accent); opacity: .7; }
.footer-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

/* ── 18  Reveal animations ──────────────────────────────────────────────── */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Groups cascade their children instead of moving as one block */
.js [data-reveal][data-stagger] { opacity: 1; transform: none; }

.js [data-stagger] > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js [data-stagger].is-in > * { opacity: 1; transform: none; }

/* ── 19  Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .work { grid-template-columns: 150px minmax(0, 1fr); }
  .tl-item { grid-template-columns: 150px minmax(0, 1fr); }
}

@media (max-width: 1080px) {
  .status { display: none; }
  .stack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  :root { --header-h: 64px; }

  .nav { display: none; }
  .menu-toggle { display: block; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 52px; }
  .hero-visual { max-width: 480px; }
  .hero { padding-top: clamp(44px, 8vw, 72px); }

  .split { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: clamp(20px, 3vw, 28px) clamp(14px, 3vw, 24px); }

  .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain-step:last-child { grid-column: 1 / -1; }

  .method { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .grid-lines span:nth-child(2),
  .grid-lines span:nth-child(3),
  .grid-lines span:nth-child(4) { display: none; }

  .panels { grid-template-columns: minmax(0, 1fr); }

  .work {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding-inline: 0;
  }
  .work-index { flex-direction: row; align-items: center; gap: 18px; }
  .work-glyph { width: 48px; height: 48px; }

  .tl-item { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tl-period { padding-top: 0; }
}

@media (max-width: 720px) {
  .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-col { padding-inline: 16px; }
}

@media (max-width: 560px) {
  .brand-name { display: none; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  /* Single column — no vertical rules left to clear, so these align with the
     rest of the page's text edge. */
  .metrics-grid { grid-template-columns: minmax(0, 1fr); }
  .metric { padding-inline: 0; }
  .chain { grid-template-columns: minmax(0, 1fr); }
  .chain-step:last-child { grid-column: auto; }
  .method { grid-template-columns: minmax(0, 1fr); }
  .stack-grid { grid-template-columns: minmax(0, 1fr); }
  .stack-col { padding-inline: 0; }
  .contact-links { gap: 14px 24px; }
}

/* ── 20  Reduced motion & print ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .js [data-reveal],
  .js [data-stagger] > * { opacity: 1; transform: none; }
  .hero-title .line-in,
  .hero-eyebrow, .hero-sub, .hero-chips, .hero-actions, .hero-visual { opacity: 1; transform: none; }
  .pulse { opacity: .55; stroke-dasharray: none; }
  .node { opacity: 1; }
  .system { transform: none !important; }
}

@media print {
  .atmosphere, .grid-lines, .progress, .masthead, .mobile-nav, .hero-visual { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 24px; }
}
