/* ============================================================
   Burak — personal site
   Monochrome / warm-neutral. Playful & experimental.
   ============================================================ */

/* Design values live in tokens.css, which Base.astro loads first. This
   file only CONSUMES them — do not declare a value here. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; background: var(--bg-edge); transition: background var(--d-fill) var(--ease); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--f-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background var(--d-fill) var(--ease), color var(--d-fill) var(--ease);
  cursor: none;
}

@media (pointer: coarse) { body { cursor: auto; } }

::selection { background: var(--ink); color: var(--bg); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: none; background: none; border: none; color: inherit; }
@media (pointer: coarse) { button, a { cursor: pointer; } }

.mono { font-family: var(--font-mono); }

/* display font (typeface tweak) */
.hero-name, .band-title, .footer .big, .role-line,
.hat h3, .proj .pmain h3, .card .body h3 { font-family: var(--font-display); }

/* grain + vignette overlay ---------------------------------- */
.grain {
  position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none;
  opacity: var(--grain);
  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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: var(--grain-blend, multiply);
}
[data-theme="dark"] .grain { mix-blend-mode: screen; }

/* custom cursor -------------------------------------------- */
.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0; z-index: var(--z-cursor); pointer-events: none;
  border-radius: var(--r-circle); mix-blend-mode: difference;
}
.cursor {
  width: 34px; height: 34px; border: 1.5px solid #fff;
  transform: translate(-50%, -50%);
  transition: width var(--d-quick) var(--ease), height var(--d-quick) var(--ease),
              background var(--d-quick) var(--ease), border-radius 0.2s var(--ease);
}
.cursor-dot { width: 5px; height: 5px; background: #fff; transform: translate(-50%, -50%); }
.cursor.hover { width: 58px; height: 58px; background: rgba(255,255,255,0.12); }
.cursor.text { width: 4px; height: 26px; border-radius: 2px; background: #fff; }
.cursor.down { width: 26px; height: 26px; }
@media (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* layout --------------------------------------------------- */
.wrap { width: var(--container); margin: 0 auto; }
section { position: relative; }

/* ---------- nav ------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  color: var(--ink);
}
.nav .brand {
  font-weight: 600; font-size: 18px; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink);
}
.nav .brand .blip {
  width: 9px; height: 9px; border-radius: var(--r-circle); background: var(--ink);
  animation: pulse 2.4s var(--ease-io) infinite;
}
.brand-logo {
  display: block; height: 14px; width: auto;
  filter: invert(1);                       /* white source → ink (light mode) */
  transition: filter var(--d-base) var(--ease);
}
[data-theme="dark"] .brand-logo { filter: none; }   /* stays light in dark mode */
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.55); opacity: 0.4; } }
.nav-links { display: flex; gap: var(--sp-lg); align-items: center; }
.nav-links a {
  font-family: var(--font-mono); font-size: var(--f-nav);
  letter-spacing: 0.04em; position: relative; padding: 4px 0;
  color: var(--ink);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--ink);
  transition: width var(--d-quick) var(--ease);
}
.nav-links a:hover::after { width: 100%; }
@media (max-width: 720px) { .nav-links a:not(.theme) { display: none; } }

