/* ============================================================================
   Pexify Studios — styles.css
   Palette: black / grey / red — the game’s register.
   Type: Bricolage Grotesque (display) / Newsreader (body) / JetBrains Mono (specs)
   ========================================================================== */

/* ── tokens ────────────────────────────────────────────────────────────────
   Black / grey / red — the game's own register. Dark is the design's home;
   the light theme is the same palette on bone-grey paper.                   */
:root {
  --ground:      #EFEEEC;   /* bone-grey paper */
  --surface:     #F8F8F7;
  --surface-alt: #E3E2DF;
  --ink:         #141416;
  --ink-soft:    #4A4A50;
  --ink-faint:   #6E6E76;
  --line:        #D9D8D4;
  --line-strong: #BCBBB6;
  --accent:      #B0221A;   /* red, deepened so small text passes AA on paper */
  --accent-soft: #8B1A13;
  --accent-vivid:#D8261C;   /* full-strength red — fills, glows, never small text */
  --on-accent:   #F8F8F7;
  --bone:        #6B655C;   /* second voice: mono spec lines */
  --glow:        #C8241A;
  --glow-alpha:  0.16;

  --term-bg:     #0A0A0C;
  --term-ink:    #D6D6DA;
  --term-dim:    #6B6B73;
  --term-accent: #FF4438;
  --term-bone:   #CFC6B8;
  --term-line:   #1E1E22;

  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body:    "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --measure: 34rem;
  --page:    64rem;
  --gutter:  clamp(1.25rem, 5vw, 3.5rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #0B0B0C;
    --surface:     #131316;
    --surface-alt: #1A1A1E;
    --ink:         #EDEDEF;
    --ink-soft:    #A6A6AD;
    --ink-faint:   #76767E;
    --line:        #232327;
    --line-strong: #34343A;
    --accent:      #E5382B;
    --accent-soft: #FF6B5E;
    --accent-vivid:#E5382B;
    --on-accent:   #0B0B0C;
    --bone:        #B5AC9D;
    --glow:        #C8241A;
    --glow-alpha:  0.26;
    --term-bg:     #08080A;
    --term-ink:    #D6D6DA;
    --term-dim:    #6B6B73;
    --term-accent: #FF4438;
    --term-bone:   #CFC6B8;
    --term-line:   #1E1E22;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ground:      #0B0B0C;
  --surface:     #131316;
  --surface-alt: #1A1A1E;
  --ink:         #EDEDEF;
  --ink-soft:    #A6A6AD;
  --ink-faint:   #76767E;
  --line:        #232327;
  --line-strong: #34343A;
  --accent:      #E5382B;
  --accent-soft: #FF6B5E;
  --accent-vivid:#E5382B;
  --on-accent:   #0B0B0C;
  --bone:        #B5AC9D;
  --glow:        #C8241A;
  --glow-alpha:  0.26;
  --term-bg:     #08080A;
  --term-ink:    #D6D6DA;
  --term-dim:    #6B6B73;
  --term-accent: #FF4438;
  --term-bone:   #CFC6B8;
  --term-line:   #1E1E22;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--accent-soft); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  z-index: 20;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ── shared layout ───────────────────────────────────────────────────────── */
main > section {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.rule {
  max-width: var(--page);
  margin: 0 auto;
  border: 0;
  border-top: 1px dashed var(--line);
  height: 0;
}

/* .prose is used two ways: as a top-level section and as an inner block. */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.15rem; }
.prose p { color: var(--ink-soft); }

main > section.prose { max-width: var(--page); }
main > section.prose > h2,
main > section.prose > p,
main > section.prose > ul:not(.pillars) { max-width: var(--measure); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── entrance motion ─────────────────────────────────────────────────────────
   Only applied once JS confirms it can reveal them again — without JS, or if
   anything throws, every element stays in its normal visible state.          */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

/* ── floating dock ───────────────────────────────────────────────────────── */
.dock {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  width: min(var(--page), calc(100% - 1.5rem));
  margin: 0.75rem auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.55rem 0.7rem 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.dock.is-stuck {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-color: var(--line);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px -18px rgba(0, 0, 0, 0.55);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.mark-core {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 35%, transparent);
  transition: box-shadow 0.3s ease;
}
.mark:hover .mark-core { box-shadow: 0 0 0 5px color-mix(in srgb, var(--glow) 45%, transparent); }

.dock-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.dock-nav a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.dock-nav a:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

.dock-nav a.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.dock-social {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.dock-social a {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  color: var(--ink-faint);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.dock-social a:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  transform: translateY(-2px);
}
.dock-social svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }

.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 34rem) {
  .mark-name { display: none; }
  .dock { justify-content: center; padding-inline: 0.7rem; }
  .mark { margin-right: 0; }
}

/* ── hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 7vw, 5rem);
}

.hero > * + * { margin-top: 1.4rem; }

/* the reactor core — drifts on its own, leans toward the pointer */
.core {
  position: absolute;
  z-index: -1;
  top: -18%;
  left: clamp(-8rem, -2vw, 0rem);
  width: min(38rem, 90vw);
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 50%,
      color-mix(in srgb, var(--glow) calc(var(--glow-alpha) * 100%), transparent) 0%,
      color-mix(in srgb, var(--accent) 10%, transparent) 38%,
      transparent 68%);
  filter: blur(6px);
  pointer-events: none;
  animation: breathe 11s ease-in-out infinite;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes breathe {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 1; }
}

.hero h1 {
  font-size: clamp(2.15rem, 1.4rem + 3.6vw, 4rem);
  max-width: 18ch;
}

.lede {
  max-width: var(--measure);
  font-size: clamp(1.08rem, 1rem + 0.45vw, 1.32rem);
  color: var(--ink-soft);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
}
.status strong { font-weight: 500; color: var(--ink); }

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 0.5rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── about ───────────────────────────────────────────────────────────────── */
#about h2, #contact h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  margin-bottom: 0.4rem;
}

.pillars {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.6rem;
}

.pillars h3 {
  font-size: 1rem;
  letter-spacing: 0;
  margin-bottom: 0.35rem;
}

.pillars h3::before {
  content: "";
  display: inline-block;
  width: 1.4rem;
  border-top: 2px solid var(--accent);
  vertical-align: 0.35em;
  margin-right: 0.6rem;
  transition: width 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.pillars li:hover h3::before { width: 2.4rem; }

.pillars p { font-size: 0.97rem; color: var(--ink-soft); }

/* ── section heads ───────────────────────────────────────────────────────── */
.section-head { max-width: calc(var(--measure) + 6rem); }
.section-head > * + * { margin-top: 0.7rem; }
.section-head h2 { font-size: clamp(1.9rem, 1.35rem + 2.2vw, 3rem); }

.tagline { font-size: 1.02rem; color: var(--ink-soft); }

#work > * + *, #systems > * + * { margin-top: 2.2rem; }

/* ── game artwork ────────────────────────────────────────────────────────── */
.keyart, .band {
  margin: 0;
  border: 1px solid var(--line-strong);
  background: #08080A;
  overflow: hidden;
}

.keyart img, .band img { display: block; width: 100%; height: auto; }

.keyart {
  perspective: 900px;
}
.keyart img {
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1), filter 0.5s ease;
}
.keyart:hover img {
  transform: scale(1.02);
  filter: saturate(1.12) brightness(1.06);
}

.band img { aspect-ratio: 2000 / 646; object-fit: cover; }

.band figcaption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  background: var(--ground);
  border-top: 1px solid var(--line);
  padding: 0.6rem 0.85rem;
}

