/* ============================================================
   PORTFOLIO — cyberpsychosis skin + motion
   Corrupted combat-HUD: red-dominant, cyan counter-accent,
   angular clipped panels, hairline frames, static CRT texture.
   Layout: every section is one full-viewport "page", flipped one
   wheel-notch at a time (app.js pager), framed by fixed HUD
   chrome over a faint grid + canvas backdrop.
   Motion: smooth eased baseline, glitch bursts as punctuation.
   ============================================================ */

/* ------------------------------------------------------------
   Display faces: the real "Sentry" + heavy angular face exist
   only as reference images. Drop the files into assets/fonts/
   and uncomment to use them; until then Orbitron + Chakra Petch
   substitute (loaded in index.html).

@font-face {
  font-family: "Sentry";
  src: url("assets/fonts/sentry.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "DisplayHeavy";
  src: url("assets/fonts/display-heavy.woff2") format("woff2");
  font-display: swap;
}
   ------------------------------------------------------------ */

/* ============================================================
   Design tokens (CLAUDE.md) — the only source of color
   ============================================================ */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --red: #ff2a3d;
  --cyan: #22e0d6;
  --amber: #ffb200;
  --text: #e8e8ef;
  --muted: #8a8a99;

  /* derived tones (all from the palette above) */
  --red-hi: #ff5c6b;                 /* red tuned up for small text (AA) */
  --red-edge: rgba(255, 42, 61, 0.28);
  --red-edge-hot: rgba(255, 42, 61, 0.62);
  --red-tint: rgba(255, 42, 61, 0.06);
  --red-ghost: rgba(255, 42, 61, 0.16);
  --red-glow: rgba(255, 42, 61, 0.45);
  --cyan-edge: rgba(34, 224, 214, 0.4);
  --cyan-tint: rgba(34, 224, 214, 0.07);
  --cyan-glow: rgba(34, 224, 214, 0.4);
  --hairline: rgba(232, 232, 239, 0.08);
  --hairline-hot: rgba(232, 232, 239, 0.2);
  --cell-off: #1c1c26;

  /* channel-split shadow pairs — one voice for every split on the page */
  --split: 2px 0 rgba(255, 42, 61, 0.75), -2px 0 rgba(34, 224, 214, 0.75);
  --split-soft: 1.5px 0 rgba(255, 42, 61, 0.55), -1.5px 0 rgba(34, 224, 214, 0.55);

  --font-display: "Sentry", "Orbitron", system-ui, sans-serif;
  --font-display-2: "DisplayHeavy", "Chakra Petch", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --content-w: 1240px;
  --pad: clamp(20px, 4vw, 48px);
  --header-h: 64px;
  --grid-cell: 80px; /* backdrop grid pitch — canvas nodes align to it */
  --cut: 14px;      /* corner cut for large panels */
  --cut-s: 6px;     /* corner cut for chips/small elements */

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
}

/* ============================================================
   Base
   ============================================================ */
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15.5px;
  line-height: 1.7;
  background:
    radial-gradient(1400px 520px at 72% -10%, rgba(255, 42, 61, 0.08), transparent 62%)
    var(--bg);
}

/* faint HUD grid — static; the canvas layers nodes/sweeps on top.
   Vignette mask keeps the center calm so content stays readable. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--hairline) 0 1px, transparent 1px var(--grid-cell)),
    repeating-linear-gradient(180deg, var(--hairline) 0 1px, transparent 1px var(--grid-cell));
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 45%, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.95) 78%);
  mask-image: radial-gradient(ellipse 120% 90% at 50% 45%, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.95) 78%);
  opacity: 0.6;
}

/* static CRT scanlines — texture only, never animated */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.55;
}

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

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #26262f;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--red-edge-hot);
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease-out, text-shadow 0.15s ease-out;
}

a:hover {
  color: var(--text);
  text-shadow:
    1px 0 rgba(255, 42, 61, 0.8),
    -1px 0 rgba(34, 224, 214, 0.8);
}

/* ============================================================
   HUD backdrop canvas — nodes, scan sweeps, datamosh bursts
   ============================================================ */
.hud-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

/* ============================================================
   FX stack — texture + burst layers above the content.
   All geometry/canvas, no data. Order (bottom→top):
   noise 996 · roll 997 · vignette 998 · scanlines 999 (body::after)
   · tear canvas 1000 · boot overlay 1400
   ============================================================ */

/* film grain — static SVG turbulence tile, never animated */
.fx-noise {
  position: fixed;
  inset: 0;
  z-index: 996;
  pointer-events: none;
  opacity: 0.05;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* CRT roll — one soft band drifting down forever (constant speed
   is the point: it's phosphor physics, not UI motion) */
.fx-roll {
  position: fixed;
  inset: 0;
  z-index: 997;
  pointer-events: none;
  overflow: clip;
}

.fx-roll::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -180px;
  height: 180px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(232, 232, 239, 0.028) 45%,
    rgba(34, 224, 214, 0.02) 70%,
    transparent
  );
  animation: crt-roll 11s linear infinite;
}

@keyframes crt-roll {
  to { transform: translateY(calc(100vh + 180px)); }
}

/* corner vignette + red/cyan edge fringe — the tube's color bleed */
.fx-vignette {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 42, 61, 0.05), transparent 7%),
    linear-gradient(-90deg, rgba(34, 224, 214, 0.045), transparent 7%),
    radial-gradient(ellipse 130% 130% at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.4) 100%);
}

/* tear-burst canvas — app.js draws slice bands on page flips /
   card expands; transparent + idle between bursts */