/* mobile burger + fullscreen menu */
.nav-burger {
  display: none; width: 38px; height: 38px; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; position: relative; z-index: var(--z-burger); color: var(--ink); background: none; border: 0;
}
.nav-burger span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--d-base) var(--ease), opacity var(--d-quick) var(--ease); }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: 0; z-index: var(--z-mobile-nav); background: var(--bg);
  display: flex; flex-direction: column; justify-content: center; padding: 84px 9vw 40px;
  opacity: 0; pointer-events: none; transform: translateY(-1.5%);
  transition: opacity var(--d-base) var(--ease), transform var(--d-lift) var(--ease);
}
.mobile-nav.open { opacity: 1; pointer-events: auto; transform: none; }
.mobile-nav-inner { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav a {
  font-family: var(--font-display); font-size: clamp(38px, 12vw, 60px); font-weight: 600;
  letter-spacing: -0.03em; color: var(--ink); padding: var(--sp-xs) 0; line-height: 1.04;
  opacity: 0; transform: translateY(14px); border-bottom: 1px solid var(--line-2);
}
.mobile-nav.open a { opacity: 1; transform: none; transition: opacity var(--d-fill) var(--ease) calc(0.12s + var(--i, 0) * 0.07s), transform var(--d-fill) var(--ease) calc(0.12s + var(--i, 0) * 0.07s); }
.mobile-nav .mn-foot { margin-top: 36px; display: flex; gap: 12px; align-items: center; opacity: 0; transition: opacity var(--d-fill) var(--ease) var(--d-base); }
.mobile-nav.open .mn-foot { opacity: 1; }
@media (max-width: 720px) { .nav-burger { display: flex; } }
@media (min-width: 721px) { .mobile-nav { display: none; } }

.theme {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid color-mix(in srgb, var(--ink) 38%, transparent); border-radius: var(--r-pill);
  padding: 6px 12px; font-family: var(--font-mono); font-size: var(--f-control);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
  transition: border-color var(--d-quick) var(--ease), background var(--d-quick) var(--ease);
}
.theme:hover { border-color: var(--ink); }
.theme .knob {
  width: 8px; height: 8px; border-radius: var(--r-circle); background: var(--ink);
  transition: transform var(--d-base) var(--ease);
}

/* language / currency switcher pill */
.lang-switch {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid color-mix(in srgb, var(--ink) 38%, transparent); border-radius: var(--r-pill);
  padding: 6px 12px; font-family: var(--font-mono); font-size: var(--f-control);
  letter-spacing: 0.06em; color: var(--ink);
  transition: border-color var(--d-quick) var(--ease), background var(--d-quick) var(--ease);
}
.lang-switch:hover { border-color: var(--ink); }
.lang-switch .flag { font-size: var(--f-note); line-height: 1; filter: saturate(1.05); }
.lang-switch .sep { opacity: 0.4; }
.lang-switch .chev { font-size: 9px; opacity: 0.6; transition: transform var(--d-quick) var(--ease); }
.lang-switch[aria-expanded="true"] .chev { transform: rotate(180deg); }
@media (max-width: 720px) { .lang-switch .sep, .lang-switch .cur { display: none; } }

/* language / currency modal */
.lang-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center;
  padding: 20px; background: color-mix(in srgb, var(--invert-bg) 42%, transparent);
  backdrop-filter: blur(8px) saturate(0.9); -webkit-backdrop-filter: blur(8px) saturate(0.9);
  opacity: 0; pointer-events: none; transition: opacity var(--d-base) var(--ease);
}
.lang-overlay.open { opacity: 1; pointer-events: auto; }
.lang-modal {
  width: min(880px, 100%); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-modal); box-shadow: var(--shadow);
  padding: 28px clamp(20px, 4vw, 38px) clamp(24px, 4vw, 36px);
  transform: translateY(16px) scale(0.985); transition: transform var(--d-base) var(--ease);
}
.lang-overlay.open .lang-modal { transform: none; }
.lang-head { display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); padding-bottom: 0; margin-bottom: var(--sp-lg); }
.lang-tab {
  font-size: 21px; font-weight: 600; letter-spacing: -0.02em; color: var(--faint);
  padding: 4px 0 16px; position: relative; transition: color var(--d-quick) var(--ease);
}
.lang-tab.active { color: var(--ink); }
.lang-tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink);
}
.lang-close {
  margin-left: auto; align-self: flex-start; width: 34px; height: 34px; border-radius: var(--r-circle);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: var(--muted);
  border: 1px solid transparent; transition: color var(--d-quick), border-color var(--d-quick), transform var(--d-quick) var(--ease);
}
.lang-close:hover { color: var(--ink); border-color: var(--line); transform: rotate(90deg); }
.lang-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-sm); }
.lang-grid[hidden] { display: none; }
.lang-opt {
  display: flex; align-items: center; gap: 13px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-control); padding: 16px var(--sp-md);
  background: transparent; transition: border-color var(--d-quick) var(--ease), background var(--d-quick) var(--ease), transform var(--d-quick) var(--ease);
}
.lang-opt:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); transform: translateY(-2px); }
.lang-opt.selected { border-color: var(--ink); background: var(--raised); box-shadow: inset 0 0 0 1px var(--ink); }
.lang-opt .flag { font-size: 26px; line-height: 1; }
.lang-opt .meta { display: flex; flex-direction: column; gap: 2px; }
.lang-opt .meta .nm { font-size: var(--f-prose); font-weight: 600; letter-spacing: -0.01em; }
.lang-opt .meta .sub { font-family: var(--font-mono); font-size: var(--f-control); color: var(--faint); letter-spacing: 0.04em; }
@media (max-width: 760px) { .lang-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .lang-grid { grid-template-columns: 1fr; } .lang-modal { border-radius: 18px; } }

/* ---------- hero ------------------------------------------ */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 120px 0 60px; }
.hero .wrap { width: var(--container); }

.hero-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: var(--sp-lg); }
.avail {
  display: inline-flex; align-items: flex-start; gap: 9px;
  font-family: var(--font-mono); font-size: var(--f-nav); color: var(--muted);
}
.avail .dot { width: 8px; height: 8px; border-radius: var(--r-circle); background: var(--status-available); position: relative; margin-top: 0.42em; flex-shrink: 0; }
.avail .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: var(--r-circle);
  border: 1px solid var(--status-available); animation: ring 2s var(--ease-io) infinite;
}
@keyframes ring { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(1.8); opacity: 0; } }