/* ── spec sheet ──────────────────────────────────────────────────────────── */
.spec { margin: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }

.spec > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: 0.7rem 0.4rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}
.spec > div:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }

.spec dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.15rem;
}

.spec dd { margin: 0; font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink); }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
}

/* ── the loop ────────────────────────────────────────────────────────────── */
.loop {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: clamp(1.25rem, 3vw, 1.9rem);
}

.loop-title {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.1rem;
}

.loop ol {
  margin: 0; padding: 0; list-style: none;
  counter-reset: step;
  display: grid; gap: 0.75rem;
  max-width: var(--measure);
}

.loop li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.5rem;
  font-size: 0.98rem;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.loop li:hover { color: var(--ink); }

.loop li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  padding-top: 0.28em;
}

/* ── hub terminal ────────────────────────────────────────────────────────── */
.terminal {
  border: 1px solid var(--line-strong);
  background: var(--term-bg);
  font-family: var(--font-mono);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--term-dim);
  border-bottom: 1px solid var(--term-line);
  background: #121215;
}

.terminal-hint { margin-left: auto; text-transform: none; letter-spacing: 0; }
.terminal-hint code { color: var(--term-accent); }
.terminal-bar { color: var(--term-dim); }

.terminal-led {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--accent-vivid);
  box-shadow: 0 0 8px 1px rgba(229, 56, 43, 0.65);
  animation: led 3.4s ease-in-out infinite;
}
@keyframes led { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.terminal-body {
  padding: 1rem 0.95rem;
  min-height: 12.5rem;
  max-height: 22rem;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--term-ink);
}

