/* Design tokens: every colour, type, space, radius, shadow and motion value
   of the account pages (docs/design.md s15.2). app.css uses these and nothing
   else. Rebranding is a change to this file, the logo template and the font
   files, not to markup or components.

   The values are the Lumehold brand (Lamplight direction): warm ink-blue
   darks with amber light, and a warm paper light theme. Colours come in two
   sets, light here and dark in the media query below (dark is the preferred
   theme and is designed first; see docs/design.md s15.2). A
   Go test (tokens_test.go) checks the WCAG AA contrast of the text and
   background pairs in both sets, so a new brand colour that fails is caught. */

/* Self-hosted fonts (SIL OFL; see static/licences/NOTICE.md). Latin and Latin Extended
   subsets (the extended faces load only when a page needs such a letter), woff2, served from this origin under hashed URLs (CSP font-src 'self').
   Never load a font from a third party. swap shows the system fallback at once. */
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/literata-latin-600-normal.99284fd89c86.woff2") format("woff2");
  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: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/inter-latin-400-normal.8909904ab6c8.woff2") format("woff2");
  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: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/inter-latin-600-normal.f9a06e79cd3a.woff2") format("woff2");
  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: "Geist Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/geist-mono-latin-600-normal.8b111a81bab8.woff2") format("woff2");
  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: Literata;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/literata-latin-ext-600-normal.8f67d8ebdfa3.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/inter-latin-ext-400-normal.6744a7f509eb.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/inter-latin-ext-600-normal.e4bdf67b0cd1.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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;
}

