/* ==========================================================================
   Laplace — the jserverhub design language
   Reference: Flytrap (technical, data-heavy control room) for type logic and
   pen-line drawings; julio-portfolio for Geist + JetBrains Mono. New palette:
   mango brand, warm beige paper, teal for data.

   Load order in the hub: Primer primitives/core/product -> app.css ->
   laplace-primer.css (generated colour layer) -> laplace-theme.css (this file).

   Neutrals carry a DELIBERATE warm beige cast (OKLCH hue 75, chroma 0.012):
   check with  python3 tools/palette.py check sites/laplace/laplace-theme.css --max-neutral-chroma 0.02
   Teal (--data) is a second hue on purpose, for charts and info only.
   ========================================================================== */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0E0A06;      /* L 0.148 */
  --surface: #16120D;     /* L 0.185 */
  --surface-2: #1F1B16;   /* L 0.225 */
  --line: #FFFFFF21;      /* white a0.13 */
  --line-soft: #FFFFFF14; /* white a0.08 */
  --ink: #EEE9E1;
  --ink-2: #9D9790;
  --on-ink: #0E0A06;      /* text on an --ink surface */
  --accent: #F2A03D;      /* mango, L 0.77: takes dark text */
  --fill: #F2A03D;
  --on-fill: #0E0A06;
  --data: #6AC6C5;        /* teal-11 dark */
  --ok: #6FDA75;
  --warn: #E3D04A;        /* yellow, kept clear of mango */
  --fail: #FF645F;
  --scrim: #000000CC;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --ground: #F8F2EB;    /* warm paper, L 0.964 */
    --surface: #EEE9E1;   /* L 0.936 */
    --surface-2: #E3DDD5; /* L 0.900 */
    --line: #00000024;
    --line-soft: #00000014;
    --ink: #15110C;
    --ink-2: #5F5A54;
    --on-ink: #F8F2EB;
    --accent: #8C5500;    /* mango darkened to pass on surface-2 */
    --fill: #8C5500;
    --on-fill: #FFFFFF;
    --data: #007373;      /* teal-11 light */
    --ok: #008020;
    --warn: #6E6400;
    --fail: #C2272D;
    --scrim: #00000080;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --ground: #F8F2EB;
  --surface: #EEE9E1;
  --surface-2: #E3DDD5;
  --line: #00000024;
  --line-soft: #00000014;
  --ink: #15110C;
  --ink-2: #5F5A54;
  --on-ink: #F8F2EB;
  --accent: #8C5500;
  --fill: #8C5500;
  --on-fill: #FFFFFF;
  --data: #007373;
  --ok: #008020;
  --warn: #6E6400;
  --fail: #C2272D;
  --scrim: #00000080;
}

/* Derived tints, computed from the tokens so both themes follow automatically. */
:root {
  --accent-soft: color-mix(in oklab, var(--accent) 13%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 38%, transparent);
  --data-soft: color-mix(in oklab, var(--data) 13%, transparent);
  --fill-hover: color-mix(in oklab, var(--fill) 86%, var(--ink));
  --glow: 0 0 0 1px var(--accent-line), 0 10px 32px -14px color-mix(in oklab, var(--accent) 45%, transparent);
}

/* ---------- type: three families ---------- */
:root {
  --font-display: "Instrument Serif", ui-serif, Georgia, serif;
  --font-text: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --fontStack-sansSerif: var(--font-text);
  --fontStack-monospace: var(--font-mono);
  --borderRadius-medium: 10px;
  --borderRadius-large: 16px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}
html, body { overflow-x: clip; } /* the orbit drawing bleeds past the edge on purpose; never scroll sideways */
body { font-family: var(--font-text); background: var(--ground); color: var(--ink); }
h1, .Subhead-heading, .page-head .Subhead-heading, .auth-title, .blankslate-heading, .app-dialog-title, .perf-hero-main {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em;
}
.page-head .Subhead-heading { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.05; }
.Subhead-heading .dim, .page-head .dim { color: var(--ink-2); }
.section-head h2, .Box-header .Box-title { font-family: var(--font-text); font-weight: 600; letter-spacing: -0.005em; }
code, kbd, pre, .meta, .tile-label, .bubble-meta, .log, .cell-key, .Counter { font-family: var(--font-mono); }
.tile-label, .field-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; color: var(--ink-2); }
::selection { background: var(--accent); color: var(--on-fill); }

/* ---------- shell ---------- */
.app-header, .app-nav { background: color-mix(in oklab, var(--ground) 86%, transparent); backdrop-filter: saturate(1.2) blur(12px); }
.app-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line-soft); }
.app-brand { font-family: var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; }
.app-mark {
  width: 26px; height: 26px; border-radius: 0; box-shadow: none; background: url("laplace-mark.svg") center / contain no-repeat;
}
.app-nav { border-bottom: 1px solid var(--line-soft); }
.UnderlineNav-item { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.UnderlineNav-item:hover { color: var(--ink); }
.UnderlineNav-item[aria-current]:not([aria-current="false"]), .UnderlineNav-item.selected { color: var(--ink); }
.UnderlineNav-item[aria-current]:not([aria-current="false"])::after, .UnderlineNav-item.selected::after { background: var(--accent) !important; }

/* ---------- buttons: pills ---------- */
.btn, .google-btn { border-radius: var(--radius-pill); font-weight: 500; transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--fill); color: var(--on-fill); border-color: transparent; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--fill-hover); }
.btn-primary .octicon { color: var(--on-fill); }
.btn-sm { padding-inline: 12px; }

/* ---------- tags: uppercase dot labels ---------- */
.Label { border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px 2px 7px; display: inline-flex; align-items: center; gap: 6px; }
.Label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- panels, tiles, cards ---------- */
.Box, .card, .tile, .service-card, .gate-card, .product-card, .job-card, .auth-card, .panel {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--borderRadius-large);
}
.Box-header { background: transparent; border-bottom-color: var(--line-soft); }
.Box-row { border-top-color: var(--line-soft); }
.tile-value, .hero-figure, .metric .num { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 3vw, 42px); line-height: 1; }
.service-card { transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out); }
.service-card:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--glow); }
.form-control { background: var(--ground); border-color: var(--line); border-radius: var(--borderRadius-medium); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.flash { border-radius: var(--borderRadius-medium); }

/* ---------- sign-in page: the orbit drawing behind the card ---------- */
.auth-wrap { position: relative; isolation: isolate; }
.auth-wrap::before {
  content: ""; position: absolute; inset: -10vmin; z-index: -1; opacity: 0.55;
  background: url("laplace-orbits.svg") center / min(120vmin, 1100px) no-repeat;
}
.auth-mark { width: 64px; height: 64px; border-radius: 0; box-shadow: none; background: url("laplace-mark.svg") center / contain no-repeat; }
.eyebrow { margin: 0 0 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

/* ---------- charts: teal leads ---------- */
:root { --series-1: var(--data); --series-2: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .service-card:hover { transform: none; }
}