.hero-name {
  font-weight: 600; letter-spacing: -0.04em; line-height: 0.86;
  font-size: var(--f-display);
  margin: 8px 0 0; user-select: none;
  width: max-content; max-width: 100%; position: relative;
}
.hero-name .ch { display: inline-block; transition: transform var(--d-fill) var(--ease); will-change: transform; }
@keyframes chRise { from { transform: translateY(28px); } to { transform: translateY(0); } }
.hero-name .ch.space { width: 0.22em; }

/* hacker decode glitch (hover) */
.hero-name.glitching {
  animation: gl-shake 0.16s steps(2, end) infinite;
}
.hero-name.glitching .ch {
  will-change: contents;
  text-shadow: 0.018em 0 color-mix(in srgb, var(--ink) 12%, transparent),
              -0.018em 0 color-mix(in srgb, var(--ink) 7%, transparent);
}
/* chromatic slice-tear ghosts of the whole word */
.hero-name.glitching::before,
.hero-name.glitching::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0; pointer-events: none; color: var(--ink);
  letter-spacing: inherit; opacity: 0.12; mix-blend-mode: var(--gl-blend, normal);
}
.hero-name.glitching::before { animation: gl-top var(--d-fill) steps(2, end) infinite; }
.hero-name.glitching::after  { animation: gl-bot 0.62s steps(2, end) infinite; }
@keyframes gl-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1.5px, 1px); }
  50% { transform: translate(1.5px, -1px); }
  75% { transform: translate(-1px, 0); }
}
@keyframes gl-top {
  0%   { clip-path: inset(0 0 72% 0); transform: translate(-4px, -1px); }
  30%  { clip-path: inset(14% 0 50% 0); transform: translate(5px, 1px); }
  60%  { clip-path: inset(30% 0 38% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(6% 0 64% 0); transform: translate(4px, -1px); }
}
@keyframes gl-bot {
  0%   { clip-path: inset(62% 0 0 0); transform: translate(4px, 1px); }
  35%  { clip-path: inset(46% 0 22% 0); transform: translate(-5px, -1px); }
  70%  { clip-path: inset(78% 0 0 0); transform: translate(3px, 1px); }
  100% { clip-path: inset(54% 0 12% 0); transform: translate(-4px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  /* signature hover decode is user-initiated & brief — keep it alive */
  .hero-name.glitching { animation-duration: 0.16s !important; }
  .hero-name.glitching::before { animation-duration: var(--d-fill) !important; }
  .hero-name.glitching::after { animation-duration: 0.62s !important; }
}

.hero-sub {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 30px;
  flex-wrap: wrap; margin-top: 30px;
}
.role-line {
  font-size: var(--f-lead); font-weight: 500; letter-spacing: -0.01em; max-width: 16ch;
}
.role-line .tick { color: var(--faint); }
.hero-meta { text-align: right; color: var(--muted); font-family: var(--font-mono); font-size: var(--f-label); line-height: 1.7; }
@media (max-width: 640px) { .hero-meta { text-align: left; } }

.hero-cta { display: flex; gap: var(--sp-sm); margin-top: 44px; flex-wrap: wrap; }

/* buttons -------------------------------------------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 24px; border-radius: var(--r-pill); font-weight: 500; font-size: var(--f-note);
  border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  transition: color var(--d-base) var(--ease), border-color var(--d-quick) var(--ease);
}
.btn .lbl { position: relative; z-index: var(--z-label); display: inline-flex; align-items: center; gap: var(--sp-xs); }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: 1; background: var(--ink);
  transform: translateY(101%); transition: transform var(--d-fill) var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--bg); border-color: var(--ink); }
.btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.solid::before { background: var(--bg); }
.btn.solid:hover { color: var(--ink); }
.btn .arrow { transition: transform var(--d-base) var(--ease); }
.btn:hover .arrow { transform: translate(7px, -7px); }
.btn kbd {
  font-family: var(--font-mono); font-size: var(--f-micro); padding: 2px 6px;
  border: 1px solid currentColor; border-radius: 5px; opacity: 0.6;
}

/* marquee -------------------------------------------------- */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; white-space: nowrap; padding: 16px 0; margin-top: 70px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: inline-flex; gap: 0; animation: scroll var(--mq) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
/* JS takes over scrolling to allow drag */
.marquee.js-marquee { cursor: none; touch-action: pan-y; }
.marquee.js-marquee .marquee-track { animation: none !important; user-select: none; will-change: transform; }
.marquee-track span {
  font-family: var(--font-mono); font-size: var(--f-compact); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); padding: 0 var(--sp-lg);
  display: inline-flex; align-items: center; gap: 39px;
}
.marquee-track span { padding: 0 19.5px; }
.marquee-track span::after { content: "✳"; color: var(--faint); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- ink-wipe: the inline counterpart of .ink-fill --- */
/* An inline box fragments across lines, so an absolutely-positioned fill would
   only cover the first fragment. Same gesture — ink rising from the bottom edge
   over the same duration — carried by a background instead, cloned per fragment.
   Horizontal padding is deliberately absent: cloning would apply it to every
   fragment and push each wrapped line off whatever indent it belongs to. */
.ink-wipe {
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 0;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  padding: 3px 0;
  transition: background-size var(--d-ink) var(--ease), color var(--d-fill) var(--ease);
}
/* doubled, for the same reason .ink-fill is: it must outrank a component's own scoped colour */
.ink-wipe.ink-wipe:hover,
.ink-wipe.ink-wipe:focus-visible { background-size: 100% 100%; color: var(--bg); }
.ink-wipe:focus-visible { outline: none; }
/* A block-level wipe may pad on all four sides: box-decoration-break only
   matters for an inline box that fragments, and a block never does. Pair it with
   a matching negative margin on the container, or the padding pushes the content
   off whatever the page aligns to. */
.ink-wipe--block {
  padding: var(--wipe-pad-y, 14px) var(--wipe-pad-x, 18px);
  border-radius: 5px;
}

/* ---------- marquee word ---------------------------------- */
/* One word of a running band. The variants differ in motion and framing, never
   in how the word is set, so size and rhythm are variables and the type is not
   restated five times. */
.mqi {
  font-family: var(--font-mono);
  font-size: var(--mqi-size, 14px); letter-spacing: var(--mqi-track, 0.04em);
  text-transform: uppercase; color: var(--muted);
  padding: 0 var(--mqi-pad, 19.5px);
  display: inline-flex; align-items: center; gap: var(--mqi-gap, 39px);
}
.mqi::after { content: "\2733"; color: var(--faint); }
.mqi--bare::after { content: none; }

/* ---------- ink-fill: the system's invariant hover --------- */
/* Ink rises from the bottom edge and the contents invert. .hat and .btn carry
   the design's original inline implementations; everything new composes this. */
.ink-fill {
  /* themeable so an inverted surface can reuse the same mechanism */
  --fill: var(--ink); --fill-ink: var(--bg);
  position: relative; overflow: hidden; transition: color var(--d-fill) var(--ease);
}
.ink-fill::after {
  content: ""; position: absolute; inset: 0; z-index: 0; background: var(--fill);
  transform: translateY(100%); transition: transform var(--d-ink) var(--ease);
}
/* doubled class so this always outranks a component's own scoped colour */
.ink-fill.ink-fill:hover { color: var(--fill-ink); }
.ink-fill:hover::after { transform: translateY(0); }
.ink-fill > * { position: relative; z-index: 1; }

/* ---------- section frame --------------------------------- */
.band { padding: var(--band) 0; border-top: 1px solid var(--line); }
.band-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: var(--band-gap); }
.band-title { font-size: var(--f-headline); font-weight: 600; letter-spacing: -0.03em; line-height: 1; max-width: 16ch; }
.band-note { color: var(--muted); max-width: 34ch; font-size: var(--f-support); }

/* ---------- hats / services ------------------------------- */
.hats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-surface); overflow: hidden; }
.hat {
  padding: 34px var(--sp-lg) 30px; border-right: 1px solid var(--line); position: relative; overflow: hidden;
  min-height: 280px; display: flex; flex-direction: column; justify-content: space-between;
  transition: background var(--d-fill) var(--ease), color var(--d-fill) var(--ease);
}
.hat:last-child { border-right: none; }
.hat::after {
  content: ""; position: absolute; inset: 0; background: var(--ink); z-index: 0;
  transform: translateY(100%); transition: transform var(--d-ink) var(--ease);
}
.hat:hover { color: var(--bg); }
.hat:hover::after { transform: translateY(0); }
.hat > * { position: relative; z-index: 1; }
.hat .idx { font-family: var(--font-mono); font-size: var(--f-meta); color: var(--muted); transition: color var(--d-base); }
.hat:hover .idx { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.hat .glyph { font-size: 30px; line-height: 1; margin-top: 6px; }
.hat h3 { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; margin-top: auto; }
.hat-go { display: inline-flex; align-items: center; gap: 7px; margin-top: var(--sp-sm); font-family: var(--font-mono); font-size: var(--f-meta); letter-spacing: 0.04em; color: var(--faint); opacity: 0; transform: translateY(6px); transition: opacity var(--d-base) var(--ease), transform var(--d-base) var(--ease), color var(--d-base) var(--ease); }
.hat-go .ar { display: inline-block; transition: transform var(--d-base) var(--ease); }
.hat:hover .hat-go { opacity: 1; transform: translateY(0); color: var(--bg); }
.hat:hover .hat-go .ar { transform: translateX(4px); }
.hat p { font-size: var(--f-compact); color: var(--muted); margin-top: 8px; transition: color var(--d-base); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(3 * 1.45em); line-height: 1.45; }
.hat:hover p { color: color-mix(in srgb, var(--bg) 72%, transparent); }
@media (max-width: 900px) { .hats { grid-template-columns: repeat(2, 1fr); } .hat:nth-child(2) { border-right: none; } .hat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
@media (max-width: 520px) { .hats { grid-template-columns: 1fr; } .hat { border-right: none !important; border-bottom: 1px solid var(--line); min-height: 200px; } .hat:last-child { border-bottom: none; } }

/* ---------- now building ---------------------------------- */
.now-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.proj {
  display: grid; grid-template-columns: 56px 1.1fr 1.3fr auto; gap: 28px; align-items: center;
  padding: 30px 8px; border-bottom: 1px solid var(--line); position: relative;
}
.proj .pn, .proj .pmain, .proj .pdesc { transition: transform var(--d-base) var(--ease); }
.proj:hover .pn, .proj:hover .pmain, .proj:hover .pdesc { transform: translateX(30px); }
.proj .pn { font-family: var(--font-mono); font-size: var(--f-label); color: var(--faint); }
.proj .pmain h3 { font-size: clamp(26px, 3.4vw, 42px); font-weight: 600; letter-spacing: -0.025em; line-height: 1; display: inline-flex; align-items: baseline; gap: 12px; }
/* The project stage badge. Global rather than scoped because six NowList
   variants render it and each used to restate the identical rule; the only
   part that genuinely differs is the optical nudge, which is set by whichever
   variant sits the badge on a display-scale baseline. */
.stage {
  font-family: var(--font-mono); font-size: var(--f-micro); letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap; color: var(--muted); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px 9px;
  transition: border-color var(--d-quick) var(--ease), color var(--d-quick) var(--ease);
}
.proj .pmain h3 .stage { transform: translateY(-4px); }
.proj .pdesc { color: var(--muted); font-size: var(--f-note); max-width: 40ch; }
.proj .pmeta { text-align: right; display: flex; flex-direction: column; gap: var(--sp-xs); align-items: flex-end; min-width: 150px; }
.proj .ptags { font-family: var(--font-mono); font-size: var(--f-control); color: var(--faint); letter-spacing: 0.02em; }
.bar { width: 150px; height: 6px; border-radius: var(--r-pill); background: var(--line-2); overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 100% 0 0; background: var(--accent, var(--ink)); border-radius: var(--r-pill); transition: right var(--d-long) var(--ease-io); }
.bar.go i { right: var(--rest, 50%); }
.proj .pct { font-family: var(--font-mono); font-size: var(--f-meta); color: var(--muted); }
.proj-glow { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ink); transform: scaleY(0); transform-origin: top; transition: transform var(--d-base) var(--ease); }
.proj:hover .proj-glow { transform: scaleY(1); }

/* "your project?" CTA row */
.proj-cta { border-bottom: 1px solid var(--line); }
.proj-cta .cta-word { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 8px; text-decoration-color: var(--faint); transition: text-decoration-color var(--d-base) var(--ease); }
.proj-cta:hover .cta-word { text-decoration-color: var(--accent, var(--ink)); }
.proj-cta h3 { color: var(--muted); transition: color var(--d-base) var(--ease); }
.proj-cta:hover h3 { color: var(--ink); }
.proj-cta .pn { color: var(--faint); }
.proj-cta .stage { border-style: dashed; }
.cta-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); font-weight: 500; font-size: var(--f-compact); white-space: nowrap;
  transition: transform var(--d-glide) var(--ease);
}
.proj-cta:hover .cta-pill { transform: translateY(-2px); }
.cta-arrow { transition: transform var(--d-glide) var(--ease); }
.proj-cta:hover .cta-arrow { transform: translate(3px, -3px); }
@media (max-width: 860px) {
  .proj { grid-template-columns: 40px 1fr; gap: 12px 16px; }
  .proj .pdesc { grid-column: 2; }
  .proj .pmeta { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
}

/* ---------- references ------------------------------------ */
.refs {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--sp-md) 0; max-width: 1080px;
}
.ref {
  position: relative; font-size: clamp(22px, 3vw, 38px); font-weight: 500; letter-spacing: -0.02em;
  color: var(--faint); padding: 4px 68px 4px 0; line-height: 1.25;
  transition: color var(--d-base) var(--ease);
  cursor: none;
}
.ref::after {
  content: "\\"; position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
  color: var(--line); font-weight: 400; transition: color var(--d-base) var(--ease);
}
.ref:last-child { padding-right: 0; }
.ref:last-child::after { content: none; }
.ref:hover { color: var(--ink); transform: skewX(-7deg); }
@media (pointer: coarse) { .ref { cursor: default; } }
@media (max-width: 640px) { .refs { gap: var(--sp-xs) 4px; } }

