/* The dashboard's shared ground: fonts, tokens, the header band, and the
   controls every page uses. Loaded by the sign-in and setup pages and by
   the dashboard itself, so all three are one design.

   The world: a post room. Post yellow carries the shell, ink sits on a cool
   paper white, airmail red marks what waits on you and airmail blue what is
   working. Flat colour and hairline rules; no gradients, glass or glow. */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/barlow-400-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/barlow-400-latin.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: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/barlow-500-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/barlow-500-latin.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: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/barlow-600-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/barlow-600-latin.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;
}

:root {
  color-scheme: light dark;

  /* Ground and ink */
  --paper: oklch(97.6% 0.004 250);
  --surface: oklch(99.7% 0.002 250);
  --sunk: oklch(94.6% 0.006 250);
  --ink: oklch(22% 0.016 260);
  --ink-2: oklch(43% 0.018 260);
  --rule: oklch(88.5% 0.008 260);
  --rule-strong: oklch(60% 0.014 260);

  /* The shell: post yellow, with ink tinted from its own hue */
  --post: oklch(86.5% 0.172 91);
  --post-ink: oklch(21% 0.03 80);
  --post-ink-2: oklch(34% 0.05 80);
  --live-dot: oklch(44% 0.16 262);

  /* Airmail red: waiting on you. Airmail blue: working. */
  --red: oklch(52% 0.2 27);
  --red-on: oklch(99% 0.005 27);
  --red-text: oklch(47% 0.18 27);
  --red-soft: oklch(95.5% 0.025 27);
  --blue: oklch(45% 0.15 262);
  --blue-text: oklch(44% 0.15 262);
  --blue-soft: oklch(95% 0.024 262);
  --green-text: oklch(44% 0.11 150);
  --green-soft: oklch(95% 0.03 150);
  --quiet-soft: oklch(93% 0.006 260);

  --focus: oklch(48% 0.17 262);
  --selection: oklch(88% 0.12 92);

  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* One type scale, about 1.2 apart. */
  --t-xs: 0.8125rem;  /* 13 */
  --t-s: 0.9375rem;   /* 15 */
  --t-m: 1rem;        /* 16 */
  --t-l: 1.1875rem;   /* 19 */
  --t-xl: 1.4375rem;  /* 23 */
  --t-2xl: 1.75rem;   /* 28 */
  --t-3xl: 2.5rem;    /* 40, the one big number */

  --r-s: 4px;
  --r: 6px;
  --r-l: 10px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --tap: 44px;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(17% 0.012 260);
    --surface: oklch(21% 0.014 260);
    --sunk: oklch(14.5% 0.01 260);
    --ink: oklch(94% 0.006 260);
    --ink-2: oklch(74% 0.014 260);
    --rule: oklch(30% 0.014 260);
    --rule-strong: oklch(55% 0.016 260);

    --post: oklch(84% 0.165 90);

    --red: oklch(64% 0.19 27);
    --red-on: oklch(16% 0.03 27);
    --red-text: oklch(76% 0.13 27);
    --red-soft: oklch(27% 0.07 27);
    --blue: oklch(70% 0.13 258);
    --blue-text: oklch(79% 0.1 258);
    --blue-soft: oklch(27% 0.06 262);
    --green-text: oklch(79% 0.12 150);
    --green-soft: oklch(26% 0.05 150);
    --quiet-soft: oklch(27% 0.012 260);

    --focus: oklch(80% 0.12 258);
    --selection: oklch(45% 0.1 92);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--rule-strong) transparent;
}
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-m);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--blue);
}
::selection { background: var(--selection); color: var(--ink); }

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
code, .mono {
  font-family: var(--mono);
  font-size: 0.875em;
}
code {
  padding: 1px 5px;
  border-radius: var(--r-s);
  background: var(--sunk);
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The header band: post yellow, on every page. */
.band {
  background: var(--post);
  color: var(--post-ink);
  padding-top: env(safe-area-inset-top);
}
.band-inner {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 56px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(var(--s4), env(safe-area-inset-right)) 0 max(var(--s4), env(safe-area-inset-left));
}
.wordmark {
  font-size: var(--t-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--post-ink);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
.band :focus-visible { outline-color: var(--post-ink); }

/* Buttons: one solid, one quiet. */
button, .button {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--tap);
  padding: 0 var(--s4);
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition-property: transform, background-color, border-color;
  transition-duration: 140ms;
  transition-timing-function: var(--ease-out);
}
button:active, .button:active { transform: scale(0.96); }
button:disabled { opacity: 0.55; cursor: default; transform: none; }
@media (hover: hover) {
  button:hover, .button:hover { background: color-mix(in oklch, var(--ink) 86%, var(--paper)); }
}

.quiet {
  background: transparent;
  color: inherit;
  border-color: var(--rule-strong);
  font-weight: 500;
}
@media (hover: hover) {
  .quiet:hover { background: var(--sunk); }
}

input {
  font: inherit;
  min-height: var(--tap);
  width: 100%;
  padding: 0 var(--s3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
}
input::placeholder { color: var(--ink-2); }

.notice {
  padding: var(--s3) var(--s4);
  border-radius: var(--r);
  border: 1px solid currentColor;
  font-size: var(--t-s);
}
.notice-error { background: var(--red-soft); color: var(--red-text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
  button:active, .button:active { transform: none; }
}
