/*
 * Samros design system: the Lexington look, built with our own code, in the Samros brand 2.0
 * colours (Emerald nocturne: noir, emerald, porcelain, one lumen light; see the brand book).
 *
 * Lexington Themes' licence allows their theme code on marketing pages, docs and internal dashboards,
 * but not as the main customer-facing UI of an app. So the app screens follow their visual language
 * (soft ground, near-black ink, one soft grey, a single small accent; large headings with a grey second
 * line; hairline ruled rows; soft cards; pill buttons) without using any of their files.
 *
 * Every screen imports this file. Change a token here and every product surface follows.
 * Themes: light by default; `data-theme="dark"` on <html> forces dark, `data-theme="light"` forces light,
 * no attribute follows the operating system.
 * Colour rule: lumen is light, so it needs the dark. On light surfaces its job passes to jade.
 */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/Geist-Variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/GeistMono-Variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Tiro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/TiroLatin-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Tiro';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/TiroLatin-Italic.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* the serif voice: Tiro Devanagari Hindi (Tiro Typeworks, OFL), Latin subset. Italic for the lit lines. */
  --font-serif: 'Tiro', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  /* Light: porcelain ground, noir ink, emerald for action, jade for small marks (Samros brand 2.0) */
  --bg: #f0f3ef;          /* porcelain */
  --surface: #e7ece8;
  --surface-2: #dfe6e1;   /* mist */
  --line: #d3dcd6;
  --line-strong: #b4c2ba;
  --ink: #07110e;         /* noir */
  --ink-2: #53605a;       /* slate: the grey second line */
  --ink-3: #56635d;       /* quiet text: timestamps, tips */
  --accent: #0e3b2e;      /* emerald: the action colour on porcelain, porcelain text on it */
  --accent-ink: #f0f3ef;
  --accent-soft: rgba(19, 112, 76, 0.14);
  --accent-line: #13704c; /* jade: lines and small marks on porcelain (5.4:1) */
  --mark-short: #13704c;  /* logo short bars: jade on porcelain, lumen after dark */
  --mark-long: #0e3b2e;   /* logo long bars and wordmark: emerald on porcelain, porcelain after dark */
  --btn: var(--ink);
  --btn-ink: #f0f3ef;
  --ok: #13704c;
  --danger: #a8281c;
  --warn: #7a5200;
  --scrim: rgba(240, 243, 239, 0.8);
  --stage: #e3e9e5;       /* behind video */
  --shadow: 0 1px 2px rgba(7, 17, 14, 0.05), 0 12px 32px rgba(7, 17, 14, 0.07);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --pill: 999px;

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

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 44px;
  --tight: -0.03em;
}

/* Dark: porcelain ink on noir, lumen for the one lit thing */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #07110e;
    --surface: #0c1a16;
    --surface-2: #12201b;
    --line: #1f302a;
    --line-strong: #2f463e;
    --ink: #f0f3ef;
    --ink-2: #9fb0a7;
    --ink-3: #8c9d94;
    --accent: #9ef3cf;
    --accent-ink: #07110e;
    --accent-soft: rgba(158, 243, 207, 0.16);
    --accent-line: #9ef3cf;
    --mark-short: #9ef3cf;
    --mark-long: #f0f3ef;
    --btn: #f0f3ef;
    --btn-ink: #07110e;
    --ok: #6fdcaa;
    --danger: #ff7a66;
    --warn: #f2c14e;
    --scrim: rgba(7, 17, 14, 0.74);
    --stage: #030806;
    --shadow: none;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #07110e;
  --surface: #0c1a16;
  --surface-2: #12201b;
  --line: #1f302a;
  --line-strong: #2f463e;
  --ink: #f0f3ef;
  --ink-2: #9fb0a7;
  --ink-3: #8c9d94;
  --accent: #9ef3cf;
  --accent-ink: #07110e;
  --accent-soft: rgba(158, 243, 207, 0.16);
  --accent-line: #9ef3cf;
  --mark-short: #9ef3cf;
  --mark-long: #f0f3ef;
  --btn: #f0f3ef;
  --btn-ink: #07110e;
  --ok: #6fdcaa;
  --danger: #ff7a66;
  --warn: #f2c14e;
  --scrim: rgba(7, 17, 14, 0.74);
  --stage: #030806;
  --shadow: none;
}

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 var(--text-base) / 1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- type ---------- */
.display {
  font-size: clamp(28px, 4vw, var(--text-3xl));
  font-weight: 600;
  letter-spacing: var(--tight);
  line-height: 1.05;
  margin: 0;
}
.display .second, .title .second { display: block; color: var(--ink-2); }
.title { font-size: var(--text-xl); font-weight: 600; letter-spacing: var(--tight); line-height: 1.15; margin: 0; }
.label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}
.muted { color: var(--ink-2); }
.quiet { color: var(--ink-3); }
.small { font-size: var(--text-sm); }
.mono, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: 36px;
  padding: 0 var(--s4);
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: 500 var(--text-sm) / 1 var(--font);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.btn.primary:hover:not(:disabled) { background: var(--btn); opacity: 0.88; }
.btn.accent, .btn.gold { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.accent:hover:not(:disabled), .btn.gold:hover:not(:disabled) { background: var(--accent); opacity: 0.9; }
.btn.small { height: 30px; padding: 0 var(--s3); font-size: var(--text-xs); }
.btn.ghost { border-color: transparent; }
.btn.block { width: 100%; height: 44px; font-size: var(--text-base); }
.btn[aria-pressed='true'] { background: var(--surface-2); }

.input, select.input {
  height: 40px;
  padding: 0 var(--s4);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  min-width: 0;
}
.input:focus { border-color: var(--ink); outline: none; }

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  gap: 2px;
  border-radius: var(--pill);
  background: var(--surface-2);
}
.segmented button {
  height: 30px;
  padding: 0 var(--s3);
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink-2);
  font: 500 var(--text-sm) / 1 var(--font);
  cursor: pointer;
}
.segmented button.on, .segmented button[aria-checked='true'] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

kbd {
  font: 500 11px / 1 var(--font-mono);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--text-xs);
  font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: var(--s5); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 1px solid var(--line); }
.meter { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.meter > * { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.3s; }

/* the .si in the Samros.si wordmark */
.tld { color: var(--accent-line); }

/* no double-tap zoom delay on controls; a deliberate tap colour */
a, button, input, select, textarea, summary { touch-action: manipulation; -webkit-tap-highlight-color: rgba(19, 112, 76, 0.18); }
html { scroll-padding-top: 80px; }  /* anchors land below the sticky header */
