/* Statscraft website. Tokens follow the brand (planning/brand/tokens.css); fonts are self-hosted, SIL Open Font License. */
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin-wght.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --paper: #FFFFFF;
  --ink: #12191C;
  --muted: #55656A;
  --petrol: #0B4F5C;
  --petrol-strong: #083B45;
  --on-petrol: #FFFFFF;
  --amber: #D9942B;
  --amber-text: #8A5A12;
  --highlight: #FBEBD0;
  --tint: #EEF4F5;
  --rule: #DCE3E5;
  --rule-strong: #B9C6C9;
  --band: #0B4F5C;
  --on-band: #FFFFFF;
  --on-band-muted: #B7D3D8;
  --sc-logo-word: #0B4F5C;
  --sc-logo-dot: #D9942B;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --max: 70rem;
  --measure: 65ch;
  --radius-s: 6px;
  --radius-m: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0C1517; --ink: #E4EDEF; --muted: #93A9AE;
    --petrol: #5CC2D2; --petrol-strong: #8AD6E2; --on-petrol: #0C1517;
    --amber: #F0B54A; --amber-text: #F0B54A; --highlight: #3A2E14;
    --tint: #132024; --rule: #1F2D30; --rule-strong: #35484C;
    --band: #0F2A30; --on-band: #E4EDEF; --on-band-muted: #93A9AE;
    --sc-logo-word: #E4EDEF; --sc-logo-dot: #F0B54A;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--font); overflow-wrap: break-word; }
a { color: var(--petrol); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 1rem; z-index: 10; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px)); }
svg[aria-hidden] { flex: none; }

/* header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: block; line-height: 0; }
.brand svg { height: 34px; width: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.9375rem; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--rule-strong); }
.site-nav a[aria-current="page"] { color: var(--petrol); font-weight: 600; border-bottom-color: var(--petrol); }
.notice { background: var(--highlight); border-bottom: 1px solid var(--amber); }
.notice p { margin: 0 auto; padding-top: 0.6rem; padding-bottom: 0.6rem; font-weight: 600; }

/* type */
main { padding: 3rem 0 5rem; }
.hero-band + .wrap > .section:first-child { margin-top: 4rem; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.5rem); line-height: 1.04; font-weight: 700; margin: 0 0 1.25rem; max-width: 22ch; }
h1 em { font-style: normal; color: var(--petrol); }
h2 { font-size: clamp(1.5rem, 3vw, 1.75rem); font-weight: 700; margin: 3.5rem 0 1rem; }
h3, .h3 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; margin: 1.75rem 0 0.4rem; }
p, ul, ol { margin: 0 0 1rem; }
p, li { max-width: var(--measure); }
.lead { font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.45; color: var(--muted); max-width: 46rem; }
.label { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }
strong { font-weight: 600; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 0; }
.button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.15rem; border-radius: var(--radius-s); border: 1.5px solid var(--rule-strong); color: var(--ink); background: transparent; font: 600 0.9375rem/1 var(--font); text-decoration: none; }
.button:hover { border-color: var(--petrol); }
.button.primary { background: var(--petrol); border-color: var(--petrol); color: var(--on-petrol); }
.button.primary:hover { background: var(--petrol-strong); border-color: var(--petrol-strong); }
.button svg { width: 18px; height: 18px; }
.facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; padding: 0; margin: 1.25rem 0 0; font-size: 0.9375rem; color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: 0.4rem; }
.facts svg { width: 16px; height: 16px; color: var(--petrol); }

/* hero: a tinted band with the text and the signature */
.hero-band { margin-top: -3rem; }
.hero-band { background: var(--tint); border-bottom: 1px solid var(--rule); }
.hero { padding: 3.5rem 0 3rem; display: grid; gap: 2.5rem; }
.hero .flow { background: var(--paper); }
.flow-note { margin: -1.5rem 0 0; font-size: 0.875rem; color: var(--muted); max-width: none; }

/* section heads */
.section { margin-top: 5rem; }
.section-head { border-top: 2px solid var(--ink); padding-top: 1rem; margin-bottom: 1.75rem; }
.section-head h2 { margin: 0 0 0.5rem; }
.section-head p { color: var(--muted); margin: 0; }

