/*
 * One stylesheet, no framework, no remote font.
 *
 * ── THE SAME WORLD AS THE PRODUCT, SINCE 2026-08-24. ────────────────────────
 * This page used to be its own thing: a green accent and the system stack,
 * against a dashboard that is paper, ink, and hairlines terminating in
 * registration crosses (`apps/web/DESIGN.md`). A landing page that does not
 * look like the thing it sells is selling something else. The tokens below are
 * `DESIGN.md`'s roles, in its values, and there is deliberately NO ACCENT
 * COLOUR — the folder swatches are the only chroma here, exactly as in the app,
 * which is what makes them read as meaning rather than decoration.
 *
 * The one licence taken over the app is scale. The app is an Operate surface
 * and stays quiet; this is a Persuade surface, so the type is larger, the
 * measure is looser, and the crosses are allowed to be the page's signature
 * rather than a boundary marker seen once per panel.
 *
 * Light is defined on bare `:root` and dark is a `prefers-color-scheme`
 * override of the SAME tokens — never a colour whose only definition lives
 * inside the media query, because that renders as an unstyled default for
 * anyone whose OS reports no preference.
 */

/*
 * The display face, self-hosted from `src/fonts/` — never a CDN, which is the
 * posture this page has always had and the reason its CSP can be
 * `default-src 'none'`. The file is the same one `apps/web` preloads, version
 * in the filename, so a release is a new file rather than an overwrite.
 *
 * `swap`, not the app's `optional`. On a dashboard a swap lands a reflow under
 * the pointer; here the face IS the first impression, and `optional` would mean
 * most first-time visitors — the entire audience of a landing page — never see
 * it. Preloaded in `index.html`, so the swap window is short.
 */
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin-var-v22.woff2")
    format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: oklch(0.975 0.002 250);
  --sheet: oklch(1 0 0);
  --sunk: oklch(0.945 0.003 250);
  --line: oklch(0.895 0.004 250);
  --ink: oklch(0.22 0.008 250);
  --ink-muted: oklch(0.52 0.008 250);
  --ink-faint: oklch(0.68 0.006 250);
  --ink-inverse: oklch(0.98 0 0);

  /*
   * The nine folder colours, at their light-theme values, carried across from
   * `apps/web/src/styles/globals.css`. They appear exactly once on this page,
   * beside the sentence about filing things. Anywhere else they would be
   * decoration and the whole discipline would collapse.
   */
  --folder-blue: oklch(0.58 0.19 255);
  --folder-cyan: oklch(0.58 0.095 200);
  --folder-green: oklch(0.58 0.18 145);
  --folder-grey: oklch(0.58 0 265);
  --folder-orange: oklch(0.58 0.135 60);
  --folder-pink: oklch(0.58 0.2 350);
  --folder-purple: oklch(0.58 0.2 300);
  --folder-red: oklch(0.58 0.2 25);
  --folder-yellow: oklch(0.58 0.115 95);

  --measure: 42rem;
  --page: 70rem;
  --display: "Space Grotesk", var(--sans);
  --mono:
    ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.19 0.006 250);
    --sheet: oklch(0.24 0.006 250);
    --sunk: oklch(0.16 0.006 250);
    --line: oklch(0.33 0.008 250);
    --ink: oklch(0.95 0.003 250);
    --ink-muted: oklch(0.72 0.006 250);
    --ink-faint: oklch(0.55 0.006 250);
    --ink-inverse: oklch(0.17 0.006 250);

    --folder-blue: oklch(0.74 0.135 255);
    --folder-cyan: oklch(0.74 0.125 200);
    --folder-green: oklch(0.74 0.2 145);
    --folder-grey: oklch(0.74 0 265);
    --folder-orange: oklch(0.74 0.13 60);
    --folder-pink: oklch(0.74 0.16 350);
    --folder-purple: oklch(0.74 0.15 300);
    --folder-red: oklch(0.74 0.16 25);
    --folder-yellow: oklch(0.74 0.13 95);
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

/*
 * Links carry ink and an underline, never a hue. `DESIGN.md` retires the accent
 * role outright; underline plus weight is what is left, and it is enough.
 */
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: currentcolor;
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ── the rule, and its crosses ───────────────────────────────────────────── */

/*
 * The signature of `DESIGN.md`: a hairline that terminates in a small `+`.
 *
 * ⚠️ A `div`, never an `<hr>`. `<hr>` is a VOID element, so `::before` and
 * `::after` on it generate nothing at all — they render as absolutely nothing,
 * with no error and no warning, and only a screenshot finds it. That cost this
 * repo a redraw once already (T-57). The line and both crosses are background
 * layers on one element for the same reason.
 */
.rule {
  position: relative;
  height: 11px;
  margin-block: clamp(2rem, 4vw, 3.25rem);
  background:
    linear-gradient(var(--line), var(--line)) left center / 100% 1px no-repeat;
}

.rule span {
  position: absolute;
  top: 0;
  width: 11px;
  height: 11px;
  background:
    linear-gradient(var(--line), var(--line)) center / 11px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) center / 1px 11px no-repeat;
}