.fx-tear {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ------------------------------------------------------------
   Boot overlay — CRT power-on. Injected by app.js (so a JS-less
   load never traps a black screen), removed after the split.
   ------------------------------------------------------------ */
.boot-crt {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.boot-half {
  background: #05050a;
}

.boot-half-top { transform-origin: 50% 0; }
.boot-half-bottom { transform-origin: 50% 100%; }

/* the ignition line living on the seam */
.boot-crt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%) scaleX(0);
  background: var(--text);
  box-shadow:
    0 0 14px rgba(232, 232, 239, 0.9),
    3px 0 18px var(--red-glow),
    -3px 0 18px var(--cyan-glow);
}

.boot-crt.is-on::after {
  animation:
    boot-line-in 0.32s var(--ease-out) both,
    boot-line-out 0.3s ease-in both 0.62s;
}

.boot-crt.is-on .boot-half-top {
  animation: boot-split-top 0.55s var(--ease-out) both 0.4s;
}

.boot-crt.is-on .boot-half-bottom {
  animation: boot-split-bottom 0.55s var(--ease-out) both 0.4s;
}

@keyframes boot-line-in {
  from { transform: translateY(-50%) scaleX(0); opacity: 0.4; }
  to   { transform: translateY(-50%) scaleX(1); opacity: 1; }
}

@keyframes boot-line-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes boot-split-top {
  from { transform: scaleY(1); }
  to   { transform: scaleY(0); }
}

@keyframes boot-split-bottom {
  from { transform: scaleY(1); }
  to   { transform: scaleY(0); }
}

/* (the pointer stays native — no custom cursor treatment) */

/* ============================================================
   Fixed HUD chrome — corner brackets + tick strips
   ============================================================ */
.hud-frame {
  position: fixed;
  inset: 12px;
  z-index: 40;
  pointer-events: none;
}

.hud-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  opacity: 0.65;
}

.hud-c-tl {
  top: 0;
  left: 0;
  border-top: 1px solid var(--red);
  border-left: 1px solid var(--red);
}

.hud-c-tr {
  top: 0;
  right: 0;
  border-top: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}

.hud-c-bl {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}

.hud-c-br {
  bottom: 0;
  right: 0;
  border-bottom: 1px solid var(--cyan);
  border-right: 1px solid var(--cyan);
}

.hud-ticks {
  position: absolute;
  opacity: 0.4;
}

.hud-ticks-bottom {
  left: 50%;
  bottom: 0;
  width: 130px;
  height: 6px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 2px,
    transparent 2px 12px
  );
}

.hud-ticks-left {
  left: 0;
  top: 50%;
  width: 6px;
  height: 130px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(
    180deg,
    var(--cyan) 0 2px,
    transparent 2px 12px
  );
}

.hud-ticks-right {
  right: 0;
  top: 24%;
  width: 6px;
  height: 84px;
  background: repeating-linear-gradient(
    180deg,
    var(--red) 0 2px,
    transparent 2px 12px
  );
}

/* ============================================================
   Chrome — fixed top nav
   ============================================================ */
.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.92), rgba(10, 10, 15, 0.78));
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(6px);
}

/* hazard block riding the header's left edge (ref1 corner prop) */
.head-hazard {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--red) 0 5px,
    transparent 5px 10px
  );
  opacity: 0.8;
}

.head-hazard::after {
  content: "";
  position: absolute;
  left: 54px;
  top: 3px;
  width: 14px;
  height: 2px;
  background: var(--cyan);
  opacity: 0.7;
}

.site-nav {
  display: flex;
  gap: clamp(22px, 3.4vw, 48px);
  max-width: var(--content-w);
  margin: 0 auto;
  width: 100%;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  font-family: var(--font-display-2);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  transition: color 0.2s ease-out;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.22s var(--ease-out);
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-nav a.is-active {
  color: var(--text);
  text-shadow:
    1px 0 rgba(255, 42, 61, 0.55),
    -1px 0 rgba(34, 224, 214, 0.55);
}

/* ============================================================
   Page rail — one diamond per page, numbered by CSS counters
   ============================================================ */
.page-rail {
  position: fixed;
  right: clamp(14px, 2.2vw, 34px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  display: grid;
  gap: 18px;
  counter-reset: rail;
}

/* spine connecting the diamonds */
.page-rail::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 1px;
  background: var(--hairline-hot);
  pointer-events: none;
}

.rail-dot {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  counter-increment: rail;
}

.rail-dot::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--muted);
  transform: rotate(45deg);
  transition:
    background-color 0.2s ease-out,
    border-color 0.2s ease-out,
    box-shadow 0.2s ease-out,
    transform 0.25s var(--ease-out);
}

.rail-dot::after {
  content: "0" counter(rail);
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s ease-out, color 0.2s ease-out;
}

.rail-dot:hover::before {
  border-color: var(--text);
  transform: rotate(45deg) scale(1.15);
}

.rail-dot:hover::after {
  opacity: 1;
}

.rail-dot.is-active::before {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 10px rgba(255, 42, 61, 0.55);
  transform: rotate(45deg) scale(1.2);
}

.rail-dot.is-active::after {
  opacity: 1;
  color: var(--red-hi);
}

/* ============================================================
   Pages — each section fills one viewport; app.js flips between
   them one wheel-notch at a time
   ============================================================ */
main {
  position: relative;
  z-index: 1;
  counter-reset: page;
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: calc(var(--header-h) + 44px) var(--pad) 76px;
  counter-increment: page;
}

