/* ==========================================================================
   Applications · Nibu M John — portal stylesheet
   --------------------------------------------------------------------------
   v3 — "Signal room" redesign.
   Same class contract as v2 (portal.js / components.js / icons.js are
   untouched and keep working): every selector, id-hook, and custom
   property name (--brand, --tint, --i, --bar, data-theme, aria-pressed,
   data-stuck…) is preserved. Everything visual is reimagined: a warm,
   near-black control-room base by default, lit by a three-colour signal
   ramp (acid lime / hot coral / warm gold) instead of the old violet
   aurora, with a cream "daylight" alternate for light mode. The suite
   index reads like an instrument panel — a live waveform, not a chart.
   No third-party fonts, no CDN, no build step — same zero-dependency
   rule as before.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* surfaces & ink — warm near-black, by default: the machine's own light */
  --page:           #120f0c;
  --page-tint:      #171310;
  --surface-1:      #1d1712;
  --surface-2:      #251e17;
  --surface-3:      #2f261c;
  --ink:            #fbf4ea;
  --ink-2:          #cdbdaa;
  --ink-3:          #93816e;
  --grid:           #2a2119;
  --border:         rgba(255, 244, 230, .09);
  --border-strong:  rgba(255, 244, 230, .19);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 74px rgba(0, 0, 0, .62), 0 6px 18px rgba(0, 0, 0, .4);

  /* the signal — lime / coral / gold, instead of one house blue */
  --accent:        #c6ff5e;   /* acid lime   */
  --accent-ink:    #dcff9a;
  --accent-2:      #ff5f4a;   /* hot coral   */
  --accent-3:      #ffb238;   /* warm gold   */
  --accent-4:      #34c9ff;   /* signal blue */
  --accent-wash:   rgba(198, 255, 94, .13);
  --accent-solid:  #ff5f4a;   /* button fill */
  --aurora: linear-gradient(115deg, var(--accent) 0%, var(--accent-3) 52%, var(--accent-2) 100%);

  /* readiness signals — brighter, still semantic */
  --ok:        #33d17e;
  --ok-ink:    #7cf0ae;
  --ok-wash:   rgba(51, 209, 126, .16);
  --warn:      #ffb238;
  --warn-ink:  #ffd28c;
  --warn-wash: rgba(255, 178, 56, .18);
  --hold:      #b592ff;
  --hold-ink:  #d3bbff;
  --hold-wash: rgba(181, 146, 255, .17);

  /* geometry & type */
  --radius-sm: 10px;
  --radius:    20px;
  --radius-lg: 28px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  /* the display voice — a heavy grotesque headline, not a terminal font */
  --display: var(--font);

  --shell:   1220px;
  --gutter:  clamp(20px, 4vw, 44px);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  .32s;

  --grain-opacity: .05;
}

:root[data-theme="light"] { color-scheme: light; }

/* Daylight alt — warm paper instead of warm ink, same signal ramp, darkened
   just enough to hold contrast on cream. */
@media (prefers-color-scheme: light) {
  :root:where(:not([data-theme="dark"])) {
    --page:          #fbf3e7;
    --page-tint:     #f5e9d5;
    --surface-1:     #ffffff;
    --surface-2:     #fbf0e0;
    --surface-3:     #f2e2c8;
    --ink:           #1d150d;
    --ink-2:         #5f4c39;
    --ink-3:         #8c775f;
    --grid:          #ecdcbf;
    --border:        rgba(40, 25, 8, .10);
    --border-strong: rgba(40, 25, 8, .20);
    --shadow-sm: 0 1px 2px rgba(40, 25, 10, .07), 0 1px 3px rgba(40, 25, 10, .05);
    --shadow-md: 0 10px 28px rgba(40, 25, 10, .12), 0 2px 8px rgba(40, 25, 10, .06);
    --shadow-lg: 0 24px 60px rgba(40, 25, 10, .16), 0 6px 16px rgba(40, 25, 10, .08);
    --accent:      #7c9d00;
    --accent-ink:  #5c7500;
    --accent-2:    #e14a34;
    --accent-3:    #c97f00;
    --accent-4:    #0e88c4;
    --accent-wash: rgba(124, 157, 0, .12);
    --accent-solid: #e14a34;
    --ok-ink:   #1f8a53;
    --warn-ink: #96650a;
    --hold-ink: #6c48c9;
    --grain-opacity: .035;
  }
}

