/* The site's look (docs/BRAND.md). Loaded by every page after its own stylesheet, and keyed on the data-brand='atlas' that every page's <html> carries in its markup.
   Selectors start with `html:root` so they outrank the page stylesheets (and their dark blocks) whatever the load order. Fonts are self-hosted from /fonts. */

@font-face { font-family: 'Inter Variable'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/inter-latin-ext-wght-normal.woff2) format('woff2'); 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: 'Inter Variable'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2'); 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: 'Newsreader Variable'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/newsreader-latin-ext-wght-normal.woff2) format('woff2'); 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: 'Newsreader Variable'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/newsreader-latin-wght-normal.woff2) format('woff2'); 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: 'Newsreader Variable'; font-style: italic; font-weight: 200 800; font-display: swap; src: url(/fonts/newsreader-latin-wght-italic.woff2) format('woff2'); 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; }

/* The site's mark, the helix of two lines meeting in a child, is teal, plum, ink and vermilion in its own markup (the light colors); the tokens lighten them in dark. */
html:root[data-brand='atlas'] .logo-line-m { stroke: var(--sex-m); }
html:root[data-brand='atlas'] .logo-line-f { stroke: var(--sex-f); }
html:root[data-brand='atlas'] .logo-fill-m { fill: var(--sex-m); }
html:root[data-brand='atlas'] .logo-fill-f { fill: var(--sex-f); }
html:root[data-brand='atlas'] .logo-rung { stroke: var(--text); }
html:root[data-brand='atlas'] .logo-child { fill: var(--connection); }

/* ---- Light: cream paper, deep ink, one vermilion ---- */
html:root[data-brand='atlas'] {
  color-scheme: light;
  --font-ui: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Newsreader Variable', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --surface: #f7f2e8; --bg: #f7f2e8;
  --panel: #ede6d6;
  --line: #d3c9b3;
  --text: #121a2b;
  --text-2: #4b5367;
  --accent: #b0301b;
  --accent-fill: #bf351d;
  --accent-ink: #fff;
  --star-on: #a8730a;
  --danger: #9b1c3a;
  --sex-m: #1d7f8c;
  --sex-f: #8e3b6b;
  --sex-u: #8b8f98;
  --dim: #ddd4c1;
  --edge-parent: #7b8394;
  --edge-spouse: #b7b0a0;
  --cat-1: #2f5d8a; --cat-2: #c8441f; --cat-3: #1d7f8c; --cat-4: #b27a06;
  --cat-5: #8e3b6b; --cat-6: #4f7a2a; --cat-7: #6a5aa8;
  --c-other: #b8b09e; --c-elsewhere: #8fa0a8; --c-none: #8b8f98; --c-missing: #d9d0bc;
  --ramp-0: #a9cdd3; --ramp-1: #6fb0bc; --ramp-2: #3a8fa0; --ramp-3: #23697f; --ramp-4: #174a62; --ramp-5: #0f3350;
  --connection: #d9381e;
  --heat-0: #f8e0cf; --heat-1: #f2b793; --heat-2: #e98a5a; --heat-3: #d4592b; --heat-4: #a63c1c; --heat-5: #6e2812;
  --map-sea: #bcd5da; --map-land: #f3ead3; --map-coast: #5d7f93; --map-border: #b3a583;
  --ghost-1: #c8441f; --ghost-2: #2f5d8a; --ghost-3: #b27a06; --ghost-4: #4f7a2a; --ghost-5: #8e3b6b; --ghost-6: #1d7f8c; --ghost-7: #6a5aa8; --ghost-8: #b8456a;
  --card: #fdfaf3; --line-2: #bdb199; --dot: rgba(18, 26, 43, 0.2); --glow: rgba(18, 26, 43, 0.5);
  /* How much of a section's color shows in a view card's art panel and its dots; a dark ground needs more. */
  --tint: 11%; --tint-dot: 38%;
  --inv-surface: #0e1524; --inv-text: #f3ecdc; --inv-text-2: #b9bfcd; --inv-card: #162037; --inv-dot: rgba(243, 236, 220, 0.3);
}

