/* ===========================================================================
   Site stylesheet — one file, no build step.

   The palette is not invented: every core color is lifted from CyberHoops'
   own src/style.css, so the portfolio and the game are the same visual
   system. The two accents carry the game's meaning too — --hot is the
   offense color, --cool is the defense color — and that split is used
   consistently here: hot = live/action/interactive, cool = status/data/meta.
   =========================================================================== */

/* --- Fonts: self-hosted, no third-party requests ------------------------- */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/splinemono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/splinemono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* --- Tokens -------------------------------------------------------------- */

/* A theme supplies FIVE values and nothing else. Everything structural is
   derived from them, so the six CyberHoops presets drop in without anyone
   hand-picking a hairline color per theme — the differences stay emergent
   from shared parameters instead of hardcoded per case.

   --hot is the game's accent (its offense color), --cool its player-A color.
   assets/theme.js overwrites only the five; the derivations follow. */
:root {
  --void: #0c0a12;
  --panel: #14111d;
  --text: #d6d0e4;
  --hot: #ff2e88;
  --cool: #27e1c1;

  /* Derived surfaces and rules */
  --panel-hi: color-mix(in srgb, var(--panel) 96%, var(--text));
  --line: color-mix(in srgb, var(--panel) 88%, var(--text));
  --line-soft: color-mix(in srgb, var(--panel) 92%, var(--text));
  --dim: color-mix(in srgb, var(--panel) 35%, var(--text));
  --faint: color-mix(in srgb, var(--panel) 45%, var(--text));
  --lift: color-mix(in srgb, var(--text) 70%, white);
  --hot-lift: color-mix(in srgb, var(--hot) 82%, white);

  /* The replay court uses the same panel->text mixes at 78% and 62%, but
     computes them in JS — see the note in assets/replay.js. */

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', 'Menlo', monospace;

  --shell: 1180px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --band: clamp(3.5rem, 8vw, 6.5rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 350;
  line-height: 1.7;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
}

/* A single hairline grid behind everything — the "ledger paper". Very faint;
   it gives the flat void some structure without becoming a texture. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(
    to right,
    var(--line-soft) 1px,
    transparent 1px
  );
  background-size: 96px 100%;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, #000 0 40vh, transparent 90vh);
}

/* --- Primitives ---------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
}

.skip:focus {
  left: 0;
  padding: 0.75rem 1rem;
  background: var(--hot);
  color: var(--void);
}

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

/* Small uppercase mono label — the site's connective tissue. */
.tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Status token. Real information, not ornament: what state a thing is in. */
.token {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid currentcolor;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--dim);
}

.token[data-state='live'] {
  color: var(--cool);
}

.token[data-state='playtest'] {
  color: var(--hot);
}

.token[data-state='reserved'],
.token[data-state='draft'] {
  color: var(--faint);
}

/* Ruled section header: label, hairline that eats the remaining width, meta.
   Reads as a ledger row heading. */
.rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 2.25rem;
}

.rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* The meta label sits past the hairline, at the far right of the row. */
.rule .rule-meta {
  order: 3;
}

.rule > .tag:first-child {
  color: var(--text);
}

@media (max-width: 620px) {
  .rule .rule-meta {
    display: none;
  }
}

/* --- Header -------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--void) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.masthead .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 60px;
}

.wordmark {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.wordmark::after {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--hot);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2.5vw, 1.9rem);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav a {
  color: var(--dim);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav a:hover {
  color: var(--text);
  border-bottom-color: var(--line);
}

.nav a[aria-current='page'] {
  color: var(--text);
  border-bottom-color: var(--hot);
}

/* The playtest is the point of the site, so it is the one hot thing in the
   nav — and it stays hot even on the page it points away from. */
.nav a.nav-hot {
  color: var(--hot);
  font-weight: 600;
}

.nav a.nav-hot:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

@media (max-width: 560px) {
  .nav {
    gap: 0.8rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .masthead .shell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding-block: 0.6rem;
  }
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  border-bottom: 1px solid var(--line);
}

.hero .shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 3.5rem);
  padding-block: clamp(3rem, 7vw, 5.5rem) var(--band);
  align-items: center;
}

@media (min-width: 900px) {
  .hero .shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  }
}

.hero-statement {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 1.25rem 0 0;
  text-wrap: balance;
}

.hero-statement em {
  font-style: normal;
  color: var(--hot);
}

.hero-sub {
  max-width: 46ch;
  color: var(--dim);
  margin: 1.5rem 0 0;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 500;
}

.hero-sub a {
  color: var(--hot);
  text-decoration-color: color-mix(in srgb, var(--hot) 45%, transparent);
  text-underline-offset: 0.25em;
}

.hero-sub a:hover {
  text-decoration-color: var(--hot);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cool);
}

.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cool);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--cool) 60%, transparent);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  font-family: var(--mono);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn:hover {
  border-color: var(--dim);
  background: var(--panel);
}

.btn-primary {
  border-color: var(--hot);
  color: var(--void);
  background: var(--hot);
}

.btn-primary:hover {
  border-color: var(--hot);
  background: var(--hot-lift);
  color: var(--void);
}

/* --- The signature: seeded replay panel ---------------------------------- */

