/* ==========================================================================
   AI Hub design tokens: the one place every colour, size and motion comes
   from. Loaded before every other style sheet.

   The look is "Nothing" (approved by Ben, 31 Oct 2026; spec in
   design/nothing-look.html): a black ground, tight dark tiles with 12 px
   corners and 4 px gaps, white text, grey second lines, a light serif for
   page titles and round-dot figures. One red (--nx-red) is used only for the
   one action on a screen and for "needs you" dots.

   Dark only for now: Settings › Appearance does not switch this look to
   light (there is one palette block, and nothing reads :root[data-theme]).
   The older names (--sky, --sea, --sun, ...) point at the Nothing palette,
   so every screen takes it until its own phase redraws it.
   ========================================================================== */

/* Fonts: Geist for text, Newsreader (300) for page titles, Doto for big
   figures (variable in weight and ROND, the dot roundness). All SIL Open Font
   License 1.1 (fonts/NOTICE-nothing-look.txt), self-hosted: the CSP allows no
   outside fonts. */
@font-face { font-family: "Geist"; src: url("/fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Doto"; src: url("/fonts/doto-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;

  /* ---- Palette: the Nothing look ----------------------------------------- */
  --nx-ground: #000000;      /* the page */
  --nx-tile: #1C1C1E;        /* tiles, groups and the ask bar */
  --nx-line: #2C2C2E;        /* lines between rows; a quiet pill */
  --nx-off: #3A3A3C;         /* an unlit dot; a quiet outline */
  --nx-ink: #FFFFFF;         /* text */
  --nx-muted: #8E8E93;       /* second lines and the date */
  --nx-quiet: #6E6E73;       /* resting names in the bottom bar; chevrons */
  --nx-red: #D71921;         /* the one action and "needs you" dots, nothing else */
  --nx-r: 12px;              /* a tile's corners */
  --nx-gap: 4px;             /* between tiles */
  --nx-bar-h: 64px;          /* the bottom bar on a phone */

  /* The older names, on the Nothing palette. */
  --sky-top: var(--nx-ground);
  --sky: var(--nx-ground);
  --sea: var(--nx-ground);
  --sea2: var(--nx-ground);
  --surface: var(--nx-tile);
  --raise: var(--nx-tile);
  --disc: var(--nx-tile);
  --p-work: var(--nx-tile);
  --p-life: var(--nx-tile);
  --p-sean: var(--nx-tile);
  --grain: 0;                /* no paper tooth in this look */
  --ink: var(--nx-ink);
  --ink2: #AEAEB2;
  --ink3: var(--nx-muted);
  --chev-down: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M7 10l5 5 5-5'/></svg>"); /* a select's arrow in --ink3 */
  --hair: var(--nx-line);
  --hair2: rgba(255, 255, 255, .06);
  --hair3: var(--nx-off);
  --live: var(--nx-ink);     /* running, done, fine: white dots */
  --live-soft: rgba(255, 255, 255, .10);
  --sun: var(--nx-red);      /* needs you, and only that */
  --sun-soft: rgba(215, 25, 33, .22);
  --sun-halo: rgba(215, 25, 33, .10);
  --alarm: var(--nx-red);    /* something broke: used sparingly */
  --alarm-soft: rgba(215, 25, 33, .14);
  --btn: var(--nx-ink);      /* a filled button: white, like the mic */
  --btn-ink: var(--nx-ground);
  --scrim: rgba(0, 0, 0, .6);
  --shade: rgba(0, 0, 0, .6);
  --shadow: 0 18px 48px rgba(0, 0, 0, .6);
  --shadow-soft: none;
  /* A provider's small light: white to grey, never a colour (only red means something). */
  --provider-claude: var(--nx-ink);
  --provider-ollama: #AEAEB2;
  --provider-opencode: var(--nx-muted);
  --provider-codex: var(--nx-quiet);
  --focus: rgba(255, 255, 255, .6);

  /* Photos, video, the remote screen and the voice call: the same black,
     tiles and white as everything else; ending a call is the one red. */
  --media-bg: var(--nx-ground);
  --media-scrim: rgba(0, 0, 0, .55);
  --call-bg: var(--nx-ground);
  --call-text: var(--nx-ink);
  --call-muted: var(--nx-muted);
  --call-soft: #AEAEB2;
  --call-line: var(--nx-line);
  --call-raised: var(--nx-tile);
  --call-control: var(--nx-tile);
  --call-light: var(--nx-ink);
  --call-ink: var(--nx-ground);
  --call-live: var(--nx-ink);
  --call-live-ring: rgba(255, 255, 255, .2);
  --call-live-glow: rgba(255, 255, 255, .6);
  --call-live-ink: var(--nx-ground);
  --call-end: var(--nx-red);
  --call-ring-1: rgba(255, 255, 255, .14);
  --call-ring-2: rgba(255, 255, 255, .24);
  --call-ring-3: rgba(255, 255, 255, .13);
  --white: #FFFFFF;
  --shade-5: rgba(0, 0, 0, .15);
  --shade-20: rgba(0, 0, 0, .2);
  --shade-25: rgba(0, 0, 0, .27);
  --shade-30: rgba(0, 0, 0, .33);
  --shade-40: rgba(0, 0, 0, .4);
  --shade-50: rgba(0, 0, 0, .53);

  /* ---- Type -------------------------------------------------------------- */
  --font-sans: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-title: "Newsreader", Georgia, "Times New Roman", serif;   /* page titles, weight 300 */
  --font-dot: "Doto", ui-monospace, monospace;                    /* big figures, round dots */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-17: 17px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-27: 27px;           /* the sentence on detail levels */
  --fs-sentence: 30px;     /* the sentence that opens each place */
  --fs-big: 44px;          /* big numbers */
  --lh-sentence: 1.2;
  --lh-body: 1.45;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-strong: 500;
  --track-tight: -.012em;

  /* ---- Space ------------------------------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --pad: 20px;             /* side padding */
  --gutter: 16px;
  --time-g: 64px;          /* the time gutter left of every row */
  --top-h: 60px;           /* the top bar */
  --tap: 44px;
  --header-h: 52px;
  --rail-w: 284px;
  --panel-w: min(468px, 38vw);
  --sidebar-width: var(--rail-w);
  --chat-max: 760px;
  --col-max: 720px;        /* deeper levels on a desktop */
  --icon: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* ---- Shape: tiles on black; depth comes from tone, not shadow ---------- */
  --r-8: 8px;
  --r-12: 12px;
  --r-block: var(--nx-r);
  --r-btn: 24px;
  --r-sheet: 20px;
  --r-pill: 999px;
  /* The group surfaces every screen shares (named "bubble" by the look
     before): now a flat dark tile with 12 px corners. */
  --bubble-bg: var(--surface);
  --bubble-shadow: none;
  --bubble-r: var(--r-block);
  --fold-r: var(--r-12);
  /* Home's pebbles: each place has its own organic shape. */
  --r-pebble-work: 57% 43% 52% 48% / 51% 45% 55% 49%;
  --r-pebble-life: 45% 55% 44% 56% / 55% 48% 52% 45%;
  --r-pebble-sean: 52% 48% 50% 50% / 46% 53% 47% 54%;
  --r-pebble-moon: 58% 42% 52% 48% / 50% 54% 46% 50%;

  /* ---- Motion ------------------------------------------------------------ */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-zoom: 660ms;         /* a level grows from the tapped point */
  --t-fade: 500ms;
  --t-sheet: 560ms;
  --t-quick: 200ms;
  --breathe: 2.8s;         /* live dots */
  --bob: 5s;               /* the needs-you buoy */
  --shimmer: 9s;           /* the now line */
  --drift: 11s;            /* the place bodies on Home */
  --morph: 15s;            /* the pebbles slowly change shape */
  --rise: 6s;              /* the sun on Home's horizon */

  /* ---- Older names, kept so every screen takes the palette above --------- */
  --bg: var(--sky);
  --side: var(--sea);
  --surface-strong: var(--sea);
  --hover: var(--hair2);
  --text: var(--ink);
  --text-2: var(--ink2);
  --muted: var(--ink3);
  --faint: var(--ink3);
  --line: var(--hair);
  --line-strong: var(--hair3);
  --accent: var(--btn);
  --on-accent: var(--btn-ink);
  --danger: var(--alarm);
  --on-danger: #FFFFFF;      /* white words on the red */
  --warning: var(--sun);
  --success: var(--live);
  --run: var(--live);
  --run-bg: var(--live-soft);
  --need: var(--sun);
  --need-bg: var(--sun-soft);
  --ok: var(--live);
  --ok-bg: var(--live-soft);
  --fail: var(--alarm);
  --fail-bg: var(--alarm-soft);
  --off: var(--ink3);
  --off-bg: var(--hair2);
  --violet: var(--ink2);
  --panel: var(--surface);
  --surface-2: var(--sea);

  font-family: var(--font-sans);
}

/* Phones: every tap target is at least 48px. */
@media (pointer: coarse) { :root { --tap: 48px; } }
/* Desktop: a wider gutter, a taller top bar and a larger sentence. */
@media (min-width: 1100px) {
  :root { --time-g: 72px; --top-h: 72px; --fs-sentence: 34px; --fs-27: 32px; }
}
/* Reduced motion stops every drift, breath and zoom. */
@media (prefers-reduced-motion: reduce) {
  :root { --t-zoom: 1ms; --t-fade: 1ms; --t-sheet: 1ms; --t-quick: 1ms; }
}