:root {
  color-scheme: light dark;

  /* Colour: surfaces and text */
  --color-bg: #f8f4ec;
  --color-surface: #ffffff;
  --color-surface-2: #f1ebdf;
  --color-text: #1c2333;
  --color-text-muted: #5a6070;
  --color-border: #e3daca;
  --color-border-strong: #857d6e;
  --color-qr-bg: #ffffff; /* a QR code is always dark on white, in both schemes */
  --color-scrim: rgb(20 16 10 / 45%);

  /* Colour: primary (the main button: ink in light, amber in dark) */
  --color-primary: #1f2a44;
  --color-primary-hover: #2e3c5f;
  --color-on-primary: #fff8ec;

  /* Colour: accent (links, active tabs, icons: amber text) and states */
  /* Decorative glow or highlight: never used for text, so it needs no contrast. */
  --color-highlight: #e9a23b;
  --color-accent: #9a5a0c;
  --color-accent-hover: #7a4609;
  --color-on-accent: #fff8ec;
  --color-accent-soft: #fbebcc;
  --color-focus: #1f2a44;
  --color-danger: #b3261e;
  --color-on-danger: #ffffff;
  --color-danger-soft: #fbe9e6;
  --color-success: #2b7449; /* the guide's #2f7a4f is 4.40:1 on surface-2, below AA; this is 4.78:1 */
  --color-success-soft: #e3f3e8;
  --color-warning: #85560a;
  --color-warning-soft: #fbebcc;

  /* The Lit door mark: the door is always amber, the L ink (light) or cream (dark). */
  --color-mark-door: #e9a23b;
  --color-mark-l: #1f2a44;

  /* Lamplight, used sparingly: a faint amber glow at the top of the page and
     a soft amber shadow under the main button. Both are dark-theme only. */
  --glow-page: none;
  --glow-page-narrow: none;
  --shadow-primary: none;

  /* Kid avatars: the colours published in /static/avatars.json (a test keeps
     them equal), the same in light and dark. */
  --avatar-fox: #fbbf77;
  --avatar-owl: #c4b5fd;
  --avatar-whale: #93c5fd;
  --avatar-cat: #fde68a;
  --avatar-dog: #fdba74;
  --avatar-panda: #d1d5db;
  --avatar-frog: #86efac;
  --avatar-lion: #fcd34d;
  --avatar-tiger: #fb923c;
  --avatar-bear: #d6b38a;
  --avatar-bunny: #fbcfe8;
  --avatar-penguin: #bae6fd;
  --avatar-koala: #cbd5e1;
  --avatar-monkey: #e7c9a5;
  --avatar-unicorn: #f5d0fe;
  --avatar-dragon: #a7f3d0;
  --avatar-dino: #bef264;
  --avatar-octopus: #f9a8d4;
  --avatar-turtle: #6ee7b7;
  --avatar-butterfly: #a5b4fc;
  --avatar-bee: #fef08a;
  --avatar-robot: #bfdbfe;
  --avatar-rocket: #fecaca;
  --avatar-star: #fde047;
  --avatar-pig: #fecdd3;
  --avatar-hedgehog: #d6c4a8;
  --avatar-otter: #bfdbd0;
  --avatar-sloth: #d9c7a3;
  --avatar-flamingo: #fda4bf;
  --avatar-shark: #a5c8e4;
  --avatar-dolphin: #7dd3fc;
  --avatar-ladybug: #fca5a5;
  --avatar-cactus: #bbf7d0;
  --avatar-sunflower: #fcd9a0;
  --avatar-mushroom: #fecaca;
  --avatar-tree: #86efac;
  --avatar-taco: #fde68a;
  --avatar-pizza: #fdba74;
  --avatar-cupcake: #f5d0fe;
  --avatar-avocado: #d9f99d;
  --avatar-strawberry: #fda4af;
  --avatar-moon: #c7d2fe;
  --avatar-sun: #fef08a;
  --avatar-planet: #ddd6fe;
  --avatar-balloon: #fbcfe8;
  --avatar-guitar: #fcd34d;
  --avatar-smile: #fde047;
  --avatar-cool: #99f6e4;
  /* Type */
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Literata, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --text-xs: 0.78125rem;
  --text-sm: 0.875rem;
  --text-base: 1.03125rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.125rem;
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --weight-regular: 400;
  --weight-medium: 600; /* only 400 and 600 are shipped; 500 would silently render as 400 */
  --weight-semibold: 600;
  --weight-bold: 600; /* only 400 and 600 are shipped */
  --tracking-tight: -0.012em;

  /* Space (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 999px;

  /* Elevation */
  --shadow-1: 0 1px 2px rgb(40 28 10 / 6%), 0 1px 1px rgb(40 28 10 / 4%);
  --shadow-2: 0 4px 12px rgb(40 28 10 / 8%), 0 1px 3px rgb(40 28 10 / 6%);
  --shadow-3: 0 12px 32px rgb(40 28 10 / 14%), 0 2px 6px rgb(40 28 10 / 8%);

  /* Motion */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 360ms;
  --duration-pulse: 1800ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --content-max: 40rem;
  --auth-max: 28rem;
  --touch-min: 44px;
  --control-height: 3rem;
  --icon-size: 1.25rem;
  --gutter: 1rem;
}

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0d111a;
    --color-surface: #151b28;
    --color-surface-2: #1d2434;
    --color-text: #f4eee2;
    --color-text-muted: #a9b0bf;
    --color-border: #283147;
    --color-border-strong: #6c7791;
    --color-scrim: rgb(0 0 0 / 60%);
    --color-primary: #f2b655;
    --color-primary-hover: #f5c77e;
    --color-on-primary: #221706;
    --color-highlight: #f2b655;
    --color-accent: #f5c77e;
    --color-accent-hover: #fad9a0;
    --color-on-accent: #221706;
    --color-accent-soft: #2a2217;
    --color-focus: #f5c77e;
    --color-danger: #ff9a8c;
    --color-on-danger: #2c0905;
    --color-danger-soft: #3a1a18;
    --color-success: #7fd3a1;
    --color-success-soft: #14301f;
    --color-warning: #f2c14e;
    --color-warning-soft: #2a2217;
    --color-mark-door: #f2b655;
    --color-mark-l: #ede6d6;
    --glow-page: radial-gradient(48rem 22rem at 50% -6rem, rgb(242 182 85 / 13%), transparent 70%);
    --glow-page-narrow: radial-gradient(26rem 12rem at 50% -4rem, rgb(242 182 85 / 9%), transparent 70%);
    --shadow-primary: 0 6px 22px -8px rgb(242 182 85 / 45%);
    /* Dark mode layers with surface steps and a faint top edge, not shadows. */
    --shadow-1: inset 0 1px 0 rgb(255 255 255 / 4%);
    --shadow-2: inset 0 1px 0 rgb(255 255 255 / 6%), 0 0 0 1px rgb(255 255 255 / 3%);
    --shadow-3: inset 0 1px 0 rgb(255 255 255 / 8%), 0 8px 24px rgb(0 0 0 / 50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}
