/* The Nest — Calming Morning Sky design tokens. Every colour, type size, space, radius,
 * shadow and motion value the app uses is defined here and nowhere else. Stylesheets use
 * the role tokens (--bg, --ink, --accent, …), never a raw colour.
 *
 * The idea: a tranquil, luminous morning sky seen through a window, with the work in
 * front of it. Everything that holds words or controls is a solid, crisp surface (one
 * edge and one soft shadow, see "Surfaces" below) so the sky and its hawks pass behind
 * the interface and never through it. Horizon cerulean anchors actions and navigation,
 * honey sunlight marks Houston's milestones, and twilight indigo takes over after dark.
 */

/* ---------- Fonts (self-hosted; licences in public/licenses/) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url(/fonts/fraunces.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  src: url(/fonts/fraunces-ext.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url(/fonts/atkinson-next.woff2) format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url(/fonts/atkinson-next-ext.woff2) format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url(/fonts/atkinson-mono.woff2) format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;

  /* ---------- Palette: Pale Morning Sky, Cloud Mist, Horizon Blue & Soft Honey Sun ---------- */
  --navy-950: #0a1b2e;
  --navy-900: #122c46;   /* serene slate-navy ink */
  --navy-800: #174d80;   /* calm deep horizon blue */
  --navy-700: #1e5f99;
  --navy-600: #2b72b5;
  --navy-300: #a6cde9;
  --navy-100: #e3f1fd;

  --cerulean-600: #12538c;
  --cerulean-500: #186ab0;  /* luminous sky cerulean: primary action & active indicator */
  --cerulean-300: #7cbaf0;
  --cerulean-100: #e0f1ff;

  --sun-600: #cc8c14;
  --sun-500: #eeb640;       /* soft honey morning sunlight (decorative glow & milestones) */
  --sun-300: #f9d982;
  --sun-100: #fef3d2;
  --sun-50: #fffbf0;
  --sun-ink: #7b5000;

  /* Keep amber aliases synced for shared illustration tokens. */
  --amber-600: var(--sun-600);
  --amber-500: var(--sun-500);
  --amber-300: var(--sun-300);
  --amber-100: var(--sun-100);
  --amber-ink: var(--sun-ink);

  --cream-50: #ffffff;   /* pure cloud white */
  --cream-100: #f3f8fe;  /* feather-light pale sky canvas */
  --sand-100: #edf6fe;   /* soft morning hover mist */
  --sand-200: #e7f2fc;   /* whisper-pale sky table heads & wells */
  --sand-300: #d7e7f6;   /* delicate sky hairline */
  --sand-400: #b2d3ef;   /* calm breeze divider */
  --sand-600: #6485a8;   /* soft yet crisp 3:1+ control border */
  --umber-600: #425e7a;  /* serene muted slate (AA on every pale sky ground) */
  --umber-700: #485f76;
  --umber-800: #264666;
  --feather-500: #8f5b3a; /* warm cinnamon hawk feathers */
  --feather-700: #6f4226;

  --sky-50: #f7fbff;
  --sky-100: #eaf4fe;
  --sky-200: #d8ecfd;
  --sky-300: #b8dcfa;
  --sky-400: #8ac4f4;
  --sky-500: #4b9ee3;

  --moss-600: #1a6d4b;   /* calm sage-emerald: available & good fit */
  --moss-100: #e1f5ec;
  --slate-600: #4349a3;  /* soft serene periwinkle: on loan & easy read */
  --slate-100: #e9ebfc;
  --rust-600: #b32b3d;   /* gentle coral-rose: overdue & alerts */
  --rust-300: #f0b1ba;
  --rust-100: #fde7ea;
  --rust-50: #fff5f6;
  --berry-600: #7e348c;  /* soft orchid-plum: stretch read */
  --berry-100: #f5e6f8;

  /* ---------- Roles ---------- */
  --bg: var(--cream-100);            /* feather-light pale morning sky */
  --surface: var(--cream-50);        /* pure cloud-white floating cards */
  --surface-sunk: var(--sand-200);   /* whisper-soft sky wells & table heads */
  --surface-hover: var(--sand-100);  /* delicate cloud hover */
  --field: #ffffff;                  /* crisp inputs */
  --line: var(--sand-300);           /* airy sky hairlines inside a surface */
  --line-strong: var(--sand-600);    /* accessible 3:1+ borders */

  /* Surfaces: the one recipe for anything that holds words or controls. A solid ground
     (--surface), a crisp 1px edge (--edge) and one soft shadow (--shadow-1). Surfaces
     that can be pressed take --edge-hover and --shadow-2 on hover; surfaces nested inside
     another surface keep the edge and drop the shadow. */
  --edge: #c7daed;                   /* the outline of a card against the sky */
  --edge-hover: #94bce2;             /* the same outline under the pointer */
  --surface-quiet: #f7fbff;          /* a second, quieter plane inside a surface */
  --surface-sheen: #ffffff;          /* the lit top edge of a raised surface */
  --control-line: #a9bfd6;           /* inputs, buttons and chips at rest */
  --control-line-hover: var(--sand-600);
  --field-shade: #12406e0f;          /* the faint recess inside an input */
  --accent-sheen: #ffffff2e;         /* light along the top edge of the primary button */
  --sk-low: #e3eefa;                 /* loading outlines: a bar of text, at rest and lit */
  --sk-high: #f1f7fe;
  --sun-surface: var(--sun-50);      /* a fully grown Houston's card */
  --sun-edge: var(--sun-300);
  --sun-halo: #f9d98273;             /* the glow around a card whose Houston just grew */
  --gold-tint: var(--sun-100);       /* gold badges: "Fully grown!" */
  --gold-ink: var(--sun-ink);
  /* A soft halo of the ground colour behind words that sit on the open sky, so they stay
     easy to read when a cloud or a hawk drifts behind them. Invisible on clear sky. */
  --ground-halo: 0 0 2px var(--bg), 0 0 8px var(--bg), 0 0 16px var(--bg);

  --ink: var(--navy-900);            /* calm twilight-slate text */
  --ink-2: var(--umber-800);
  --muted: var(--umber-600);
  --brand: var(--navy-800);
  --brand-strong: #0f375e;
  --brand-mid: var(--navy-600);
  --brand-soft: var(--navy-100);

  --accent: var(--cerulean-500);     /* clear horizon cerulean: main action & active tab */
  --accent-strong: var(--cerulean-600);
  --accent-soft: var(--cerulean-100);
  --accent-ink: #13518a;
  --on-accent: #ffffff;              /* crisp white text on cerulean */
  --on-brand: #ffffff;

  /* Keyboard focus: horizon blue ring with a soft luminous sky halo. */
  --focus-ring: var(--cerulean-500);
  --focus-halo: #b8dcfa;

  /* The navigation rail: a solid pane of pale morning sky. */
  --rail-bg: #e6f2fc;
  --rail-bg-hover: #d8ebfa;
  --rail-bg-current: #ffffff;
  --rail-ink: #143454;
  --rail-muted: #3c5a78;
  --rail-line: #174d801a;
  --rail-edge: #c9dcee;              /* where the rail meets the sky */

  /* Toasts: one deep navy slab in both themes. */
  --toast-bg: #14304f;
  --toast-ink: #ffffff;
  --toast-line: #ffffff24;
  --toast-alert-bg: #9a2233;
  --scrim: #0c1a2e73;                /* behind a dialog */

  /* ---------- Status: serene pastel tints with AA contrast ---------- */
  --good: var(--moss-600);       --good-tint: var(--moss-100);
  --easy: var(--slate-600);      --easy-tint: var(--slate-100);
  --stretch: var(--berry-600);   --stretch-tint: var(--berry-100);
  --alert: var(--rust-600);      --alert-tint: var(--rust-100);
  --alert-line: var(--rust-300); --alert-wash: var(--rust-50);
  --none: var(--umber-700);      --none-tint: #ebf1f7;

  /* ---------- Type ---------- */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Atkinson Hyperlegible Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, Menlo, Consolas, monospace;

  --text-2xs: 0.75rem;     /* 12 */
  --text-xs: 0.8125rem;    /* 13 */
  --text-sm: 0.875rem;     /* 14 */
  --text-md: 1rem;         /* 16 */
  --text-lg: 1.125rem;     /* 18 */
  --text-xl: 1.3125rem;    /* 21 */
  --text-2xl: 1.625rem;    /* 26 */
  --text-3xl: 2.125rem;    /* 34 */
  --text-4xl: 2.75rem;     /* 44 */

  --leading-tight: 1.12;
  --leading-snug: 1.28;
  --leading-normal: 1.52;
  --tracking-display: -0.022em;
  --tracking-caps: 0.09em;

  /* ---------- Space (a 4px grid) ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---------- Shape: soft cloud-sculpted radii ---------- */
  --radius-xs: 8px;       /* small buttons, badges, rail links */
  --radius-sm: 10px;      /* controls: buttons, inputs */
  --radius-md: 14px;      /* cards and tiles */
  --radius-lg: 20px;      /* panels, dialogs */
  --radius-pill: 999px;

  /* ---------- Depth: three steps, each a tight contact shadow plus a soft ambient one ---------- */
  --shadow-0: 0 1px 2px #12406e0f;                                  /* controls */
  --shadow-1: 0 1px 2px #12406e0f, 0 4px 14px -6px #12406e24;       /* a surface at rest */
  --shadow-2: 0 2px 4px #12406e14, 0 14px 30px -14px #12406e3d;     /* raised: hover, sticky bars */
  --shadow-3: 0 8px 20px #0a1b2e1c, 0 36px 80px -24px #0a1b2e47;    /* over the page: dialogs */

  /* ---------- Motion: silky, effortless, calming transitions ---------- */
  --dur-1: 160ms;
  --dur-2: 210ms;
  --dur-3: 250ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-silk: cubic-bezier(0.37, 0, 0.63, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ---------- Layout ---------- */
  --tap: 44px;            /* the smallest touch target */
  --control: 44px;        /* buttons, inputs, selects, toolbar toggles: one height */
  --control-sm: 36px;     /* small buttons and filter chips (--tap on touch screens) */
  --rail: 248px;
  --rail-compact: 84px;
  --page: 1260px;

  /* ---------- Pictures: pale sunlit sky backdrop kept in both themes ---------- */
  --spot-sky: #d6ecfd;
  --spot-sand: #b8e1cf;
  --spot-straw: #f3dfb7;
  --spot-cream: #ffffff;
  --spot-navy: #174d80;
  --hawk-disc: radial-gradient(circle at 50% 30%, #fffdf2 0%, #e1f2ff 54%, #c4e4fc 100%);
  /* The frame behind one of Houston's pictures: a small window of sky, by day or by night. */
  --hawk-well: linear-gradient(180deg, #f4faff 0%, #dcedfc 100%);
  --hawk-well-edge: #b9d6f0;
  --hawk-well-sun: linear-gradient(180deg, #fffbee 0%, #fbe9b4 100%);
  --hawk-well-sun-edge: #ecc866;

  /* ---------- Compatibility aliases used by nest.css and screen stylesheets ---------- */
  --paper: var(--bg);
  --cream: var(--sand-200);
  --cream-soft: var(--sand-100);
  --straw: #ecd8b3;
  --straw-light: #f6ead2;
  --twig: var(--feather-500);
  --twig-dark: var(--feather-700);
  --brand-dark: var(--brand-strong);
  --brand-tint: var(--brand-soft);
  --brand-bright: var(--brand-mid);
  --outline: #231812;
  --sky-high: var(--sky-400);
  --sky: var(--sky-300);
  --sky-low: var(--sky-100);
  --sky-deep: var(--sky-500);
  --sky-edge: #9cc6ea;
  --sky-ink: var(--brand);
  --sky-muted: var(--muted);
  --radius: var(--radius-md);
  --radius-small: var(--radius-sm);
  --shadow: var(--shadow-1);
  --font: var(--font-ui);
}

/* ---------- Starry Twilight Sky: calm, velvety indigo after dark ---------- */
:root[data-theme="night"] {
  color-scheme: dark;

  --bg: #0c1a2e;
  --surface: #132640;
  --surface-sunk: #0f2036;
  --surface-hover: #193254;
  --field: #0f2036;
  --line: #254163;
  --line-strong: #7899bd;
  --edge: #2e4d75;
  --edge-hover: #4d7bb0;
  --surface-quiet: #10213a;
  --surface-sheen: #ffffff0f;
  --control-line: #456a94;
  --control-line-hover: #7899bd;
  --field-shade: #00000038;
  --accent-sheen: #ffffff66;
  --sk-low: #152a45;
  --sk-high: #1c3556;
  --sun-surface: #231f13;
  --sun-edge: #6b5320;
  --sun-halo: #eeb64047;
  --gold-tint: #3b2d10;
  --gold-ink: #f9d982;

  --ink: #edf5ff;
  --ink-2: #d3e5f8;
  --muted: #a6c4e2;
  --brand: #90ccfc;
  --brand-strong: #ffffff;
  --brand-mid: #6ab7f7;
  --brand-soft: #183559;

  --accent: #82c5fc;
  --accent-strong: #61b4fa;
  --accent-soft: #183559;
  --accent-ink: #9ad2ff;
  --on-accent: #0c1a2e;
  --on-brand: #0c1a2e;

  --focus-ring: #82c5fc;
  --focus-halo: #0c1a2e;

  --rail-bg: #0a1628;
  --rail-bg-hover: #132947;
  --rail-bg-current: #1b3860;
  --rail-ink: #edf5ff;
  --rail-muted: #a6c8ea;
  --rail-line: #ffffff1a;
  --rail-edge: #1c3353;

  --toast-bg: #20426d;
  --toast-line: #ffffff2e;
  --toast-alert-bg: #8a2334;
  --scrim: #040b16a6;

  --hawk-well: radial-gradient(circle at 50% 40%, #3d6997 0%, #2a5180 46%, #1b3a5f 100%);
  --hawk-well-edge: #416b9c;
  --hawk-well-sun: radial-gradient(circle at 50% 40%, #8a6a26 0%, #5e4819 46%, #3a2d10 100%);
  --hawk-well-sun-edge: #9c7a28;

  --good: #82e0b4;      --good-tint: #123828;
  --easy: #b0b8ff;      --easy-tint: #1d2252;
  --stretch: #e8aef5;   --stretch-tint: #371942;
  --alert: #ffa1ad;     --alert-tint: #471720;
  --alert-line: #8f3545; --alert-wash: #2b1218;
  --none: #c4d5e8;      --none-tint: #21334a;

  --sky-50: #11243d;
  --sky-100: #122845;
  --sky-200: #173357;
  --sky-300: #1e426e;
  --sky-400: #275387;
  --sky-500: #3469a6;
  --sand-100: #152b47;
  --sand-200: #183152;
  --sand-300: #254163;
  --sand-400: #395c85;

  --shadow-0: 0 1px 2px #00000040;
  --shadow-1: 0 1px 2px #00000047, 0 6px 16px -8px #00000080;
  --shadow-2: 0 2px 6px #00000059, 0 16px 34px -14px #000000a6;
  --shadow-3: 0 10px 24px #00000070, 0 36px 80px -24px #000000d9;
}