/* page index — real structure rendered as HUD numeral, split channels */
.page::after {
  content: "0" counter(page);
  position: absolute;
  top: calc(var(--header-h) + 26px);
  right: var(--pad);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(54px, 7vw, 124px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--red-ghost);
  -webkit-text-stroke: 1px var(--red-edge);
  text-shadow:
    4px 0 rgba(255, 42, 61, 0.14),
    -4px 0 rgba(34, 224, 214, 0.14);
  pointer-events: none;
}

/* hazard footer under the numeral — same prop language as the header */
.page::before {
  content: "";
  position: absolute;
  top: calc(var(--header-h) + 26px + clamp(58px, 7.4vw, 130px));
  right: var(--pad);
  width: clamp(54px, 7vw, 124px);
  height: 5px;
  background: repeating-linear-gradient(
    -45deg,
    var(--red-edge) 0 4px,
    transparent 4px 9px
  );
  pointer-events: none;
}

/* giant ghost word — the section's name as a watermark behind its
   content; chrome text duplicated from the heading, outline only */
.page-ghost {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  overflow: clip;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.page-ghost::before,
.page-ghost::after {
  content: attr(data-w);
  grid-area: 1 / 1;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(110px, 17vw, 300px);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
}

.page-ghost::before {
  -webkit-text-stroke: 1.5px rgba(255, 42, 61, 0.11);
  transform: translate(3px, 0);
}

.page-ghost::after {
  -webkit-text-stroke: 1.5px rgba(34, 224, 214, 0.08);
  transform: translate(-3px, 0);
}

.page-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--content-w);
  margin-inline: auto;
}

/* keep content clear of the page rail on mid-size windows */
@media (min-width: 761px) {
  .page {
    padding-right: max(var(--pad), 72px);
  }
}

.load-error {
  position: fixed;
  top: calc(var(--header-h) + 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  max-width: min(720px, calc(100vw - 2 * var(--pad)));
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--amber);
  color: var(--amber);
  background: var(--surface);
  clip-path: polygon(0 0, calc(100% - var(--cut-s)) 0, 100% var(--cut-s), 100% 100%, var(--cut-s) 100%, 0 calc(100% - var(--cut-s)));
}

/* ============================================================
   Section titles — index slab + split-layer word + fading rule
   ============================================================ */
.section-title {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 34px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}

.section-title::after {
  content: "";
  flex: 1;
  height: 5px;
  background:
    linear-gradient(90deg, var(--red-edge), rgba(255, 42, 61, 0.03)) 0 2px / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--red-edge) 0 1px, transparent 1px 14px) 0 0 / 38% 100% no-repeat;
}

/* the word carries hidden channel copies for slice bursts */
.title-word {
  position: relative;
  text-shadow: var(--split-soft);
}

.title-word::before,
.title-word::after {
  content: attr(data-w);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.title-word::before { color: var(--red); }
.title-word::after { color: var(--cyan); }

/* ============================================================
   1 · Intro — centered title screen
   ============================================================ */
.page-intro .page-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.intro-name {
  position: relative;
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(56px, 9.4vw, 176px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text);
}

/* channel-split copies — the cyberpsychosis signature.
   Real DOM spans injected by app.js (aria-hidden, data-sourced).
   They boot through violent slice offsets and settle at a 2px rest. */
.intro-name-copy {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  opacity: 0.8;
}

.intro-name-copy-r {
  color: var(--red);
  transform: translate(2px, -1px);
}

.intro-name-copy-c {
  color: var(--cyan);
  transform: translate(-2px, 1px);
}

/* hairline crosses flanking the name — HUD alignment marks */
.intro-name::before,
.intro-name::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  background:
    linear-gradient(var(--red-edge), var(--red-edge)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(var(--red-edge), var(--red-edge)) 0 50% / 100% 1px no-repeat;
  opacity: 0.7;
}

.intro-name::before { left: clamp(-72px, -4vw, -40px); }
.intro-name::after { right: clamp(-72px, -4vw, -40px); }

.intro-fullname {
  margin: 0 0 26px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.34em;
}

/* tagline — terminal line with a blinking block cursor */
.intro-tagline {
  margin: 0 0 54px;
  color: var(--cyan);
  font-size: 16.5px;
  letter-spacing: 0.02em;
}

.intro-tagline::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 1.05em;
  margin-left: 10px;
  vertical-align: text-bottom;
  background: var(--cyan);
  animation: cursor-blink 1.1s step-end infinite;
}

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* meta panel — framed HUD readout, rows left-aligned inside */
.intro-meta {
  margin: 0 0 56px;
  width: min(620px, 100%);
  text-align: left;
  padding: 18px 32px;
  position: relative;
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--red-tint), transparent 55%);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.intro-meta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  width: 34px;
  height: 2px;
  background: var(--red);
  box-shadow: 42px 0 0 var(--cyan-edge);
}

/* bottom-right bracket + left tick strip — quiet frame detail */
.intro-meta::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 16px;
  height: 16px;
  border-right: 1px solid var(--cyan-edge);
  border-bottom: 1px solid var(--cyan-edge);
}

.meta-row {
  display: flex;
  gap: 24px;
  padding: 8px 0;
  transition: background-color 0.18s ease-out;
}

.meta-row:hover {
  background: linear-gradient(90deg, var(--red-tint), transparent 70%);
}

.meta-row + .meta-row {
  border-top: 1px solid var(--hairline);
}

.meta-row dt {
  width: 112px;
  flex: none;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--font-display-2);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  padding-top: 5px;
}

.meta-row dd {
  margin: 0;
  font-size: 15px;
}

/* CV button — ref1 slab: skewed red plate over a cyan echo plate,
   cut corners, hazard sweep on hover, download chevrons */
.btn-cv {
  position: relative;
  display: inline-block;
  color: var(--bg);
  text-decoration: none;
  text-transform: uppercase;
  font-family: var(--font-display-2);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.2em;
}