/* ---------- selected work (portfolio) [unused] ------------ */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface);
  transition: transform var(--d-fill) var(--ease), box-shadow var(--d-fill) var(--ease), border-color var(--d-base);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-10px) rotate(-0.6deg); box-shadow: var(--shadow); border-color: var(--ink); }
.card .thumb {
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  background-color: var(--raised);
  background-image: repeating-linear-gradient(135deg, var(--line-2) 0 1px, transparent 1px 11px);
  display: flex; align-items: center; justify-content: center;
}
.card .thumb .ph {
  font-family: var(--font-mono); font-size: var(--f-meta); color: var(--faint);
  letter-spacing: 0.05em; text-transform: uppercase; text-align: center; padding: 0 20px;
  border: 1px dashed var(--line); border-radius: 8px; padding: 9px var(--sp-sm); background: var(--surface);
}
.card .thumb .scan {
  position: absolute; inset: 0; background: linear-gradient(transparent, var(--ink)); opacity: 0;
  transform: translateY(40%); transition: opacity var(--d-fill) var(--ease), transform var(--d-lift) var(--ease);
}
.card:hover .thumb .scan { opacity: 0.06; transform: translateY(0); }
.card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.card .body .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card .body h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.card .body .yr { font-family: var(--font-mono); font-size: var(--f-meta); color: var(--faint); }
.card .body p { font-size: 14.5px; color: var(--muted); }
.card .body .tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 6px; }
.card .body .tags span { font-family: var(--font-mono); font-size: var(--f-micro); color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 9px; }
.card.placeholder { border-style: dashed; background: transparent; }
.card.placeholder:hover { transform: translateY(-3px); }
@media (max-width: 720px) { .work-grid { grid-template-columns: 1fr; } }