.t-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-dim  { color: var(--term-dim); }
.t-cmd  { color: var(--term-accent); }
.t-err  { color: #FF6B5E; }
.t-you  { color: var(--term-bone); }
.t-you::before { content: "> "; color: var(--term-dim); }

.terminal-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.95rem;
  border-top: 1px solid var(--term-line);
  background: #08080A;
}

.t-prompt { color: var(--term-accent); font-size: 0.85rem; }

.terminal-input input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--term-ink);
  background: transparent;
  border: 0;
  padding: 0.2rem 0;
  caret-color: var(--term-accent);
}
.terminal-input input::placeholder { color: #55555C; }
.terminal-input input:focus { outline: none; }
.terminal-input:focus-within { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--term-accent) 40%, transparent); }

/* ── call to action ──────────────────────────────────────────────────────── */
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.1rem; }

.cta {
  position: relative;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--on-accent);
  background: var(--accent-vivid);
  border-radius: 2px;
  padding: 0.7rem 1.4rem;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.25s ease;
}
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}
.cta:hover {
  color: var(--on-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -14px var(--accent-vivid);
}
.cta:hover::after { transform: translateX(120%); }

.cta-note { font-size: 0.9rem; color: var(--ink-faint); }

/* ── systems index ───────────────────────────────────────────────────────── */
.index {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.sys {
  background: var(--ground);
  padding: 1.4rem clamp(0rem, 2vw, 1.5rem) 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: background 0.25s ease;
}
.sys:hover { background: color-mix(in srgb, var(--accent) 4%, var(--ground)); }

.sys h3 { font-size: 1.08rem; }

.sys-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.sys-toggle:hover { color: var(--accent); }

.sys-sign {
  position: relative;
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  color: var(--accent);
}
.sys-sign::before, .sys-sign::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.3s ease;
}
.sys-sign::before { inset: 45% 0 45% 0; }                    /* horizontal bar */
.sys-sign::after  { inset: 0 45% 0 45%; }                    /* vertical bar   */
.sys-toggle[aria-expanded="true"] .sys-sign::after { transform: scaleY(0); opacity: 0; }

.sys .meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--bone);
  overflow-wrap: anywhere;
}

.sys-lead { font-size: 0.95rem; color: var(--ink-soft); }

.sys-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.sys-more-inner { overflow: hidden; }
.sys.is-open .sys-more { grid-template-rows: 1fr; }

.sys-more p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding-top: 0.8rem;
}

.sys-more .sys-note {
  color: var(--ink-faint);
  border-left: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 0.1rem 0 0.1rem 0.8rem;
  margin-top: 0.8rem;
}