:root[data-theme="light"] {
  --page:          #fbf3e7;
  --page-tint:     #f5e9d5;
  --surface-1:     #ffffff;
  --surface-2:     #fbf0e0;
  --surface-3:     #f2e2c8;
  --ink:           #1d150d;
  --ink-2:         #5f4c39;
  --ink-3:         #8c775f;
  --grid:          #ecdcbf;
  --border:        rgba(40, 25, 8, .10);
  --border-strong: rgba(40, 25, 8, .20);
  --shadow-sm: 0 1px 2px rgba(40, 25, 10, .07), 0 1px 3px rgba(40, 25, 10, .05);
  --shadow-md: 0 10px 28px rgba(40, 25, 10, .12), 0 2px 8px rgba(40, 25, 10, .06);
  --shadow-lg: 0 24px 60px rgba(40, 25, 10, .16), 0 6px 16px rgba(40, 25, 10, .08);
  --accent:      #7c9d00;
  --accent-ink:  #5c7500;
  --accent-2:    #e14a34;
  --accent-3:    #c97f00;
  --accent-4:    #0e88c4;
  --accent-wash: rgba(124, 157, 0, .12);
  --accent-solid: #e14a34;
  --ok-ink:   #1f8a53;
  --warn-ink: #96650a;
  --hold-ink: #6c48c9;
  --grain-opacity: .035;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  position: relative;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Three drifting signal blooms behind the whole page, plus a slow hue
   breathe — the base layer never sits still, but never distracts either. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(50% 36% at 6% -8%,   color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(46% 34% at 98% 2%,   color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%),
    radial-gradient(52% 42% at 46% 114%, color-mix(in srgb, var(--accent-3) 16%, transparent), transparent 74%);
  opacity: .85;
  animation: hue-breathe 26s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hue-breathe {
  0%, 100% { filter: hue-rotate(0deg) saturate(1); }
  50%      { filter: hue-rotate(-8deg) saturate(1.12); }
}
/* A whisper of grain so glass surfaces read as material, not flat gradient. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: var(--grain-opacity);
  pointer-events: none;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.026em; line-height: 1.1; }
p { margin: 0; }
dl, dd, dt { margin: 0; }
ul, ol { margin: 0; }
figure, figcaption { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { display: block; }
code { font-family: var(--mono); font-size: .92em; }

input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  translate: -50% -160%;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--aurora);
  color: #16110a;
  font-size: 14px;
  font-weight: 700;
  transition: translate var(--dur) var(--ease);
}
.skip-link:focus { translate: -50% 0; }

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-ink, var(--ink-3));
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Shared "signal ring" a few elements borrow: an animated conic-gradient
   edge, drawn as a padding-box/border-box mask so the fill underneath still
   shows. Toggled on with .ring-live; sits inert otherwise. */
@property --ring-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes spin-ring { to { --ring-angle: 360deg; } }

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--page) 76%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.masthead[data-stuck="true"] {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--page) 90%, transparent);
  box-shadow: 0 1px 0 var(--border), 0 12px 30px -18px rgba(0,0,0,.6);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 66px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  padding: 6px;
  margin-left: -6px;
  border-radius: var(--radius-sm);
  min-width: 0;
}
.wordmark__mark {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--aurora);
  color: #16110a;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.02em;
  box-shadow: 0 3px 14px -3px color-mix(in srgb, var(--accent-2) 75%, transparent);
}
.wordmark__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.wordmark__name {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -.018em;
  white-space: nowrap;
}
.wordmark__sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.navlink {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.navlink:hover { color: var(--ink); background: var(--surface-2); }

.ctl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-1) 82%, transparent);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ctl:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.ctl svg { width: 16px; height: 16px; }

.ctl--search {
  min-width: 196px;
  color: var(--ink-3);
  font-size: 13.5px;
}
.ctl--search .ctl__hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--ink-3);
  background: var(--surface-2);
}
.ctl--icon { width: 38px; padding: 0; justify-content: center; }

