/* ============================================================
   Elemental Sensemaking — design tokens
   Six elemental palettes + shared brand tokens.
   Each element is anchored to its site-native CORE (unchanged
   from the existing dot palette); the expanded range is for
   per-element pages and sections.
   The ochre "aether bridge" (#B8923C) is shared across all six.
   ============================================================ */

:root {
  /* ---- Shared / brand ---- */
  --paper:        #F4F1EA;  /* warm paper base — global background */
  --ink:          #1F2A2E;  /* default text */
  --aether:       #B8923C;  /* ochre — the bridge, shared accent */
  --panel:        #E8E4DC;  /* paper-dark panel */

  /* ---- Stage-named neutrals (integrative: the palette is the process) ----
     Alchemical stage names over the site's warm base. The two inks are
     assigned by REGISTER: slate = soft mode (contemplative), nigredo =
     hard mode (the native ground of the geometry). */
  --albedo:       #F4F1EA;  /* the whitening — parchment ground (== --paper) */
  --nigredo:      #16130E;  /* the blackening — warm near-black, hard-mode ground */
  --slate:        #1F2A2E;  /* soft-mode ink (cool) — the Reader (== --ink) */
  --ash:          #A39E92;  /* calcined — hairlines, grid lines, disabled */
  --ash-deep:     #57534A;  /* secondary ink on albedo — captions, colophon */
  --citrinitas:   #B8923C;  /* the yellowing — aether gold (== --aether) */
  --citr-raised:  #D9A92E;  /* aether gold on nigredo (raised) */
  --rubedo:       #B5512A;  /* the reddening — fire (== --fire) */

  /* element CORE colors (the six dots — DO NOT change these) */
  --air:   #A8AEB2;
  --water: #3D5566;
  --fire:  #B5512A;
  --wood:  #5A6F3C;
  --earth: #B8923C;   /* dot palette earth (== aether hue) */
  --metal: #5C5E62;

  /* operator-glyph earth (distinct, so it reads against the ochre) */
  --earth-op: #9C7B2E;

  /* ---- Type registers (four voices) ---- */
  --font-oracle:    "Cormorant Garamond", Garamond, Georgia, serif; /* display, Greek, names */
  --font-reader:    "EB Garamond", Garamond, Georgia, serif;        /* soft-mode body */
  --font-architect: "Inter", system-ui, -apple-system, sans-serif;   /* hard-mode UI/data */
  --font-scribe:    "IBM Plex Mono", ui-monospace, monospace;        /* signal, operators */

  /* ---- Motion tempo grammar (from the alchemical system) ---- */
  --t-state: 200ms;                          /* state changes */
  --t-page:  600ms;                          /* page transitions */
  --t-orbit: 120s;                           /* sigil rotation — one turn / two minutes */
  --ease-precipitate: cubic-bezier(0.16, 1, 0.3, 1); /* fast out, long settle */

  /* ---- The hexad / septenary geometry ---- */
  --geo-stroke:      #A39E92;  /* ring hairline (ash) on light */
  --geo-stroke-dark: #57534A;  /* wireframe on nigredo (ash-deep) */
  --geo-bridge:      #B8923C;  /* inscribed hexagram (aether) */
  --geo-weight:      0.8px;    /* hairline weight */
}

/* ============================================================
   THEME × REGISTER
   ------------------------------------------------------------
   Two independent axes:
     REGISTER (per page, data-register)  soft = the Reader's descent
                                         hard = the Architect's instrument
     THEME    (per visitor, data-theme)  light | dark
   The register is NOT the theme. Ground colour is only one of the ways a
   register speaks — it also carries through type (Reader serif vs Architect
   sans), accent (citrinitas vs raised gold) and density. So the theme may
   flip the ground while the register survives: HARD IS ALWAYS DEEPER THAN
   SOFT, in both themes. In dark, soft lifts to a warm reading ground and
   hard keeps canonical nigredo — so the lab still sits below the descent.
   ============================================================ */
