/* SPDX-License-Identifier: GPL-3.0-only */
/* Trillium site, Stage palette. Self-contained: tokens, fonts, layout. */
:root {
  /* Trillium brand tokens (Stage). Generated from tokens.json */
  --tr-black: #0C0C0D; /* Primary ground. ~58% of any layout. */
  --tr-graphite: #232326; /* Panels, cards, icon ground. ~20%. */
  --tr-ash: #8A8580; /* Secondary text on black (5.4:1). */
  --tr-ash-light: #B3ADA4; /* Resting UI icons and captions on black (8.8:1). */
  --tr-warm-white: #F4F1EA; /* Text on black (17.3:1); light ground. ~13%. */
  --tr-signal: #FF5A1F; /* The brand orange: mark, active state, primary button. ~6%. */
  --tr-amber: #FFB020; /* Levels, meters, highlights only. ~3%. */
  --tr-ember: #E8480F; /* Mark color on light grounds (not for text). */
  --tr-rust: #C23D0E; /* Orange text on light grounds (4.7:1 on warm white). */
  --tr-unavailable: #55524D; /* Disabled UI on black (decorative, not for text). */
  --tr-connected: #6FAE9A; /* Connected / OK status dot. */
  --tr-record: #FF5A1F; /* Alias of signal for live/record states. */
  --tr-bg: var(--tr-black);
  --tr-surface: var(--tr-graphite);
  --tr-text: var(--tr-warm-white);
  --tr-text-muted: var(--tr-ash);
  --tr-accent: var(--tr-signal);
  --tr-on-accent: var(--tr-black);
  --tr-icon-rest: var(--tr-ash-light);
  --tr-icon-hover: var(--tr-warm-white);
  --tr-icon-active: var(--tr-signal);
  --tr-font-display: "Outfit", "Inter", system-ui, sans-serif;
  --tr-font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --tr-font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --tr-radius-card: 20px;
  --tr-radius-control: 10px;
}

/* Light grounds (release notes, print, docs) */
.tr-light {
  --tr-bg: var(--tr-warm-white);
  --tr-surface: #FFFFFF;
  --tr-text: var(--tr-black);
  --tr-text-muted: #55524D;
  --tr-accent-text: var(--tr-rust);
}
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/outfit-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--tr-black); color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  background: var(--tr-black); color: var(--tr-warm-white);
  font-family: var(--tr-font-ui); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--tr-warm-white); text-decoration-color: var(--tr-signal); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--tr-signal); outline-offset: 3px; border-radius: 3px; }
.wrap { width: 100%; max-width: var(--max, 46rem); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; z-index: 20; background: var(--tr-signal); color: var(--tr-black); padding: .5rem 1rem; text-decoration: none; border-radius: 10px; }
.skip:focus { left: 1rem; top: 1rem; }

/* Header: lockup + Zero · Sense · Source */
.site-header { border-bottom: 1px solid var(--tr-graphite); background: var(--tr-black); }
.site-header .wrap, .site-footer .wrap { max-width: 72rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .75rem; padding-bottom: .75rem; flex-wrap: nowrap; }
.tr-lockup { display: block; line-height: 0; text-decoration: none; }
.tr-lockup img { display: block; width: auto; height: 32px; max-width: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .15rem; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .7rem;
  color: var(--tr-ash-light); text-decoration: none; font-size: .95rem; letter-spacing: .02em;
}
.nav a:hover, .nav a:focus-visible { color: var(--tr-warm-white); }
.nav a[aria-current="page"] { color: var(--tr-warm-white); box-shadow: inset 0 -2px 0 var(--tr-signal); }

/* Footer */
.site-footer { border-top: 1px solid var(--tr-graphite); color: var(--tr-ash); font-size: .8rem; margin-top: auto; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.25rem; padding-bottom: 1.5rem; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.25rem; }
.site-footer a { color: var(--tr-ash); text-decoration: none; }
.site-footer a:hover { color: var(--tr-ash-light); text-decoration: underline; text-decoration-color: var(--tr-unavailable); }

main { padding: 0 0 3rem; flex: 1 0 auto; }
h1, h3 { font-family: var(--tr-font-display); font-weight: 400; letter-spacing: -.01em; color: var(--tr-warm-white); }
h2 { font-family: var(--tr-font-ui); color: var(--tr-ash); }
p { margin: 0 0 1rem; }
.tagline { color: var(--tr-ash-light); }
.lead { color: var(--tr-warm-white); font-size: 1.125rem; margin: 0 0 1rem; max-width: 38rem; }
.page-banner { background: var(--tr-black); padding-bottom: 2.5rem; }
.hero-page { text-align: left; padding: 1.25rem 0 1.75rem; }
.hero-page h1 { font-size: clamp(2.2rem, 6vw, 3.25rem); line-height: 1.1; margin: 0 0 .6rem; letter-spacing: -.02em; font-weight: 300; }

