/* ==========================================================
   Ayip Taqiyyudin — portfolio
   Two layers: Bad Apple!! ASCII on a canvas (content backdrop)
   and Apple-style glass panels floating above it.
   ========================================================== */

/* ---------- Tokens ---------- */
:root {
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* dark is the default look; light inverts the video like the PV does */
  --bg: #0a0a0c;
  --ink: 236 236 240;          /* ASCII glyph colour (rgb triplet) */
  --ink-alpha: .46;
  --text: #f5f5f7;
  --text-2: rgba(235 235 245 / .74);
  --text-3: rgba(235 235 245 / .56);
  --line: rgba(255 255 255 / .09);
  --surface: rgba(255 255 255 / .045);
  --surface-2: rgba(255 255 255 / .08);
  --accent: #ff453a;           /* the apple — used for status dots */
  --accent-bg: #d70015;        /* primary button fill, white text 5.4:1 */
  --accent-text: #fff;

  --glass-fill: rgba(20 20 24 / .56);
  --glass-solid: #17171b;
  --glass-blur: 26px;
  --glass-sat: 1.6;
  --glass-hi: rgba(255 255 255 / .16);
  --glass-edge-a: rgba(255 255 255 / .34);
  --glass-edge-b: rgba(255 255 255 / .03);
  --glass-shadow: 0 30px 60px -30px rgba(0 0 0 / .65), 0 2px 6px rgba(0 0 0 / .25);
  --spec: rgba(255 255 255 / .07);

  --r-xl: 32px;
  --r-lg: 22px;
  --r-md: 14px;
  --gutter: clamp(16px, 4vw, 40px);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f4f6;
    --ink: 22 22 28;
    --ink-alpha: .40;
    --text: #1d1d1f;
    --text-2: rgba(29 29 31 / .76);
    --text-3: rgba(29 29 31 / .64);
    --line: rgba(0 0 0 / .08);
    --surface: rgba(0 0 0 / .035);
    --surface-2: rgba(0 0 0 / .06);
    --accent: #d70015;
    --glass-fill: rgba(250 250 252 / .62);
    --glass-solid: #fbfbfd;
    --glass-hi: rgba(255 255 255 / .9);
    --glass-edge-a: rgba(255 255 255 / .95);
    --glass-edge-b: rgba(255 255 255 / .25);
    --glass-shadow: 0 30px 60px -30px rgba(0 0 0 / .28), 0 2px 6px rgba(0 0 0 / .06);
    --spec: rgba(255 255 255 / .45);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.muted { color: var(--text-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
::selection { background: var(--accent-bg); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: var(--glass-solid); color: var(--text);
  transition: top .25s var(--ease);
}
.skip:focus { top: 16px; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg canvas {
  width: 100%; height: 100%;
  filter: blur(.6px);
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.bg canvas.is-ready { opacity: 1; }
.bg__vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 40%, var(--bg) 100%),
    linear-gradient(to bottom, transparent 70%, color-mix(in srgb, var(--bg) 70%, transparent));
}

/* ---------- Glass material ----------
   Regular variant: heavy blur + translucent fill, hairline gradient edge,
   specular glow that follows the pointer. */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
}
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, var(--glass-edge-a), var(--glass-edge-b) 35%, var(--glass-edge-b) 65%, var(--glass-edge-a));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}
.glass::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, -30%), var(--spec), transparent 55%);
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
  z-index: -1;
}
@media (hover: hover) { .glass:hover::after { opacity: 1; } }

@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .bg canvas { filter: none; }
}
@media (prefers-contrast: more) {
  :root { --glass-fill: var(--glass-solid); --text-2: var(--text); --text-3: var(--text); --line: rgba(128 128 128 / .5); }
  .glass::before { background: var(--text); opacity: .5; }
}