/* --------------------------------------------------------------------------
   4. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(60px, 9vw, 108px) clamp(44px, 6vw, 72px);
  border-bottom: 1px solid var(--border);
}

.hero__grid {
  position: absolute;
  inset: 0;
  --line: color-mix(in srgb, var(--ink) 9%, transparent);
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: 0 0;
  mask-image: radial-gradient(125% 95% at 12% 0%, #000 0%, rgba(0,0,0,.55) 42%, transparent 78%);
  pointer-events: none;
}
.hero__glow {
  position: absolute;
  pointer-events: none;
  border-radius: 46% 54% 61% 39% / 44% 39% 61% 56%;
  filter: blur(84px);
  opacity: .5;
  animation: drift 20s ease-in-out infinite alternate, morph 15s ease-in-out infinite;
}
.hero__glow--a {
  width: 480px; height: 320px;
  top: -120px; left: -90px;
  background: var(--accent);
  opacity: .32;
}
.hero__glow--b {
  width: 440px; height: 280px;
  top: 10px; right: -120px;
  background: var(--accent-2);
  opacity: .26;
  animation-delay: -7s;
}
.hero::after {
  content: "";
  position: absolute;
  left: 8%; bottom: -140px;
  width: 380px; height: 260px;
  border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%;
  background: var(--accent-3);
  opacity: .18;
  filter: blur(90px);
  pointer-events: none;
  animation: drift 24s ease-in-out infinite alternate-reverse, morph 18s ease-in-out infinite reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(24px, 16px) scale(1.08); }
}
@keyframes morph {
  0%, 100% { border-radius: 46% 54% 61% 39% / 44% 39% 61% 56%; }
  50%      { border-radius: 58% 42% 39% 61% / 55% 61% 39% 45%; }
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-1) 65%, transparent);
  backdrop-filter: blur(8px);
}
.hero__eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-wash);
  animation: pulse-dot 2.2s var(--ease) infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px var(--ok-wash); }
  50%      { box-shadow: 0 0 0 7px var(--ok-wash); }
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.3rem, 5.8vw, 4.05rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
  margin-bottom: 22px;
}
.hero h1 .soft {
  display: inline-block;
  background: var(--aurora);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  animation: signal-shift 7s ease-in-out infinite;
}
@keyframes signal-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero__lede {
  font-size: clamp(1rem, 1.35vw, 1.14rem);
  color: var(--ink-2);
  max-width: 46ch;
  margin-bottom: 32px;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 47px;
  padding: 0 23px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.008em;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn svg { width: 16px; height: 16px; position: relative; z-index: 1; }
.btn > * { position: relative; z-index: 1; }
.btn--primary {
  background: var(--aurora);
  background-size: 200% 100%;
  color: #16110a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 30px -12px color-mix(in srgb, var(--accent-2) 80%, transparent);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.5) 48%, transparent 62%);
  translate: -130% 0;
  transition: translate .55s var(--ease);
}
.btn--primary:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .32), 0 20px 42px -12px color-mix(in srgb, var(--accent-2) 88%, transparent);
}
.btn--primary:hover::before { translate: 130% 0; }
.btn--ghost {
  background: color-mix(in srgb, var(--surface-1) 75%, transparent);
  border-color: var(--border);
  color: var(--ink);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.hero__figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.figure {
  padding-right: 30px;
  margin-right: 30px;
  border-right: 1px solid var(--border);
}
.figure:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.figure__n {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.figure__k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}

/* --- The signature: the suite plotted as a live instrument-panel signal -- */
.plate {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-1) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
/* A slow-spinning signal seam around the plate — the one place the "ring"
   motif gets to run continuously, since this card is the signature. */
.plate::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--ring-angle), var(--accent), var(--accent-3), var(--accent-2), var(--accent-4), var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .6;
  animation: spin-ring 14s linear infinite;
  pointer-events: none;
}
.plate__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.plate__title { font-size: 12.5px; font-weight: 700; letter-spacing: -.01em; }
.plate__meta { margin-left: auto; color: var(--ink-3); }
.plate__body { position: relative; padding: 20px 18px 16px; }