/* ---- Dark: ink-navy ground, cream ink ---- */
@media (prefers-color-scheme: dark) {
  html:root[data-brand='atlas']:not([data-theme='light']) {
    color-scheme: dark;
    --surface: #0e1524; --bg: #0e1524;
    --panel: #162037;
    --line: #2b3856;
    --text: #f3ecdc;
    --text-2: #b9bfcd;
    --accent: #ff7d5f;
    --accent-fill: #c4361e;
    --star-on: #e3a928;
    --danger: #ff8fa8;
    --sex-m: #43b3c1;
    --sex-f: #c97aa8;
    --sex-u: #8b94a8;
    --dim: #2b3856;
    --edge-parent: #7e8aa6;
    --edge-spouse: #4a5778;
    --cat-1: #6a9fd1; --cat-2: #ff7d5f; --cat-3: #43b3c1; --cat-4: #e3a928;
    --cat-5: #c97aa8; --cat-6: #8fba5a; --cat-7: #a79be0;
    --c-other: #4a5778; --c-elsewhere: #51657a; --c-none: #8b94a8; --c-missing: #2b3856;
    --ramp-0: #174a62; --ramp-1: #23697f; --ramp-2: #3a8fa0; --ramp-3: #6fb0bc; --ramp-4: #a9cdd3; --ramp-5: #cfe6ea;
    --connection: #ff7d5f;
    --heat-0: #4a2314; --heat-1: #7a341b; --heat-2: #ab4a25; --heat-3: #d4683a; --heat-4: #ee9566; --heat-5: #f8c2a0;
    --map-sea: #0a1220; --map-land: #364640; --map-coast: #7f9bb8; --map-border: #62766f;
    --ghost-1: #ff7d5f; --ghost-2: #6a9fd1; --ghost-3: #e3a928; --ghost-4: #8fba5a; --ghost-5: #c97aa8; --ghost-6: #43b3c1; --ghost-7: #a79be0; --ghost-8: #e58aa5;
    --card: #162037; --line-2: #3a4a70; --dot: rgba(243, 236, 220, 0.42); --glow: rgba(67, 179, 193, 0.55);
    --tint: 15%; --tint-dot: 42%;
    --inv-surface: #f7f2e8; --inv-text: #121a2b; --inv-text-2: #4b5367; --inv-card: #121a2b; --inv-dot: transparent;
  }
}
html:root[data-brand='atlas'][data-theme='dark'] {
  color-scheme: dark;
  --surface: #0e1524; --bg: #0e1524;
  --panel: #162037;
  --line: #2b3856;
  --text: #f3ecdc;
  --text-2: #b9bfcd;
  --accent: #ff7d5f;
  --accent-fill: #c4361e;
  --star-on: #e3a928;
  --danger: #ff8fa8;
  --sex-m: #43b3c1;
  --sex-f: #c97aa8;
  --sex-u: #8b94a8;
  --dim: #2b3856;
  --edge-parent: #7e8aa6;
  --edge-spouse: #4a5778;
  --cat-1: #6a9fd1; --cat-2: #ff7d5f; --cat-3: #43b3c1; --cat-4: #e3a928;
  --cat-5: #c97aa8; --cat-6: #8fba5a; --cat-7: #a79be0;
  --c-other: #4a5778; --c-elsewhere: #51657a; --c-none: #8b94a8; --c-missing: #2b3856;
  --ramp-0: #174a62; --ramp-1: #23697f; --ramp-2: #3a8fa0; --ramp-3: #6fb0bc; --ramp-4: #a9cdd3; --ramp-5: #cfe6ea;
  --connection: #ff7d5f;
  --heat-0: #4a2314; --heat-1: #7a341b; --heat-2: #ab4a25; --heat-3: #d4683a; --heat-4: #ee9566; --heat-5: #f8c2a0;
  --map-sea: #0a1220; --map-land: #364640; --map-coast: #7f9bb8; --map-border: #62766f;
  --ghost-1: #ff7d5f; --ghost-2: #6a9fd1; --ghost-3: #e3a928; --ghost-4: #8fba5a; --ghost-5: #c97aa8; --ghost-6: #43b3c1; --ghost-7: #a79be0; --ghost-8: #e58aa5;
  --card: #162037; --line-2: #3a4a70; --dot: rgba(243, 236, 220, 0.42); --glow: rgba(67, 179, 193, 0.55);
  --tint: 15%; --tint-dot: 42%;
  --inv-surface: #f7f2e8; --inv-text: #121a2b; --inv-text-2: #4b5367; --inv-card: #121a2b; --inv-dot: transparent;
}

