/* ScreenGecko "Aurora Glass" (Sam, 2026-10-09): the shared theme layer for the web console (/app/), the website and
   the Windows app's pages. Source of truth: docs/design/home-variants-2026-10-09/blend/tokens.md (+ system.css).
   apps/site/public/aurora.css is a copy (test: apps/site/test/theme.test.ts). Mood colors come from /brand.css
   (scripts/brand-assets.mjs). No inline styles anywhere (CSP); fonts are self-hosted in fonts/ (SIL OFL 1.1).
   Themes: html[data-theme="light" | "dark"], set before first paint by /theme-init.js (follows the system unless the
   Appearance button forces one). */

@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/AtkinsonHyperlegibleNext-Regular.ttf") format("truetype"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/AtkinsonHyperlegibleNext-Medium.ttf") format("truetype"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/AtkinsonHyperlegibleNext-Bold.ttf") format("truetype"); }
@font-face { font-family: "Unbounded"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/Unbounded-Medium.ttf") format("truetype"); }
@font-face { font-family: "Unbounded"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/Unbounded-SemiBold.ttf") format("truetype"); }

/* The sheen arc's start angle (hover/focus sweep on desktop). */
@property --sg-sweep { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

:root {
  /* Brand spectrum (logo #41), same in both themes */
  --sg-forest: #14532D; --sg-green: #1C9549; --sg-brand: #15803D; --sg-leaf: #8CC63F; --sg-lime: #B9E86F; --sg-sprout: #D8F59A;
  /* Jade: the Help Someone family (teal stays the Camera mood) */
  --sg-jade-deep: #0F5132; --sg-jade: #3FBF7F; --sg-jade-hi: #9BE8C0; --sg-jade-mist: #DDF7E7;
  /* Iridescent foil: decoration only, never text on it */
  --sg-foil-mint: #C9F7DB; --sg-foil-aqua: #9FE6DE; --sg-foil-sky: #B9E9F7; --sg-foil-lime: #E2F7A6; --sg-foil-gold: #FFE4A8;

  --sg-display: "Unbounded", "Segoe UI Variable Display", system-ui, sans-serif;
  --sg-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --sg-r-window: 30px; --sg-r-dock: 26px; --sg-r-card: 22px; --sg-r-control: 20px; --sg-r-digit: 18px; --sg-r-row: 18px; --sg-r-pill: 999px;
  --sg-ring-w: 2.5px;
  --sg-ease: cubic-bezier(.2, .7, .2, 1);
  --sg-t1: 120ms; --sg-t2: 180ms; --sg-t3: 300ms; --sg-t4: 600ms;
  --sg-danger-bg: #C62828; --sg-danger-fg: #FFFFFF;

  /* Light: daylight frost (the default before the theme script runs) */
  color-scheme: light;
  --sg-bg-top: #EEF4EE; --sg-bg-bottom: #E1EAE3;
  --sg-text: #10261B; --sg-muted: #43574C; --sg-muted-sky: #3B4F44; --sg-icon: #15803D;
  --sg-glass: rgba(255, 255, 255, .62); --sg-glass-quiet: rgba(255, 255, 255, .55); --sg-glass-solid: rgba(255, 255, 255, .92);
  --sg-line: rgba(255, 255, 255, .85); --sg-divider: rgba(16, 38, 27, .09); --sg-edge: rgba(16, 38, 27, .16);
  --sg-highlight: rgba(255, 255, 255, .95);
  --sg-primary-bg: #15803D; --sg-primary-fg: #FFFFFF;
  --sg-primary-shadow: 0 10px 22px -10px rgba(21, 128, 61, .75), inset 0 1px 0 rgba(255, 255, 255, .25);
  --sg-secondary-bg: rgba(28, 149, 73, .10); --sg-secondary-fg: #0E5E33; --sg-secondary-line: rgba(21, 128, 61, .45);
  --sg-badge-bg: rgba(21, 128, 61, .12); --sg-badge-fg: #0E5E33;
  --sg-link: #0E6B33;
  --sg-lift: 0 1px 1px rgba(16, 38, 27, .05), 0 12px 26px -12px rgba(21, 128, 61, .30), 0 34px 64px -30px rgba(16, 90, 70, .34);
  --sg-quiet-shadow: inset 0 1px 0 var(--sg-highlight), inset 0 0 0 1px rgba(255, 255, 255, .6), var(--sg-lift);
  --sg-ring-glow: 0; --sg-sheen-alpha: .75;
  --sg-aurora-a: #B7DE7E; --sg-aurora-b: #CDEFA6; --sg-aurora-c: #A6DDCB; --sg-aurora-d: #FFE3A6;
  --sg-aurora-opacity: .85; --sg-aurora-blend: multiply; --sg-ray: rgba(255, 255, 255, .16);
  --sg-warn-bg: rgba(255, 176, 46, .16); --sg-warn-line: rgba(180, 83, 9, .45); --sg-warn-fg: #6B3D00; --sg-warn-icon: #B45309;
  --sg-scrim: rgba(16, 38, 27, .38);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --sg-bg-top: #0C3532; --sg-bg-bottom: #051C22;
  --sg-text: #EEF7F0; --sg-muted: #B4CEC3; --sg-muted-sky: #D2E6DC; --sg-icon: #8CC63F;
  --sg-glass: rgba(7, 34, 36, .72); --sg-glass-quiet: rgba(255, 255, 255, .06); --sg-glass-solid: rgba(9, 38, 38, .94);
  --sg-line: rgba(255, 255, 255, .12); --sg-divider: rgba(255, 255, 255, .12); --sg-edge: rgba(255, 255, 255, .16);
  --sg-highlight: rgba(255, 255, 255, .10);
  --sg-primary-bg: linear-gradient(90deg, #B9E86F, #8CC63F); --sg-primary-fg: #0A2A12;
  --sg-primary-shadow: 0 8px 24px -10px rgba(140, 198, 63, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
  --sg-secondary-bg: rgba(63, 191, 127, .14); --sg-secondary-fg: #D3F6E2; --sg-secondary-line: rgba(155, 232, 192, .55);
  --sg-badge-bg: rgba(140, 198, 63, .20); --sg-badge-fg: #D7F2A9;
  --sg-link: #B9E86F;
  --sg-lift: none;
  --sg-quiet-shadow: inset 0 0 0 1px var(--sg-line);
  --sg-ring-glow: .55; --sg-sheen-alpha: 1;
  --sg-aurora-a: #1C9549; --sg-aurora-b: #8CC63F; --sg-aurora-c: #1FA58C; --sg-aurora-d: #2F7FC0;
  --sg-aurora-opacity: .5; --sg-aurora-blend: screen; --sg-ray: rgba(255, 255, 255, .022);
  --sg-warn-bg: rgba(255, 176, 46, .14); --sg-warn-line: rgba(255, 176, 46, .5); --sg-warn-fg: #FDE7A8; --sg-warn-icon: #FFB02E;
  --sg-scrim: rgba(2, 14, 16, .6);
}

/* ---------- Page base ---------- */
.sg-page { background: linear-gradient(180deg, var(--sg-bg-top), var(--sg-bg-bottom) 70%) fixed, var(--sg-bg-bottom); color: var(--sg-text);
  font-family: var(--sg-body); -webkit-font-smoothing: antialiased; }
.sg-display { font-family: var(--sg-display); font-weight: 600; letter-spacing: -.01em; }

/* ---------- Aurora sky (fixed behind everything; static frame of a slow loop) ---------- */
.sg-sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; overflow: clip; contain: paint; pointer-events: none; }
.sg-sky .b { position: absolute; border-radius: 50%; filter: blur(40px); mix-blend-mode: var(--sg-aurora-blend); opacity: var(--sg-aurora-opacity);
  animation: sg-drift-a 48s var(--sg-ease) infinite alternate; }
.sg-sky .b1 { width: 620px; height: 120px; left: -150px; top: 70px; background: var(--sg-aurora-a); transform: rotate(-17deg); }
.sg-sky .b2 { width: 520px; height: 70px; left: -60px; top: 170px; background: var(--sg-aurora-b); transform: rotate(-11deg); opacity: calc(var(--sg-aurora-opacity) * .7); animation-name: sg-drift-b; animation-duration: 56s; }
.sg-sky .b3 { width: 460px; height: 120px; left: 120px; top: -10px; background: var(--sg-aurora-c); transform: rotate(-25deg); opacity: calc(var(--sg-aurora-opacity) * .8); animation-name: sg-drift-c; animation-duration: 42s; }
.sg-sky .b4 { width: 300px; height: 70px; left: 170px; top: 250px; background: var(--sg-aurora-d); transform: rotate(-8deg); opacity: calc(var(--sg-aurora-opacity) * .45); animation-duration: 60s; animation-delay: -20s; }
.sg-sky .b5 { width: 420px; height: 140px; left: -80px; top: 560px; background: var(--sg-aurora-a); transform: rotate(12deg); opacity: calc(var(--sg-aurora-opacity) * .35); animation-name: sg-drift-b; animation-duration: 52s; animation-delay: -30s; }
.sg-sky .rays { position: absolute; inset: 0 0 40% 0;
  background: repeating-linear-gradient(97deg, transparent 0 26px, var(--sg-ray) 26px 34px, transparent 34px 61px);
  mask-image: linear-gradient(180deg, transparent, #000 25%, #000 55%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 55%, transparent);
  opacity: .77; animation: sg-breathe 12s ease-in-out infinite alternate; }
/* Task screens: the sky at 60 %. */
.sg-sky.quiet { opacity: .6; }
/* Desktop widths: the same five bands, drawn across the top of a big window, softer (the console is a work tool). */
@media (min-width: 900px) {
  .sg-sky { opacity: .78; }
  .sg-sky.quiet { opacity: .45; }
  .sg-sky .b { filter: blur(70px); }
  .sg-sky .b1 { width: 72vw; height: 230px; left: -12vw; top: 40px; }
  .sg-sky .b2 { width: 58vw; height: 120px; left: 6vw; top: 210px; }
  .sg-sky .b3 { width: 50vw; height: 220px; left: 40vw; top: -60px; }
  .sg-sky .b4 { width: 34vw; height: 120px; left: 58vw; top: 230px; }
  .sg-sky .b5 { width: 46vw; height: 220px; left: -10vw; top: auto; bottom: -60px; }
  .sg-sky .rays { inset: 0 0 55% 0; }
}
@keyframes sg-drift-a { from { translate: -24px 0; rotate: -3deg; } to { translate: 24px 10px; rotate: 3deg; } }
@keyframes sg-drift-b { from { translate: 20px -8px; rotate: 2deg; } to { translate: -24px 8px; rotate: -3deg; } }
@keyframes sg-drift-c { from { translate: 0 12px; rotate: -2deg; } to { translate: -20px -6px; rotate: 3deg; } }
@keyframes sg-breathe { from { opacity: .54; } to { opacity: 1; } }
/* The aurora pauses while a session is live (the mood bar must be the only thing moving). */
.sg-sky.paused .b, .sg-sky.paused .rays, body[data-mood] .sg-sky .b, body[data-mood] .sg-sky .rays,
body[data-view="live"] .sg-sky .b, body[data-view="live"] .sg-sky .rays { animation-play-state: paused; }

/* ---------- Wordmark: the real #41 artwork, light = logo.svg, dark = logo-night.svg ---------- */
.sg-wordmark { display: inline-flex; align-items: center; margin: 0; line-height: 0; flex: none; }
.sg-wordmark img { display: block; height: var(--sg-wordmark-h, 42px); width: auto; }
.sg-wordmark .logo-dark { display: none; }
html[data-theme="dark"] .sg-wordmark .logo-light { display: none; }
html[data-theme="dark"] .sg-wordmark .logo-dark { display: block; margin-left: calc(var(--sg-wordmark-h, 42px) * -.26); }

/* ---------- Glass window: spectrum ring + holographic sheen ---------- */
.sg-window { position: relative; display: block; border-radius: var(--sg-r-window); padding: var(--sg-ring-w); isolation: isolate; color: inherit; text-decoration: none; }
.sg-window, .sg-ringed {
  --ring: conic-gradient(from calc(230deg + var(--sg-sweep)), var(--sg-forest), var(--sg-green) 10%, var(--sg-leaf) 18%, var(--sg-foil-lime) 24%, var(--sg-foil-gold) 30%, #FFFFFF 33%, var(--sg-foil-mint) 37%, var(--sg-foil-aqua) 42%, var(--sg-foil-sky) 46%, var(--sg-leaf) 56%, var(--sg-green) 66%, var(--sg-foil-aqua) 74%, var(--sg-foil-lime) 77%, var(--sg-green) 82%, var(--sg-forest) 92%, var(--sg-forest)); }
.sg-window.give, .sg-ringed.give { --ring: conic-gradient(from calc(230deg + var(--sg-sweep)), var(--sg-jade-deep), var(--sg-green) 10%, var(--sg-jade) 18%, var(--sg-foil-mint) 24%, var(--sg-foil-sky) 30%, #FFFFFF 33%, var(--sg-foil-lime) 37%, var(--sg-foil-gold) 41%, var(--sg-foil-mint) 46%, var(--sg-jade) 56%, var(--sg-green) 66%, var(--sg-foil-sky) 74%, var(--sg-foil-mint) 77%, var(--sg-green) 82%, var(--sg-jade-deep) 92%, var(--sg-jade-deep)); }
html[data-theme="light"] .sg-window { --sg-ring-w: 2px; box-shadow: var(--sg-lift); }
html[data-theme="light"] .sg-window, html[data-theme="light"] .sg-ringed {
  --ring: conic-gradient(from calc(200deg + var(--sg-sweep)), rgba(255, 255, 255, .9), rgba(140, 198, 63, .55) 20%, var(--sg-foil-lime) 34%, var(--sg-foil-gold) 39%, var(--sg-foil-mint) 44%, var(--sg-foil-aqua) 48%, rgba(255, 255, 255, .95) 56%, rgba(140, 198, 63, .45) 80%, rgba(255, 255, 255, .9)); }
html[data-theme="light"] .sg-window.give, html[data-theme="light"] .sg-ringed.give {
  --ring: conic-gradient(from calc(200deg + var(--sg-sweep)), rgba(255, 255, 255, .9), rgba(63, 191, 127, .5) 20%, var(--sg-foil-mint) 34%, var(--sg-foil-sky) 39%, var(--sg-foil-lime) 44%, var(--sg-foil-mint) 48%, rgba(255, 255, 255, .95) 56%, rgba(63, 191, 127, .42) 80%, rgba(255, 255, 255, .9)); }
.sg-window::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: var(--ring); animation: sg-ring-in var(--sg-t4) var(--sg-ease) both; }
.sg-window::after { content: ""; position: absolute; inset: 8px; border-radius: inherit; z-index: -2; background: var(--ring); filter: blur(22px); opacity: var(--sg-ring-glow);
  animation: sg-glow-in var(--sg-t4) var(--sg-ease) both; }
.sg-window.give::before, .sg-window.give::after, .sg-window.later::before, .sg-window.later::after { animation-delay: var(--sg-t1); }
@keyframes sg-ring-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sg-glow-in { from { opacity: 0; } to { opacity: var(--sg-ring-glow); } }
/* No gyroscope on desktop: the sheen slowly sweeps round, only on the hovered or focused window. */
.sg-window:hover, .sg-window:focus-within, .sg-window:focus-visible, .sg-ringed:hover, .sg-ringed:focus-within { animation: sg-sweep 14s linear infinite; }
@keyframes sg-sweep { from { --sg-sweep: 0deg; } to { --sg-sweep: 360deg; } }
.sg-pane { position: relative; border-radius: calc(var(--sg-r-window) - 2px); background: var(--sg-glass);
  backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35); padding: 14px 18px; overflow: hidden; }
.sg-pane::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(201, 247, 219, .10), rgba(255, 228, 168, .06) 18%, transparent 38%); opacity: var(--sg-sheen-alpha); }
html[data-theme="light"] .sg-pane { box-shadow: inset 0 1px 0 var(--sg-highlight); }
html[data-theme="light"] .sg-pane::before { background: linear-gradient(115deg, rgba(226, 247, 166, .45), rgba(255, 228, 168, .25) 16%, rgba(185, 233, 247, .22) 28%, transparent 44%); }
.sg-pane > * { position: relative; }

/* One element with the ring drawn on its edge (no wrapper): the console's and the Get Help page's main panels.
   The glow is a colored shadow (dark) or the lift (light), so the glass stays readable. */
.sg-ringed { position: relative; isolation: isolate; box-shadow: 0 0 48px -14px rgba(140, 198, 63, .55), 0 34px 70px -34px rgba(0, 0, 0, .65); }
.sg-ringed.give { box-shadow: 0 0 48px -14px rgba(63, 191, 127, .5), 0 34px 70px -34px rgba(0, 0, 0, .65); }
html[data-theme="light"] .sg-ringed, html[data-theme="light"] .sg-ringed.give { --sg-ring-w: 2px; box-shadow: inset 0 1px 0 var(--sg-highlight), var(--sg-lift); }
.sg-ringed::before { content: ""; position: absolute; inset: 0; z-index: 0; padding: var(--sg-ring-w); border-radius: inherit; background: var(--ring); pointer-events: none;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  animation: sg-ring-in var(--sg-t4) var(--sg-ease) both; }
.sg-ringed::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(201, 247, 219, .10), rgba(255, 228, 168, .06) 18%, transparent 38%); opacity: var(--sg-sheen-alpha); }
html[data-theme="light"] .sg-ringed::after { background: linear-gradient(115deg, rgba(226, 247, 166, .45), rgba(255, 228, 168, .25) 16%, rgba(185, 233, 247, .22) 28%, transparent 44%); }
.sg-ringed > * { position: relative; z-index: 1; }

/* Orb (icon disc) */
.sg-orb { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #062019;
  background: radial-gradient(circle at 35% 30%, #E6FBB8, var(--sg-leaf) 45%, var(--sg-green) 100%); box-shadow: 0 0 26px rgba(140, 198, 63, .6); }
.sg-orb svg { width: 30px; height: 30px; }
.give .sg-orb, .sg-orb.give { background: radial-gradient(circle at 35% 30%, var(--sg-jade-mist), var(--sg-jade) 48%, var(--sg-green) 100%); box-shadow: 0 0 26px rgba(63, 191, 127, .55); }
html[data-theme="light"] .sg-orb { color: #fff; background: radial-gradient(circle at 34% 28%, #4CC274, var(--sg-green) 45%, var(--sg-brand) 100%); box-shadow: 0 10px 22px -8px rgba(21, 128, 61, .7); }
html[data-theme="light"] .give .sg-orb, html[data-theme="light"] .sg-orb.give { background: radial-gradient(circle at 34% 28%, #5ED39A, #23A060 45%, #0F6B3F 100%); box-shadow: 0 10px 22px -8px rgba(15, 81, 50, .6); }

/* ---------- Quiet glass (lists, cards, docks) ---------- */
.sg-quiet { background: var(--sg-glass-quiet); backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); box-shadow: var(--sg-quiet-shadow); }
.sg-badge { display: inline-block; white-space: nowrap; padding: 2px 10px; border-radius: 12px; background: var(--sg-badge-bg); color: var(--sg-badge-fg); font-weight: 700; }

/* ---------- Code digits (3 + 3, the next box wears the iridescent ring) ---------- */
.sg-digits { display: flex; align-items: center; justify-content: center; gap: 8px; }
.sg-digits .gap { width: 12px; flex: none; }
.sg-digit { position: relative; width: 48px; height: 66px; border-radius: var(--sg-r-digit); display: grid; place-items: center; flex: none;
  font: 700 34px/1 var(--sg-body); color: var(--sg-text); background: var(--sg-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 1.5px rgba(140, 198, 63, .6); }
html[data-theme="light"] .sg-digit { box-shadow: inset 0 1px 0 var(--sg-highlight), inset 0 0 0 1.5px rgba(21, 128, 61, .55), 0 8px 18px -12px rgba(16, 90, 70, .4); }
.sg-digit.empty { box-shadow: inset 0 0 0 1.5px var(--sg-line); }
html[data-theme="light"] .sg-digit.empty { box-shadow: inset 0 1px 0 var(--sg-highlight), inset 0 0 0 1.5px rgba(16, 38, 27, .16), 0 8px 18px -12px rgba(16, 90, 70, .4); }
.sg-digit.next { --next-fill: rgba(9, 44, 40, .95); border: 2.5px solid transparent;
  background: linear-gradient(var(--next-fill), var(--next-fill)) padding-box, conic-gradient(from 200deg, var(--sg-green), var(--sg-leaf) 25%, var(--sg-foil-lime) 34%, var(--sg-foil-gold) 40%, #FFFFFF 43%, var(--sg-foil-aqua) 47%, var(--sg-leaf) 58%, var(--sg-green)) border-box;
  box-shadow: 0 0 22px 2px rgba(140, 198, 63, .45); }
html[data-theme="light"] .sg-digit.next { --next-fill: rgba(255, 255, 255, .96); box-shadow: 0 0 0 4px rgba(140, 198, 63, .18), 0 10px 22px -10px rgba(21, 128, 61, .5); }

/* ---------- Mood pill (solid: mood colors never use glass or aurora) ---------- */
.sg-mood { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: var(--sg-r-pill); font-weight: 700;
  background: var(--mood-bg); color: var(--mood-fg); box-shadow: 0 0 0 1px color-mix(in srgb, var(--mood-fg) 18%, transparent), 0 8px 26px -6px color-mix(in srgb, var(--mood-bg) 75%, transparent); }

/* ---------- Motion rules ---------- */
@media (prefers-reduced-motion: reduce) {
  .sg-sky .b, .sg-sky .rays { animation: none; }
  .sg-window, .sg-window::before, .sg-window::after, .sg-ringed, .sg-ringed::before { animation: none; }
  .sg-window::after { opacity: var(--sg-ring-glow); }
}