/* Buttons: black text on signal orange; 44 px minimum */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1.25rem; border-radius: 999px;
  font-family: var(--tr-font-ui); font-size: 1rem; font-weight: 600;
  text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--tr-signal); color: var(--tr-on-accent); }
.btn-primary:hover { text-decoration: underline; text-decoration-color: var(--tr-on-accent); }
.btn-secondary { background: transparent; color: var(--tr-warm-white); box-shadow: inset 0 0 0 1px var(--tr-ash); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--tr-warm-white); }

/* Home hero: full light trails, wordmark, headline, descriptor, two buttons */
body.home main { padding: 0; display: flex; flex-direction: column; }
.hero-stage {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2.5rem 1.25rem 3rem;
  background: radial-gradient(ellipse 60% 55% at 50% 42%, #18181b 0%, var(--tr-black) 72%);
}
.trails { width: min(46vh, 70vw, 400px); height: auto; margin: 0 auto 1.5rem; }
.word-wrap { margin: 0; line-height: 0; }
.word { width: clamp(132px, 14vw, 188px); height: auto; margin: 0 auto .9rem; }
.headline {
  margin: 0; font-family: var(--tr-font-display); font-weight: 300;
  font-size: clamp(1.6rem, 3.4vw, 2.25rem); letter-spacing: -.02em; line-height: 1.15;
  color: var(--tr-warm-white);
}
.descriptor {
  margin: .65rem 0 0; font-family: var(--tr-font-ui); font-weight: 400;
  font-size: 1rem; /* 16 px; brand: Inter, not mono */ line-height: 1.4;
  color: var(--tr-ash-light); letter-spacing: .01em;
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin: 1.75rem 0 0; }

@media (prefers-reduced-motion: no-preference) {
  .word, .headline, .descriptor, .hero-actions { animation: fade .6s ease-out .3s backwards; }
}
@keyframes fade { from { opacity: 0; } }

@media (max-width: 560px) {
  .nav a { padding: 0 .45rem; font-size: .9rem; }
  .trails { width: min(72vw, 300px); margin-bottom: 1.25rem; }
  .word-wrap { margin: 0; line-height: 0; }
.word { width: 148px; }
  .hero-stage { padding: 2rem 1.25rem 2.5rem; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 10rem; }
}

/* Subpages */
body.zero, body.sense, body.downloads { --max: 56rem; }
body.sense h2, body.downloads h2, body.support h2, body.prose h2 {
  font-family: var(--tr-font-display); font-weight: 500; font-size: 1.15rem;
  text-transform: none; letter-spacing: 0; color: var(--tr-warm-white); margin: 0 0 .8rem;
}
section { padding: 1.75rem 0; border-top: 1px solid var(--tr-graphite); }
body.sense section:first-child, body.downloads section:first-child { border-top: none; }

.zero-spec { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; margin: .5rem 0 2rem; }
figure.product-shot { margin: 0; width: 100%; }
figure.product-shot img { display: block; width: 100%; height: auto; border-radius: var(--tr-radius-control); }
.facts { display: grid; grid-template-columns: 5.5rem 1fr; gap: .35rem .75rem; margin: 0; font-size: .875rem; line-height: 1.4; }
.facts dt { font-family: var(--tr-font-mono); font-size: .75rem; color: var(--tr-ash); padding-top: .1rem; }
.facts dd { margin: 0; color: var(--tr-warm-white); }
.disclosure { margin: .75rem 0 0; font-size: .75rem; line-height: 1.4; color: var(--tr-ash); }
body.zero .page-banner { padding-bottom: 1rem; }
body.zero .hero-page { padding: .75rem 0 1rem; }
body.zero .lead { margin-bottom: .5rem; }
@media (max-width: 640px) {
  .zero-spec { grid-template-columns: 1fr; gap: 1rem; }
  figure.product-shot { width: min(240px, 70vw); }
}

.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.downloads li { background: var(--tr-graphite); border: 1px solid var(--tr-graphite); border-radius: var(--tr-radius-card); padding: 1.15rem 1.35rem; }
.downloads a { font-weight: 650; font-size: 1.1rem; text-decoration: none; color: var(--tr-warm-white); }
.downloads a:hover { text-decoration: underline; }
.downloads .meta { font-family: var(--tr-font-mono); font-size: .8rem; color: var(--tr-ash-light); margin: .3rem 0 .35rem; overflow-wrap: anywhere; }
.downloads p:last-child { margin: 0; color: var(--tr-ash); }
.downloads p a { font-weight: inherit; font-size: inherit; text-decoration: underline; text-decoration-color: var(--tr-signal); }
.downloads .dl-name { font-weight: 650; font-size: 1.1rem; }
.downloads .soon { display: inline-block; margin-left: .5rem; font-size: .8rem; padding: .1rem .5rem; border: 1px solid var(--tr-unavailable); border-radius: 999px; color: var(--tr-ash-light); vertical-align: middle; }
/* Primary download (macOS) is the first link: orange pill, black text, 44 px */
.downloads li:first-child > a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.15rem; border-radius: 999px;
  background: var(--tr-signal); color: var(--tr-on-accent); text-decoration: none;
}
.downloads li:first-child > a:hover { text-decoration: underline; text-decoration-color: var(--tr-on-accent); }
.disclaimer { color: var(--tr-ash); font-size: .85rem; margin: 1rem 0 0; }

