/* Doorstep brand: tokens, fonts and shared components for the landing page and the app.
   See design/DESIGN_SYSTEM.md. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #F6F7F2;
  --surface: #FFFFFF;
  --surface-2: #EAF1E8;
  --line: #E1E6DE;
  --line-strong: #C9D2C7;
  --ink: #171C19;
  --muted: #5B6960;
  --forest: #153E31;
  --forest-2: #1E5241;
  --forest-ink: #F6F7F2;
  --forest-muted: #A9C2B5;
  --lime: #B9F27C;
  --ok: #1E7A4C;
  --wait: #8A5D0B;
  --back: #A3412B;
  --link: #1E5E47;
  --focus: #1E5E47;
  --code-bg: #0F1F19;
  --code-ink: #E3EEE6;

  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media all { /* dark theme: chosen with the switch in the header (theme.js) */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0F1613;
    --surface: #16201B;
    --surface-2: #1C2822;
    --line: #2A3832;
    --line-strong: #3A4B43;
    --ink: #E9EFEA;
    --muted: #A3B1A8;
    --forest: #1A4A3A;
    --forest-2: #235C49;
    --ok: #5FCB8E;
    --wait: #E2B44F;
    --back: #E58A73;
    --link: #B9F27C;
    --focus: #B9F27C;
    --code-bg: #0A120F;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
code, .mono, pre { font-family: var(--mono); }
/* JetBrains Mono turns => and === into arrows; code must show what you type. */
code, .mono, pre, pre *, .addr, .m, .hash { font-variant-ligatures: none !important; }
code { font-size: .9em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo svg.tile { width: 32px; height: 32px; flex: none; }
.logo .word { font: 700 23px/1 var(--sans); letter-spacing: -0.02em; color: var(--forest); }
@media all { :root[data-theme="dark"] .logo .word { color: var(--ink); } }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  font: 600 15px/1.2 var(--sans); letter-spacing: -0.005em;
  border-radius: 10px; border: 1.5px solid var(--forest);
  background: var(--forest); color: var(--forest-ink);
  text-decoration: none; cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn:hover { background: var(--forest-2); border-color: var(--forest-2); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--ink); background: transparent; }
.btn.lime { background: var(--lime); border-color: var(--lime); color: #10241C; }
.btn.lime:hover { background: #CBF79A; border-color: #CBF79A; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
@media all {
  :root[data-theme="dark"] .btn:not(.secondary):not(.lime) { background: var(--lime); border-color: var(--lime); color: #10241C; }
  :root[data-theme="dark"] .btn:not(.secondary):not(.lime):hover { background: #CBF79A; border-color: #CBF79A; }
}

/* ------------------------------------------------------------------ status chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 13px/1 var(--sans); padding: 6px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); }
.chip.wait { color: var(--wait); }
.chip.back { color: var(--back); }
.chip.back::before { border-radius: 1px; transform: rotate(45deg); }
.chip.wait::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }

/* ------------------------------------------------------------------ site header (shared) */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .bar { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.site-nav .btn { margin-left: 10px; min-height: 40px; padding: 8px 16px; }
.menu-btn { display: none; min-height: 44px; min-width: 44px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 10px; font: 600 15px var(--sans); padding: 0 14px; cursor: pointer; }
@media (max-width: 880px) {
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; }
  .site-nav { position: absolute; top: 68px; left: 12px; right: 12px; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(15, 31, 25, .35); }
  .site-nav:not(.open) { display: none; }
  .site-nav a:not(.btn) { padding: 12px 14px; font-size: 16px; }
  .site-nav .btn { margin: 8px 0 2px; }
}

/* ------------------------------------------------------------------ site footer (shared) */
.site-footer { border-top: 1px solid var(--line); margin-top: 0; padding: 56px 0 64px; font-size: 15px; color: var(--muted); }
.site-footer .in { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.site-footer .cols { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .site-footer .cols > :first-child { grid-column: 1 / -1; } }
.site-footer h2 { font: 600 15px var(--sans); color: var(--ink); margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }

/* ------------------------------------------------------------------ theme switch */
.theme-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-btn:hover { border-color: var(--ink); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
.head-tools { display: flex; align-items: center; gap: 8px; }