.spectrum {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 132px;
}
.spectrum__bar {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 4px;
  --bar-ink: var(--bar, var(--accent));
}
:root[data-theme="light"] .spectrum__bar {
  --bar-ink: color-mix(in srgb, var(--bar, var(--accent)) 78%, #000);
}
@media (prefers-color-scheme: light) {
  :root:where(:not([data-theme="dark"])) .spectrum__bar {
    --bar-ink: color-mix(in srgb, var(--bar, var(--accent)) 78%, #000);
  }
}
.spectrum__fill {
  width: 100%;
  border-radius: 3px;
  background: var(--bar-ink);
  box-shadow: 0 0 14px -3px var(--bar-ink);
  opacity: .88;
  transform-origin: bottom;
  animation: bar-breathe 3.6s var(--ease) infinite;
  animation-delay: calc(var(--i, 0) * -.18s);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@keyframes bar-breathe {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(.91); }
}
.spectrum__bar:hover .spectrum__fill,
.spectrum__bar:focus-visible .spectrum__fill {
  opacity: 1;
  box-shadow: 0 0 24px -2px var(--bar-ink);
  transform: scaleY(1.06);
  animation-play-state: paused;
}
.spectrum__bar::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  translate: -50% 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--page);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease), translate .18s var(--ease);
  z-index: 3;
}
.spectrum__bar:hover::after,
.spectrum__bar:focus-visible::after { opacity: 1; translate: -50% 0; }

.plate__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   5. Section furniture
   -------------------------------------------------------------------------- */
.band { padding-block: clamp(48px, 7vw, 82px); }
.band--tint { background: var(--page-tint); border-block: 1px solid var(--border); }

.band__head { margin-bottom: 32px; max-width: 62ch; }
.band__head .eyebrow { margin-bottom: 12px; display: block; }
.band__head h2 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.9vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -.034em;
  margin-bottom: 10px;
}
.band__head p { color: var(--ink-2); font-size: 15.5px; }

/* --------------------------------------------------------------------------
   6. Featured application
   -------------------------------------------------------------------------- */
.featured {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .84fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-1) 92%, transparent);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 140% at 0% 0%, var(--tint), transparent 60%);
  pointer-events: none;
}
.featured__main { position: relative; padding: clamp(28px, 3.4vw, 42px); }
.featured__side {
  position: relative;
  padding: clamp(28px, 3.4vw, 42px);
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  border-left: 1px solid var(--border);
}

.featured__top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.featured__ident { min-width: 0; flex: 1; }
.featured__where { color: var(--ink-3); margin-top: 6px; }
.featured h3 {
  font-family: var(--display);
  font-size: clamp(1.42rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -.032em;
  margin-bottom: 0;
}
.featured__lede { color: var(--ink-2); font-size: 15.5px; max-width: 52ch; margin-bottom: 24px; }
.featured__cta { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }

.caps { display: grid; gap: 13px; }
.caps__k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.caps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.45;
}
.caps ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.caps li svg { flex: none; width: 15px; height: 15px; margin-top: 3px; color: var(--brand-ink, var(--accent)); }

/* --------------------------------------------------------------------------
   7. Toolbar — search + filters
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.search {
  position: relative;
  flex: 1 1 300px;
  min-width: 0;
  max-width: 420px;
}
.search__icon {
  position: absolute;
  left: 14px; top: 50%;
  translate: 0 -50%;
  width: 16px; height: 16px;
  color: var(--ink-3);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 47px;
  padding: 0 74px 0 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-1) 85%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.search__kbd {
  position: absolute;
  right: 12px; top: 50%;
  translate: 0 -50%;
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink-3);
  background: var(--surface-2);
  pointer-events: none;
}
.search input:not(:placeholder-shown) ~ .search__kbd { opacity: 0; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-left: auto;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 37px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-1) 82%, transparent);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              background var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.chip:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  color: var(--ink);
  transform: translateY(-1px);
}
.chip__n {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.chip[aria-pressed="true"] {
  background: var(--aurora);
  border-color: transparent;
  color: #16110a;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent-2) 85%, transparent);
}
.chip[aria-pressed="true"] .chip__n { color: rgba(22,17,10,.65); }

/* --------------------------------------------------------------------------
   8. Application grid — cards as instrument dials
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card, .featured, .palette__item {
  --tint: color-mix(in srgb, var(--brand, var(--accent)) 15%, transparent);
  --brand-ink: color-mix(in srgb, var(--brand, var(--accent)) 70%, #fff);
}
:root[data-theme="light"] :is(.card, .featured, .palette__item) {
  --tint: color-mix(in srgb, var(--brand, var(--accent)) 12%, transparent);
  --brand-ink: color-mix(in srgb, var(--brand, var(--accent)) 85%, #000);
}
@media (prefers-color-scheme: light) {
  :root:where(:not([data-theme="dark"])) :is(.card, .featured, .palette__item) {
    --tint: color-mix(in srgb, var(--brand, var(--accent)) 12%, transparent);
    --brand-ink: color-mix(in srgb, var(--brand, var(--accent)) 85%, #000);
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-1) 92%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
/* A flat band of the app's own colour along the top edge, always visible... */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 18px; right: 18px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--brand, var(--accent));
  opacity: .8;
  transition: opacity var(--dur) var(--ease), height var(--dur) var(--ease);
}
/* ...and a fine signal ring drawn in the same hue, on hover. */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, var(--brand, var(--accent)), var(--brand-ink, var(--accent-3)), var(--brand, var(--accent)));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.card:hover, .card:focus-within {
  transform: translateY(-5px) scale(1.006);
  box-shadow: var(--shadow-md), 0 0 0 1px transparent;
  border-color: transparent;
}
.card:hover::before, .card:focus-within::before { height: 5px; opacity: 1; }
.card:hover::after, .card:focus-within::after { opacity: .85; }