/* the signature: ask, syntax, result */
.flow { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); grid-template-areas: "ask syntax" "result result"; border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; }
.step.ask-step { grid-area: ask; }
.step.syntax-step { grid-area: syntax; border-left: 1px solid var(--rule); }
.step.result-step { grid-area: result; border-top: 1px solid var(--rule); }
.step.syntax-step pre { margin: 0; }
.step { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.step .label { margin: 0; display: flex; gap: 0.5rem; }
.step .label b { color: var(--petrol); }
.ask { font-size: 1.25rem; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.step .who { font-size: 0.8125rem; color: var(--muted); margin: auto 0 0; }

/* code */
code, pre, kbd { font-family: var(--mono); font-size: 0.875em; }
code { background: var(--tint); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--tint); border-radius: var(--radius-s); padding: 1rem 1.1rem; overflow-x: auto; line-height: 1.65; margin: 0 0 1rem; font-size: 0.875rem; }
pre code { background: none; padding: 0; font-size: inherit; }
.k { color: var(--petrol); font-weight: 600; }
.s { color: var(--amber-text); }
.c { color: var(--muted); font-style: italic; }

/* result table */
.table-scroll { overflow-x: auto; min-width: 0; }
table.result { border-collapse: collapse; width: 100%; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
table.result caption { text-align: left; font-weight: 600; padding: 0 0 0.5rem; }
table.result th, table.result td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.result thead th { text-align: right; font-weight: 600; vertical-align: bottom; }
table.result thead th.corner { text-align: left; }
table.result thead th.span { text-align: center; border-bottom-color: var(--rule-strong); }
table.result thead tr.letters th { font-weight: 400; font-size: 0.75rem; color: var(--muted); }
table.result tbody th { text-align: left; font-weight: 400; }
table.result td { text-align: right; }
table.result td.sig { background: var(--highlight); }
table.result sup { font-size: 0.6875rem; font-weight: 700; margin-left: 1px; }
table.result tbody tr:last-child > * { border-bottom: 1px solid var(--ink); }

/* two ways of working */
.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
.way { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.way h3 { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.5rem; }
.way h3 svg, .ruled h3 svg, .downloads h2 svg { width: 22px; height: 22px; color: var(--petrol); }
.way ul { padding-left: 1.1rem; margin-bottom: 1.25rem; }
.way li { margin-bottom: 0.3rem; }

/* ruled list of strengths */
.ruled { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.5rem; list-style: none; padding: 0; margin: 0; }
.ruled li { border-top: 1px solid var(--rule); padding: 1.25rem 0 1.5rem; }
.ruled h3 { margin: 0 0 0.4rem; display: flex; gap: 0.6rem; align-items: center; }
.ruled p { margin: 0; color: var(--muted); }

/* status */
.two-col { display: grid; gap: 0 3rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checklist { list-style: none; padding: 0; }
.checklist li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 0.6rem; margin-bottom: 0.55rem; }
.checklist svg { width: 18px; height: 18px; margin-top: 0.25rem; color: var(--petrol); }
.checklist.later svg { color: var(--muted); }

/* call to action band */
.band { background: var(--band); color: var(--on-band); border-radius: var(--radius-m); padding: 2.5rem; margin-top: 5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.band h2 { margin: 0 0 0.35rem; color: var(--on-band); }
.band p { margin: 0; color: var(--on-band-muted); }
.band .actions { margin: 0; }
.band .button { color: var(--on-band); border-color: var(--on-band-muted); }
.band .button.primary { background: var(--amber); border-color: var(--amber); color: #12191C; }
.band .button.primary:hover { filter: brightness(1.08); }

/* download */
.release-info { border-left: 3px solid var(--amber); padding: 0.25rem 0 0.25rem 1rem; }
.downloads { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); padding: 0; list-style: none; margin: 2rem 0 1rem; }
.downloads .card { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.35rem; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.downloads h2 { margin: 0 0 0.25rem; display: flex; align-items: center; gap: 0.6rem; }
.downloads .card p { margin: 0; font-size: 0.9375rem; }
.downloads .card .button { align-self: flex-start; margin-top: auto; }
.downloads .card .file + .button, .downloads .card p:last-of-type + .button { margin-top: 0.75rem; }
.downloads .card .alt { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); }
.file { font-family: var(--mono); font-size: 0.8125rem !important; color: var(--muted); overflow-wrap: anywhere; }

/* footer */
.site-footer { border-top: 1px solid var(--rule); font-size: 0.9375rem; color: var(--muted); }
.site-footer .wrap { padding-top: 2rem; padding-bottom: 2.5rem; display: grid; gap: 0.75rem; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; font-size: 1.0625rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--ink); }
.site-footer p { margin: 0; max-width: none; }

@media (max-width: 860px) {
  .flow { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ask" "syntax" "result"; }
  .step.syntax-step { border-left: 0; border-top: 1px solid var(--rule); }
  .hero { padding: 2.5rem 0 2.5rem; }
  .ways, .two-col { grid-template-columns: minmax(0, 1fr); }
  .ruled { grid-template-columns: minmax(0, 1fr); }
  .band { padding: 1.75rem; }
}
@media (min-width: 861px) and (max-width: 1040px) { .ruled { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