.features { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.features li { color: var(--tr-ash-light); }
.features strong { color: var(--tr-warm-white); font-weight: 600; margin-right: .4rem; }

.cheatsheet h3 { font-family: var(--tr-font-ui); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--tr-ash); margin: 1.5rem 0 .4rem; }
.cheatsheet h3:first-of-type { margin-top: 0; }
.table-scroll { overflow-x: auto; }
.cheatsheet table, table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-bottom: .5rem; table-layout: fixed; }
th, td { text-align: left; vertical-align: top; padding: .45rem .55rem .45rem 0; border-bottom: 1px solid var(--tr-graphite); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tr-ash); font-weight: 600; }
.cheatsheet td:nth-child(2), .cheatsheet th:nth-child(2) { width: 40%; }
.cheatsheet td { color: var(--tr-ash-light); line-height: 1.45; }
.cheatsheet th:first-child { width: 11rem; }
.cheatsheet td:first-child { color: var(--tr-warm-white); font-weight: 500; white-space: nowrap; width: 11rem; }
.cheatsheet .req { display: block; font-family: var(--tr-font-mono); font-size: .7rem; font-weight: 400; color: var(--tr-amber); }
.cheatsheet .note { color: var(--tr-ash); font-size: .85rem; margin: .25rem 0 0; }
@media (max-width: 560px) {
  .cheatsheet table, .cheatsheet thead, .cheatsheet tbody, .cheatsheet tr, .cheatsheet td { display: block; width: auto; }
  .cheatsheet thead { display: none; }
  .cheatsheet tr { border-bottom: 1px solid var(--tr-graphite); padding: .5rem 0; }
  .cheatsheet td, .cheatsheet td:first-child, .cheatsheet td:nth-child(2) { border: none; padding: .05rem 0; white-space: normal; width: auto; }
  .cheatsheet td:nth-child(3) { color: var(--tr-warm-white); }
  .cheatsheet td:nth-child(3)::before { content: "\2192\00a0"; color: var(--tr-signal); }
}

.prose { --max: 46rem; }
.prose h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); line-height: 1.15; margin: 2rem 0 .5rem; letter-spacing: -.01em; font-weight: 300; }
.prose h2 { margin: 2rem 0 .5rem; }
.prose .updated { color: var(--tr-ash); margin-bottom: 2rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }

body.base figure.product-shot { margin: 0 0 1.5rem; width: 100%; }
body.support .contact { font-size: 1.125rem; }
body.notfound .hero-stage { min-height: 60vh; }
body.notfound .descriptor { margin-bottom: 0; }

@media print {
  html { background: var(--tr-warm-white); color-scheme: light; }
  body, .site-header, .page-banner, .hero-stage { background: var(--tr-warm-white); color: var(--tr-black); }
  h1, h2, h3, .lead, .headline, a { color: var(--tr-black); }
  a { text-decoration-color: var(--tr-rust); }
  .downloads li:first-child > a, .btn-primary { background: none; color: var(--tr-rust); padding: 0; min-height: 0; }
  .tr-lockup, .trails { display: none; }
}

/* App screenshot (Sense page). */
figure.app-shot { margin: 0 0 2rem; }
figure.app-shot img { display: block; width: 100%; height: auto; border-radius: var(--tr-radius-control); border: 1px solid var(--tr-unavailable); }
figure.app-shot figcaption { font-size: .85rem; color: var(--tr-ash-light); margin-top: .5rem; }