/* ---------- contact / terminal ---------------------------- */
.contact { padding: var(--band) 0 0; border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--sp-xl); align-items: start; }
@media (max-width: 920px) { .contact-grid { grid-template-columns: 1fr; gap: 30px; } }

.terminal {
  position: relative;
  background:
    radial-gradient(130% 90% at 50% -20%, color-mix(in srgb, var(--invert-ink) 9%, transparent), transparent 62%),
    var(--invert-bg);
  color: var(--invert-ink); border-radius: var(--r-surface); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--invert-ink) 13%, transparent);
  box-shadow: var(--shadow-console-inset), var(--shadow);
  font-family: var(--font-mono); font-size: var(--f-mono);
  display: flex; flex-direction: column; min-height: 460px;
}
.terminal::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent, color-mix(in srgb, var(--invert-ink) 55%, transparent)), transparent);
  opacity: 0.7;
}
.term-bar {
  display: flex; align-items: center; gap: var(--sp-xs); padding: 13px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--invert-ink) 11%, transparent);
  background: color-mix(in srgb, var(--invert-ink) 4%, transparent);
}
.term-bar .dots { display: flex; gap: 7px; }
.term-bar .dots i { width: 11px; height: 11px; border-radius: var(--r-circle); background: color-mix(in srgb, var(--invert-ink) 22%, transparent); transition: background var(--d-base) var(--ease); }
.terminal:hover .dots i:nth-child(1) { background: #ff5f57; }
.terminal:hover .dots i:nth-child(2) { background: #febc2e; }
.terminal:hover .dots i:nth-child(3) { background: #28c840; }
.term-bar .tt { margin-left: 4px; opacity: 0.55; font-size: var(--f-meta); letter-spacing: 0.04em; }
.term-status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.65; }
.term-status .live { width: 7px; height: 7px; border-radius: var(--r-circle); background: var(--t-prompt); position: relative; }
.term-status .live::after { content: ""; position: absolute; inset: -3px; border-radius: var(--r-circle); border: 1px solid var(--t-prompt); animation: ring 2.2s var(--ease-io) infinite; }
.term-body { padding: var(--sp-md) 20px; flex: 1; overflow-y: auto; max-height: 480px; scrollbar-width: thin; font-size: var(--f-compact); }
.term-body::-webkit-scrollbar { width: 6px; }
.term-body::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--invert-ink) 28%, transparent); border-radius: var(--r-pill); }
.term-line { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; line-height: 1.75; }
.term-line + .term-line { margin-top: 2px; }
.term-line.cmd { color: var(--invert-ink); margin-top: var(--sp-lg); }
.term-body .term-line.cmd:first-child { margin-top: 0; }
.term-line .pmt { color: var(--t-prompt); margin-right: 4px; }
.term-line.out { color: color-mix(in srgb, var(--invert-ink) 86%, transparent); }
.term-line a { color: var(--t-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--t-link) 50%, transparent); }
.term-line a:hover { text-decoration-color: var(--t-link); }
.term-line.accent { color: var(--t-head); font-weight: 500; }
/* aligned key/value rows — wrap cleanly with a hanging indent */
.term-line .trow { display: flex; gap: var(--sp-xs) 16px; align-items: baseline; flex-wrap: wrap; }
.term-line .trow.indent { padding-left: 1.6em; }
.term-line .tindent { display: block; padding-left: 1.6em; }
.term-line .trow .tk { flex: 0 0 auto; min-width: 8.5em; color: var(--t-key); font-weight: 500; }
.term-line .trow .tcmd { cursor: pointer; text-underline-offset: 3px; text-decoration: underline dashed transparent; transition: text-decoration-color 0.15s var(--ease), opacity 0.15s var(--ease); }
.term-line .trow .tcmd:hover, .term-line .trow .tcmd:focus-visible { text-decoration-color: currentColor; outline: none; }
.term-line .trow .tv { flex: 1 1 14em; color: color-mix(in srgb, var(--invert-ink) 82%, transparent); }
.term-line .trow .tv a { color: var(--t-link); }
.term-line .tg {
  display: inline-block; font-size: var(--f-micro); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 1px 8px; margin-left: 6px; border-radius: var(--r-pill); vertical-align: 1px;
  color: var(--t-tag);
  border: 1px solid color-mix(in srgb, var(--t-tag) 45%, transparent);
  background: color-mix(in srgb, var(--t-tag) 10%, transparent);
}
.term-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 var(--sp-md) var(--sp-sm); }
.qchip {
  font-family: var(--font-mono); font-size: var(--f-control); letter-spacing: 0.02em;
  padding: 5px 11px; border-radius: var(--r-pill); color: color-mix(in srgb, var(--invert-ink) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--invert-ink) 18%, transparent);
  transition: background var(--d-quick) var(--ease), color var(--d-quick) var(--ease), border-color var(--d-quick) var(--ease), transform var(--d-quick) var(--ease);
}
.qchip::before { content: "/"; opacity: 0.4; margin-right: 3px; }
.qchip:hover { background: var(--invert-ink); color: var(--invert-bg); border-color: var(--invert-ink); transform: translateY(-1px); }
.term-input-row {
  display: flex; align-items: center; gap: var(--sp-xs); padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid color-mix(in srgb, var(--invert-ink) 11%, transparent);
  background: color-mix(in srgb, var(--invert-ink) 3%, transparent);
}
.term-input-row .pmt { color: var(--t-prompt); font-weight: 500; }
.term-input {
  flex: 1; background: none; border: none; outline: none; color: var(--invert-ink);
  font-family: inherit; font-size: var(--f-mono); caret-color: var(--t-prompt);
}
.term-input::placeholder { color: color-mix(in srgb, var(--invert-ink) 38%, transparent); }
.term-caret { width: 8px; height: 17px; border-radius: 1px; background: var(--t-prompt); animation: blink var(--d-long) steps(1) infinite; }
.term-input-row:focus-within .term-caret { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.term-hint { padding: 0 var(--sp-md) var(--sp-sm); opacity: 0.4; font-size: var(--f-control); }
.term-chip { display: inline-block; white-space: nowrap; vertical-align: baseline; border: 1px solid color-mix(in srgb, var(--invert-ink) 30%, transparent); border-radius: var(--r-chip); padding: 1px 7px; margin: 0 2px; line-height: 1.3; cursor: none; transition: background 0.2s, color 0.2s; }
.term-chip:hover { background: var(--invert-ink); color: var(--invert-bg); }

/* classic native cursor + selectable text inside the terminal */
.terminal { cursor: text; }
.terminal .term-body, .terminal .term-line, .terminal .term-input { cursor: text; user-select: text; -webkit-user-select: text; }
.terminal .term-bar, .terminal .term-status, .terminal .term-quick { cursor: default; user-select: none; }
.terminal .qchip, .terminal .term-chip { cursor: pointer; }
.terminal .term-line a { cursor: pointer; }
.terminal ::selection, .terminal *::selection { background: var(--invert-ink) !important; color: var(--invert-bg) !important; }
.terminal ::-moz-selection, .terminal *::-moz-selection { background: var(--invert-ink) !important; color: var(--invert-bg) !important; }

/* contact rail (right) ------------------------------------- */
.rail { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--surface); }
.rail-card {
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 22px 24px; background: transparent;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; overflow: hidden;
  transition: background var(--d-base) var(--ease);
}
.rail-card:last-child { border-bottom: 0; }
.rail-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent, var(--ink)); transform: scaleY(0); transform-origin: top;
  transition: transform var(--d-base) var(--ease);
}
.rail-card:hover { background: var(--raised); }
.rail-card:hover::before { transform: scaleY(1); }
.rail-card .l { display: flex; flex-direction: column; gap: 5px; }
.rail-card .l .k { font-family: var(--font-mono); font-size: var(--f-control); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); transition: color var(--d-base) var(--ease); }
.rail-card:hover .l .k { color: var(--accent, var(--muted)); }
.rail-card .l .v { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; transition: transform var(--d-base) var(--ease); }
.rail-card:hover .l .v { transform: translateX(2px); }
.rail-card .go { font-family: var(--font-mono); font-size: var(--f-meta); letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; transition: transform var(--d-base) var(--ease), color var(--d-base) var(--ease); }
.rail-card:hover .go { transform: translate(3px, -3px); color: var(--ink); }
/* arrow glyphs larger than the text labels */
a.rail-card .go { font-size: 21px; letter-spacing: 0; }

