/* ============================================================
   THE GILDED ORRERY — token core
   winterwonderland.win · one source for colour, type and rule
   weights across the hub and every module.

   The thesis: an 18th-century celestial atlas and its brass
   instruments, running aboard a cold ship. Warm engraved metal,
   chart-ink type, verdigris corrosion, frost at the edges.

   Committed single theme. This is a lacquered night instrument;
   there is no day mode (see ADR 0006).

   Legacy aliases at the bottom keep every pre-existing app CSS
   file working — they consume `--primary`, `--ice`, `--muted`
   and friends, which now resolve to the new metal.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;0,6..96,500;0,6..96,600;0,6..96,700;0,6..96,800;1,6..96,400;1,6..96,600;1,6..96,700&family=Archivo:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* ── GROUND ─────────────────────────────────────────────
     Lacquered black, biased warm-neutral. Never blue-black —
     the blue ground is what the aurora skin did, and it is
     what every other dark site does. */
  --ink-void:   #060607;
  --ink:        #0a0b0c;
  --ink-plate:  #101011;
  --ink-raise:  #161513;
  --ink-inset:  #0d0d0e;

  /* ── METAL ──────────────────────────────────────────────
     Brass is the accent. All of it. Boldness spent in one
     place; everything else stays quiet. */
  --brass:      #c69749;
  --brass-lit:  #f6e0a8;
  --brass-pale: #e6c77e;
  --brass-dim:  #6d5324;
  --brass-deep: #3b2c12;
  --brass-rgb:  198, 151, 73;

  /* ── CORROSION ──────────────────────────────────────────
     Aged copper. The cool counterweight to brass, and the
     colour of anything live. */
  --verdigris:     #3f9e8b;
  --verdigris-lit: #6fd0ba;
  --verdigris-dim: #1f4e45;
  --verdigris-rgb: 63, 158, 139;

  /* ── FROST ──────────────────────────────────────────────
     Winter, kept as a material rather than a palette. Ice
     bloom on metal: hairlines, glass, cold glow. */
  --frost:      #bcd6e4;
  --frost-dim:  #6d8494;
  --frost-rgb:  188, 214, 228;

  /* ── CHART INK ──────────────────────────────────────────
     Warm bone, not blue-white. Text sits on lacquer the way
     ink sits on plate paper. */
  --ivory:      #ece6d8;
  --ivory-soft: #cfc7b6;
  --ash:        #8d8574;
  --ash-dim:    #635d51;

  /* ── SEMANTIC ───────────────────────────────────────────
     Held separate from the accent so state never competes
     with decoration. */
  --good: #3f9e8b;
  --warn: #e0a531;
  --crit: #cf5b3c;
  --crit-rgb: 207, 91, 60;

  /* ── RULES ──────────────────────────────────────────────
     Engraved lines, in three weights. The plate border is a
     double rule; the inner one is always lighter. */
  --rule:        rgba(198, 151, 73, 0.20);
  --rule-strong: rgba(198, 151, 73, 0.42);
  --rule-faint:  rgba(198, 151, 73, 0.10);
  --rule-cold:   rgba(188, 214, 228, 0.11);

  /* ── SURFACES ───────────────────────────────────────────
     Lacquer, not frosted glass. Opaque-ish fills and hairline
     metal instead of backdrop blur — cheaper and truer to the
     material. */
  --plate-fill: linear-gradient(168deg,
      rgba(28, 26, 22, 0.70) 0%,
      rgba(16, 16, 16, 0.82) 46%,
      rgba(10, 11, 12, 0.90) 100%);
  --plate-fill-lit: linear-gradient(168deg,
      rgba(52, 43, 28, 0.80) 0%,
      rgba(24, 22, 19, 0.86) 46%,
      rgba(12, 12, 13, 0.92) 100%);
  --inset-fill: rgba(8, 8, 9, 0.72);

  /* Rolled gold, for foil-stamped text and swept rules. The
     bright band near 50% is the specular; animating
     background-position drags it across the glyphs. */
  --foil: linear-gradient(100deg,
      #7a5c20 0%, #a67f34 14%, #c69749 28%,
      #f6e0a8 44%, #fff7e2 50%, #f6e0a8 56%,
      #c69749 72%, #a67f34 86%, #6d5324 100%);

  /* Verdigris equivalent, for live readouts. */
  --foil-cold: linear-gradient(100deg,
      #1f4e45 0%, #3f9e8b 32%, #a5eede 50%,
      #3f9e8b 68%, #1f4e45 100%);

  /* ── TEXTURE ────────────────────────────────────────────
     Plate grain and engine-turned engraving. Both ride at
     very low alpha; they should register as tooth, not as
     pattern. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
  --engrave: repeating-linear-gradient(112deg,
      rgba(198, 151, 73, 0.045) 0px,
      rgba(198, 151, 73, 0.045) 1px,
      transparent 1px,
      transparent 7px);

  /* ── TYPE ───────────────────────────────────────────────
     Bodoni Moda (Didone, 1798) carries the engraving; Archivo
     labels the instrument; Plex Mono reads the data out. */
  --font-display: 'Bodoni Moda', 'Didot', 'Bodoni MT', Georgia, serif;
  --font-ui: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Scale — 1.25 through the middle, wider at the display end */
  --step--2: 0.6875rem;   /* 11px  · ticks, corner marks */
  --step--1: 0.8125rem;   /* 13px  · labels, chips */
  --step-0:  0.9375rem;   /* 15px  · body */
  --step-1:  1.125rem;    /* 18px  · plate titles */
  --step-2:  1.5rem;      /* 24px  · sub-heads */
  --step-3:  2.125rem;    /* 34px  · wing titles */
  --step-4:  clamp(2.25rem, 5vw, 3.75rem);
  --step-5:  clamp(2.75rem, 7.6vw, 6.75rem);   /* wordmark */

  /* Engraved labels want air between the caps */
  --track-label: 0.26em;
  --track-tight: 0.14em;

  /* ── GEOMETRY ───────────────────────────────────────────
     Plates are cut, not rounded. 2px is the whole budget. */
  --r-plate: 2px;
  --r-chip: 1px;
  --r-pill: 999px;

  --gutter: clamp(16px, 3vw, 40px);
  --frame-inset: clamp(10px, 1.6vw, 20px);
  --measure: 68ch;

  /* Height of the station feed rail, when a page carries one. Stamped
     by JS so the plate frame stops above it instead of crossing it. */
  --feed-h: 0px;

  /* ── DEPTH ──────────────────────────────────────────────
     Plates sit on the ground; they do not float. Shadow is
     contact shadow plus a thin brass bloom on hover. */
  --lift: 0 18px 46px rgba(0, 0, 0, 0.62);
  --lift-lit: 0 22px 60px rgba(0, 0, 0, 0.70),
              0 0 0 1px rgba(198, 151, 73, 0.30),
              0 0 34px rgba(198, 151, 73, 0.10);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-cut: cubic-bezier(0.83, 0, 0.17, 1);
}

/* ============================================================
   LEGACY ALIASES
   Every app CSS file written against the aurora skin keeps
   working; the names now resolve to brass, verdigris and ink.
   New code should use the tokens above, not these.
   ============================================================ */
:root {
  --primary:      var(--brass);
  --primary-rgb:  var(--brass-rgb);
  --secondary:    var(--verdigris);
  --accent:       var(--brass);
  --accent-rgb:   var(--brass-rgb);

  --bg:        var(--ink);
  --bg-deep:   var(--ink-void);
  --card-bg:   rgba(24, 22, 19, 0.62);
  --text:      var(--ivory);
  --text-dim:  var(--ash);

  --border:        var(--rule);
  --panel-border:  var(--rule);
  --hairline:      var(--rule);

  --hazard:  var(--crit);
  --danger:  var(--crit);
  --alert:   var(--verdigris-lit);
  --alert-glow: rgba(111, 208, 186, 0.45);
  --mint:    var(--verdigris-lit);
  --ice:     var(--frost);
  --violet:  var(--verdigris);
  --blush:   var(--crit);

  --snow-ink:    var(--ivory);
  --muted:       var(--ash);
  --void-purple: var(--ink-raise);
  --night-0: var(--ink-void);
  --night-1: var(--ink);
  --night-2: var(--ink-raise);

  --frost-fill: var(--plate-fill);
}