:root {
  color-scheme: light;

  --ground-soft:   var(--albedo);
  --ground-hard:   var(--nigredo);
  --ink-soft:      var(--slate);
  --ink-hard:      var(--albedo);
  --accent-soft:   var(--citrinitas);
  --accent-hard:   var(--citr-raised);
  --panel-soft:    #E8E4DC;
  --panel-hard:    #221D16;
  --rule-soft:     rgba(31, 42, 46, 0.14);
  --rule-hard:     rgba(244, 241, 234, 0.14);
  --wash-soft:     rgba(31, 42, 46, 0.05);
  --wash-hard:     rgba(244, 241, 234, 0.06);

  /* Bare channels, so existing rgba(…, α) values keep their own alpha while the colour
     follows the theme: rgba(var(--ink-rgb), 0.14) rather than a fixed slate. */
  --ink-rgb-soft:    31, 42, 46;
  --ink-rgb-hard:    244, 241, 234;
  --accent-rgb-soft: 184, 146, 60;
  --accent-rgb-hard: 217, 169, 46;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* The Reader at night — lifted clear of nigredo so the descent still reads ABOVE the lab.
     The gap is deliberate and must stay perceptible: a step, not a blend. Soft rgb(36,31,24)
     against hard rgb(22,19,14) is ~14 points — a cut you can see without it turning grey. */
  --ground-soft:   #241F18;
  --ink-soft:      #E4DFD4;   /* warm off-white; softer than albedo to cut glare */
  --accent-soft:   var(--citr-raised);
  --panel-soft:    #2E2820;
  --rule-soft:     rgba(228, 223, 212, 0.14);
  --wash-soft:     rgba(228, 223, 212, 0.06);
  --ink-rgb-soft:    228, 223, 212;
  --accent-rgb-soft: 217, 169, 46;

  /* hard mode is unchanged — nigredo is its native ground in either theme */
  --ash:           #8A857A;   /* hairlines need to lift a little on dark */
}

/* Resolved per page. Soft is the default; a page declares itself hard. */
:root {
  --ground: var(--ground-soft);
  --ink-on: var(--ink-soft);
  --accent-on: var(--accent-soft);
  --panel-on: var(--panel-soft);
  --rule: var(--rule-soft);
  --wash: var(--wash-soft);
  --ink-rgb: var(--ink-rgb-soft);
  --accent-rgb: var(--accent-rgb-soft);
}
:root[data-register="hard"] {
  --ground: var(--ground-hard);
  --ink-on: var(--ink-hard);
  --accent-on: var(--accent-hard);
  --panel-on: var(--panel-hard);
  --rule: var(--rule-hard);
  --wash: var(--wash-hard);
  --ink-rgb: var(--ink-rgb-hard);
  --accent-rgb: var(--accent-rgb-hard);
}

/* Legacy aliases: pages written before the theme layer keep working. */
:root {
  --paper: var(--ground);
  --ink:   var(--ink-on);
  --panel: var(--panel-on);
}

/* The geometry line follows the ink so canvas/SVG marks stay legible. */
:root { --geo-line: var(--rule); }

/* ============================================================
   AIR — Aerunik · σ
   "distinction without certainty · the cut · weak signal"
   cadence: "contrast forming…" not "the truth is."
   art: slate/bone linework, diagonal cuts, weak-signal dots; no clouds.
   ============================================================ */
.el-air, [data-element="air"] {
  --el-core:    #A8AEB2;  /* air canonical */
  --el-ink:     #1F2A2E;  /* primary text */
  --el-steel:   #7E868C;  /* air steel */
  --el-shadow:  #40484C;  /* slate shadow */
  --el-shell:   #DED7CB;  /* bone shell */
  --el-field:   #E0E2E0;  /* breath field */
  --el-panel:   #E8E4DC;  /* paper-dark panel */
  --el-paper:   #F4F1EA;  /* warm paper base */
  --el-soft:    #B8C4C8;  /* weak signal blue */
  --el-alert:   #A64846;  /* noise red — sparing */
  --el-bridge:  #B8923C;  /* aether ochre bridge */
}

/* ============================================================
   WATER — Sentaria · ρ
   "resonance without absorption · feeling with boundary"
   cadence: "this resonates…" not "this is true."
   art: translucent veils, ripples not waves; no spa-cyan.
   ============================================================ */