.card__top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; margin-top: 4px; }
.card__id { min-width: 0; flex: 1; }
.card__where { color: var(--ink-3); margin-top: 3px; }

.glyph {
  flex: none;
  width: 43px; height: 43px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--tint, var(--surface-2));
  color: var(--brand-ink, var(--accent));
  border: 1px solid color-mix(in srgb, var(--brand, var(--accent)) 30%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 24%, transparent);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.glyph svg { width: 21px; height: 21px; }
.glyph--lg { width: 54px; height: 54px; border-radius: 15px; }
.glyph--lg svg { width: 27px; height: 27px; }
.card:hover .glyph {
  transform: translateY(-2px) rotate(-6deg) scale(1.06);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 24%, transparent), 0 8px 18px -6px var(--brand, var(--accent));
}

.card h3 {
  font-size: 16.5px;
  font-weight: 750;
  letter-spacing: -.022em;
  margin-bottom: 0;
}
.card__link { display: inline; }
.card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card__link:focus-visible { outline: none; }
.card:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }

.card__desc {
  font-size: 13.8px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 15px;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  list-style: none;
  padding: 0;
}
.tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .03em;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-3);
}

.card__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}
.card__cat {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.status i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  box-shadow: 0 0 0 3px currentColor;
  opacity: .9;
}
.status--ready { color: var(--ok-ink);   background: var(--ok-wash);   border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.status--ready i { box-shadow: 0 0 0 3px var(--ok-wash); }
.status--setup { color: var(--warn-ink); background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 38%, transparent); }
.status--setup i { box-shadow: 0 0 0 3px var(--warn-wash); }
.status--auth  { color: var(--hold-ink); background: var(--hold-wash); border-color: color-mix(in srgb, var(--hold) 34%, transparent); }
.status--auth i { box-shadow: 0 0 0 3px var(--hold-wash); }

.card__go {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-ink, var(--accent));
  white-space: nowrap;
}
.card__go svg {
  width: 14px; height: 14px;
  transition: translate var(--dur) var(--ease);
}
.card:hover .card__go svg { translate: 3px 0; }

.empty {
  grid-column: 1 / -1;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-1) 85%, transparent);
}
.empty svg { width: 26px; height: 26px; margin: 0 auto 14px; color: var(--ink-3); }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--ink-2); font-size: 14px; margin-bottom: 18px; }

/* --------------------------------------------------------------------------
   9. Command palette
   -------------------------------------------------------------------------- */