/* ---------- Navigation (functional layer) ---------- */
.nav {
  position: fixed; z-index: 50;
  top: max(14px, env(safe-area-inset-top));
  left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 4px;
  padding: 6px;
  border-radius: 999px;
  max-width: calc(100% - 32px);
}
.nav__brand {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  font: 600 .8125rem/1 var(--mono);
  background: var(--text); color: var(--bg);
}
.nav__links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a {
  display: block;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: .9375rem; font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a[aria-current="true"] { color: var(--text); background: var(--surface-2); }
.nav__sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.nav__bg {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text-2);
  cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease), scale .3s var(--spring);
}
.nav__bg:hover { color: var(--text); background: var(--surface-2); }
.nav__bg:active { scale: .9; }
.nav__bg svg { width: 18px; height: 18px; fill: currentColor; }
.nav__bg .i-play { display: none; }
.nav__bg[aria-pressed="true"] .i-play { display: block; }
.nav__bg[aria-pressed="true"] .i-pause { display: none; }

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: .75rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

h2 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 600; line-height: 1.02; letter-spacing: -0.035em;
  text-wrap: balance;
}
h3 { font-size: 1.1875rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px;
  font-weight: 500;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .25s var(--ease), scale .35s var(--spring);
}
.btn:hover { background: color-mix(in srgb, var(--surface-2) 100%, var(--text) 6%); }
.btn:active { scale: .96; }
.btn--primary { background: var(--accent-bg); color: var(--accent-text); box-shadow: none; }
.btn__icon { width: 18px; height: 18px; margin-left: -4px; }
.btn__meta { font-size: .6875rem; letter-spacing: .06em; color: var(--text-3); }
.btn--primary:hover { background: #e8001a; }

/* ---------- Hero ---------- */
main { padding: 0 var(--gutter); }

.hero {
  position: relative;
  min-height: 100svh;
  max-width: 1240px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "card live";
  align-items: end;
  gap: 24px;
  padding: 112px 0 96px;
}
.hero__card {
  grid-area: card;
  max-width: 740px;
  padding: clamp(28px, 3.6vw, 48px);
  border-radius: var(--r-xl);
}
.hero__name {
  margin: 16px 0 20px;
  font-size: clamp(3.25rem, 7.4vw, 7rem);
  font-weight: 650; line-height: .9; letter-spacing: -0.055em;
}
.hero__name .line { display: block; overflow: clip; padding: 0 .04em .14em; margin: 0 -.04em -.14em; }
.hero__name .line > span { display: inline-block; }
.hero__card.is-in .line > span { animation: line-up 1.1s var(--ease) backwards; }
.hero__card.is-in .line:nth-child(1) > span { animation-delay: .12s; }
.hero__card.is-in .line:nth-child(2) > span { animation-delay: .22s; }
@keyframes line-up { from { translate: 0 105%; rotate: 4deg; } }
.hero__lead { max-width: 56ch; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--text-2); text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: .8125rem;
}
.hero__meta dt { color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-size: .6875rem; }
.hero__meta dd { color: var(--text); margin-top: 2px; }

.scrollcue {
  position: absolute; left: 50%; bottom: 36px; translate: -50% 0;
  padding: 10px 14px;
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3);
  animation: bob 2.6s var(--ease-io) infinite;
}
@keyframes bob { 50% { translate: -50% 6px; } }

/* Live photo: hover (or tap) plays the hello clip. The photo tilts toward
   the pointer on a spring (driven from main.js), with a glare that follows. */
.live {
  grid-area: live;
  position: relative;
  width: clamp(220px, 24vw, 340px);
  aspect-ratio: 1;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 30px 60px -25px rgba(0 0 0 / .6), 0 0 0 1px var(--line);
  transform: rotate(2deg);
  transition: transform .8s var(--ease);
  background: var(--glass-solid);
  -webkit-tap-highlight-color: transparent;
}
.live.has-spring { transition: none; }
.live:not(.has-spring):hover, .live:not(.has-spring).is-playing { transform: rotate(0deg) scale(1.02); }
.live img, .live video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.live img { transition: filter .5s var(--ease), scale .8s var(--ease); }
.live video { opacity: 0; scale: 1.04; transition: opacity .45s var(--ease), scale .8s var(--ease); }
.live.is-playing video { opacity: 1; scale: 1; }
.live.is-playing img { filter: blur(6px); scale: 1.04; }