.el-water, [data-element="water"] {
  --el-core:    #3D5566;  /* sentaria core */
  --el-ink:     #1E2D35;  /* deep current / text */
  --el-tidal:   #5E7888;  /* tidal blue */
  --el-glass:   #86A8B7;  /* river glass */
  --el-veil:    #C8D8DD;  /* mist veil */
  --el-foam:    #E8F0EF;  /* foam / panel */
  --el-paper:   #F4F1EA;  /* warm paper base */
  --el-pearl:   #FAF8F3;  /* pearl pause */
  --el-shadow:  #17252B;  /* undertow shadow */
  --el-accent:  #C99A8F;  /* shell warmth accent */
  --el-bridge:  #B8923C;  /* ochre aether bridge */
}

/* ============================================================
   FIRE — Jvalion · λ
   "direction without command · controlled flame · vector, vow"
   cadence: "vector forming…" not "you must."
   art: ember/copper on warm paper; arrows, beacons, forge-lines.
   ============================================================ */
.el-fire, [data-element="fire"] {
  --el-core:    #B5512A;  /* jvalion core */
  --el-ink:     #2B1B16;  /* ember ink / text */
  --el-vow:     #8F2F22;  /* vow red */
  --el-coal:    #3A2420;  /* coal line */
  --el-copper:  #C06A32;  /* forged copper */
  --el-flame:   #D98A3A;  /* controlled flame */
  --el-spark:   #F0B35A;  /* spark / signal */
  --el-ash:     #EFE4D8;  /* hearth ash panel */
  --el-paper:   #F4F1EA;  /* warm paper base */
  --el-heat:    #FFF2CC;  /* white heat accent */
  --el-bridge:  #B8923C;  /* aether ochre bridge */
}

/* ============================================================
   WOOD — Arboriel · β
   "possibility without sprawl · branching with constraint"
   cadence: "one branch opening…" not "this is the story."
   art: trellis, grafts, rings, mycelium dots; growth with structure.
   ============================================================ */
.el-wood, [data-element="wood"] {
  --el-core:     #5A6F3C;  /* arboriel core */
  --el-ink:      #1F2A2E;  /* primary text */
  --el-moss:     #354326;  /* deep moss */
  --el-olive:    #73834B;  /* olive branch */
  --el-leaf:     #9AA66A;  /* new leaf */
  --el-seedling: #C0C98A;  /* seedling light */
  --el-bark:     #7A5B3A;  /* bark / trellis */
  --el-panel:    #E8E4DC;  /* mycelium panel */
  --el-paper:    #F4F1EA;  /* warm paper base */
  --el-fruit:    #C48A5A;  /* fruiting accent */
  --el-bridge:   #B8923C;  /* aether ochre bridge */
}

/* ============================================================
   EARTH — Humavita · δγ
   "capacity · compost · metabolizable ground"
   cadence: δγ(load | release) · carry what can metabolize,
            archive what has ended · hold / compost / release.
   ============================================================ */
.el-earth, [data-element="earth"] {
  --el-core:    #B8923C;  /* earth / ochre */
  --el-ink:     #3F352B;  /* humus (text) */
  --el-clay:    #9A6B3A;  /* clay */
  --el-compost: #7B6A45;  /* compost */
  --el-loam:    #5C4632;  /* loam */
  --el-straw:   #C8B071;  /* straw */
  --el-bone:    #D8CCB8;  /* bone */
  --el-sprout:  #6F7A43;  /* sprout */
  --el-paper:   #F4F1EA;  /* warm paper */
  --el-bridge:  #B8923C;  /* ochre */
}

/* ============================================================
   METAL — Ferrosid · μ
   "boundary · receipt · admissible structure"
   cadence: μ(gate | receipt) · boundary with criteria,
            provenance before passage · boundary without prison.
   ============================================================ */
.el-metal, [data-element="metal"] {
  --el-core:    #5C5E62;  /* metal core */
  --el-ink:     #2F3336;  /* graphite (text) */
  --el-steel:   #7C8286;  /* steel */
  --el-tin:     #A9ADB0;  /* tin */
  --el-ash:     #D9D8D2;  /* ash */
  --el-panel:   #E6E6E1;  /* panel */
  --el-paper:   #F4F1EA;  /* warm paper */
  --el-witness: #6E7F8D;  /* witness blue */
  --el-flag:    #A64846;  /* red flag — sparing */
  --el-bridge:  #B8923C;  /* ochre */
}