/* ---- Type: a serif for titles, a plain sans for everything you operate ---- */
html:root[data-brand='atlas'] { accent-color: var(--accent-fill); }
html:root[data-brand='atlas'] body { font-family: var(--font-ui); font-feature-settings: 'cv11', 'ss03'; }
html:root[data-brand='atlas'] h1,
html:root[data-brand='atlas'] h2,
html:root[data-brand='atlas'] .brand { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
html:root[data-brand='atlas'] h1 { font-optical-sizing: auto; }
html:root[data-brand='atlas'] .tagline,
html:root[data-brand='atlas'] .tagline-foot { font-family: var(--font-display); font-style: italic; font-weight: 400; }
/* The page stylesheets' base sizes were set for a system sans; the serif needs a little more at the same weight of presence. */
html:root[data-brand='atlas'] .topbar h1 { font-size: 20px; }
html:root[data-brand='atlas'] .drop h1 { font-size: 26px; }
html:root[data-brand='atlas'] h2 { font-size: 20px; }
/* The app's h3 are small capital labels; the landing and static pages' are titles and keep normal spacing. */
html:root[data-brand='atlas'] #root h3 { letter-spacing: 0.09em; font-weight: 600; }
html:root[data-brand='atlas'] h3 { font-family: var(--font-display); font-weight: 600; }
html:root[data-brand='atlas'] #root h3 { font-family: var(--font-ui); }

/* ---- Shape: hairline rules, 8 px controls and 10 px cards, as on the landing page ---- */
/* Every field takes the card surface and the stronger hairline whatever its view's own rule says; the page stylesheets set only the base. The home page styles its own. */
html:root[data-brand='atlas'] :is(input:not([type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color']), select, textarea):not(.home *) { background-color: var(--card); border-color: var(--line-2); border-radius: 8px; }
html:root[data-brand='atlas'] :is(input:not([type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color']), select, textarea):not(.home *):hover:not(:disabled) { border-color: var(--accent); }
html:root[data-brand='atlas'] .skip { border-radius: 8px; }

/* ---- Buttons: the filled one is vermilion; creating something is ink ---- */
html:root[data-brand='atlas'] button.create { background: var(--text); border-color: var(--text); color: var(--surface); }
html:root[data-brand='atlas'] button.create:hover:not(:disabled) { border-color: var(--text); filter: none; opacity: 0.88; }
/* Zero specificity: it replaces the browser's blue, and any component's own link color still wins. */
:where(html[data-brand='atlas'] a:any-link) { color: var(--accent); }
html:root[data-brand='atlas'] a { text-underline-offset: 3px; }

/* ---- Polish ---- */
/* Figures line up in columns. */
html:root[data-brand='atlas'] table,
html:root[data-brand='atlas'] td,
html:root[data-brand='atlas'] th { font-variant-numeric: tabular-nums; }

html:root[data-brand='atlas'] ::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
html:root[data-brand='atlas'] * { scrollbar-color: color-mix(in srgb, var(--text) 28%, var(--surface)) transparent; }

/* Zero specificity: a select takes the page's ground and hairline, and any component's own select styling still wins. */
:where(html[data-brand='atlas'] select) { font: inherit; color: var(--text); background-color: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; }

/* People and places in a list are ink with a vermilion rule, so a long list is not a column of red; hover turns the word vermilion. */
html:root[data-brand='atlas'] button.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
html:root[data-brand='atlas'] button.link:hover { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  html:root[data-brand='atlas'] .star { transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
}

/* ---- App tables and figures ---- */
/* The same small capital column heads as the static pages' tables. */
html:root[data-brand='atlas'] :is(table.data, .facttable, .createtable, .admintable, .ideastable) thead th { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; border-bottom-color: var(--line-2); }
html:root[data-brand='atlas'] #root :is(.statvalue, .big) { font-family: var(--font-display); letter-spacing: -0.01em; }
/* A sticky row head covers what scrolls under it with the ground it sits on, and a card is not the page's. */
html:root[data-brand='atlas'] .card :is(table.data th[scope='row'], .odmatrix th.corner, .odmatrix th.odrow) { background: var(--card); }

/* ---- App screens that are pages rather than tools: the account pages and the unlock prompt sit on the dot field; a view's own ground stays plain ---- */
html:root[data-brand='atlas'] body:has(.authpage, .unlock) { background-image: radial-gradient(var(--dot) 1px, transparent 1.5px); background-size: 127px 127px; background-position: 31px 17px; }
html:root[data-brand='atlas'] .authpage { padding-top: 32px; }
html:root[data-brand='atlas'] .authpage h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.015em; }
html:root[data-brand='atlas'] .unlock h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; }

/* ---- Static pages (help, guides, views, about, legal): `body > main` is only theirs; the app's main is inside #root ---- */
html:root[data-brand='atlas'] body > main h1 { font-size: clamp(30px, 4.4vw, 40px); line-height: 1.15; letter-spacing: -0.015em; margin: 20px 0 8px; }
html:root[data-brand='atlas'] body > main h2 { font-size: 24px; line-height: 1.25; margin: 40px 0 10px; }
html:root[data-brand='atlas'] body > main h3 { font-size: 18px; }
html:root[data-brand='atlas'] body > main nav.top .tagline { font-size: 15px; }
html:root[data-brand='atlas'] body > main thead th { font-family: var(--font-ui); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
html:root[data-brand='atlas'] body > main section.cta h2 { margin-top: 20px; }
/* A faint dot field in the top band only, fading out before the text of the page begins. */
html:root[data-brand='atlas'] body:has(> main > nav.top) { position: relative; }
html:root[data-brand='atlas'] body:has(> main > nav.top)::before { content: ''; position: absolute; inset: 0 0 auto; height: 220px; pointer-events: none; background-image: radial-gradient(var(--dot) 1px, transparent 1.6px), radial-gradient(color-mix(in srgb, var(--dot) 52%, transparent) 1px, transparent 1.4px); background-size: 113px 113px, 71px 71px; background-position: 13px 29px, 47px 5px; mask-image: linear-gradient(#000, transparent); }
html:root[data-brand='atlas'] body > main { position: relative; }