.replay {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

/* Spacing utilities. These exist so no page needs a style attribute — the
   deployed CSP is style-src 'self', which blocks inline styles outright. */
.is-flush {
  margin-top: 0;
}

.is-spaced {
  margin-top: 1.5rem;
}

.is-spaced-lg {
  margin-top: 2.5rem;
}

.entry.is-first {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

/* Square: a half court is 50ft x 47ft, and the renderer needs one uniform
   scale on both axes anyway. */
.replay-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
}

.replay-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.replay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.85rem;
  border-top: 1px solid var(--line);
  background: var(--panel-hi);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.replay-bar output {
  color: var(--cool);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.replay-reroll {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.replay-reroll:hover {
  color: var(--hot);
  border-color: var(--hot);
}

.replay-note {
  margin: 0.85rem 0 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--faint);
}

/* --- Bands --------------------------------------------------------------- */

.band {
  border-bottom: 1px solid var(--line);
}

.band > .shell {
  padding-block: var(--band);
}

.page-head .shell {
  padding-block: clamp(2.75rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem);
}

.page-title {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0.9rem 0 0;
}

.lede {
  max-width: 62ch;
  color: var(--dim);
  margin: 1.25rem 0 0;
}

/* --- Feature project (CyberHoops) ---------------------------------------- */

.feature {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel) 0%, var(--void) 100%);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.feature-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.feature-name {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.015em;
  margin: 0;
}

.feature-body {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 820px) {
  .feature-body {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}

.feature-body p {
  margin: 0 0 1rem;
  max-width: 58ch;
}

.feature-body p:last-of-type {
  margin-bottom: 0;
}

/* Spec list: label / value pairs on hairlines. */
.spec {
  margin: 0;
  border-top: 1px solid var(--line);
}

.spec > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.spec dt {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.spec dd {
  margin: 0;
  text-align: right;
  font-size: 0.82rem;
}

/* --- Row list (projects, writing) ---------------------------------------- */

.rows {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.rows > li {
  border-bottom: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 1.25rem 0;
  text-decoration: none;
  color: inherit;
  transition: padding-inline-start 0.2s ease, color 0.15s;
}

a.row:hover,
a.row:focus-visible {
  padding-inline-start: 0.75rem;
  color: var(--lift);
}

.row-name {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.row-note {
  grid-column: 1;
  color: var(--dim);
  font-size: 0.85rem;
}

a.row:hover .row-note {
  color: var(--text);
}

.row-meta {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.row-date {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.row.is-empty {
  opacity: 0.55;
}

.row.is-empty .row-name {
  color: var(--dim);
  font-weight: 400;
}

/* --- Prose (CV, consulting, writing) ------------------------------------- */

.prose {
  max-width: 68ch;
}

.prose h2 {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.85rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.75rem 0 0.35rem;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
}

.prose ul {
  padding-left: 1.1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose li::marker {
  color: var(--hot);
}

.prose a {
  color: var(--text);
  text-decoration-color: var(--hot);
  text-underline-offset: 0.25em;
}

.prose a:hover {
  color: var(--hot);
}

/* CV entry: role line + org/date meta on a hairline. */
.entry {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  margin-top: 1.75rem;
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.entry-role {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
}

.entry-when {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.entry-org {
  color: var(--cool);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin: 0.2rem 0 0.7rem;
}

/* Placeholder marker — obvious on purpose, so nothing ships by accident. */
.placeholder {
  border: 1px dashed var(--line);
  padding: 1rem 1.15rem;
  color: var(--faint);
  font-size: 0.82rem;
  margin: 1rem 0;
}

.placeholder::before {
  content: 'PLACEHOLDER';
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  color: var(--hot);
  margin-bottom: 0.4rem;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--cool);
  overflow-wrap: anywhere;
}

/* Skill / tag cluster */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.chips li {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  color: var(--dim);
  margin: 0;
}

/* --- Footer -------------------------------------------------------------- */

.footer .shell {
  padding-block: var(--band) 3rem;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 760px) {
  .footer .shell {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: end;
  }
}

.contact-line {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0.9rem 0 0;
}

.contact-line a {
  color: var(--hot);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.contact-line a:hover {
  border-bottom-color: var(--hot);
}

.colophon {
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--faint);
}

.colophon p {
  margin: 0 0 0.5rem;
}

.colophon a {
  color: var(--dim);
  text-decoration-color: var(--line);
}

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

/* --- Theme picker -------------------------------------------------------- */

/* Lives in the masthead. Swatches only — no names: the chip previews the
   theme it selects, which is the whole label it needs. The name still
   reaches screen readers through aria-label and hover through title. */
.themes {
  display: flex;
  align-items: center;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.swatch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  transition: border-color 0.15s;
}

.swatch:hover {
  border-color: var(--dim);
}

.swatch[aria-pressed='true'] {
  border-color: var(--hot);
}

/* The chip previews the theme it selects: that theme's own two accents on
   that theme's own panel. */
.swatch-chip {
  display: inline-flex;
  width: 26px;
  height: 16px;
  border: 1px solid;
  border-radius: 1px;
  overflow: hidden;
}

.swatch-chip i {
  flex: 1;
}

/* Nav and swatches share the right-hand side of the masthead. */
.masthead-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

/* --- Motion preferences -------------------------------------------------- */

@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;
  }
}
