/* ─────────────────────────────────────────────────────────────
   ALMA landing — hand-written, no framework, no build.
   Palette and type come from the product's user portal
   (alma-frontend/src/presentation/views/user/UserAccessView.tsx).
   Sections: fonts · tokens · base · masthead · rail · hero ·
   console · path · account · stack · failure · access · foot
   ───────────────────────────────────────────────────────────── */

/* ── fonts ─────────────────────────────────────────────────── */
@font-face {
  font-family: 'Space Grotesk';
  /* Variable file (weight axis 300-700); plain woff2 is the widely supported
     format string, and the axis still works through font-weight. */
  src: url('../fonts/space-grotesk-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ── tokens ────────────────────────────────────────────────── */
:root {
  --ink: #0b1324;
  --ink-2: #26324a;
  --muted: #5c6880;
  --faint: #646e85;          /* 4.55:1 on the cream ground */

  --accent: #f97316;          /* graphics, marks, fills */
  --accent-ink: #a8410a;      /* accent used as text on light */
  --glow: #ffb37b;
  --blue: #2563eb;
  --red: #d4183d;
  --green: #15803d;

  --cream: #f7f1e8;
  --sky: #e9f4ff;
  --butter: #fff4e2;
  --paper: rgba(255, 255, 255, 0.74);
  --paper-solid: #fffdfa;
  --rule: rgba(11, 19, 36, 0.13);
  --rule-soft: rgba(11, 19, 36, 0.07);

  --sans: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --gutter: clamp(1.15rem, 4.5vw, 4.5rem);
  --measure: 1180px;
  --radius: 16px;
  --band-space: clamp(4.5rem, 8vw, 7.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html:focus-within { scroll-padding-top: 6.5rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.97rem + 0.16vw, 1.08rem);
  line-height: 1.62;
  color: var(--ink-2);
  background-color: var(--cream);
  background-image:
    radial-gradient(120% 60% at 78% -10%, rgba(255, 179, 123, 0.55) 0%, rgba(255, 179, 123, 0) 55%),
    radial-gradient(90% 55% at 0% 45%, rgba(37, 99, 235, 0.13) 0%, rgba(37, 99, 235, 0) 60%),
    linear-gradient(120deg, var(--cream) 0%, var(--sky) 42%, var(--butter) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Paper grain. Fixed, non-interactive, invisible on its own; it only keeps the
   large flat areas from looking like a rendered gradient. */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

h1, h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.2rem, 1.35rem + 2.6vw, 3.4rem); letter-spacing: -0.032em; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 1.15rem + 2.1vw, 2.7rem); line-height: 1.12; }
h3 { font-size: 1.06rem; line-height: 1.35; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }

code, pre, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code { font-size: 0.86em; background: rgba(11, 19, 36, 0.055); padding: 0.1em 0.34em; border-radius: 5px; }
pre { margin: 0; }
pre code { background: none; padding: 0; font-size: inherit; }

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

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.7rem 1rem; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

.eyebrow, .marker, .foot__label, .console__title, .hop__where, .slacard__kicker {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}

.note { font-size: 0.88rem; color: var(--muted); margin-top: 0.9rem; }
.note--wide { max-width: 62ch; margin-top: 1.4rem; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.94rem; font-weight: 500; text-decoration: none;
  padding: 0.62rem 1.1rem; border-radius: 999px;
  border: 1px solid transparent; transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn--solid { background: var(--ink); color: var(--paper-solid); }
.btn--solid:hover { background: #16223d; transform: translateY(-1px); }
.btn--ghost { border-color: var(--rule); color: var(--ink); background: rgba(255, 255, 255, 0.5); }
.btn--ghost:hover { border-color: rgba(11, 19, 36, 0.35); background: rgba(255, 255, 255, 0.85); transform: translateY(-1px); }
.btn--wide { width: 100%; justify-content: center; }

/* ── masthead ──────────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(247, 241, 232, 0.92), rgba(247, 241, 232, 0.72));
  border-bottom: 1px solid var(--rule-soft);
}
.masthead__inner {
  max-width: var(--measure); margin-inline: auto;
  padding: 0.7rem var(--gutter);
  display: flex; align-items: center; gap: 1.5rem;
}
.wordmark { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); }
.wordmark__mark { display: block; width: 26px; height: 26px; color: var(--accent-ink); }
.wordmark__mark svg { width: 100%; height: 100%; display: block; }
.wordmark__text { font-family: var(--mono); font-weight: 600; letter-spacing: 0.22em; font-size: 0.95rem; }

.masthead__nav { display: none; gap: 1.35rem; margin-left: auto; font-size: 0.9rem; }
.masthead__nav a { text-decoration: none; color: var(--muted); padding-block: 0.3rem; border-bottom: 1px solid transparent; }
.masthead__nav a:hover, .masthead__nav a.is-current { color: var(--ink); border-bottom-color: var(--accent); }

.masthead__side { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.masthead__nav + .masthead__side { margin-left: 0; }

.pill {
  display: none; align-items: center; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  padding: 0.28rem 0.65rem; border: 1px solid var(--rule); border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill__dot[data-state="up"] { background: var(--green); box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15); }
.pill__dot[data-state="down"] { background: var(--red); box-shadow: 0 0 0 3px rgba(212, 24, 61, 0.14); }

/* ── left rail ─────────────────────────────────────────────── */
.rail { display: none; }
@media (min-width: 1440px) {
  .rail {
    display: block; position: fixed; left: 1.6rem; top: 50%; transform: translateY(-50%); z-index: 30;
  }
  .rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
  .rail a {
    display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none;
    font-family: var(--mono); font-size: 0.7rem; color: var(--faint); letter-spacing: 0.08em;
  }
  .rail em { font-style: normal; opacity: 0; transform: translateX(-4px); transition: opacity .2s ease, transform .2s ease; }
  .rail a:hover em, .rail a.is-current em { opacity: 1; transform: none; }
  .rail a.is-current { color: var(--accent-ink); }
  .rail a.is-current span { border-bottom: 1px solid var(--accent); }
}

/* ── hero ──────────────────────────────────────────────────── */
.hero {
  max-width: var(--measure); margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(3.5rem, 7vw, 6rem);
  display: grid; gap: clamp(2.5rem, 5vw, 4rem);
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr); align-items: center; }
}
.hero h1 { margin: 0.9rem 0 0; }
.lede { margin-top: 1.4rem; max-width: 46ch; font-size: 1.06rem; color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.9rem; }

.hero__facts {
  margin: 2.6rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--rule);
  display: grid; gap: 0.75rem;
}
.hero__facts > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.8rem; align-items: baseline; }
.hero__facts dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.hero__facts dd { margin: 0; font-size: 0.94rem; color: var(--ink-2); }