/* the echo plate behind — cyan wireframe twin */
.btn-cv::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--cyan-edge);
  transform: skewX(-10deg) translate(7px, 7px);
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease-out;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.btn-cv-face {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 42px;
  background: var(--red);
  overflow: clip;
  transform: skewX(-10deg);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: background-color 0.18s ease-out, transform 0.2s var(--ease-out), box-shadow 0.18s ease-out;
}

/* cyan keying notch on the plate's top edge */
.btn-cv-face::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  width: 34px;
  height: 3px;
  background: var(--cyan);
}

/* hazard band parked off-plate; sweeps across on hover */
.btn-cv-face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(10, 10, 15, 0.28) 0 8px,
    transparent 8px 20px
  );
  transform: translateX(-102%);
  transition: transform 0.4s var(--ease-out);
}

.btn-cv:hover .btn-cv-face::after {
  transform: translateX(0);
}

.btn-cv:hover .btn-cv-face {
  background: var(--red-hi);
  transform: skewX(-10deg) translate(-2px, -2px);
  box-shadow:
    5px 0 0 rgba(34, 224, 214, 0.4),
    -5px 0 0 rgba(255, 42, 61, 0.4);
}

.btn-cv:hover::before {
  transform: skewX(-10deg) translate(11px, 11px);
  border-color: var(--cyan);
}

.btn-cv:active .btn-cv-face {
  transform: skewX(-10deg) scale(0.97);
}

/* download chevrons — cascade on hover */
.btn-cv-arrows {
  display: flex;
  gap: 7px;
}

.btn-cv-arrows i {
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2.5px solid var(--bg);
  border-bottom: 2.5px solid var(--bg);
  transform: rotate(45deg);
  opacity: 0.55;
}

.btn-cv:hover .btn-cv-arrows i {
  animation: arrow-march 0.7s ease-in-out infinite;
}

.btn-cv:hover .btn-cv-arrows i:nth-child(2) { animation-delay: 0.12s; }
.btn-cv:hover .btn-cv-arrows i:nth-child(3) { animation-delay: 0.24s; }

@keyframes arrow-march {
  0%, 100% { opacity: 0.35; transform: rotate(45deg) translate(0, 0); }
  50%      { opacity: 1;    transform: rotate(45deg) translate(2px, 2px); }
}

/* scroll cue — pulsing chevrons at the intro's foot */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: grid;
  gap: 4px;
  padding: 8px;
  text-decoration: none;
}

.cue-chev {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  animation: cue-pulse 1.9s ease-in-out infinite;
}

.cue-chev:nth-child(2) {
  animation-delay: 0.18s;
}

.scroll-cue:hover .cue-chev {
  border-color: var(--red-hi);
}

@keyframes cue-pulse {
  0%, 100% { opacity: 0.25; transform: rotate(45deg) translate(0, 0); }
  50%      { opacity: 0.9;  transform: rotate(45deg) translate(3px, 3px); }
}

/* ============================================================
   2 · Projects — angular framed cards, two columns
   ============================================================ */
.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 30px;
  margin-top: 52px;
}

/* a lone project (no columns built) spans the full width */
.project-list > .project-card {
  grid-column: 1 / -1;
}

/* independent columns — expanding a card only grows its own column */
.project-col {
  display: grid;
  gap: 30px;
  align-content: start;
  min-width: 0;
}

/* card = red hairline frame drawn by layering: the card itself
   is the edge color, ::before re-cuts the surface 1px inside */
.project-card {
  position: relative;
  background: var(--red-edge);
  padding: 34px 40px 38px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: background-color 0.2s ease-out, transform 0.2s ease-out;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  background:
    linear-gradient(180deg, var(--red-tint), transparent 46%)
    var(--surface);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.project-card > * {
  position: relative;
}

.project-card:hover {
  background: var(--red-edge-hot);
  transform: translateY(-2px);
}

/* target acquired — corner brackets snap onto the hovered card
   (gradient-drawn on the surface layer; instant on, like a lock) */
.project-card:hover::before,
.project-card.is-open::before {
  background:
    linear-gradient(var(--red) 0 0) 10px 10px / 16px 2px,
    linear-gradient(var(--red) 0 0) 10px 10px / 2px 16px,
    linear-gradient(var(--red) 0 0) calc(100% - 10px) 10px / 16px 2px,
    linear-gradient(var(--red) 0 0) calc(100% - 10px) 10px / 2px 16px,
    linear-gradient(var(--cyan-edge) 0 0) 10px calc(100% - 10px) / 16px 2px,
    linear-gradient(var(--cyan-edge) 0 0) 10px calc(100% - 10px) / 2px 16px,
    linear-gradient(var(--cyan-edge) 0 0) calc(100% - 10px) calc(100% - 10px) / 16px 2px,
    linear-gradient(var(--cyan-edge) 0 0) calc(100% - 10px) calc(100% - 10px) / 2px 16px,
    linear-gradient(180deg, var(--red-tint), transparent 46%),
    var(--surface);
  background-repeat: no-repeat;
}

/* featured — amber hazard rail on the left edge */
.project-card.is-featured::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 8px;
  background: repeating-linear-gradient(
    45deg,
    var(--amber) 0 5px,
    transparent 5px 11px
  );
  opacity: 0.75;
}

.project-card.is-featured {
  padding-left: 50px;
}

.project-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.project-top .chip-list {
  margin: 0;
}

/* status LED — square indicator, color = state; holds steady */
.project-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  vertical-align: 6%;
}