.palette {
  border: 0;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: min(70vh, 540px);
  margin: 0 auto;
  margin-top: clamp(48px, 12vh, 132px);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-1) 95%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  overflow: hidden;
  border-top: 2px solid transparent;
  border-image: var(--aurora) 1;
}
.palette::backdrop {
  background: rgba(6, 4, 2, .6);
  backdrop-filter: blur(4px);
}
.palette__field {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
}
.palette__field svg { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.palette__field input {
  flex: 1;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 15.5px;
  outline: none;
  min-width: 0;
}
.palette__field input::placeholder { color: var(--ink-3); }
.palette__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  max-height: min(52vh, 400px);
}
.palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 10px;
  cursor: pointer;
  scroll-margin: 8px;
  border-left: 2px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.palette__item[aria-selected="true"] {
  background: var(--tint, var(--surface-2));
  border-left-color: var(--brand, var(--accent));
}
.palette__item .glyph { width: 32px; height: 32px; border-radius: 9px; }
.palette__item .glyph svg { width: 16px; height: 16px; }
.palette__name { font-size: 14.5px; font-weight: 650; letter-spacing: -.014em; }
.palette__cat { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.palette__go { margin-left: auto; }
.palette__foot {
  display: flex;
  gap: 16px;
  padding: 10px 17px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-3);
}
.palette__none { padding: 30px 18px; text-align: center; color: var(--ink-2); font-size: 14px; }
kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-1);
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */
.footer {
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--surface-1);
  padding-block: 44px 34px;
  overflow: hidden;
}
.footer::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 3px;
  background: var(--aurora);
  opacity: .8;
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.footer__blurb { max-width: 40ch; color: var(--ink-2); font-size: 14px; margin-top: 12px; }
.footer__cols { display: flex; flex-wrap: wrap; gap: clamp(28px, 5vw, 64px); }
.footer__col h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 12px;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer__col a { font-size: 13.5px; color: var(--ink-2); transition: color var(--dur) var(--ease); }
.footer__col a:hover { color: var(--brand-ink, var(--accent)); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding-top: 20px;
  color: var(--ink-3);
}
.footer__bottom .sep { margin-left: auto; }

.totop {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 30;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-1) 90%, transparent);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  translate: 0 10px;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), translate var(--dur) var(--ease),
              color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.totop[data-show="true"] { opacity: 1; translate: 0 0; pointer-events: auto; }
.totop:hover { color: var(--accent); box-shadow: var(--shadow-md), 0 0 0 3px var(--accent-wash); }
.totop svg { width: 17px; height: 17px; }

/* --------------------------------------------------------------------------
   11. Motion — one orchestrated entrance, then rest
   -------------------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes growY {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.reveal { animation: rise .62s var(--ease) both; }
.reveal[data-d="1"] { animation-delay: .06s; }
.reveal[data-d="2"] { animation-delay: .12s; }
.reveal[data-d="3"] { animation-delay: .18s; }
.reveal[data-d="4"] { animation-delay: .24s; }
.reveal[data-d="5"] { animation-delay: .3s; }

.spectrum__fill { animation: growY .8s var(--ease) both, bar-breathe 3.6s var(--ease) infinite; }

.card { animation: rise .5s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .card:hover, .featured:hover { transform: none; }
  .card:hover .glyph { transform: none; }
  .hero__glow, .hero::after { animation: none; }
}

/* --------------------------------------------------------------------------
   12. Responsive — intentional layouts, not a shrunken desktop
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .plate { max-width: 560px; }
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured__side { border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 880px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masthead__nav { display: none; }
  .ctl--search { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .ctl--search .ctl__label, .ctl--search .ctl__hint { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { max-width: none; flex: none; }
  .filters { margin-left: 0; }
}

@media (max-width: 620px) {
  :root { --gutter: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hero { padding-block: 40px 34px; }
  .hero h1 { font-size: clamp(2rem, 10vw, 2.7rem); letter-spacing: -.03em; }
  .hero__figures { margin-top: 28px; gap: 18px 0; }
  .figure { padding-right: 20px; margin-right: 20px; }
  .btn { height: 48px; flex: 1 1 auto; justify-content: center; }
  .card { padding: 17px 17px 0; }
  .card__foot { padding: 14px 0; }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scroll-snap-type: x proximity;
  }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 38px; scroll-snap-align: start; }
  .spectrum { height: 104px; }
  .footer__top { gap: 24px; }
  .totop { right: 14px; bottom: 14px; }
}

@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .card:hover .glyph { transform: none; }
  .card:hover .card__go svg { translate: 0 0; }
  .card:active { transform: scale(.994); }
  .spectrum__bar::after { display: none; }
}

@media print {
  .masthead, .totop, .toolbar, .hero__glow, .hero__grid { display: none; }
  .card { break-inside: avoid; box-shadow: none; }
  body::before, body::after { display: none; }
}