/* ── console (hero panel) ──────────────────────────────────── */
.console {
  margin: 0; padding: 0.85rem 0.9rem 0.75rem;
  background: linear-gradient(168deg, #0d1729 0%, #0b1324 55%, #111d34 100%);
  color: #cfdaee; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 20px;
  box-shadow: 0 28px 60px -30px rgba(11, 19, 36, 0.65), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
  font-family: var(--mono); font-size: 0.76rem; line-height: 1.5;
  transform: rotate(-0.5deg);
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
  position: relative; overflow: hidden;
}
.console::before {
  content: ''; position: absolute; inset: -40% -20% auto -20%; height: 70%;
  background: radial-gradient(60% 60% at 70% 0%, rgba(249, 115, 22, 0.22), transparent 70%);
  pointer-events: none;
}
.console:hover { transform: rotate(0deg); }
.console__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 0.6rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.console__title { color: #8ea3c6; }
.console__meta { color: #6f83a6; font-size: 0.72rem; }
.console__meta span { color: var(--glow); }

.console__nodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; padding: 0.75rem 0; }
.node {
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.028); transition: border-color .3s ease, background-color .3s ease;
}
.node.is-busy { border-color: rgba(249, 115, 22, 0.4); background: rgba(249, 115, 22, 0.07); }
.node__name { color: #b9c8e2; font-size: 0.72rem; letter-spacing: 0.04em; }
.node__type { color: #6f83a6; font-size: 0.65rem; }
.node__gpus { display: flex; gap: 3px; margin-top: 0.4rem; }
.gpu {
  width: 100%; height: 7px; border-radius: 2px; background: rgba(255, 255, 255, 0.12);
  transition: background-color .35s ease, box-shadow .35s ease;
}
.gpu.is-on { background: var(--accent); box-shadow: 0 0 10px rgba(249, 115, 22, 0.55); }
.gpu.is-warm { background: rgba(255, 179, 123, 0.55); }

.console__jobs { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 0.55rem; }
.console__jobshead, .job {
  display: grid; grid-template-columns: minmax(0, 5.6rem) minmax(0, 1fr) minmax(0, 6.4rem);
  gap: 0.5rem; align-items: center;
}
.console__jobshead { color: #7b8eb0; font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; padding-bottom: 0.3rem; }
.console__jobs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.28rem; min-height: 5.4rem; }
.job { padding: 0.2rem 0; color: #9fb2d1; }
.job__id { color: #7f93b6; }
.job__model { color: #e4ebf7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job__state { justify-self: end; font-size: 0.68rem; padding: 0.1rem 0.45rem; border-radius: 999px; border: 1px solid currentColor; opacity: 0.9; }
.job__state[data-state="PENDING"] { color: #8ea3c6; }
.job__state[data-state="RUNNING"] { color: var(--glow); }
.job__state[data-state="TUNNEL"] { color: #7fb5ff; }
.job__state[data-state="SERVING"] { color: #6ee7a8; }
.job__state[data-state="ENDED"] { color: #8494b3; }
.job.is-new { animation: jobIn .45s ease both; }
@keyframes jobIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.console__log {
  margin-top: 0.55rem; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 0.5rem;
  height: 4.1rem; overflow: hidden; color: #7b8eb0; font-size: 0.68rem; line-height: 1.42;
}
.console__log p { opacity: 0.42; }
.console__log p:last-child { opacity: 1; color: #93a8ca; }

.console__caption {
  margin-top: 0.7rem; padding-top: 0.55rem; border-top: 1px dashed rgba(255, 255, 255, 0.1);
  color: #8ea3c6; font-size: 0.67rem; line-height: 1.45; font-family: var(--sans); letter-spacing: 0.01em;
}

/* ── bands ─────────────────────────────────────────────────── */
.band {
  max-width: var(--measure); margin-inline: auto;
  padding: var(--band-space) var(--gutter);
  border-top: 1px solid var(--rule);
}
.band--warm { border-top-color: rgba(249, 115, 22, 0.28); }
.band--ink {
  max-width: none; border-top: 0; background: linear-gradient(168deg, #0b1324 0%, #101c33 100%);
  color: #b9c6de; margin-top: var(--band-space);
}
.band--ink h2, .band--ink h3 { color: #f4f7fc; }
.band--ink .marker, .band--ink .standfirst { color: #8ea3c6; }
.band--ink code { background: rgba(255, 255, 255, 0.09); color: #e6edf8; }

.band__head { display: grid; gap: 1rem; margin-bottom: clamp(2.2rem, 4vw, 3.4rem); }
.band__head h2 { max-width: 17ch; }
.standfirst { max-width: 54ch; color: var(--muted); }
@media (min-width: 980px) {
  .band__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; column-gap: clamp(2rem, 5vw, 5rem); }
  .band__head .marker { grid-column: 1 / -1; }
  .standfirst { justify-self: end; }
}
.band--ink .band__head { max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.band--ink .cases { max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.marker::before { content: ''; display: inline-block; width: 1.6rem; height: 1px; background: var(--accent); vertical-align: middle; margin-right: 0.6rem; }

/* ── 02 path ───────────────────────────────────────────────── */
.path { display: grid; gap: clamp(2.2rem, 4vw, 3.2rem); }
@media (min-width: 1100px) {
  .path { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); column-gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start; }
}

/* The route rail: one dashed line down the list, a numbered stop per hop.
   Hops already passed keep a solid accent segment, so the line doubles as
   a progress indicator instead of decoration. */
.hops { list-style: none; margin: 0; padding: 0; counter-reset: hop; }
.hop {
  counter-increment: hop; position: relative;
  padding: 1.55rem 0 1.55rem 3.6rem;
}
.hop::after {
  content: ''; position: absolute; left: 1.02rem; top: 0; bottom: 0;
  border-left: 1px dashed var(--rule);
  transition: border-color .4s ease;
}
.hop:first-child::after { top: 1.55rem; }
.hop:last-child::after { bottom: calc(100% - 1.9rem); }
.hop.is-done::after, .hop.is-active::after { border-left-style: solid; border-left-color: rgba(249, 115, 22, 0.5); }
.hop.is-active:last-child::after { border-left-color: var(--rule); }
.hop::before {
  content: counter(hop, decimal-leading-zero);
  position: absolute; left: 0; top: 1.3rem; z-index: 1;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.72rem; color: var(--faint);
  background: var(--cream); border: 1px solid var(--rule); border-radius: 50%;
  transition: color .35s ease, border-color .35s ease, background-color .35s ease;
}
.hop.is-done::before { color: var(--accent-ink); border-color: rgba(249, 115, 22, 0.45); }
.hop.is-active::before { color: var(--paper-solid); background: var(--accent); border-color: var(--accent); }
.hop h3 { margin: 0.25rem 0 0.5rem; }
.hop p:last-child { max-width: 62ch; color: var(--muted); font-size: 0.97rem; }
.hop__where { color: var(--faint); }
.hop.is-active .hop__where { color: var(--accent-ink); }

.wire { display: grid; gap: 1.2rem; align-content: start; min-width: 0; }
.wire > * { min-width: 0; }
.path > * { min-width: 0; }
@media (min-width: 1100px) { .wire { position: sticky; top: 6.5rem; } }

.code { margin: 0; border-radius: var(--radius); position: relative; min-width: 0; overflow: hidden; }
.code figcaption {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.75rem 5.2rem 0.75rem 1rem; border-bottom: 1px solid var(--rule-soft);
}
.code figcaption span { text-transform: none; letter-spacing: 0; opacity: 0.7; }
.code pre { padding: 1rem; overflow-x: auto; font-size: 0.79rem; line-height: 1.65; }
.code--dark pre { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: visible; }
.code--dark {
  background: #0b1324; color: #cfdaee; border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 44px -30px rgba(11, 19, 36, 0.6);
}
.code--dark figcaption { color: #7f93b6; border-bottom-color: rgba(255, 255, 255, 0.08); }
.code--light { background: var(--paper); border: 1px solid var(--rule); }
.code--light figcaption { color: var(--muted); }
.code--light pre { color: var(--ink-2); padding-bottom: 0.6rem; }
.code .note { margin: 0; padding: 0 1rem 1rem; }

.copy {
  position: absolute; top: 0.52rem; right: 0.6rem;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #9fb2d1; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px; padding: 0.3rem 0.55rem; cursor: pointer; transition: background-color .2s ease, color .2s ease;
}
.copy:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.copy[data-done="1"] { color: #6ee7a8; border-color: rgba(110, 231, 168, 0.4); }

/* ── 03 account ────────────────────────────────────────────── */
.account { display: grid; gap: clamp(2rem, 4vw, 3.2rem); }
@media (min-width: 980px) { .account { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr); align-items: start; } }

.account__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
@media (min-width: 620px) { .account__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.5rem, 3vw, 2.6rem); } }
.account__list li { padding: 1.15rem 0; border-top: 1px solid var(--rule-soft); }
.account__list h3 { margin-bottom: 0.35rem; }
.account__list p { font-size: 0.93rem; color: var(--muted); }

.slacard {
  margin: 0; padding: 1.15rem 1.25rem 1rem; border-radius: 18px;
  background: var(--paper); border: 1px solid var(--rule);
  box-shadow: 0 24px 50px -34px rgba(11, 19, 36, 0.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
@media (min-width: 980px) { .slacard { position: sticky; top: 7rem; } }
.slacard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.slacard__name { font-family: var(--mono); font-size: 1.02rem; color: var(--ink); margin-top: 0.2rem; }
.tag {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.22rem 0.55rem; border-radius: 999px; border: 1px solid;
}
.tag--live { color: var(--green); border-color: rgba(21, 128, 61, 0.35); background: rgba(21, 128, 61, 0.08); }
.slacard__key { margin: 1.1rem 0 0; display: grid; gap: 0.25rem; }
.slacard__key dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.slacard__key dd { margin: 0; }
.slacard__key code { background: rgba(11, 19, 36, 0.06); font-size: 0.8rem; }
.slacard__model {
  margin-top: 1.1rem; padding-top: 0.85rem; border-top: 1px solid var(--rule-soft);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink);
}
.slacard__muted { color: var(--faint); font-size: 0.72rem; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.35rem; }
.dot--on { background: var(--green); box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.14); }
.slacard__table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-family: var(--mono); font-size: 0.74rem; }
.slacard__table th {
  text-align: left; font-weight: 400; color: var(--faint); font-size: 0.64rem;
  letter-spacing: 0.12em; text-transform: uppercase; padding-bottom: 0.4rem;
}
.slacard__table td { padding: 0.34rem 0; border-top: 1px solid var(--rule-soft); color: var(--ink-2); }
.slacard__table td:last-child, .slacard__table th:last-child { text-align: right; color: var(--accent-ink); }
.slacard figcaption { margin-top: 0.9rem; font-family: var(--sans); font-size: 0.76rem; color: var(--faint); line-height: 1.45; }

/* ── 04 stack ──────────────────────────────────────────────── */
.stack__scroll { overflow-x: auto; }
.stack { width: 100%; min-width: 640px; border-collapse: collapse; text-align: left; }
.stack thead th {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); font-weight: 400; padding-bottom: 0.7rem; border-bottom: 1px solid var(--rule);
}
.stack tbody th, .stack tbody td { padding: 1.15rem 1.4rem 1.15rem 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.stack tbody th { font-family: var(--mono); font-weight: 600; font-size: 0.88rem; white-space: nowrap; }
.stack tbody th a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid rgba(168, 65, 10, 0.3); }
.stack tbody th a:hover { border-bottom-color: var(--accent-ink); }
.stack tbody td { color: var(--muted); font-size: 0.94rem; }
.stack tbody td:last-child { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); white-space: nowrap; padding-right: 0; }

/* ── 05 failure ────────────────────────────────────────────── */
.cases { list-style: none; margin: 0; padding: 0; counter-reset: kase; display: grid; gap: 0; }
@media (min-width: 900px) { .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 4vw, 3.5rem); } }
.cases li {
  counter-increment: kase; padding: 1.5rem 0; border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.cases h3::before {
  content: counter(kase, decimal-leading-zero) ' ';
  font-family: var(--mono); font-size: 0.72rem; color: var(--accent); margin-right: 0.6rem;
  vertical-align: 0.18em; letter-spacing: 0.08em;
}
.cases p { margin-top: 0.55rem; color: #9fb0cc; font-size: 0.95rem; }
.cases em { color: #dbe4f3; font-style: italic; }
.chip {
  display: inline-block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em;
  padding: 0.1rem 0.45rem; margin-right: 0.25rem; border-radius: 5px; border: 1px solid currentColor;
}
.chip--ok { color: #6ee7a8; }
.chip--warn { color: var(--glow); }
.chip--bad { color: #ff8095; }

/* ── 06 access ─────────────────────────────────────────────── */
.access { display: grid; gap: clamp(2rem, 4vw, 3.4rem); }
@media (min-width: 900px) { .access { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 1.2rem 0 1.2rem 3.2rem; border-top: 1px solid var(--rule-soft); }
.steps li:first-child { border-top: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1.15rem;
  width: 2rem; height: 2rem; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.8rem; color: var(--accent-ink);
  border: 1px solid rgba(168, 65, 10, 0.3); border-radius: 50%;
}
.steps h3 { margin-bottom: 0.3rem; }
.steps p { color: var(--muted); font-size: 0.94rem; }

.access__side { display: grid; gap: 0.7rem; }
.access__mail { font-family: var(--mono); font-size: 0.82rem; text-align: center; color: var(--muted); }
.access__mail a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid rgba(168, 65, 10, 0.3); }

.warning {
  margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 12px;
  background: rgba(212, 24, 61, 0.05); border: 1px solid rgba(212, 24, 61, 0.35);
  border-left-width: 3px;
}
.warning__title {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); margin-bottom: 0.5rem;
}
.warning p:last-child { font-size: 0.87rem; color: var(--ink-2); line-height: 1.55; }
.warning strong { font-weight: 600; }

/* ── foot ──────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--rule); padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) 2rem; }
.foot__inner { max-width: var(--measure); margin-inline: auto; display: grid; gap: 2rem; }
@media (min-width: 760px) { .foot__inner { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); } }
.foot__brand { display: flex; gap: 0.8rem; align-items: flex-start; }
.foot__brand p { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.foot__links { display: grid; gap: 0.4rem; align-content: start; font-size: 0.9rem; }
.foot__links a { color: var(--ink-2); text-decoration: none; width: fit-content; border-bottom: 1px solid transparent; }
.foot__links a:hover { border-bottom-color: var(--accent); }
.foot__label { margin-bottom: 0.2rem; }
.foot__fine { max-width: var(--measure); margin: 2.5rem auto 0; font-size: 0.78rem; color: var(--faint); }

/* ── wider viewports ───────────────────────────────────────── */
@media (min-width: 720px) { .pill { display: inline-flex; } }
@media (min-width: 1040px) { .masthead__nav { display: flex; } }

/* ── motion ────────────────────────────────────────────────── */
@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; }
  .console { transform: none; }
}

/* ── forced dark preference ────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f5fa;
    --ink-2: #c3cee2;
    --muted: #93a1bb;
    --faint: #74829d;
    --accent-ink: #ffa15c;
    --cream: #070d1a;
    --sky: #0b1526;
    --butter: #120e18;
    --paper: rgba(255, 255, 255, 0.045);
    --paper-solid: #0b1324;
    --rule: rgba(255, 255, 255, 0.16);
    --rule-soft: rgba(255, 255, 255, 0.08);
  }
  body {
    background-image:
      radial-gradient(120% 60% at 78% -10%, rgba(249, 115, 22, 0.18) 0%, rgba(249, 115, 22, 0) 55%),
      radial-gradient(90% 55% at 0% 45%, rgba(37, 99, 235, 0.16) 0%, rgba(37, 99, 235, 0) 60%),
      linear-gradient(120deg, #070d1a 0%, #0b1526 45%, #100c17 100%);
  }
  .masthead { background: linear-gradient(to bottom, rgba(7, 13, 26, 0.92), rgba(7, 13, 26, 0.7)); }
  .btn--solid { background: var(--accent); color: #16100a; }
  .btn--solid:hover { background: #ff8a33; }
  .btn--ghost { background: rgba(255, 255, 255, 0.04); }
  .pill { background: rgba(255, 255, 255, 0.04); color: var(--muted); }
  code { background: rgba(255, 255, 255, 0.08); }
  .band--ink { background: linear-gradient(168deg, #0a1120 0%, #0d1729 100%); }
  .path__stops circle { fill: #0b1324; stroke: rgba(255, 255, 255, 0.3); }
  .slacard__key code, .slacard__table td { color: var(--ink-2); }
  .warning { background: rgba(212, 24, 61, 0.12); }
  .warning p:last-child { color: #d7deec; }
}