[data-status="built"] .project-status { color: var(--cyan); }
[data-status="in-progress"] .project-status { color: var(--amber); }
[data-status="archived"] .project-status { color: var(--muted); }

.project-date {
  color: var(--muted);
}

.private-marker {
  border: 1px solid var(--red-edge);
  color: var(--red-hi);
  padding: 2px 10px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut-s)), calc(100% - var(--cut-s)) 100%, 0 100%);
}

.project-link {
  font-size: 11.5px;
  letter-spacing: 0.14em;
}

.project-head {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 14px 48px 0 0;
  cursor: pointer;
}

/* expand caret */
.project-head::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 34px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease-out;
}

.is-open .project-head::after {
  transform: rotate(45deg);
  border-color: var(--red-hi);
}

.project-name {
  display: block;
  font-family: var(--font-display-2);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 4px 0 10px;
  transition: text-shadow 0.15s ease-out;
}

.project-card:hover .project-name {
  text-shadow: var(--split);
}

.project-summary {
  display: block;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 70ch;
}

/* expand/collapse — animated grid-rows + content fade */
.project-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s var(--ease-in);
}

.project-card.is-open .project-body {
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.46s var(--ease-out);
}

.project-body-inner {
  position: relative;
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s var(--ease-in), transform 0.2s var(--ease-in);
}

.project-card.is-open .project-body-inner {
  opacity: 1;
  transform: none;
  transition: opacity 0.42s ease-out 0.1s, transform 0.46s var(--ease-out) 0.1s;
}

/* decrypt sweep — a cyan scanline runs the expanded body once.
   The layer carries the line on its top edge and translates its own
   height, so the sweep is transform-only. */
.project-body-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(34, 224, 214, 0.5) 0 2px, rgba(34, 224, 214, 0.06) 2px 46px, transparent 46px) no-repeat;
  transform: translateY(-100%);
  opacity: 0;
}

.project-card.is-open .project-body-inner::after {
  animation: decrypt-sweep 0.7s var(--ease-out) 0.08s 1;
}

@keyframes decrypt-sweep {
  0%   { transform: translateY(-46px); opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

.project-cover {
  max-width: 100%;
  margin-top: 26px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

/* results — ref8 value/label treatment: framed translucent panels */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.result {
  position: relative;
  border: 1px solid var(--red-edge);
  background:
    linear-gradient(var(--cyan-edge) 0 0) 0 0 / 26px 2px no-repeat,
    var(--red-tint);
  padding: 22px 24px 20px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
}

.result:hover {
  border-color: var(--red-edge-hot);
}

.result-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 38px;
  line-height: 1.1;
  color: var(--cyan);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

/* count-up settle — one split flash when the live value locks in */
.result-value.is-set {
  animation: text-split 0.3s step-end 1;
}

.result-label {
  display: block;
  margin-top: 6px;
  text-transform: uppercase;
  font-family: var(--font-display-2);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.result-detail {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.project-description {
  margin: 30px 0 0;
  padding-left: 22px;
  border-left: 2px solid var(--red-edge);
  list-style: square;
  font-size: 14px;
  line-height: 1.75;
  max-width: 76ch;
}

.project-description li {
  margin: 10px 0;
  padding-left: 4px;
}

.project-description li::marker {
  color: var(--red);
}

/* ============================================================
   Chips (tags / stack / focus / tools)
   ============================================================ */
.chip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
}

.chip {
  border: 1px solid var(--hairline);
  color: var(--muted);
  padding: 4px 14px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut-s)), calc(100% - var(--cut-s)) 100%, 0 100%);
  transition:
    border-color 0.2s ease-out,
    color 0.2s ease-out,
    transform 0.2s var(--ease-out),
    background-color 0.2s ease-out;
}

.chip:hover {
  border-color: var(--red-edge-hot);
  color: var(--text);
  background: var(--red-tint);
  transform: translateY(-2px) skewX(-6deg);
}

.project-top .chip {
  padding: 2px 10px;
  font-size: 10.5px;
}

/* ============================================================
   3 · Stack — proficiency meters (ref8) + focus/tools
   ============================================================ */
.stack-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  column-gap: clamp(48px, 7vw, 120px);
  margin-top: 56px;
}

.stack-side {
  display: grid;
  gap: 44px;
  align-content: start;
}

.block-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--font-display-2);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.block-label::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%);
}

.stack-block .chip-list {
  margin-top: 0;
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.skill {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 230px) 1fr 52px;
  gap: 24px;
  align-items: center;
  padding: 18px 10px;
  border-bottom: 1px solid var(--hairline);
  transition: background-color 0.2s ease-out;
}

.skill:first-child {
  border-top: 1px solid var(--hairline);
}

.skill:hover {
  background: linear-gradient(90deg, var(--red-tint), transparent 60%);
}

/* row targeting tick — red edge mark on hover */
.skill::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 60%;
  transform: translateY(-50%) scaleY(0);
  background: var(--red);
  transition: transform 0.22s var(--ease-out);
}