.rule .start {
  left: 0;
}

.rule .end {
  right: 0;
}

/* ── page frame ──────────────────────────────────────────────────────────── */

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page);
  padding: 1.25rem 1.5rem;
  margin-inline: auto;
}

.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/*
 * The one filled control on the page. Ink, not a hue — `DESIGN.md` carries
 * emphasis in fill and weight rather than colour, and a single green pill was
 * the loudest thing on the old page.
 */
.cta {
  padding: 0.35rem 0.95rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-inverse);
  text-decoration: none;
  background: var(--ink);
  border-radius: 6px;
}

main h2 {
  max-width: var(--measure);
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 1.2rem + 1.35vw, 2.15rem);
  font-weight: 500;
}

main {
  max-width: var(--page);
  padding: 1rem 1.5rem 4rem;
  margin-inline: auto;
}

footer.bar {
  font-size: 0.9rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
}

/* ── hero ────────────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(2rem, 6vw, 4.5rem) 0;
}

.hero h1 {
  max-width: 20ch;
  margin: 0 0 1.1rem;
  font-size: clamp(2.25rem, 1.3rem + 4.2vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.lede {
  max-width: var(--measure);
  margin: 0 0 2.25rem;
  font-size: 1.15em;
  color: var(--ink-muted);
}

.fineprint {
  max-width: var(--measure);
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.section-label {
  margin: 0 0 1.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ── the command ─────────────────────────────────────────────────────────── */

.command {
  position: relative;
  max-width: var(--measure);
  margin: 0 0 1rem;
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.command figcaption {
  padding: 0.55rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--sunk);
  border-bottom: 1px solid var(--line);
}

.command pre {
  padding: 1.1rem 1rem;
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: clamp(0.85rem, 0.75rem + 0.45vw, 1rem);
  line-height: 1.7;
  -webkit-user-select: all;
  /*
   * The no-JavaScript copy affordance: one click (or one Cmd-A inside the
   * block) selects the whole command rather than a word of it.
   */
  user-select: all;
}

.command.output pre {
  color: var(--ink-muted);
}

.command.wide {
  max-width: none;
}

/*
 * Injected by copy.js and therefore styled here rather than there — a button
 * that only exists when the script ran cannot leave a dead control on the page
 * when it did not.
 */
.copy-button {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  padding: 0.25rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink-muted);
  cursor: pointer;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.copy-button:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
}

/* ── the proof ───────────────────────────────────────────────────────────── */

/*
 * A real screenshot of a real published artifact, inside a frame whose address
 * bar carries that artifact's real URL as TEXT.
 *
 * It is a screenshot rather than an `<iframe>` on purpose, and not for weight:
 * every artifact is served with `frame-ancestors 'self' <app origin>`
 * (`apps/worker/src/content/isolation-headers.ts`), so this apex is not allowed
 * to frame one. Loosening that to sell the product would be trading an
 * isolation guarantee for a demo. The whole figure is a link to the live thing
 * instead, which is the honest version of the same claim.
 */
.frame {
  max-width: 54rem;
  margin: 0;
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.frame a {
  display: block;
  text-decoration: none;
}

.frame .chrome {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: var(--sunk);
  border-bottom: 1px solid var(--line);
}

.frame .dots {
  display: flex;
  flex: none;
  gap: 0.3rem;
}

.frame .dots i {
  width: 9px;
  height: 9px;
  background: var(--line);
  border-radius: 50%;
}

.frame .address {
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  white-space: nowrap;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--line);
}

.frame figcaption {
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

/* ── facts ───────────────────────────────────────────────────────────────── */

.facts > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.facts h3,
.doors h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.facts li p,
.doors article p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--ink-muted);
}

.facts li p + p,
.doors article p + p {
  margin-top: 0.75rem;
}

/* ── the swatches ────────────────────────────────────────────────────────── */

.swatches {
  display: flex;
  gap: 0.4rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.swatches li {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 4px;
}

/*
 * Nine classes rather than nine `style` attributes: `style-src 'self'` blocks
 * an inline attribute exactly as it blocks a `<style>` block, so the attribute
 * version renders nine invisible squares on the deployed page and looks
 * perfect everywhere the header is absent.
 */
.sw-blue {
  background: var(--folder-blue);
}

.sw-cyan {
  background: var(--folder-cyan);
}

.sw-green {
  background: var(--folder-green);
}

.sw-yellow {
  background: var(--folder-yellow);
}

.sw-orange {
  background: var(--folder-orange);
}

.sw-red {
  background: var(--folder-red);
}

.sw-pink {
  background: var(--folder-pink);
}

.sw-purple {
  background: var(--folder-purple);
}

.sw-grey {
  background: var(--folder-grey);
}

/* ── doors ───────────────────────────────────────────────────────────────── */

.door-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
}

.door-grid article {
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.door-grid code {
  overflow-wrap: anywhere;
}

/* Placed after `.doors p` so equal specificity resolves in its favour. */
.doors .links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