.email-card { cursor: none; }
.email-card .v.masked { letter-spacing: 0.04em; }
.email-card.copied { border-color: var(--ink); }
.email-card .copied-flag {
  position: absolute; inset: 0; background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center; gap: var(--sp-xs);
  font-family: var(--font-mono); font-size: var(--f-label); letter-spacing: 0.06em;
  transform: translateY(101%); transition: transform var(--d-base) var(--ease);
}
.email-card.copied .copied-flag { transform: translateY(0); }

/* ---------- footer ---------------------------------------- */
.footer { padding: 80px 0 36px; border-top: 1px solid var(--line); margin-top: var(--band); }
.footer .big {
  white-space: nowrap; user-select: none; cursor: none;
}
/* ===== shared big "sweep" CTA component — used by .big (home) and .huge (role pages) ===== */
.cta-reveal {
  position: relative; display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(48px, 11vw, 150px); line-height: 0.95; padding-bottom: 0.06em;
  letter-spacing: -0.04em; color: color-mix(in srgb, var(--ink) 46%, transparent);
  transition: transform var(--d-settle) var(--ease-sweep), letter-spacing var(--d-settle) var(--ease-sweep), color var(--d-lift) var(--ease);
}
.cta-reveal::before {
  content: attr(data-label); position: absolute; inset: 0; z-index: 1; color: var(--ink);
  white-space: nowrap; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000 50%, transparent 94%);
          mask-image: linear-gradient(90deg, #000 50%, transparent 94%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 200% 100%; mask-size: 200% 100%;
  -webkit-mask-position: 215% 0; mask-position: 215% 0;
  transition: -webkit-mask-position var(--d-sweep) var(--ease-sweep-mask), mask-position var(--d-sweep) var(--ease-sweep-mask);
}
.cta-reveal:hover::before { -webkit-mask-position: 0 0; mask-position: 0 0; }
.cta-reveal .cta-ar { display: inline-block; opacity: 0.46; transition: transform var(--d-settle) var(--ease-sweep), opacity var(--d-fill) ease; }
.cta-reveal:hover .cta-ar { opacity: 1; transition: transform var(--d-settle) var(--ease-sweep), opacity var(--d-fill) ease var(--d-fill); }
.cta-reveal::after {
  content: ""; position: absolute; left: 0; bottom: 0.12em; height: 0.045em; width: 100%;
  background: var(--accent, var(--ink)); transform: scaleX(0); transform-origin: left; opacity: 0;
  transition: transform var(--d-long) var(--ease-sweep-mask), opacity var(--d-reveal) ease;
}
.cta-reveal:hover { letter-spacing: -0.026em; }
.cta-reveal:hover::after { transform: scaleX(1); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .cta-reveal { transition: transform var(--d-settle) var(--ease-sweep), letter-spacing var(--d-settle) var(--ease-sweep), color var(--d-lift) var(--ease) !important; }
  .cta-reveal::before { transition: -webkit-mask-position var(--d-sweep) var(--ease-sweep-mask), mask-position var(--d-sweep) var(--ease-sweep-mask) !important; }
  .cta-reveal::after { transition: transform var(--d-long) var(--ease-sweep-mask), opacity var(--d-reveal) ease !important; }
}
/* the copyright/clock row. One base; each footer only states its own difference. */
.frow { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; color: var(--muted); font-family: var(--font-mono); font-size: var(--f-nav); }
.frow a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.frow a:hover { text-decoration-color: var(--ink); }
.footer .frow { align-items: flex-end; margin-top: 56px; }
.footer .frow .clock { font-variant-numeric: tabular-nums; }
.foot-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); transition: text-decoration-color var(--d-quick) var(--ease), color var(--d-quick) var(--ease); }
.foot-link:hover { text-decoration-color: var(--ink); color: var(--ink); }

/* reveal animation ----------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(40px) scale(0.985); }
[data-reveal].in { opacity: 1; transform: none; transition: opacity var(--d-reveal) var(--ease), transform var(--d-reveal) var(--ease); }
[data-reveal][data-d="1"].in { transition-delay: 0.08s; }
[data-reveal][data-d="2"].in { transition-delay: 0.16s; }
[data-reveal][data-d="3"].in { transition-delay: 0.24s; }
[data-reveal][data-d="4"].in { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  /* gentle continuous band is intentional — keep it scrolling */
  .marquee-track { animation-duration: var(--mq) !important; }
  /* keep the now-list indent in sync with the role-page steps under reduced-motion */
  .proj .pn, .proj .pmain, .proj .pdesc { transition: transform var(--d-base) var(--ease) !important; }
  /* glow bars (now-list + contact rail) grow identically */
  .proj-glow, .rail-card::before { transition: transform var(--d-base) var(--ease) !important; }
}

/* theme circular reveal ------------------------------------ */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: var(--z-cursor); }