/* no JS: nothing stays collapsed */
html:not(.js) .sys-more { grid-template-rows: 1fr; }
html:not(.js) .sys-sign { display: none; }

/* ── contact ─────────────────────────────────────────────────────────────── */
.mailrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.6rem !important;
}

.mail {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.2rem);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.mail:hover { border-bottom-color: var(--accent); }

.copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.is-done { color: var(--accent); border-color: var(--accent); }

.links {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.links li { display: flex; }
.links li[hidden] { display: none; }

.links a {
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.links a:hover { border-bottom-color: var(--accent); transform: translateX(3px); }

/* ── footer ──────────────────────────────────────────────────────────────── */
footer {
  max-width: var(--page);
  margin-inline: auto;
  padding: 2rem var(--gutter) 3.5rem;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (min-width: 40rem) {
  .pillars { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .spec { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
  .spec > div:nth-child(-n+2) { border-top: 0; }
}

@media (min-width: 56rem) {
  .index { grid-template-columns: 1fr 1fr; column-gap: 1px; }
  .sys { padding-inline: 0 2rem; }
  .sys:nth-child(even) { padding-inline: 2rem 0; }
  /* an odd number of cards would leave a hole in the grid — the last one spans */
  .sys:last-child:nth-child(odd) { grid-column: 1 / -1; padding-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ============================================================================
   LIFE — atmosphere, reactor rings, quota bar, counters, tilt
   Everything in this block is decorative and switches off entirely under
   prefers-reduced-motion (see the very end of the file).
   ========================================================================== */

/* ── drifting embers + film grain + the cursor's light ───────────────────── */
#atmos, #grain, #torch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#atmos { opacity: 0.75; }

#grain {
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(3) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-2%, 1%); }
  66%  { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

/* the light you're carrying — strongest in the dark, barely there on paper */
#torch {
  background: radial-gradient(
    18rem 18rem at var(--tx, 50%) var(--ty, 30%),
    color-mix(in srgb, var(--accent-vivid) 9%, transparent) 0%,
    color-mix(in srgb, var(--accent-vivid) 3%, transparent) 42%,
    transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
}
#torch.is-lit { opacity: 1; }

/* content sits above the atmosphere */
.dock, main, footer { position: relative; z-index: 1; }

/* ── the reactor core in the hero ────────────────────────────────────────── */
.core-stack {
  position: absolute;
  z-index: -1;
  top: -20%;
  left: clamp(-9rem, -3vw, 0rem);
  width: min(40rem, 92vw);
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 1s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.core { position: absolute; inset: 0; transform: none; }

.rings {
  position: absolute;
  inset: 12%;
  overflow: visible;
}

.ring {
  stroke: color-mix(in srgb, var(--accent-vivid) 28%, transparent);
  stroke-width: 0.6;
  transform-origin: 100px 100px;
}
.ring-1 { stroke-dasharray: 46 30 12 22; animation: spin 44s linear infinite; }
.ring-2 { stroke-dasharray: 8 14;        animation: spin 30s linear infinite reverse; opacity: 0.75; }
.ring-3 { stroke-dasharray: 30 90;       animation: spin 19s linear infinite; stroke-width: 1.1; }

.ring-dot {
  fill: var(--accent-vivid);
  transform-origin: 100px 100px;
  animation: spin 12s linear infinite;
  filter: drop-shadow(0 0 5px var(--accent-vivid));
}

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

/* ── quota bar in the dock ───────────────────────────────────────────────── */
.quota {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.quota-track {
  position: relative;
  width: 3.6rem;
  height: 3px;
  background: var(--line-strong);
  overflow: hidden;
}

.quota-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent-vivid);
  box-shadow: 0 0 8px 0 color-mix(in srgb, var(--accent-vivid) 70%, transparent);
  transition: width 0.15s linear;
}

.quota-num { font-variant-numeric: tabular-nums; min-width: 2.4rem; }

@media (max-width: 52rem) { .quota { display: none; } }

/* ── the numbers ─────────────────────────────────────────────────────────── */
main > section.stats {
  padding-block: 0 clamp(2rem, 5vw, 3rem);
  padding-inline: 0;
  width: min(var(--page), 100% - var(--gutter) * 2);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  border-block: 1px solid var(--line);
}

.stat {
  border-right: 1px solid var(--line);
  padding: 1.1rem 0.9rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: background 0.25s ease;
}
.stat:last-child { border-right: 0; }
.stat:hover { background: color-mix(in srgb, var(--accent) 6%, var(--ground)); }

.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-wrap: balance;
}

/* the stats strip is its own band — it shouldn't inherit the page container */
main > section.stats { max-width: var(--page); margin-inline: auto; }

/* ── key art tilt ────────────────────────────────────────────────────────── */
.keyart {
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.5s ease;
  will-change: transform;
}
.keyart.is-tilting {
  transition: transform 0.12s ease-out;
  box-shadow: 0 24px 60px -40px var(--accent-vivid);
}

/* ── section headings draw a line as they arrive ─────────────────────────── */
.section-head h2 { position: relative; display: inline-block; padding-bottom: 0.35rem; }
.section-head h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent-vivid);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s;
}
.section-head h2.is-in::after { transform: scaleX(1); }

/* ── terminal: caret + one-tap commands ──────────────────────────────────── */
.t-caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  vertical-align: -0.15em;
  background: var(--term-accent);
  animation: caret 1.1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.95rem 0.85rem;
  background: #08080A;
}

.term-chips button {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--term-dim);
  background: transparent;
  border: 1px solid var(--term-line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.term-chips button:hover {
  color: var(--term-accent);
  border-color: color-mix(in srgb, var(--term-accent) 60%, transparent);
  transform: translateY(-1px);
}

/* ── magnetic call to action ─────────────────────────────────────────────── */
.cta { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  #atmos, #grain, #torch { display: none; }
  .ring, .ring-dot, .t-caret { animation: none; }
  .section-head h2::after { transform: scaleX(1); }
}

/* ── who am i ────────────────────────────────────────────────────────────── */
#whoami > * + * { margin-top: 2.2rem; }

.bio {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.portrait {
  margin: 0;
  border: 1px solid var(--line-strong);
  background: #08080A;
  overflow: hidden;
  max-width: 22rem;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.portrait:hover img { transform: scale(1.03); }

.portrait figcaption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: var(--ground);
  border-top: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  display: grid;
  gap: 0.15rem;
}
.portrait figcaption span { color: var(--accent); }

.bio-text { display: grid; gap: 1.15rem; max-width: var(--measure); }
.bio-text > p { color: var(--ink-soft); }

/* the path — a real sequence, so it gets real dates */
.path {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0 0 0 1.4rem;
  display: grid;
  gap: 1.1rem;
  border-left: 1px solid var(--line);
}

.path li {
  position: relative;
  display: grid;
  gap: 0.12rem;
}

.path li::before {
  content: "";
  position: absolute;
  left: -1.78rem;
  top: 0.5rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.path li:hover::before { background: var(--accent-vivid); transform: scale(1.35); }

.path li.is-now::before {
  background: var(--accent-vivid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-vivid) 22%, transparent);
}

.path-when {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.path-what {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.path-where { font-size: 0.92rem; color: var(--ink-soft); }

.also { margin-top: 0.6rem; }

.also-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

.also ul {
  list-style: none;
  margin: 0 0 0.7rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.also li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.also li:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  transform: translateY(-2px);
}

.also-note { font-size: 0.92rem; color: var(--ink-faint); }

@media (min-width: 46rem) {
  .bio { grid-template-columns: minmax(13rem, 20rem) minmax(0, 1fr); gap: 2.6rem; }
  .portrait { position: sticky; top: 6rem; }
}