.skill:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.skill-id {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.skill-name {
  font-family: var(--font-display-2);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: text-shadow 0.15s ease-out;
}

.skill:hover .skill-name {
  text-shadow: var(--split-soft);
}

.skill-note {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.skill-track {
  display: flex;
  gap: 7px;
}

/* value cells — notched parallelograms (ref8's segment meter) */
.skill-cell {
  height: 20px;
  flex: 1;
  background:
    linear-gradient(180deg, rgba(232, 232, 239, 0.05), transparent 40%)
    var(--cell-off);
  transform: skewX(-14deg);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  transition: box-shadow 0.2s ease-out;
}

.skill-cell.is-filled {
  background: linear-gradient(180deg, var(--cyan) 0 55%, rgba(34, 224, 214, 0.72));
  box-shadow: 0 0 9px rgba(34, 224, 214, 0.4);
}

.skill:hover .skill-cell.is-filled {
  box-shadow: 0 0 16px rgba(34, 224, 214, 0.65);
}

/* the readout numeral — display face, like ref8's VALUE figures */
.skill-value {
  text-align: right;
  color: var(--cyan);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---- languages — name + level readout rows ---- */
.lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.lang {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hairline);
}

.lang:first-child {
  border-top: 1px solid var(--hairline);
}

.lang-name {
  font-family: var(--font-display-2);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lang-level {
  color: var(--cyan);
  font-size: 12.5px;
  letter-spacing: 0.08em;
}

.focus-list .chip {
  border-color: var(--cyan-edge);
  color: var(--cyan);
  padding: 6px 16px;
}

.focus-list .chip:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}


/* ============================================================
   4 · Contact
   ============================================================ */
.contact-line {
  margin: 40px 0 0;
  font-size: 15px;
}

.connection-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 820px;
}

.connection {
  position: relative;
  display: flex;
  gap: 24px;
  align-items: baseline;
  padding: 16px 10px;
  border-bottom: 1px solid var(--hairline);
  overflow: clip;
}

.connection:first-child {
  border-top: 1px solid var(--hairline);
}

/* channel sweep — a red wash slides through the hovered row */
.connection::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--red-tint) 40%, transparent);
  transform: translateX(-101%);
  transition: transform 0.3s var(--ease-out);
  pointer-events: none;
}

.connection:hover::before {
  transform: translateX(0);
}

.connection-key {
  width: 112px;
  flex: none;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--font-display-2);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  transition: color 0.2s ease-out;
}

.connection:hover .connection-key {
  color: var(--red-hi);
}

.connection-link,
.connection-text {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.connection-copy {
  margin-left: auto;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 12px;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut-s)), calc(100% - var(--cut-s)) 100%, 0 100%);
  transition: color 0.15s ease-out, border-color 0.15s ease-out;
}

.connection-copy:hover {
  color: var(--red-hi);
  border-color: var(--red-edge-hot);
}

.connection-copy .copy-done {
  color: var(--amber);
}

.contact-base {
  margin-top: 32px;
  display: flex;
  gap: 24px;
  align-items: baseline;
}

.contact-base-label {
  width: 112px;
  flex: none;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--font-display-2);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.2em;
}

/* ============================================================
   MOTION — boot sequence (plays once on load)
   ============================================================ */

/* pre-boot: hide chrome until .is-ready animations take over */
.is-booting .site-head,
.is-booting .intro-name,
.is-booting .intro-fullname,
.is-booting .intro-tagline,
.is-booting .intro-meta,
.is-booting .btn-cv,
.is-booting .scroll-cue,
.is-booting .page-rail,
.is-booting .hud-corner,
.is-booting .hud-ticks,
.is-booting .hud-bg {
  opacity: 0;
}

body.is-booting::before {
  opacity: 0;
}

