/* Fonts (Archivo, JetBrains Mono) are declared in index.html <head>. */

/* =========================================================================
   aaa628 — Portfolio
   Light theme  : grey + red-orange (the reference design)
   Dark theme   : matte near-black + cyan
   ========================================================================= */

:root {
  --bg: #e3e3e1;
  --bg-2: #d9d9d6;
  --surface: #ececea;
  --ink: #111111;
  --ink-2: #4f4f4c;
  --ink-3: #8b8b87;
  --line: rgba(17, 17, 17, 0.16);
  --line-strong: rgba(17, 17, 17, 0.85);
  --accent: #e04a36;
  --on-accent: #111111;
  --shadow: 0 34px 60px -32px rgba(0, 0, 0, 0.55), 0 10px 18px -12px rgba(0, 0, 0, 0.25);

  --pad: clamp(16px, 3.7vw, 56px);
  --max: 1440px;
  --header-h: 52px;
  --f-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0c0d0e;
  --bg-2: #141618;
  --surface: #17191b;
  --ink: #e8eced;
  --ink-2: #a3acaf;
  --ink-3: #697275;
  --line: rgba(232, 236, 237, 0.13);
  --line-strong: rgba(232, 236, 237, 0.8);
  --accent: #3cc8d4;
  --on-accent: #0c0d0e;
  --shadow: 0 34px 60px -30px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(232, 236, 237, 0.06);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Type helpers ---------- */
.label {
  font-family: var(--f-sans);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mono {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.muted { color: var(--ink-3); }

.inline-link {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.inline-link:hover { color: var(--accent); }

/* Crosshair marks, positioned with --x / --y inside a relative parent */
.cross {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cross::before,
.cross::after {
  content: "";
  position: absolute;
  background: var(--ink-3);
}
.cross::before { left: 6px; top: 0; width: 1px; height: 13px; }
.cross::after { top: 6px; left: 0; height: 1px; width: 13px; }
.cross--light::before,
.cross--light::after { background: rgba(255, 255, 255, 0.35); }

/* ---------- Intro on every page load (pixel bloom) ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: #0b0b0c;
  color: #efece2;
}
.intro-pending .intro,
.intro.is-playing { display: block; }
.intro-pending { overflow: hidden; }
.intro__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__count,
.intro__skip {
  position: absolute;
  bottom: clamp(18px, 3vw, 36px);
  margin: 0;
  font-size: 11px;
  color: rgba(239, 236, 226, 0.6);
}
.intro__count { left: var(--pad); }
.intro__count span { color: #efece2; }
.intro__skip {
  right: var(--pad);
  padding: 8px 14px;
  border: 1px solid rgba(239, 236, 226, 0.3);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.intro__skip:hover { color: #0b0b0c; background: #efece2; }
.intro.is-leaving {
  transform: translateY(-100%);
  transition: transform 0.9s cubic-bezier(0.7, 0, 0.2, 1);
}

/* hold the hero's own entrance until the intro lifts */
.intro-pending .hero__bar,
.intro-pending .ch,
.intro-pending .ch__in,
.intro-pending .flip { animation-play-state: paused; }

/* ---------- Header: slim, layered glass with a pixel-grid texture ---------- */
.header {
  --grid-line: color-mix(in srgb, var(--ink) 7%, transparent);
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--pad);
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 35%, transparent) inset;
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease),
    transform 0.5s var(--ease), opacity 0.35s var(--ease);
}
.header.is-hidden {
  opacity: 0;
  transform: translateY(-45%);
  pointer-events: none;
}
html[data-theme="dark"] .header { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset; }
.header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 35%, transparent) inset, 0 14px 30px -22px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .header.is-scrolled { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 16px 34px -20px rgba(0, 0, 0, 0.9); }

/* layer 1: grid paper that drifts and leans with the pointer */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 8px 8px;
  background-position: calc(var(--mx, 0) * 6px) calc(var(--my, 0) * 4px);
  -webkit-mask-image: radial-gradient(60% 140% at 50% 50%, #000 30%, transparent 75%);
  mask-image: radial-gradient(60% 140% at 50% 50%, #000 30%, transparent 75%);
  pointer-events: none;
  transition: background-position 0.6s var(--ease);
}
.js .header::before { animation: grid-drift 24s linear infinite; }
@keyframes grid-drift { to { translate: -8px 0; } }

/* layer 2: the verse, revealed once from the right (reading direction) */
.verse {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}
.verse[dir="ltr"] { flex-direction: row; }
.verse p { margin: 0; }
.verse__ar,
.verse__by-ar {
  font-family: "Kufi Verse", "Noto Kufi Arabic", "Geeza Pro", "Segoe UI", sans-serif;
}
.verse__ar { font-weight: 600; font-size: 13.5px; line-height: 1.75; white-space: nowrap; }
.verse__en { font-weight: 500; font-size: 13px; letter-spacing: -0.005em; white-space: nowrap; }
.verse__by { color: var(--ink-3); white-space: nowrap; }
.verse__by-ar { font-weight: 400; font-size: 11px; }
.verse__by-en { font-size: 10.5px; }
.verse__toggle {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.verse__toggle .mono { font-size: 10px; letter-spacing: 0.06em; }
.verse__toggle .verse__glyph { font-family: "Kufi Verse", sans-serif; font-weight: 600; font-size: 13px; line-height: 1; }
.verse__toggle:hover { background: var(--ink); color: var(--bg); }
.verse__line,
.verse__by { transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.verse.is-swapping .verse__line,
.verse.is-swapping .verse__by { opacity: 0; transform: translateY(4px); }

.header__verse {
  /* the middle grid column: centred on the page */
  justify-self: center;
  padding-inline: 16px;
  min-width: 0;
}
@media (max-width: 1100px) {
  .header__verse { display: none; }   /* too tight for the verse: it isn't squeezed or clipped */
}
.js .header__verse .verse__line,
.js .header__verse .verse__by { clip-path: inset(-12px -6px -12px 100%); animation: verse-in 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.45s forwards; }
.js .header__verse .verse__by { animation-delay: 1.1s; animation-duration: 0.9s; }
.intro-pending .header__verse .verse__line,
.intro-pending .header__verse .verse__by { animation-play-state: paused; }
@keyframes verse-in { to { clip-path: inset(-12px -6px -12px -6px); } }  /* margins keep vowel marks unclipped */

/* layer 3: reading progress along the bottom edge */
.header__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--sp, 0));
  transform-origin: left;
  pointer-events: none;
}


.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand__mark { width: 21px; height: 21px; }

.header__actions { display: flex; gap: 6px; }
.header__left { display: flex; align-items: center; gap: 14px; }
/* wide screens: three columns, so the verse sits at the true centre of the page */
@media (min-width: 1101px) {
  .header { display: grid; grid-template-columns: 1fr auto 1fr; }
  .header__left { justify-self: start; }
  .header__actions { justify-self: end; }
}
.header .pill .label { font-size: 11px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.pill:hover { background: var(--ink); color: var(--bg); }

.theme-toggle__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.menu-toggle__lines {
  position: relative;
  width: 18px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transition: border-color 0.2s;
}
.menu-toggle__lines::before,
.menu-toggle__lines::after {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__lines { border-color: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines::before { opacity: 1; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines::after { opacity: 1; transform: rotate(-45deg); }

/* ---------- Discord: copy username ---------- */
.discord {
  position: relative;
  width: 32px;
  padding: 0;
  justify-content: center;
  overflow: visible;
}
.discord__icon { width: 16px; height: 16px; overflow: visible; }
.discord__icon--sm { width: 15px; height: 15px; }
.discord__lids { transform-box: fill-box; transform-origin: 50% 50%; transform: scaleY(0); }
.discord__check { opacity: 0; }
.discord__mark,
.discord__lids { transition: opacity 0.2s var(--ease); }
.js .discord .discord__icon { animation: dc-bob 3.2s ease-in-out infinite; }
.js .discord__lids { animation: dc-blink 4.6s infinite; }
@keyframes dc-bob { 50% { transform: translateY(-1.5px); } }
@keyframes dc-blink { 0%, 93%, 100% { transform: scaleY(0); } 96% { transform: scaleY(1); } }
.discord:hover,
.discord:focus-visible { background: #5865f2; border-color: #5865f2; color: #fff; }
.discord:hover .discord__icon { animation: dc-wiggle 0.6s ease-in-out; }
@keyframes dc-wiggle { 25% { transform: rotate(-12deg); } 60% { transform: rotate(9deg); } 100% { transform: rotate(0); } }
/* copied state: the mark becomes a check for a moment */
.is-copied .discord__mark,
.is-copied .discord__lids { opacity: 0; }
.is-copied .discord__check { opacity: 1; }
.discord.is-copied { animation: dc-pop 0.4s var(--ease); background: #5865f2; border-color: #5865f2; color: #fff; }
@keyframes dc-pop { 40% { transform: scale(1.12); } }

.toast {
  position: fixed;
  inset: auto auto clamp(18px, 4vw, 32px) 50%;
  margin: 0;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11.5px;
  text-transform: none;
  box-shadow: 0 16px 30px -16px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 0);
  opacity: 1;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast[hidden],
.toast.is-out { opacity: 0; transform: translate(-50%, 10px); }
.toast::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: #5865f2; vertical-align: 1px; }

/* ---------- X button ---------- */
/* GitHub button + card */
.ghbtn { width: 32px; padding: 0; justify-content: center; text-decoration: none; }
.ghbtn__icon { width: 15px; height: 15px; }
.ghbtn:hover,
.ghbtn:focus-visible { background: var(--ink); color: var(--bg); }
.ghbtn:hover .ghbtn__icon { animation: gh-spin 0.6s var(--ease); }
@keyframes gh-spin { to { transform: rotate(360deg); } }
.pcard--github .pcard__banner { background: #090b1a; }
.pcard--github .pcard__banner-mark { color: rgba(238, 240, 255, 0.85); }
.space { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard__link--gh { color: var(--ink-2); }
.pcard__link--gh:hover { color: var(--accent); }
/* the banner only animates while the card is open */
.space .sp-star,
.space .sp-glow,
.space .sp-astro,
.space .sp-planet,
.space .sp-tether { animation-play-state: paused; }
.social--github:hover .space *,
.social--github:has(:focus-visible) .space * { animation-play-state: running; }
.sp-star { animation: sp-twinkle 2.6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes sp-twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.sp-glow { transform-box: fill-box; transform-origin: center; animation: sp-drift 9s ease-in-out infinite alternate; }
@keyframes sp-drift { to { transform: translate(40px, 6px) scale(1.15); } }
.sp-astro { transform-box: fill-box; transform-origin: 30% 40%; animation: sp-float 5.5s ease-in-out infinite; }
@keyframes sp-float { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 50% { transform: translate(6px, -6px) rotate(8deg); } }
.sp-tether { animation: sp-dash 4s linear infinite; }
@keyframes sp-dash { to { stroke-dashoffset: -20; } }
.sp-planet { transform-box: fill-box; transform-origin: center; animation: sp-bob 7s ease-in-out infinite; }
@keyframes sp-bob { 50% { transform: translateY(-3px); } }

.xbtn { width: 32px; padding: 0; justify-content: center; text-decoration: none; }
.xbtn__icon { width: 13px; height: 13px; }
.js .xbtn__icon { animation: x-tick 6s ease-in-out infinite; }
@keyframes x-tick { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(90deg) scale(0.85); } 96% { transform: rotate(90deg); } }
.xbtn:hover,
.xbtn:focus-visible { background: var(--ink); color: var(--bg); }

/* ---------- Profile cards (hover / keyboard focus) ---------- */
.social { position: relative; display: inline-flex; }
.pcard {
  position: absolute;
  top: calc(100% + 12px);
  right: -6px;
  z-index: 5;
  width: 292px;
  padding: 0 18px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 28px 50px -24px rgba(0, 0, 0, 0.5), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
  transition-delay: 0.15s;
}
.pcard::before {           /* bridge, so the pointer can travel from button to card */
  content: "";
  position: absolute;
  inset: -14px 0 auto 0;
  height: 14px;
}
@media (hover: hover) {
  .social:hover .pcard { opacity: 1; visibility: visible; transform: none; transition-delay: 0.12s, 0.12s, 0s; }
}
.social:has(:focus-visible) .pcard { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.pcard__banner {
  position: relative;
  display: block;
  height: 72px;
  margin: 0 -18px;
  border-radius: 17px 17px 0 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 8px 8px,
    #0e0e0f;
}
.pcard--discord .pcard__banner {
  background:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(120deg, #5865f2, #3b44b8);
}
/* banner image: an <img> in the HTML (removed on error, so the pattern above shows instead) */
.pcard__banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard__banner-mark {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 44px;
  height: 44px;
  color: rgba(255, 255, 255, 0.14);
}
.pcard__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: -32px 0 10px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  overflow: hidden;
}
.pcard--discord .pcard__avatar { background: #0e0e0f; color: #eceeee; }
html[data-theme="dark"] .pcard--discord .pcard__avatar { background: #2b2d31; }
.pcard__avatar svg { width: 36px; height: 36px; }
.pcard__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.social:hover .pcard__avatar,
.social:has(:focus-visible) .pcard__avatar { animation: pc-pop 0.5s var(--ease) 0.15s both; }
@keyframes pc-pop { from { transform: scale(0.6); opacity: 0; } }
.pcard p { margin: 0; }
.pcard__name { font-stretch: 125%; font-weight: 800; font-size: 18px; line-height: 1.2; }
.pcard__handle { color: var(--ink-3); font-size: 11px; text-transform: none; margin-bottom: 10px !important; }
.pcard__bio { font-size: 14px; line-height: 1.45; color: var(--ink); }
.pcard__meta { margin-top: 10px !important; color: var(--ink-3); font-size: 10.5px; text-transform: none; }
.pcard__link { display: inline-block; text-decoration: none; color: #5865f2; }
html[data-theme="dark"] .pcard__link { color: #8b93ff; }
.pcard__link:hover { text-decoration: underline; }
.pcard__cta {
  display: block;
  margin-top: 14px !important;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 10.5px;
  text-decoration: none;
}
a.pcard__cta:hover { color: var(--accent); }

/* ---------- Menu overlay: index left, live preview + links right ---------- */
.menu {
  --rule: color-mix(in srgb, var(--ink) 20%, transparent);   /* one hairline for every divider */
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  padding: clamp(18px, 3.5vh, 36px) var(--pad) clamp(14px, 2.5vh, 24px);
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; }
.menu__inner {
  display: flex;
  flex-direction: column;
  max-width: var(--max);
  min-height: 100%;
  margin: 0 auto;
}
.menu__head,
.menu__foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-3);
  font-size: 11px;
}
.menu__head { align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.menu__close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.menu__close:hover { background: var(--ink); color: var(--bg); }
.menu__kbd {
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  line-height: 1;
  opacity: 0.6;
}
.menu__x { position: relative; width: 12px; height: 12px; }
.menu__x::before,
.menu__x::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.menu__x::after { transform: rotate(-45deg); }
@media (hover: none) { .menu__kbd { display: none; } }

/* the header steps aside while the menu is open */
.header { transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.5s var(--ease), opacity 0.3s var(--ease), visibility 0s; }
.menu-open .header { opacity: 0; visibility: hidden; pointer-events: none; transition-delay: 0s, 0s, 0s, 0s, 0s, 0.3s; }
.menu__foot { padding-top: 12px; border-top: 1px solid var(--rule); }
.menu__foot .handle { color: var(--ink-2); }

/* the grid fills everything between the two rules */
.menu__grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
}

/* left: five rows, evenly spread over the full height */
.menu__nav { display: flex; padding-right: clamp(24px, 4vw, 72px); container-type: inline-size; }
.menu__list { display: flex; flex-direction: column; flex: 1; }
.menu__list li { flex: 1; display: flex; min-height: 64px; border-bottom: 1px solid var(--rule); }
.menu__list li:last-child { border-bottom: 0; }
.menu__list a {
  flex: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: background-color 0.25s var(--ease);
}
.menu__list a > span { transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.3s var(--ease), opacity 0.3s var(--ease); }
.menu__n,
.menu__note { color: var(--ink-3); font-size: 11px; }
.menu__word {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(20px, min(5.8cqw, 7.5vh), 60px);   /* sized to the column, so it always clears its label */
  line-height: 1;
  text-transform: uppercase;
}
.menu__arrow {
  color: var(--accent);
  font-size: 22px;
  opacity: 0;
  transform: translateX(-10px);
}
.menu__list li.is-current .menu__word,
.menu__list a:hover .menu__word,
.menu__list a:focus-visible .menu__word { transform: translateX(10px); }
.menu__list li.is-current .menu__word,
.menu__list a:hover .menu__word,
.menu__list a:focus-visible .menu__word { color: var(--accent); }
.menu__list li.is-current .menu__note { color: var(--ink); }
.menu__list li.is-current .menu__arrow,
.menu__list a:hover .menu__arrow,
.menu__list a:focus-visible .menu__arrow { opacity: 1; transform: none; }
.menu__list a:focus-visible { outline: none; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.menu.is-open .menu__list li { animation: menu-in 0.4s var(--ease) both; animation-delay: calc(var(--k) * 40ms + 40ms); }
@keyframes menu-in { from { opacity: 0; transform: translateY(12px); } }

/* right: divider runs rule to rule; preview on top, links at the bottom */
.menu__aside {
  display: flex;
  flex-direction: column;
  padding-left: clamp(20px, 3vw, 40px);
  border-left: 1px solid var(--rule);
  min-width: 0;
}
.menu__label { margin: 0 0 14px; color: var(--ink-3); font-size: 11px; }
.mpv { flex: 1; display: grid; padding: clamp(18px, 3vh, 28px) 0; min-height: 0; }
.mpv__panel {
  grid-area: 1 / 1;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  /* leaving: fade out fast and get out of the way */
  transition: opacity 0.1s linear, transform 0.1s linear, visibility 0s linear 0.1s;
}
/* arriving: wait for the old panel to clear, then ease in, so text never overlaps */
.mpv__panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.22s var(--ease) 0.1s, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s, visibility 0s linear 0.1s;
}

.mpv__rows > div,
.mpv__list a,
.mpv__list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}
.mpv__rows > div:first-child,
.mpv__list > li:first-child { border-top: 1px solid var(--rule); }
.mpv__rows dt { color: var(--ink-3); font-size: 11px; }
.mpv__rows dd { font-size: 15px; line-height: 1.4; }
.mpv__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: #2fbf71;
  vertical-align: 1px;
  box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.5);
}
.menu.is-open .mpv__dot { animation: mpv-pulse 2s ease-out infinite; }
@keyframes mpv-pulse { 70% { box-shadow: 0 0 0 7px rgba(47, 191, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); } }
.mpv__muted { color: var(--ink-3); font-size: 10.5px; margin-left: 6px; }
.mpv__link { color: var(--accent); text-decoration: none; font-size: 11px; margin-left: 4px; white-space: nowrap; }
.mpv__link:hover { text-decoration: underline; }
[data-clock] { font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-size: 14px; }
.mpv__lead { margin: 0 0 14px; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.4; font-weight: 500; }
.mpv__list { padding: 0; }
.mpv__list li { padding: 0; border-top: 0; border-bottom: 0; display: block; }
.mpv__list a { grid-template-columns: minmax(0, 1fr) auto; text-decoration: none; transition: padding 0.15s var(--ease), color 0.15s; }
.mpv__list a:hover,
.mpv__list a:focus-visible { padding-left: 8px; color: var(--accent); }
.mpv__list li > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.mpv__name { font-stretch: 112%; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em; }
.mpv__meta { color: var(--ink-3); font-size: 10.5px; text-align: right; white-space: nowrap; }
.mpv__text { color: var(--ink-2); font-size: 14px; line-height: 1.4; }

.menu__else { padding: 16px 0 clamp(14px, 2vh, 22px); border-top: 1px solid var(--rule); }
.menu__social a,
.menu__social button {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  color: inherit;
  font: inherit;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: padding 0.18s var(--ease), color 0.15s;
}
.menu__social li:first-child a { border-top: 1px solid var(--rule); }
.menu__social li:last-child > * { border-bottom: 0; }
.menu__social .mono { color: var(--ink-3); font-size: 11px; }
.menu__social span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__social a:hover,
.menu__social button:hover { padding-left: 8px; color: var(--accent); }
.menu__social [data-discord]:hover { color: #5865f2; }
.menu__social .is-copied .menu__act { color: #2fbf71; }


/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  padding-top: calc(var(--header-h) + clamp(28px, 4vw, 56px));
  padding-inline: var(--pad);
}

.hero__frame {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  height: clamp(300px, 33vw, 480px);
}

.hero__bar {
  position: absolute;
  left: 41.4%;
  width: 17.3%;
  top: 0;
  bottom: 0;
  background: var(--accent);
  transform-origin: bottom;
  animation: bar-in 1.1s var(--ease) both;
}
@keyframes bar-in { from { transform: scaleY(0); } }

.hero__welcome {
  position: absolute;
  left: 11.1%;
  top: -0.25em;
  margin: 0;
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(14px, 2vw, 28px);
  line-height: 1;
  text-transform: uppercase;
}

.hero__year {
  position: absolute;
  right: 11%;
  top: 0;
  margin: 0;
  color: var(--ink-2);
}

.hero__tri {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  transform: translateY(-50%);
}
.hero__tri--l { left: 0.4%; border-left: 9px solid var(--ink); }
.hero__tri--r { right: 0.4%; border-right: 9px solid var(--ink); }

.hero__title {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin: 0;
  transform: translateY(-62%);
  font-stretch: 125%;
  font-weight: 800;
  font-size: min(9.6vw, 140px);
  line-height: 0.82;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-align: center;
}

.hero__name,
.hero__role {
  position: absolute;
  bottom: 0;
  margin: 0;
  transform: translateY(50%);
}
.hero__name { left: 11.1%; max-width: 26%; }
.hero__role { right: 11%; max-width: 23.5%; text-align: right; text-wrap: balance; }
.hero__name,
.hero__role { letter-spacing: 0.035em; }
.hero__handle { color: var(--ink-3); }

/* ---- Flipping letters ---- */
.flip {
  display: flex;
  justify-content: center;
  perspective: 900px;
}
.flip--echo {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.5em;
}

.ch {
  position: relative;
  display: inline-block;
  transform-style: preserve-3d;
}
.ch__in {
  position: relative;
  display: block;
  transform-style: preserve-3d;
}
.ch__f,
.ch__b {
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.ch__b {
  position: absolute;
  inset: 0;
  transform: rotateX(180deg);
}

/* main row: solid front, outline back. echo row: outline front, solid back */
.flip--main .ch__b,
.flip--echo .ch__f {
  color: transparent;
  -webkit-text-stroke: max(1.5px, 0.02em) var(--ink);
}
.flip--echo .ch__b { color: var(--ink); }

/* 1. letters tumble in on load */
.js .ch.is-intro {
  animation: letter-in 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 0.06s + 0.25s);
}
.js .flip--echo .ch.is-intro { animation-delay: calc(var(--i) * 0.06s + 0.45s); }
@keyframes letter-in {
  from { opacity: 0; transform: translateY(0.45em) rotateX(-100deg); }
  to { opacity: 1; transform: none; }
}

/* 2. a continuous wave of flips runs across the word */
.js .ch__in {
  animation: letter-flip 5s infinite;
  animation-delay: calc(var(--i) * 0.08s + 1.3s);
}
.js .flip--echo .ch__in { animation-delay: calc(var(--i) * 0.08s + 1.6s); }
@keyframes letter-flip {
  0%, 14% { transform: rotateX(0deg); animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1); }
  31% { transform: translateY(-0.1em) rotateX(100deg); animation-timing-function: cubic-bezier(0.2, 0.6, 0.3, 1); }
  44%, 58% { transform: rotateX(180deg); animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1); }
  75% { transform: translateY(0.1em) rotateX(280deg); animation-timing-function: cubic-bezier(0.2, 0.6, 0.3, 1); }
  88%, 100% { transform: rotateX(360deg); }
}

/* 3. the two rows slide against each other */
.js .flip--main { animation: row-drift 5s cubic-bezier(0.6, 0, 0.4, 1) 1.3s infinite; }
.js .flip--echo { animation: row-drift 5s cubic-bezier(0.6, 0, 0.4, 1) 1.3s infinite reverse; }
@keyframes row-drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(0.07em); }
}

/* 4. hovering a letter flips it */
.ch.is-poked { animation: letter-poke 0.9s cubic-bezier(0.3, 0.7, 0.2, 1); }
@keyframes letter-poke {
  from { transform: rotateX(0deg); }
  to { transform: rotateX(-360deg); }
}

.handle,
.nocase { text-transform: none; }

/* =========================================================================
   Card wheel
   ========================================================================= */
.wheel {
  position: relative;
  overflow: hidden;
  margin-top: clamp(28px, 4vw, 60px);
}

.wheel__stage {
  --cw: clamp(124px, 21vw, 250px);
  --chh: calc(var(--cw) * 1.4);
  --R: calc(var(--cw) * 2.3);
  --off: calc(var(--R) * 0.19);
  position: relative;
  height: calc(var(--R) + var(--chh) / 2 + 56px - var(--off));
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.wheel__stage.is-dragging { cursor: grabbing; }

.wheel__ring {
  position: absolute;
  left: 50%;
  top: calc(100% + var(--off));
  width: calc(var(--cw) * 2.6);
  height: calc(var(--cw) * 2.6);
  max-width: none;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}
.js .wheel__ring { animation: ring-spin 80s linear infinite; }
@keyframes ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}
.ring-dash {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.4;
  stroke-dasharray: 10 9;
}
.ring-dash--inner { opacity: 0.5; stroke-dasharray: 2 8; }
.ring-text text {
  fill: var(--ink-3);
  font-family: var(--f-sans);
  font-stretch: 125%;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.08em;
}

.wheel__pointer {
  position: absolute;
  left: 50%;
  top: calc(100% + var(--off) - var(--cw) * 1.257);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  transform: translate(-50%, -6px);
  pointer-events: none;
}
.wheel__tri {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--ink);
}
.wheel__label {
  font-size: clamp(13px, 1.5vw, 18px);
  font-weight: 800;
  padding: 0 6px;
}

.wheel__spin {
  position: absolute;
  left: 50%;
  top: calc(100% + var(--off));
  width: 0;
  height: 0;
  will-change: transform;
}

.wheel__hint {
  margin: 0;
  padding: 14px var(--pad) 0;
  text-align: center;
  color: var(--ink-3);
  font-size: 11px;
}

/* ---- Cards ---- */
.card {
  position: absolute;
  left: calc(var(--cw) / -2);
  top: calc(var(--chh) / -2);
  width: var(--cw);
  height: var(--chh);
  border-radius: calc(var(--cw) * 0.085);
  overflow: hidden;
  container-type: size;
  text-decoration: none;
  box-shadow: var(--shadow);
  transform: rotate(calc(var(--i) * 360deg / var(--n, 14))) translateY(calc(-1 * var(--R)));
  -webkit-user-drag: none;
  transition: box-shadow 0.25s var(--ease);
}
.card:hover { box-shadow: var(--shadow), 0 0 0 2px var(--ink); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.card > * { pointer-events: none; }

.card__top {
  position: absolute;
  top: 7cqw;
  left: 8cqw;
  font-size: max(8px, 5.2cqw);
}
.card__foot {
  position: absolute;
  bottom: 7cqw;
  left: 8cqw;
  right: 8cqw;
  font-size: max(7px, 4.4cqw);
  opacity: 0.75;
}

/* Projects */
.card--projects { background: var(--accent); color: var(--on-accent); }
.card__count {
  position: absolute;
  left: 7cqw;
  top: 16cqw;
  font-stretch: 125%;
  font-weight: 900;
  font-size: 34cqw;
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.card__title {
  position: absolute;
  left: 8cqw;
  top: calc(16cqw + 34cqw);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 9.5cqw;
  text-transform: uppercase;
}
.card__list {
  position: absolute;
  left: 8cqw;
  bottom: 8cqw;
  font-size: max(7px, 4.6cqw);
  line-height: 1.55;
}

/* Capabilities */
.card--caps { background: #0d0d0e; color: #ecefef; }
.card__stack {
  position: absolute;
  left: 8cqw;
  right: 6cqw;
  top: 30cqh;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 11.5cqw;
  line-height: 1.02;
  text-transform: uppercase;
}
.card--caps .card__foot { color: var(--accent); opacity: 1; }

/* Me */
.card--me {
  background-color: #cfcfcc;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: #111;
}
.card__code {
  position: absolute;
  top: 7cqw;
  right: 8cqw;
  font-size: max(7px, 5cqw);
  font-weight: 800;
  text-align: right;
  line-height: 1.05;
}
.card__hello {
  position: absolute;
  left: 8cqw;
  top: 34cqh;
  font-size: max(7px, 4.6cqw);
}
.card__mono-big {
  position: absolute;
  left: 7cqw;
  top: calc(34cqh + 8cqw);
  font-stretch: 125%;
  font-weight: 900;
  font-size: 27cqw;
  line-height: 0.86;
  letter-spacing: -0.02em;
}

.card__vertical {
  position: absolute;
  left: 7cqw;
  bottom: 7cqw;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 9cqw;
  line-height: 1;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* Research */
.card--physics { background: #ececea; color: #111; }
.card__orbit {
  position: absolute;
  width: 96cqw;
  height: 96cqw;
  left: 2cqw;
  top: 18cqw;
}
.orbit-star { fill: var(--accent); }
.card__eq {
  position: absolute;
  left: 8cqw;
  bottom: 8cqw;
  font-size: max(8px, 5.4cqw);
  line-height: 1.6;
}

/* Contact */
.card--contact { background: #f3f3f1; color: #111; }
.card--contact .card__vertical { font-size: 17cqw; left: 6cqw; bottom: 6cqw; }
.card--contact .card__top { left: auto; right: 8cqw; top: auto; bottom: 8cqw; }
.card__arrow {
  position: absolute;
  top: 9cqw;
  right: 9cqw;
  width: 30cqw;
  height: 30cqw;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
}
html[data-theme="dark"] .card--contact .card__arrow { stroke: #111; }

@keyframes slow-spin { to { transform: rotate(360deg); } }

/* =========================================================================
   Index (compact list under the wheel; every entry opens a pop-up)
   ========================================================================= */
.index {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 7vw, 100px) var(--pad) clamp(56px, 7vw, 96px);
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: clamp(32px, 5vw, 88px);
  align-items: start;
}
.index__lead {
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.index__lead em {
  font-style: normal;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 0.18em;
}
.index__meta { color: var(--ink-3); }
.index__list {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: clamp(20px, 3vw, 40px);
  border-top: 1px solid var(--line-strong);
}
.index__list a {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding 0.3s var(--ease), color 0.2s;
}
.index__list a:hover,
.index__list a:focus-visible { padding-left: 10px; color: var(--accent); }
.index__list .mono { color: var(--ink-3); }
.index__word {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(17px, 1.7vw, 24px);
  line-height: 1.1;
  text-transform: uppercase;
}
.index__note { font-size: 10.5px; }

/* =========================================================================
   Pop-ups
   ========================================================================= */
html:has(.modal[open]) { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}
.modal::backdrop {
  background: rgba(8, 9, 10, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal[open]::backdrop { animation: fade-in 0.3s var(--ease); }
.modal.is-closing::backdrop { animation: fade-out 0.22s var(--ease) forwards; }

.modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1180px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
}
.modal:focus,
.modal__panel:focus { outline: none; }
.modal[open] .modal__panel { animation: panel-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal.is-closing .modal__panel { animation: panel-out 0.22s var(--ease) forwards; }
@keyframes panel-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
}
@keyframes panel-out {
  to { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.modal__head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 3vw, 36px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.modal__head::before {
  content: "";
  position: absolute;
  left: clamp(18px, 3vw, 36px);
  top: 0;
  width: 46px;
  height: 4px;
  background: var(--accent);
}
.modal__crumb { margin: 0; color: var(--ink-2); }
.modal__actions { display: flex; gap: 8px; }
.modal__back { text-decoration: none; }

.plist__intro { max-width: 56ch; margin: -12px 0 clamp(28px, 4vw, 44px); color: var(--ink-2); font-size: 18px; }
.plist { border-top: 1px solid var(--line-strong); }
.plist a {
  display: grid;
  grid-template-columns: 64px 34px minmax(0, 1fr) minmax(0, 1.4fr) auto 24px;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding 0.3s var(--ease), color 0.2s;
}
.plist a:hover,
.plist a:focus-visible { padding-left: 10px; }
.plist a:hover .plist__name,
.plist a:hover .plist__arrow { color: var(--accent); }
.plist__thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
}
.plist__thumb svg { position: absolute; inset: 8px; width: 48px; height: 48px; }
.plist__thumb--flare,
.plist__thumb--himonide,
.plist__thumb--avionics { background: #0d0d0e; color: #ecefef; }
.plist__thumb--flare svg { inset: -6px; width: 76px; height: 76px; }
.plist__thumb--studio { background: var(--accent); color: var(--on-accent); }
.plist__thumb--p0,
.plist__thumb--ailab { background: #f3f3f1; color: #111; }
.plist__thumb--p0 svg { inset: 0; width: 64px; height: 64px; }
.plist__n { color: var(--ink-3); }
.plist__name {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(17px, 1.7vw, 23px);
  line-height: 1.1;
  text-transform: uppercase;
  transition: color 0.2s;
}
.plist__line { color: var(--ink-2); font-size: 15px; line-height: 1.4; }
.plist__meta { color: var(--ink-3); font-size: 10.5px; white-space: nowrap; }
.plist__arrow { font-size: 20px; transition: color 0.2s; }

.project__art--avionics { background: #0d0d0e; color: #ecefef; }
.project__art--avionics svg { left: 8%; top: 8%; width: 84%; height: 84%; }
.flight-apogee { fill: var(--accent); }
.project__art--ailab { background: #f3f3f1; color: #111; }
.project__art--ailab svg { left: 8%; top: 8%; width: 84%; height: 84%; }
.nodes-core { fill: #f3f3f1; }
.nodes-tool { fill: #f3f3f1; }
.chain--states { margin-top: 22px; gap: 8px 12px; font-size: 11px; }
.modal__x {
  position: relative;
  width: 12px;
  height: 12px;
}
.modal__x::before,
.modal__x::after {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 12px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
}
.modal__x::after { transform: rotate(-45deg); }

.modal__body { padding: clamp(24px, 4vw, 56px) clamp(18px, 4vw, 56px) clamp(32px, 5vw, 64px); }

.modal__title {
  margin-bottom: clamp(28px, 4vw, 52px);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(42px, 7vw, 104px);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.modal__sub { margin: clamp(48px, 6vw, 80px) 0 18px; color: var(--ink-2); }

/* content tweaks inside pop-ups */
.modal .feature__visual { box-shadow: none; }
.modal .stats,
.modal .built,
.modal .learned { margin-top: clamp(44px, 5vw, 72px); }
.modal .built__title,
.modal .learned > h3 { top: 84px; }
.modal .project { border-top: 0; padding: 0; }
.modal .marquee { margin-bottom: clamp(36px, 4vw, 56px); }
.modal .quote { margin-bottom: clamp(40px, 5vw, 72px); }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
}
.lead {
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 1.1em;
}
.lead em {
  font-style: normal;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 0.18em;
}
.about__text p:not(.lead) { color: var(--ink-2); max-width: 60ch; }


/* ---------- Tags, buttons, chips ---------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  margin-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  vertical-align: 1px;
}
.tag--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-stretch: 125%;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  font-family: var(--f-mono);
  font-size: 12px;
}
.chips--sm li { font-size: 11px; padding: 4px 10px; }


/* ---------- Featured: Flare AI ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  grid-template-areas:
    "meta visual"
    "stats stats"
    "built built"
    "learned learned";
  column-gap: clamp(32px, 5vw, 88px);
  align-items: center;
}
.feature__meta { grid-area: meta; }
.kicker { color: var(--ink-2); margin-bottom: 22px; line-height: 2; }
.feature__title {
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(52px, 7.2vw, 112px);
  line-height: 0.85;
  white-space: nowrap;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.feature__sub {
  margin: 16px 0 26px;
  font-stretch: 125%;
  font-weight: 600;
  font-size: clamp(13px, 1.2vw, 16px);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.feature__intro { color: var(--ink-2); max-width: 58ch; }

.feature__visual {
  grid-area: visual;
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1.04;
  border-radius: 24px;
  background: #0b0b0c;
  overflow: hidden;
  color: #e9eef0;
}
.feature__rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}
.feature__rings .dash { stroke-dasharray: 4 7; }
.feature__rings .axis { stroke: rgba(255, 255, 255, 0.08); }
.feature__flame {
  position: absolute;
  width: 78%;
  height: 78%;
  left: 11%;
  top: 11%;
}
.js .feature__flame { animation: slow-spin 70s linear infinite; }
.feature__caption {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 7.5%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(233, 238, 240, 0.7);
  font-size: 11px;
}

.stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 24px;
  margin-top: clamp(56px, 7vw, 100px);
}
.stats li {
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}
.stats__n {
  display: block;
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(48px, 6.6vw, 100px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stats li:nth-child(2) .stats__n { color: var(--accent); }
.stats--2 { grid-template-columns: repeat(2, 1fr); max-width: 760px; }
.stats__l {
  display: block;
  margin-top: 10px;
  max-width: 26ch;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.4;
}

.built,
.learned {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px clamp(32px, 5vw, 88px);
  margin-top: clamp(56px, 7vw, 100px);
}
.built { grid-area: built; }
.learned { grid-area: learned; }
.built__title,
.learned > h3 {
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.built__list > li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.built__list > li:last-child { border-bottom: 1px solid var(--line); }
.built__n { color: var(--accent); padding-top: 4px; }
.built__list h4 {
  margin-bottom: 6px;
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(18px, 1.7vw, 23px);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.built__list p { margin: 0; color: var(--ink-2); max-width: 62ch; }

.learned .chips { margin-top: 24px; }
.fineprint { margin: 22px 0 0; color: var(--ink-3); font-size: 11px; text-transform: none; }
.learned > :not(h3) { grid-column: 2; }

/* ---------- Other projects ---------- */

.project {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(28px, 5vw, 88px);
  align-items: start;
  padding: clamp(40px, 5vw, 72px) 0;
  border-top: 1px solid var(--line-strong);
}
.project:nth-child(even) .project__art { order: 2; }

.project__art {
  position: relative;
  aspect-ratio: 1 / 1.05;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.project__art svg { position: absolute; }
.project__art--studio { background: var(--accent); color: var(--on-accent); }
.project__art--studio svg { width: 56%; height: 56%; left: 22%; top: 22%; }
.project__art--p0 { background: #f3f3f1; color: #111; }
.project__art--p0 svg { inset: 0; width: 100%; height: 100%; opacity: 0.4; }
.project__art-big {
  position: absolute;
  left: 8%;
  bottom: 8%;
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.project__art-big small { font-size: 0.4em; margin-left: 0.15em; letter-spacing: 0; }
.project__art--himonide { background: #0d0d0e; color: #ecefef; }
.project__art--himonide svg { left: 10%; top: 6%; width: 80%; height: 88%; }

.project__meta { color: var(--ink-2); margin-bottom: 18px; }
.project__title {
  margin-bottom: 18px;
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(34px, 4.6vw, 68px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.project__title .muted { font-size: 0.42em; letter-spacing: 0; vertical-align: middle; }
.project__body > p { color: var(--ink-2); max-width: 62ch; }

.small-head { margin: 26px 0 8px; color: var(--ink); }

/* ---------- Dossier components ---------- */
.project__body > .project__lead,
.project__lead {
  color: var(--ink);
  margin-bottom: 26px;
  max-width: 54ch;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.dgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0 0 6px;
}
.dgrid > div {
  padding: 12px 0 14px;
  border-top: 1px solid var(--line-strong);
}
.dgrid dt { color: var(--ink-3); font-size: 11px; margin-bottom: 4px; }
.dgrid dd {
  font-stretch: 112%;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.feature__meta .dgrid { margin-top: 26px; max-width: 560px; }

.hl { border-top: 1px solid var(--line); }
.hl li {
  display: grid;
  grid-template-columns: 34px minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 4px 14px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.hl__n { color: var(--accent); font-size: 11px; }
.hl__t {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.hl__d { color: var(--ink-2); font-size: 15px; line-height: 1.4; }

.roadmap { margin: 18px 0 0; color: var(--ink-3); font-size: 11px; }

.principle {
  margin: 0 0 14px;
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.process { color: var(--ink-2); max-width: 60ch; }

/* ---------- About grid, capabilities, research fields ---------- */
.about__grid { align-self: start; }
.dgrid dd.nocase { text-transform: none; }
.method { align-items: center; }
.method .hl { border-top-color: var(--line-strong); }

.skills.skills--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill__line { margin: 0 0 16px; max-width: 42ch; color: var(--ink-2); }
.skill__used { margin: 14px 0 0; color: var(--ink-3); font-size: 11px; }

.fields { border-top: 1px solid var(--line-strong); }
.fields > div {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 3.2fr;
  gap: 8px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.fields dt { padding-top: 5px; }
.fields dd {
  max-width: 74ch;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.4;
}

.fields dt { display: flex; gap: 12px; }
.fields__n { color: var(--accent); font-size: 11px; padding-top: 1px; }

.synthesis { margin-top: clamp(48px, 6vw, 80px); }
.synthesis__text {
  margin: 16px 0 26px;
  max-width: 60ch;
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.chain {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-2);
}
.chain span[aria-hidden] { color: var(--accent); }

/* ---------- Technical ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 18px 0;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.marquee__track {
  display: flex;
  width: max-content;
}
.js .marquee__track { animation: marquee 48s linear infinite; }
.marquee__track span {
  display: inline-flex;
  align-items: center;
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(24px, 3.6vw, 52px);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee__track span::after {
  content: "";
  display: inline-block;
  width: 0.34em;
  height: 0.34em;
  margin: 0 0.7em;
  background: var(--accent);
}
@keyframes marquee { to { transform: translateX(-50%); } }

.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(36px, 4vw, 56px) clamp(24px, 3vw, 48px);
}
.skill { padding-top: 18px; border-top: 1px solid var(--line-strong); }
.skill__n { color: var(--accent); margin-bottom: 14px; }
.skill__title {
  margin-bottom: 14px;
  font-stretch: 112%;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  text-transform: uppercase;
}

/* ---------- Research ---------- */
.quote {
  position: relative;
  margin: 0 0 clamp(56px, 7vw, 100px);
  padding-left: clamp(28px, 4vw, 64px);
  max-width: 1100px;
}
.quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: clamp(8px, 1vw, 14px);
  background: var(--accent);
}
.quote p {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 46px);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.015em;
}



/* ---------- Method ---------- */
.method {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
}
.method__statement {
  font-size: clamp(22px, 2.5vw, 34px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* ---------- Contact ---------- */
.contact__body { position: relative; }
.contact__bar {
  position: absolute;
  left: 50%;
  top: -12px;
  width: clamp(70px, 13vw, 200px);
  height: clamp(150px, 22vw, 330px);
  background: var(--accent);
}
.contact__big {
  position: relative;
  margin: 0 0 28px;
  font-family: var(--f-sans);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(40px, 8vw, 112px);
  line-height: 0.88;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.contact__text { position: relative; color: var(--ink-2); max-width: 46ch; font-size: 18px; }
.contact__links { position: relative; margin-top: 40px; max-width: 880px; border-top: 1px solid var(--line-strong); }
.contact__links a {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 500;
  transition: padding 0.3s var(--ease), color 0.2s;
}
.contact__links a:hover { padding-left: 14px; color: var(--accent); }
.contact__links .mono { color: var(--ink-3); font-size: 12px; }
.contact__copy {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: padding 0.3s var(--ease), color 0.2s;
}
.contact__copy:hover { padding-left: 14px; color: #5865f2; }
.contact__copy-act { display: inline-flex; align-items: center; gap: 8px; }
.contact__copy.is-copied .contact__copy-act { color: #5865f2; }
.contact__links a > span:last-child { font-size: 22px; }

.contact__badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: clamp(120px, 14vw, 190px);
  height: clamp(120px, 14vw, 190px);
  color: var(--ink);
  overflow: visible;
}
.js .contact__badge text { animation: badge-spin 30s linear infinite; transform-origin: 0 0; }
.contact__badge text {
  fill: var(--ink);
  font-family: var(--f-sans);
  font-stretch: 125%;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
@keyframes badge-spin { to { transform: rotate(360deg); } }

/* ---------- Footer: sign-off band + a line-art world that builds itself ---------- */
:root {
  --band-bg: #0e0e0f;
  --band-ink: #eceeee;
  --band-ink-2: #8d9497;
  --band-line: rgba(236, 238, 238, 0.14);
}
html[data-theme="dark"] {
  --band-bg: #e8eced;
  --band-ink: #0c0d0e;
  --band-ink-2: #5b6366;
  --band-line: rgba(12, 13, 14, 0.16);
}

.footer { --p: 1; margin-top: clamp(24px, 4vw, 56px); }
.js .footer { --p: 0; }
.footer p { margin: 0; }

.footer__band {
  background: var(--band-bg);
  color: var(--band-ink);
  padding: clamp(56px, 8vw, 112px) 0 26px;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad);
}
.footer__band > .footer__inner:first-child {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 40px clamp(32px, 5vw, 88px);
  align-items: start;
}
.footer__sign {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(28px, 3.3vw, 50px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.footer__sign span { color: var(--band-ink-2); }
.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
}
.footer__h { color: var(--band-ink-2); margin-bottom: 14px !important; font-size: 11px; }
.footer__cols li { padding: 3px 0; font-size: 16px; }
.footer__cols a { text-decoration: none; }
.footer__discord { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.footer__sub { color: var(--band-ink-2); font-size: 11px; text-transform: none; margin-left: 6px; }
.footer__discord .mono { color: var(--band-ink-2); font-size: 11px; text-transform: none; margin-left: 6px; }
.footer__discord:hover,
.footer__discord.is-copied { color: #8b93ff; }
.footer__cols a:hover,
.footer__top:hover { color: var(--accent); }
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(56px, 7vw, 96px) !important;
  padding-top: 18px !important;
  border-top: 1px solid var(--band-line);
  color: var(--band-ink-2);
}
.footer__meta .handle { color: var(--band-ink); }
.footer__top { text-decoration: none; }
.footer__links { display: inline-flex; gap: 20px; align-items: center; }
.footer__replay {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.footer__replay:hover { color: var(--accent); }
.footer__band :focus-visible { outline-color: var(--accent); }

.footer__scene {
  position: relative;
  overflow: hidden;
  height: clamp(230px, 27.8vw, 430px);
  background: var(--bg);
}
.footer__word {
  position: absolute;
  left: 50%;
  bottom: 30%;
  transform: translateX(-50%);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(110px, 21vw, 330px);
  line-height: 0.8;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: color-mix(in srgb, var(--ink) 9%, transparent);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.footer__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

/* each piece rises out of the ground once footer progress (--p) passes its start (--t) */
.fx {
  --k: clamp(0, (var(--p) - var(--t)) * 3.2, 1);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: translateY(calc((1 - var(--k)) * 112%));
  transition: transform 0.45s var(--ease);
}
.fx--far { transform: none; opacity: var(--k); transition: opacity 0.45s var(--ease); }

.sc-shape { fill: var(--bg); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.sc-nofill { fill: none; }
.sc-line { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sc-thick { stroke-width: 2.4; }
.sc-faint { stroke: var(--ink-3); stroke-width: 1.2; }
.sc-ground { stroke-width: 2; }
.sc-road { fill: none; stroke: var(--ink-3); stroke-width: 1.4; stroke-dasharray: 18 14; }
.sc-orbit { fill: none; stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 8; }
.sc-win { fill: var(--bg); stroke: var(--ink); stroke-width: 1.1; }
.sc-lit {
  fill: var(--accent);
  opacity: clamp(0, (var(--p) - var(--t) * 0.45 - 0.55 - var(--l) * 0.12) * 10, 1);
  transition: opacity 0.3s;
}
.sc-sign {
  fill: var(--ink);
  font-family: var(--f-sans);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.sc-big { font-size: 24px; }
.sc-vert { writing-mode: vertical-rl; font-size: 10px; }
.sc-beacon,
.sc-eye { fill: var(--accent); }
.sc-led { fill: var(--ink); }

.footer.is-live .sc-beacon { animation: sc-blink 2.4s ease-in-out infinite; }
.footer.is-live .sc-led { animation: sc-blink 1.4s steps(2) infinite; animation-delay: calc(var(--l) * -1.4s); }
@keyframes sc-blink { 50% { opacity: 0.15; } }

/* Himonide walking the road */
.sc-walker { transform: translateX(-80px); }
.footer.is-live .sc-walker { animation: sc-walk 48s linear infinite; }
.footer.is-live .sc-bob { animation: sc-bob 0.45s ease-in-out infinite alternate; }
.sc-leg { transform-box: fill-box; transform-origin: 50% 0; }
.footer.is-live .sc-leg--a { animation: sc-step 0.9s ease-in-out infinite alternate; }
.footer.is-live .sc-leg--b { animation: sc-step 0.9s ease-in-out infinite alternate-reverse; }
@keyframes sc-walk { from { transform: translateX(-80px); } to { transform: translateX(1520px); } }
@keyframes sc-bob { to { transform: translateY(-2px); } }
@keyframes sc-step { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }

/* ---------- Footer world: livelier animation (page footer and its copy in the menu) ---------- */
.footer--menu {
  margin: clamp(48px, 8vh, 96px) calc(-1 * var(--pad)) calc(-1 * clamp(14px, 2.5vh, 24px));
}
/* sign-off band slides in, columns staggered */
.js .footer .footer__sign,
.js .footer .footer__cols > div,
.js .footer .footer__meta {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.footer .footer__cols > div:nth-child(1) { transition-delay: 0.12s; }
.footer .footer__cols > div:nth-child(2) { transition-delay: 0.2s; }
.footer .footer__cols > div:nth-child(3) { transition-delay: 0.28s; }
.footer .footer__meta { transition-delay: 0.36s; }
.footer.is-in .footer__sign,
.footer.is-in .footer__cols > div,
.footer.is-in .footer__meta { opacity: 1; transform: none; }

/* wordmark rises letter by letter */
.footer .footer__word span {
  display: inline-block;
  --w: clamp(0, (var(--p) - var(--i) * 0.07) * 3, 1);
  opacity: var(--w);
  transform: translateY(calc((1 - var(--w)) * 55%));
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
/* mountains lag behind the buildings (depth) */
.footer .fx--far { transform: translateY(calc((1 - var(--p)) * 46px)); }

/* stars */
.sc-stars circle { fill: var(--ink-3); opacity: 0; }
.footer.is-live .sc-stars circle { animation: sc-twinkle-star 3.6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes sc-twinkle-star { 0%, 100% { opacity: 0.08; } 50% { opacity: 0.85; } }

/* windows flicker once the city is complete */
.footer.is-built.is-live .sc-lit { animation: sc-window calc(5s + var(--l) * 7s) steps(1, end) infinite; animation-delay: calc(var(--l) * -9s); }
@keyframes sc-window { 0%, 64% { opacity: 1; } 66%, 78% { opacity: 0.12; } 80%, 100% { opacity: 1; } }

/* rocket: shake, ignite, lift off, fresh rocket on the pad, repeat */
.sc-flame { fill: var(--accent); opacity: 0; transform-box: fill-box; transform-origin: 50% 0; }
.sc-smoke circle { fill: var(--bg); stroke: var(--ink-3); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.footer.is-built.is-live .sc-rocket { animation: sc-launch 11s infinite; }
.footer.is-built.is-live .sc-flame { animation: sc-flame 11s infinite; }
.footer.is-built.is-live .sc-smoke circle { animation: sc-smoke 11s infinite; animation-delay: var(--d); }
@keyframes sc-launch {
  0%, 16% { transform: translate(0, 0); opacity: 1; animation-timing-function: linear; }
  17% { transform: translate(-1px, 0); } 18% { transform: translate(1px, 0); } 19% { transform: translate(-1px, 0); }
  20% { transform: translate(1px, 0); } 21% { transform: translate(0, 0); animation-timing-function: cubic-bezier(0.55, 0, 0.9, 0.4); }
  50% { transform: translate(0, -720px); opacity: 1; }
  51% { transform: translate(0, 0); opacity: 0; }
  70% { opacity: 0; transform: translate(0, 0); }
  76%, 100% { opacity: 1; transform: translate(0, 0); }
}
@keyframes sc-flame {
  0%, 16% { opacity: 0; transform: scaleY(0.2); }
  18% { opacity: 1; transform: scaleY(0.6); }
  21% { transform: scaleY(1.1); }
  24%, 46% { opacity: 1; transform: scaleY(1.5); }
  50%, 100% { opacity: 0; transform: scaleY(0.2); }
}
@keyframes sc-smoke {
  0%, 17% { opacity: 0; transform: scale(0.3) translate(0, 0); }
  24% { opacity: 0.9; transform: scale(1.1) translate(0, -4px); }
  42% { opacity: 0.5; transform: scale(2) translate(0, -14px); }
  58%, 100% { opacity: 0; transform: scale(2.6) translate(0, -22px); }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1000px) {
  .skills { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1180px) {
  .header__verse .verse__by { display: none; }
}
@media (max-width: 900px) {
  .menu__grid { grid-template-columns: 1fr; }
  .menu__nav { padding-right: 0; }
  .menu__list li { flex: none; min-height: 0; }
  .menu__list a { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 10px 0; }
  .menu__arrow { display: none; }
  .menu__aside { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .mpv__panel:not([data-panel="now"]) { display: none !important; }
  .mpv__panel[data-panel="now"] { opacity: 1; visibility: visible; transform: none; }
  .header__verse { display: none; }
}

@media (max-width: 900px) {
  .plist a { grid-template-columns: 56px minmax(0, 1fr) 20px; gap: 4px 14px; }
  .plist__thumb { width: 56px; height: 56px; grid-row: span 3; }
  .plist__thumb svg { inset: 6px; width: 44px; height: 44px; }
  .plist__thumb--flare svg { inset: -6px; width: 68px; height: 68px; }
  .plist__thumb--p0 svg { inset: 0; width: 56px; height: 56px; }
  .plist__n { display: none; }
  .plist__name { grid-column: 2; }
  .plist__line { grid-column: 2; font-size: 14px; }
  .plist__meta { grid-column: 2; }
  .plist__arrow { grid-column: 3; grid-row: 1 / span 3; }
  .footer__band > .footer__inner:first-child { grid-template-columns: 1fr; }
  .index { grid-template-columns: 1fr; }
  .modal__panel { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 18px; }
  .about,
  .method { grid-template-columns: 1fr; }

  .feature {
    grid-template-columns: 1fr;
    grid-template-areas: "meta" "visual" "stats" "built" "learned";
  }
  .feature__visual { margin-top: 40px; max-width: 560px; width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }

  .built,
  .learned { grid-template-columns: 1fr; }
  .built__title,
  .learned > h3 { position: static; }
  .learned > :not(h3) { grid-column: auto; }

  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project__art { order: 0; }
  .project__art { max-width: 520px; width: 100%; aspect-ratio: 4 / 3; }

  .contact__badge { position: relative; margin-top: 40px; }
}

@media (max-width: 640px) {
  .theme-toggle { width: 32px; padding: 0; justify-content: center; }
  .theme-toggle .theme-toggle__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .contact__copy { grid-template-columns: 1fr auto; }
  .contact__copy .mono:first-child { grid-column: 1 / -1; margin-bottom: -10px; }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .footer__word { bottom: 38%; }
  .skills.skills--4 { grid-template-columns: 1fr; }
  .fields > div { grid-template-columns: 1fr; }
  .hl li { grid-template-columns: 28px 1fr; }
  .hl__d { grid-column: 2; }
  .stats--2 { grid-template-columns: repeat(2, 1fr); }
  .index__list { grid-template-columns: 1fr; }
  body { font-size: 16px; }
  .hero__frame { height: clamp(220px, 58vw, 300px); }
  .hero__title { font-size: 11.3vw; }
  .hero__welcome { left: 0; top: 14px; font-size: 13px; }
  .hero__year { right: 0; top: 14px; }
  .hero__bar { left: 39%; width: 22%; }
  .hero__name,
  .hero__role { max-width: 48%; font-size: 10px; }
  .hero__name { left: 14px; }
  .hero__role { right: 14px; }
  .hero__handle { display: block; }
  .hero__tri { display: none; }

  .skills { grid-template-columns: 1fr; }
  .spec { grid-template-columns: 1fr; }
  .contact__links a { grid-template-columns: 1fr auto; }
  .contact__links a .mono { grid-column: 1 / -1; margin-bottom: -10px; }
  .feature__caption { flex-direction: column; gap: 4px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .footer .footer__sign,
  .js .footer .footer__cols > div,
  .js .footer .footer__meta { opacity: 1; transform: none; }
  .discord__lids { transform: scaleY(0) !important; }
  .js .header__verse .verse__line,
  .js .header__verse .verse__by { clip-path: none; }
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
