/* Arenos — design-system tokens and component classes.

   Ported from the Arenos brand standards (v1.0 draft, September 2026) via the
   arenos-design skill's token files (tokens/colors.css, neutrals.css,
   semantic.css, typography.css, spacing.css, elevation.css) — every value here
   traces to one of those, not to a redraw. This file is the source of truth
   for the app's look; retune it here.

   Dark is the product's default surface, not light: this :root block IS
   Arenos Dark, so the empty-override theme in settings.js is 'arenos-dark'.
   'arenos-light' is the full peer, applied as a token overlay — see
   THEMES['arenos-light'] in settings.js for the light-mode values.

   Fonts are vendored TTFs (assets/fonts/), not a Google Fonts @import: the
   brand standards ship the nine weight files under an OFL licence specifically
   so a product can bundle them rather than depend on a CDN. */

@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-Light.ttf") format("truetype");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-SemiBold.ttf") format("truetype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/Geist-Mono-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/Geist-Mono-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/Geist-Mono-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* Component tokens — semantic.css, [data-theme="dark"] block. */
  --color-bg: #0F1113;
  --color-surface: #17191C;
  --color-text: #E6E6E6;
  --color-accent: #D4881A;
  --color-accent-2: #CA5C57;
  --color-divider: #2B2F34;

  /* on-accent is the one correctness rule this system insists on: amber as a
     FILL takes ink text, never white. #D4881A under #FFFFFF is ~1.9:1 and
     fails outright; under #111111 it is 6.6:1 and correct. Identical in both
     themes (semantic.css defines it the same in light and dark), so it is not
     overridden by arenos-light. */
  --color-on-accent: #111111;

  /* Neutral ramp — the brand's 7-step dark scale (neutrals.css --dark-0..6)
     spread across 9 slots. 100 is a surface, 300-500 are rules, 600-800 are
     text, 900 is the ground a picture sits on (kept near-black, at the same
     step as the page ground, not just a numbered continuation). */
  --color-neutral-100: #17191C;
  --color-neutral-200: #1E2125;
  --color-neutral-300: #2B2F34;
  --color-neutral-400: #343940;
  --color-neutral-500: #3E4248;
  --color-neutral-600: #606568;
  --color-neutral-700: #8B9094;
  --color-neutral-800: #C7CACC;
  --color-neutral-900: #0B0D0F;

  /* Accent ramp — 100-300 are --accent-soft at rising strength (dark:
     rgba(212,136,26,0.14) is the brand's own mid-point, so 200 lands there
     exactly), 400-600 are the amber itself and its hover/press moves, 700-900
     are amber as text, which is simply amber itself on this dark ground
     (semantic.css: --accent-text dark = #D4881A). */
  --color-accent-100: rgba(212, 136, 26, 0.10);
  --color-accent-200: rgba(212, 136, 26, 0.14);
  --color-accent-300: rgba(212, 136, 26, 0.22);
  --color-accent-400: #B87415;
  --color-accent-500: #D4881A;
  --color-accent-600: #DE9736;
  --color-accent-700: #D4881A;
  --color-accent-800: #E3A34C;
  --color-accent-900: #F0C27E;

  /* Second accent — Arenos brick (alert/error), dark-mode lift #CA5C57. This
     is the system's ONLY other accent-shaped colour, and it means one thing:
     alert. Amber is never repurposed as a warning colour. */
  --color-accent-2-100: rgba(202, 92, 87, 0.10);
  --color-accent-2-200: rgba(202, 92, 87, 0.16);
  --color-accent-2-300: rgba(202, 92, 87, 0.26);
  --color-accent-2-400: #B23D38;
  --color-accent-2-500: #CA5C57;
  --color-accent-2-600: #D57874;
  --color-accent-2-700: #E0928F;
  --color-accent-2-800: #EBB4B1;
  --color-accent-2-900: #F5D6D4;

  --font-heading: "Geist", "Helvetica Neue", Arial, sans-serif;
  --font-heading-weight: 500;
  --font-body: "Geist", "Helvetica Neue", Arial, sans-serif;
  /* New: anything a model produced — timecodes, confidence, IDs, hashes —
     is set in this face, never the sans. Not part of Modernist; introduced
     for Arenos because the brand standards make the mono a functional
     requirement, not a style choice (section 09). */
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, monospace;

  /* Spacing — the Fibonacci ladder (spacing.css), not the old 4/8/12/16 one.
     21px is both a spacing step and the mark's fixed clear space. */
  --space-1: 3px;
  --space-2: 5px;
  --space-3: 8px;
  --space-4: 13px;
  --space-6: 21px;
  --space-8: 34px;

  /* Radii — the standards specify none; spacing.css derives small ones on
     purpose (this system's geometry is circles and squares, not pills).
     8px on cards/panels, 5px on inputs/chips/buttons, 3px on meters/controls. */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;

  /* Elevation (elevation.css, dark block) — an edge plus ambient darkness,
     never a stacked drop shadow. */
  --shadow-sm: 0 1px 0 rgba(230, 230, 230, 0.04);
  --shadow-md: 0 2px 13px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 34px rgba(0, 0, 0, 0.6);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.grayscale{filter:grayscale(1) contrast(1.08)}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
/* display/h1/h2 are the brand's own steps (typography.css); h3-h6 have no
   register in the standards (the product only ever uses two heading levels),
   so they continue the same phi-derived descent: 29 -> 21 -> 19 -> 17 -> 15 -> 13. */
h1 { font-size: 29px; }
h2 { font-size: 21px; }
h3 { font-size: 19px; }
h4 { font-size: 17px; }
h5 { font-size: 15px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr {
  height: 2px; border: 0; margin: var(--space-4) 0;
  background: var(--color-divider);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); justify-content: flex-start; text-align: left; }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-divider);
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 2px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