.live__glare {
  position: absolute; left: -50%; top: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(255 255 255 / .28), rgba(255 255 255 / .06) 22%, transparent 42%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* the whole photo is the button; the visible part is the disc */
.live__hit {
  position: absolute; inset: 0;
  margin: 0; padding: 0;
  border: 0; border-radius: inherit;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.live__hit:focus-visible { outline-offset: -4px; outline-color: #fff; }

.live__play {
  position: absolute; right: 14px; bottom: 14px;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(0 0 0 / .34);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255 255 255 / .22), 0 8px 24px -8px rgba(0 0 0 / .5);
  transition: scale .5s var(--spring);
}
/* soft halo that breathes while idle, inviting a hover */
.live__play::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255 255 255 / .55);
  animation: halo 2.8s var(--ease) infinite;
  pointer-events: none;
}
@keyframes halo {
  0% { opacity: .9; scale: 1; }
  70%, 100% { opacity: 0; scale: 1.45; }
}
.live:hover .live__play { scale: 1.08; }
.live__hit:active .live__play { scale: .92; }
.live.is-playing .live__play::before { animation: none; opacity: 0; }

.live__ring { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; overflow: visible; }
.live__ring circle { fill: none; stroke-width: 2.5; }
.live__track { stroke: rgba(255 255 255 / .22); }
.live__progress {
  stroke: #fff; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.live.is-playing .live__progress { opacity: 1; }

.live__icon { position: relative; width: 22px; height: 22px; fill: currentColor; overflow: visible; }
.live__icon .i-play, .live__icon .i-pause {
  transform-box: fill-box; transform-origin: center;
  transition: opacity .25s var(--ease), scale .45s var(--spring), rotate .45s var(--spring);
}
.live__icon .i-pause { opacity: 0; scale: .4; rotate: -90deg; }
.live.is-playing .i-play { opacity: 0; scale: .4; rotate: 90deg; }
.live.is-playing .i-pause { opacity: 1; scale: 1; rotate: 0deg; }

/* ---------- Panels ---------- */
.panel {
  max-width: 1120px;
  margin: 0 auto clamp(64px, 12vh, 140px);
  padding: clamp(24px, 4vw, 56px);
  border-radius: var(--r-xl);
}
.panel--wide { max-width: 1240px; }
.panel--left { max-width: 960px; margin-left: max(0px, calc((100% - 1240px) / 2)); }
.panel--right { max-width: 1040px; margin-right: max(0px, calc((100% - 1240px) / 2)); }
.panel--mid { max-width: 900px; }
.panel__head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.tile {
  grid-column: span 2;
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  transition: background-color .4s var(--ease), translate .5s var(--ease);
}
.tile h3 { color: var(--text); }
@media (hover: hover) { .tile:hover { background: var(--surface-2); translate: 0 -2px; } }
.tile__kicker { font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.tile--stat { grid-column: span 3; grid-row: span 2; justify-content: space-between; }
.tile--term { grid-column: span 3; }
.bento > .tile:nth-child(3) { grid-column: span 3; }
.tile--live { grid-column: span 2; }
.stat { display: grid; gap: 4px; margin: 8px 0; color: var(--text); }
.stat__num {
  font-size: clamp(4.5rem, 11vw, 9rem);
  font-weight: 650; line-height: .85; letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; }

.term {
  display: grid; gap: 2px;
  font-size: .8125rem; line-height: 1.6;
  color: var(--text-2);
}
.term li { display: grid; grid-template-columns: auto 13.5em minmax(0, 1fr); gap: 0 .6em; }
@media (max-width: 520px) {
  .term li { grid-template-columns: auto minmax(0, 1fr); }
  .term .c { grid-column: 2; margin-bottom: 6px; }
}
.term .p, .win .p { color: var(--accent); }
.term .c { color: var(--text-3); }
.term a, .win a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.term a:hover, .win a:hover { text-decoration-color: currentColor; }

.checks { display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks li::before { content: "[x]"; font-family: var(--mono); font-size: .75rem; color: var(--text-3); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 5px 10px; border-radius: 999px;
  font-size: .8125rem; color: var(--text);
  background: var(--surface-2);
}
.onair { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }

/* ---------- Timeline ---------- */
.tl { position: relative; display: grid; gap: 0; }
.tl::before {
  content: ""; position: absolute;
  left: 7px; top: 10px; bottom: 10px; width: 1px;
  background: linear-gradient(var(--accent), var(--line) 22%, var(--line) 80%, transparent);
}
.tl__item {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px 36px;
  padding: 0 0 40px 40px;
}
.tl__item:last-child { padding-bottom: 0; }
.tl__item::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--text-3);
}
.tl__item--now::before { background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.tl__item--edu::before { border-radius: 4px; }
.tl__when { display: grid; gap: 6px; align-content: start; font-size: .8125rem; color: var(--text); padding-top: 2px; }
.bar { font-size: .6875rem; color: var(--text-3); white-space: nowrap; }
.bar b { font-weight: 400; opacity: .55; }
.bar i { font-style: normal; color: var(--text); }
.tl__item--now .bar i { color: var(--accent); }
.tl__body { display: grid; gap: 10px; color: var(--text-2); }
.tl__org { font-size: .9375rem; color: var(--text-3); margin-top: -4px; }
.tl__body ul { display: grid; gap: 8px; }
.tl__body li { position: relative; padding-left: 18px; }
.tl__body li::before { content: "—"; position: absolute; left: 0; color: var(--text-3); }
.tl__sub { padding-top: 10px; border-top: 1px solid var(--line); }
.tl__sub strong { color: var(--text); font-weight: 500; }

/* ---------- Work ---------- */
.work {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.proj {
  display: flex; flex-direction: column; gap: 12px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
}
.proj h3 { color: var(--text); font-size: 1.375rem; }
.proj--feature { grid-row: span 2; justify-content: space-between; }
.proj--feature h3 { font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.05; letter-spacing: -0.035em; }
.proj--feature > p:not(.tile__kicker):not(.links) { font-size: 1.125rem; }
.proj--term { grid-column: 1 / -1; padding: 0; background: transparent; box-shadow: none; }
.links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: auto; padding-top: 6px; }
.links a {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 32px;
  font-size: .9375rem; font-weight: 500; color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: border-color .25s var(--ease);
}
.links a:hover { border-color: currentColor; }

.win {
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.win__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: .75rem; color: var(--text-3);
}
.win__bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.win__bar i:nth-child(2) { background: #febc2e; }
.win__bar i:nth-child(3) { background: #28c840; }
.win__bar span { margin-left: auto; margin-right: auto; translate: -30px 0; }
.win__body { padding: 20px; font-size: .8125rem; line-height: 1.7; color: var(--text-2); }
.win__cmd { color: var(--text); }
.scripts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 32px; margin: 12px 0 16px; }
.scripts div { display: grid; grid-template-columns: minmax(0, 15.5em) minmax(0, 1fr); gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.scripts dt { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scripts dd { color: var(--text-3); }
.caret { display: inline-block; width: .6em; height: 1.1em; margin-left: 4px; vertical-align: -2px; background: var(--text); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Skills ---------- */
.skills { display: grid; }
.skills div {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 32px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.skills dt { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding-top: 4px; }
.skills dd { color: var(--text); }
.subhead { margin: 40px 0 16px; font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ways li { padding: 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); }
.ways strong { display: block; margin-bottom: 6px; color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact {
  max-width: 1240px;
  margin: 0 auto 40px;
  padding: clamp(32px, 6vw, 80px);
  border-radius: var(--r-xl);
}
.contact h2 { margin: 18px 0 40px; font-size: clamp(2.25rem, 6vw, 5rem); max-width: 16ch; }
.contact__list { display: grid; grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)); gap: 12px; }
.contact__list a {
  display: grid; gap: 6px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 1.0625rem; font-weight: 500;
  overflow-wrap: break-word;
  transition: background-color .3s var(--ease), translate .5s var(--ease);
}
.contact__list a:hover { background: var(--surface-2); translate: 0 -2px; }
.contact__list .cvcard {
  display: grid; gap: 6px; align-content: start;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent-bg) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.contact__list .cvcard a { display: inline; padding: 0; background: none; box-shadow: none; border-radius: 0; font-size: 1.0625rem; font-weight: 500; }
.contact__list .cvcard a:hover { background: none; translate: none; text-decoration: underline; text-underline-offset: 3px; }
.contact__list .cvcard .cvcard__alt { font-size: .875rem; font-weight: 400; color: var(--text-2); }
.contact__list .mono { font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 400; }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  max-width: 1240px; margin: 0 auto;
  padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  font-size: .75rem; color: var(--text-3);
}
.foot cite { font-style: normal; color: var(--text-2); }
#frame { font-variant-numeric: tabular-nums; }

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: grid; place-items: center; padding: 24px var(--gutter); }
.lost__card { display: grid; gap: 18px; justify-items: start; max-width: 560px; padding: clamp(28px, 5vw, 52px); border-radius: var(--r-xl); }
.lost__card h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 650; line-height: .95; letter-spacing: -0.045em; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; translate: 0 28px; transition: opacity .9s var(--ease), translate .9s var(--ease); }
.reveal.is-in { opacity: 1; translate: 0 0; }
.no-js .reveal { opacity: 1; translate: none; }
html:not(.no-js) .reveal:not(.is-in) .stagger > * { opacity: 0; }
.reveal.is-in .stagger > * {
  /* backwards fill only, so hover styles take over once it lands */
  animation: rise .85s var(--ease) backwards;
  animation-delay: calc(.12s + var(--i, 0) * 70ms);
}
@keyframes rise { from { opacity: 0; translate: 0 22px; scale: .98; } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile, .tile--stat, .tile--term, .tile--live, .bento > .tile:nth-child(3) { grid-column: span 1; grid-row: auto; }
  .tile--stat, .tile--term { grid-column: 1 / -1; }
  .scripts { grid-template-columns: minmax(0, 1fr); }
  .ways { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1180px) {
  .contact__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 24px; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "live" "card";
    align-items: start;
    padding: 72px 0 96px;
    gap: 20px;
  }
  .live { width: 148px; border-radius: 26px; }
  .live__play { width: 40px; height: 40px; right: 10px; bottom: 10px; }
  .live__icon { width: 18px; height: 18px; }
  .scrollcue { display: none; }

  /* nav becomes a bottom bar within thumb reach */
  .nav { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); }
  .nav__brand { display: none; }
  .nav { gap: 0; padding: 4px; }
  .nav__links a { padding: 11px 9px; font-size: .84375rem; }
  .nav__sep { margin: 0 2px; }
  .nav__links li:nth-child(4) { display: none; }

  .bento, .work, .contact__list { grid-template-columns: minmax(0, 1fr); }
  .tile, .tile--stat, .tile--term, .tile--live, .bento > .tile:nth-child(3) { grid-column: auto; }
  .proj--term, .proj--feature { grid-column: auto; grid-row: auto; }
  .tl__item { grid-template-columns: minmax(0, 1fr); padding-left: 32px; }
  .skills div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .scripts div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .win__bar span { translate: none; }
  .panel, .panel--left, .panel--right { margin-left: 0; margin-right: 0; }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .nav__links a { padding: 11px 7px; font-size: .8125rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; translate: none; }
  .live, .live:hover, .live.is-playing { transform: none; }
  .live__glare { display: none; }
}