@keyframes nav-in {
  from {
    transform: translateY(-100%);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bracket-in {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 0.65;
    transform: none;
  }
}

@keyframes ticks-in {
  from { opacity: 0; }
  to { opacity: 0.4; }
}

@keyframes rail-in {
  from {
    opacity: 0;
    transform: translate(18px, -50%);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

@keyframes bg-in {
  from { opacity: 0; }
  to { opacity: 0.9; }
}

@keyframes grid-in {
  from { opacity: 0; }
  to { opacity: 0.6; }
}

/* the resolve: copies tear through clip slices from a wide offset,
   then settle to the 2px anaglyph rest */
@keyframes resolve-r {
  0%   { transform: translate(30px, -12px); opacity: 1; clip-path: inset(10% 0 62% 0); }
  14%  { transform: translate(-20px, 8px);  clip-path: inset(58% 0 6% 0); }
  30%  { transform: translate(13px, -6px);  clip-path: inset(0 0 76% 0); }
  46%  { transform: translate(-8px, 4px);   clip-path: inset(72% 0 0 0); }
  62%  { transform: translate(5px, -2px);   clip-path: inset(30% 0 38% 0); }
  78%  { clip-path: inset(0 0 0 0); }
  100% { transform: translate(2px, -1px); opacity: 0.8; clip-path: inset(0 0 0 0); }
}

@keyframes resolve-c {
  0%   { transform: translate(-30px, 12px); opacity: 1; clip-path: inset(64% 0 8% 0); }
  14%  { transform: translate(20px, -8px);  clip-path: inset(4% 0 60% 0); }
  30%  { transform: translate(-13px, 6px);  clip-path: inset(74% 0 0 0); }
  46%  { transform: translate(8px, -4px);   clip-path: inset(0 0 70% 0); }
  62%  { transform: translate(-5px, 2px);   clip-path: inset(36% 0 32% 0); }
  78%  { clip-path: inset(0 0 0 0); }
  100% { transform: translate(-2px, 1px); opacity: 0.8; clip-path: inset(0 0 0 0); }
}

/* boot choreography — the CRT split (0–0.55s) hands over to content */
.is-ready .site-head {
  animation: nav-in 0.5s var(--ease-out) both 0.5s;
}

body.is-ready::before {
  animation: grid-in 1.1s ease-out both 0.7s;
}

.is-ready .hud-bg {
  animation: bg-in 1.4s ease-out both 0.75s;
}

.is-ready .intro-name {
  animation: fade-in 0.4s ease-out both 0.55s;
}

.is-ready .intro-name-copy-r {
  animation: resolve-r 1s var(--ease-out) both 0.62s;
}

.is-ready .intro-name-copy-c {
  animation: resolve-c 1s var(--ease-out) both 0.62s;
}

.is-ready .intro-fullname {
  animation: rise-in 0.5s var(--ease-out) both 0.78s;
}

.is-ready .intro-tagline {
  animation: rise-in 0.5s var(--ease-out) both 0.88s;
}

.is-ready .intro-meta {
  animation: rise-in 0.6s var(--ease-out) both 1s;
}

.is-ready .btn-cv {
  animation: rise-in 0.55s var(--ease-out) both 1.18s;
}

.is-ready .hud-c-tl { animation: bracket-in 0.45s var(--ease-out) both 1.28s; }
.is-ready .hud-c-tr { animation: bracket-in 0.45s var(--ease-out) both 1.34s; }
.is-ready .hud-c-bl { animation: bracket-in 0.45s var(--ease-out) both 1.4s; }
.is-ready .hud-c-br { animation: bracket-in 0.45s var(--ease-out) both 1.46s; }

.is-ready .hud-ticks {
  animation: ticks-in 0.6s ease-out both 1.5s;
}

.is-ready .page-rail {
  animation: rail-in 0.5s var(--ease-out) both 1.4s;
}

.is-ready .scroll-cue {
  animation: fade-in 0.6s ease-out both 1.6s;
}

/* ============================================================
   MOTION — scroll reveals (IntersectionObserver, once)
   ============================================================ */
.will-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.will-reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* section titles: smaller rise + rule sweep + split */
.section-title.will-reveal {
  transform: translateY(10px);
}

.section-title.will-reveal::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s var(--ease-out) 0.2s;
}

.section-title.is-revealed::after {
  transform: scaleX(1);
}

.section-title.is-revealed {
  animation: text-split 0.3s step-end 0.12s 1;
}

/* focus/tools chips: pop in */
.stack-side .chip.will-reveal {
  transform: translateY(12px) scale(0.92);
}

/* stack meters: cells cascade-fill after the row lands */
.skill.will-reveal .skill-cell.is-filled {
  opacity: 0;
  transform: skewX(-14deg) scale(0.3);
}

.skill.is-revealed .skill-cell.is-filled {
  opacity: 1;
  transform: skewX(-14deg) scale(1);
  transition:
    transform 0.45s var(--ease-out),
    opacity 0.3s ease-out;
  transition-delay: calc(var(--i, 0) * 70ms + var(--cell-i, 0) * 80ms + 150ms);
}

.skill.will-reveal .skill-value {
  opacity: 0;
}

.skill.is-revealed .skill-value {
  opacity: 1;
  transition: opacity 0.4s ease-out;
  transition-delay: calc(var(--i, 0) * 70ms + 620ms);
}

/* ============================================================
   MOTION — glitch bursts (event-triggered, settle to stable)
   ============================================================ */

/* card frame flickers red<->cyan + micro-jumps, then settles */
@keyframes card-glitch {
  0%   { transform: translate(0, 0); }
  12%  { transform: translate(-3px, 1px); background-color: rgba(34, 224, 214, 0.5); }
  26%  { transform: translate(3px, -1px); background-color: rgba(255, 42, 61, 0.62); }
  42%  { transform: translate(-2px, 0);  background-color: rgba(34, 224, 214, 0.38); }
  60%  { transform: translate(2px, 1px); background-color: rgba(255, 42, 61, 0.5); }
  78%  { transform: translate(-1px, 0); }
  100% { transform: translate(0, 0); }
}

@keyframes text-split {
  0%   { text-shadow: none; }
  15%  { text-shadow: 3px 0 rgba(255, 42, 61, 0.85), -3px 0 rgba(34, 224, 214, 0.85); }
  35%  { text-shadow: -2.5px 0 rgba(255, 42, 61, 0.8), 2.5px 0 rgba(34, 224, 214, 0.8); }
  55%  { text-shadow: 2px 0 rgba(255, 42, 61, 0.6), -2px 0 rgba(34, 224, 214, 0.6); }
  100% { text-shadow: none; }
}

/* ambient re-splits for the intro copies — tear into slices, settle */
@keyframes copy-tick-r {
  0%   { transform: translate(2px, -1px); clip-path: inset(0 0 0 0); }
  25%  { transform: translate(12px, -6px); clip-path: inset(14% 0 52% 0); }
  50%  { transform: translate(-8px, 4px);  clip-path: inset(60% 0 4% 0); }
  75%  { transform: translate(5px, -2px);  clip-path: inset(0 0 66% 0); }
  100% { transform: translate(2px, -1px); clip-path: inset(0 0 0 0); }
}

@keyframes copy-tick-c {
  0%   { transform: translate(-2px, 1px); clip-path: inset(0 0 0 0); }
  25%  { transform: translate(-12px, 6px); clip-path: inset(56% 0 10% 0); }
  50%  { transform: translate(8px, -4px);  clip-path: inset(6% 0 58% 0); }
  75%  { transform: translate(-5px, 2px);  clip-path: inset(64% 0 0 0); }
  100% { transform: translate(-2px, 1px); clip-path: inset(0 0 0 0); }
}

/* section-word slice burst — the hidden channel copies flash on */
@keyframes word-slice-r {
  0%   { opacity: 0; }
  10%  { opacity: 0.9; transform: translate(6px, -2px);  clip-path: inset(8% 0 58% 0); }
  40%  { opacity: 0.9; transform: translate(-4px, 2px);  clip-path: inset(52% 0 12% 0); }
  70%  { opacity: 0.9; transform: translate(3px, -1px);  clip-path: inset(0 0 70% 0); }
  100% { opacity: 0; transform: translate(0, 0); }
}

@keyframes word-slice-c {
  0%   { opacity: 0; }
  10%  { opacity: 0.9; transform: translate(-6px, 2px);  clip-path: inset(54% 0 10% 0); }
  40%  { opacity: 0.9; transform: translate(4px, -2px);  clip-path: inset(6% 0 62% 0); }
  70%  { opacity: 0.9; transform: translate(-3px, 1px);  clip-path: inset(66% 0 0 0); }
  100% { opacity: 0; transform: translate(0, 0); }
}

/* rail diamond ping on activation */
@keyframes dot-ping {
  0%   { transform: rotate(45deg) scale(1.9); }
  100% { transform: rotate(45deg) scale(1.2); }
}

/* solid-slab jitter (CV button) — transform only, settles */
@keyframes slab-jitter {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3px, 1px) skewX(-4deg); }
  45%  { transform: translate(3px, -1px) skewX(3deg); }
  70%  { transform: translate(-2px, 0); }
  100% { transform: translate(0, 0); }
}

