/* Leakturn design tokens. One file, every page.
   World: pressure-tested pipework and inspection instruments. Warm paper sheets for reading,
   a near-black instrument stage for the 3D and live data. One signal colour, and it only ever means "leak". */

@font-face { font-family: 'Geist'; src: url(fonts/geist-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap;
  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'; src: url(fonts/geist-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap;
  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: 'Geist Mono'; src: url(fonts/geist-mono-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* paper: reading surfaces */
  --paper: #f5f4f0;
  --paper-2: #edece6;
  --paper-3: #e3e1d9;
  --ink: #121211;
  --ink-2: #4f4e49;   /* secondary text, 8.4:1 on paper */
  --ink-3: #6b6963;   /* muted, meta, 4.99:1 on paper, 4.64:1 on paper-2 */
  --line: rgb(18 18 17 / .1);
  --line-2: rgb(18 18 17 / .18);

  /* night: the instrument stage */
  --night: #0b0c0e;
  --night-2: #121316;
  --night-3: #1a1b1f;
  --fog: #f2f1ec;
  --fog-2: rgb(242 241 236 / .66);
  --fog-3: rgb(242 241 236 / .52);
  --line-d: rgb(242 241 236 / .1);
  --line-d2: rgb(242 241 236 / .18);

  /* signal: leaks only. On paper use --signal-ink for text (5.0:1). */
  --signal: #ff5b1f;
  --signal-ink: #c23a05;
  --signal-soft: rgb(255 91 31 / .12);
  /* status, toned to sit inside the palette */
  --ok: #2f7a4d;
  --ok-d: #6fcf97;
  --warn: #86590c; /* 5.3:1 on paper, also on the tinted open-leak rows */
  --warn-d: #e9b85c;

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* type scale */
  --t-display: clamp(46px, 7.4vw, 116px);
  --t-h1: clamp(40px, 5.6vw, 84px);
  --t-h2: clamp(34px, 4.4vw, 64px);
  --t-h3: clamp(21px, 1.9vw, 27px);
  --t-lede: clamp(17px, 1.35vw, 20px);
  --t-body: 16px;
  --t-small: 14px;
  --t-meta: 12px;

  /* space: 4px grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px; --s32: 128px;
  --gutter: clamp(20px, 4vw, 64px);
  --max: 1320px;
  --section: clamp(96px, 12vw, 176px);

  /* radius: controls 10, cards 16, panels 20, actions are pills */
  --r-ctl: 10px; --r-card: 16px; --r-panel: 20px; --r-pill: 999px;

  /* motion: one curve for entrances, one for state */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-state: cubic-bezier(.4, 0, .2, 1);
  --d-fast: 160ms; --d-mid: 260ms; --d-slow: 700ms;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; font: 400 var(--t-body)/1.55 var(--sans); font-feature-settings: 'ss01', 'cv11'; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; text-rendering: optimizeLegibility; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgb(255 91 31 / .28); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.night :focus-visible { outline-color: var(--fog); }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; text-decoration-color: var(--line-2); transition: text-decoration-color var(--d-fast) var(--ease-state); }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0; font-weight: 460; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: var(--t-meta); letter-spacing: 0; }

/* dark sheet: any element with .night flips the roles */
.night { background: var(--night); color: var(--fog); --line: var(--line-d); --line-2: var(--line-d2); --ink: var(--fog); --ink-2: var(--fog-2); --ink-3: var(--fog-3); --signal-ink: var(--signal); --ok: var(--ok-d); --warn: var(--warn-d); color-scheme: dark; }

/* type roles */
.t-display { font-size: var(--t-display); line-height: .94; letter-spacing: -.048em; font-weight: 460; }
.t-h1 { font-size: var(--t-h1); line-height: .98; letter-spacing: -.044em; font-weight: 460; }
.t-h2 { font-size: var(--t-h2); line-height: 1; letter-spacing: -.04em; font-weight: 460; }
.t-h3 { font-size: var(--t-h3); line-height: 1.18; letter-spacing: -.02em; font-weight: 500; }
.t-lede { font-size: var(--t-lede); line-height: 1.5; color: var(--ink-2); letter-spacing: -.008em; }
.t-meta { font: 400 var(--t-meta)/1.4 var(--mono); color: var(--ink-3); }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }

/* buttons: primary is solid ink on paper and fog on night; secondary is a hairline pill */
.btn { --bg: var(--ink); --fg: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 20px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--bg); color: var(--fg); font: 500 15px/1 var(--sans); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--d-fast) var(--ease-state), color var(--d-fast) var(--ease-state), border-color var(--d-fast) var(--ease-state), transform var(--d-fast) var(--ease-state); }
.btn:hover { --bg: #2a2a28; }
.btn:active { transform: scale(.97); }
.night .btn { --bg: var(--fog); --fg: var(--night); }
.night .btn:hover { --bg: #ffffff; }
.btn-line { --bg: transparent; --fg: var(--ink); border-color: var(--line-2); }
.btn-line:hover { --bg: transparent; border-color: var(--ink); }
.night .btn-line { --bg: transparent; --fg: var(--fog); border-color: var(--line-d2); }
.night .btn-line:hover { --bg: transparent; border-color: var(--fog); }
.btn .arr { width: 16px; height: 16px; transition: transform var(--d-mid) var(--ease); }
.btn:hover .arr { transform: translateX(2px); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: .22em; color: inherit; }
.linkish:hover { text-decoration-color: currentColor; }

/* inputs */
.input { width: 100%; min-height: 48px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: transparent; color: var(--ink); transition: border-color var(--d-fast) var(--ease-state), background-color var(--d-fast) var(--ease-state); }
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--ink); }

/* the signature: the leak marker. A small ring with a gap, the crack. */
.leak-mark { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--signal); flex: none; position: relative; }
.leak-mark::after { content: ''; position: absolute; right: -2px; top: 2px; width: 3px; height: 3px; background: var(--paper); border-radius: 50%; }
.night .leak-mark::after { background: var(--night); }
.leak-mark[data-s="pass"], .leak-mark[data-s="sealed"] { border-color: var(--ink-3); }
.leak-mark[data-s="pass"]::after, .leak-mark[data-s="sealed"]::after { display: none; }
.leak-mark[data-s="warn"] { border-color: var(--warn); }
.leak-mark[data-s="unknown"], .leak-mark[data-s="locked"] { border-color: var(--line-2); border-style: dashed; }
.leak-mark[data-s="unknown"]::after, .leak-mark[data-s="locked"]::after { display: none; }

/* status text */
.status { display: inline-flex; align-items: center; gap: 8px; font: 500 13px/1 var(--sans); color: var(--ink-2); white-space: nowrap; }
.status[data-s="fail"] { color: var(--signal-ink); }
.status[data-s="warn"] { color: var(--warn); }
.status[data-s="pass"] { color: var(--ok); }

/* layout */
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Leakturn mark: gauge ring, needle turned onto the leak. Inline SVG, ink = currentColor, dot = --signal. */
.brand-mark { width: 24px; height: 24px; flex: none; }