/* page numeral + HUD corner micro-jumps */
@keyframes num-jitter {
  0%   { transform: translate(0, 0); opacity: 1; }
  20%  { transform: translate(-6px, 2px); opacity: 0.5; }
  45%  { transform: translate(5px, -2px); opacity: 1; }
  70%  { transform: translate(-3px, 0); opacity: 0.65; }
  100% { transform: translate(0, 0); opacity: 1; }
}

@keyframes corner-jitter {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2px, 1px); }
  55%  { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0); }
}

/* project-card expand burst */
.project-card.is-glitching {
  animation: card-glitch 0.32s step-end 1;
}

.is-glitching .project-name {
  animation: text-split 0.32s step-end 1;
}

/* ambient momentary glitches — one random target at a time (app.js) */
.section-title.glitch-tick {
  animation: text-split 0.34s step-end 1;
}

.intro-name.glitch-tick {
  animation: text-split 0.36s step-end 1;
}

.intro-name.glitch-tick .intro-name-copy-r {
  animation: copy-tick-r 0.36s step-end 1;
}

.intro-name.glitch-tick .intro-name-copy-c {
  animation: copy-tick-c 0.36s step-end 1;
}

.project-card.glitch-tick {
  animation: card-glitch 0.32s step-end 1;
}

.project-card.glitch-tick .project-name {
  animation: text-split 0.32s step-end 1;
}

.btn-cv.glitch-tick .btn-cv-face {
  animation: slab-jitter 0.3s step-end 1;
}

/* copy-to-clipboard confirmation — a quick rattle, amber flash */
.connection-copy.glitch-tick {
  animation: slab-jitter 0.3s step-end 1;
  border-color: var(--amber);
  color: var(--amber);
}

/* page-enter burst — fired each time a new page becomes active */
.page.is-entering .section-title {
  animation: text-split 0.32s step-end 1;
}

.page.is-entering .title-word::before {
  animation: word-slice-r 0.38s step-end 1;
}

.page.is-entering .title-word::after {
  animation: word-slice-c 0.38s step-end 1;
}

.page.is-entering::after {
  animation: num-jitter 0.32s step-end 1;
}

/* just the peripheral HUD corners rattle — the frame itself stays put */
.is-shifting .hud-corner {
  animation: corner-jitter 0.3s step-end 1;
}

/* ambient ticks on section titles also fire their word copies */
.section-title.glitch-tick .title-word::before {
  animation: word-slice-r 0.34s step-end 1;
}

.section-title.glitch-tick .title-word::after {
  animation: word-slice-c 0.34s step-end 1;
}

/* rail diamond pings when its page arms */
.rail-dot.is-active::before {
  animation: dot-ping 0.45s var(--ease-out) 1;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .project-list {
    grid-template-columns: 1fr;
  }

  /* dissolve the columns; cards interleave back into one flow (order) */
  .project-col {
    display: contents;
  }
}

@media (max-width: 900px) {
  .stack-grid {
    display: block;
  }

  .stack-side {
    margin-top: 44px;
  }
}

@media (max-width: 760px) {
  .page-rail {
    display: none;
  }

  .page-ghost {
    display: none;
  }

  .intro-name::before,
  .intro-name::after {
    display: none;
  }
}

@media (max-width: 600px) {
  :root {
    --cut: 10px;
  }

  body {
    font-size: 15px;
  }

  .page {
    padding-top: calc(var(--header-h) + 32px);
    padding-bottom: 56px;
  }

  .page::after {
    font-size: 36px;
    top: calc(var(--header-h) + 18px);
  }

  .section-title {
    font-size: 20px;
    gap: 12px;
  }

  .intro-meta {
    padding: 14px 20px;
  }

  .meta-row {
    flex-direction: column;
    gap: 1px;
    padding: 8px 0;
  }

  .meta-row dt {
    width: auto;
  }

  .project-card {
    padding: 24px 22px 28px;
  }

  .project-card.is-featured {
    padding-left: 32px;
  }

  .project-name {
    font-size: 20px;
  }

  .project-head::after {
    top: 28px;
  }

  .skill {
    grid-template-columns: minmax(90px, 130px) 1fr 34px;
    gap: 12px;
    padding: 14px 2px;
  }

  .skill-name {
    font-size: 11.5px;
  }

  .skill-value {
    font-size: 18px;
  }

  .connection {
    flex-wrap: wrap;
    gap: 6px 16px;
  }

  .connection-key {
    width: 100%;
  }

  .connection-copy {
    margin-left: 0;
  }
}
