/* Skarpvect design tokens. Single source of truth — import this, never copy hex. */

:root {
  /* Core palette. Neutrals are biased violet so they sit under the accent
     rather than fight it — none of these greys are hue-neutral. */
  --sv-ink:        #171426;  /* violet-black: wordmark, body text, dark ground */
  --sv-graphite:   #2C2740;  /* cards and borders on dark                      */
  --sv-steel:      #6B6580;  /* muted text and rules on light (5.32:1)         */
  --sv-mist:       #E9E6EF;  /* light surfaces, dividers                       */
  --sv-paper:      #FBFAFD;  /* page background                                */
  --sv-iris:       #6438C9;  /* the accent, on LIGHT grounds (6.84:1)          */
  --sv-iris-light: #9F86E8;  /* the accent, on DARK grounds (6.05:1 on ink)    */
  --sv-snow:       #FFFFFF;  /* one step lighter than Paper: light-ground raised
                                 surface, mirrors --sv-graphite on ink         */
  --sv-pitch:      #0D0B16;  /* one step darker than Ink: the dark-theme page
                                 ground, so Ink and the raised surfaces sit a
                                 step above it the way Snow sits above Paper
                                 (SKV-593)                                     */

  /* Text/border for content sitting on an ink-coloured surface. Unconditional
     (not under [data-theme="dark"]) because .band is always an ink surface
     regardless of which page theme is active — [data-theme="dark"] reuses
     these rather than redeclaring the same hex a second time. */
  --sv-on-ink-text:       #EDEAF4;  /* 15.18:1 on ink */
  --sv-on-ink-text-muted: #9A93AD;  /* 6.14:1 on ink — steel is only 3.26:1 on ink */
  --sv-on-ink-border:     #7D71A8;  /* 4.12:1 on ink, 3.26:1 on graphite (SKV-58:
                                        the old #383150 was 1.48:1 / 1.17:1) */

  /* Semantic aliases — prefer these in application code. */
  --sv-bg:          var(--sv-paper);
  --sv-surface:     var(--sv-snow);
  --sv-text:        var(--sv-ink);
  --sv-text-muted:  var(--sv-steel);
  --sv-border:      var(--sv-mist);
  --sv-accent:      var(--sv-iris);
  /* Alternate section wash (.section--tint, .panel) — a step off --sv-bg to
     mark a section boundary, distinct from --sv-surface (a raised card
     fill). Raw --sv-mist has no dark-theme meaning of its own: on Paper it
     reads as "one step down"; on Ink the token that reads the same way is
     Graphite, not Mist held constant, which is why this needs its own
     semantic alias rather than components reaching for --sv-mist directly. */
  --sv-tint:        var(--sv-mist);
  /* Rules drawn on the tint use steel rather than the page border so they
     remain visible against the light wash. The dark value preserves the
     existing on-ink-border treatment. */
  --sv-tint-border: var(--sv-steel);
  /* Hairline dividers drawn edge to edge on the page ground: the header's
     bottom rule, the footer's top rule. Mist on Paper (1.19:1) in light;
     the dark value is Graphite on Pitch (1.37:1), the same order of
     subtlety, not --sv-border, whose dark value is the 4.12:1 control
     border from SKV-58 and reads as a bar when run full width (SKV-593). */
  --sv-divider:     var(--sv-mist);

  /* The mark's three planes, lit from one source: darkest turns away, lightest
     faces the light. Style an inline SVG through these and it flips with the
     theme; the standalone files in logo/ carry the same values baked in.
     Adjacent planes stay at least 2.3:1 apart, which is what keeps the mark
     reading as three surfaces rather than two. Palette colours only. */
  --sv-mark-body:   var(--sv-ink);
  --sv-mark-crease: var(--sv-iris);
  --sv-mark-wing:   var(--sv-iris-light);

  /* Type */
  --sv-font-display: "Familjen Grotesk", system-ui, -apple-system, sans-serif;
  --sv-font-body:    "Familjen Grotesk", system-ui, -apple-system, sans-serif;
  --sv-font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* 1.25 major third from 16px */
  --sv-text-xs:   0.75rem;   /* 12 */
  --sv-text-sm:   0.875rem;  /* 14 */
  --sv-text-base: 1rem;      /* 16 */
  --sv-text-lg:   1.25rem;   /* 20 */
  --sv-text-xl:   1.5625rem; /* 25 */
  --sv-text-2xl:  1.9375rem; /* 31 */
  --sv-text-3xl:  2.4375rem; /* 39 */
  --sv-text-4xl:  3.0625rem; /* 49 */
  /* Two display steps on the same 1.25 ratio, admitted by STD-DEL-003 2.0.0
     §3.4.2 (website v2.0, SKV-582). Reserved for the page h1 and a
     section-opening statement heading; a card, panel or column heading, a
     lede and body copy never take them. */
  --sv-text-5xl:  3.8125rem; /* 61 */
  --sv-text-6xl:  4.75rem;   /* 76 */

  /* 8px spacing scale */
  --sv-space-1: 0.5rem;  --sv-space-2: 1rem;  --sv-space-3: 1.5rem;
  --sv-space-4: 2rem;    --sv-space-6: 3rem;  --sv-space-8: 4rem;
  /* Two section-rhythm steps, same 8 px scale, admitted by STD-DEL-003 2.0.0
     §3.5.1 (website v2.0, SKV-582). Reserved for a section's vertical padding
     and the vertical space between the blocks inside it; never a horizontal
     gap, a gap between grid or list siblings, or a component's internal
     padding. */
  --sv-space-12: 6rem;   --sv-space-16: 8rem;

  /* Corners are cut, not rounded. 2px is the ceiling everywhere except the
     app icon, which needs 24/128 to survive platform masking. */
  --sv-radius: 2px;
}

:root[data-theme="dark"] {
  /* Pitch, not Ink: with the page ground one step below Ink, an ink
     surface (the hero, a band) and the raised surfaces are steps above the
     page rather than level with it, as Snow and Mist are on Paper
     (SKV-593). The on-ink set is calibrated on Ink and only gains on
     Pitch: --sv-on-ink-text 16.42:1, --sv-on-ink-text-muted 6.64:1,
     --sv-iris-light 6.55:1. */
  --sv-bg:         var(--sv-pitch);
  --sv-surface:    #201C33;
  --sv-text:       var(--sv-on-ink-text);
  --sv-text-muted: var(--sv-on-ink-text-muted);
  --sv-border:     var(--sv-on-ink-border);
  --sv-accent:     var(--sv-iris-light);
  /* Graphite, not Mist: Mist stays a light swatch even here, which is
     exactly the SKV-141 bug (--sv-on-ink-text at 15.18:1-on-Ink measures
     1.04:1 on Mist — light text on a light surface). --sv-on-ink-text on
     Graphite measures 12.01:1, and Graphite-on-Pitch (1.37:1) is the same
     order of subtlety as light theme's Mist-on-Paper (1.19:1), so the tint
     keeps its "barely a step off the page" read in both themes. */
  --sv-tint:       var(--sv-graphite);
  --sv-tint-border: var(--sv-on-ink-border);
  --sv-divider:    var(--sv-graphite);
  --sv-mark-body:   var(--sv-paper);
  --sv-mark-crease: var(--sv-iris-light);
  --sv-mark-wing:   var(--sv-iris);
}

/* The accent flips with the ground, and this is the thing that is easy to get
   wrong. Iris is 6.84:1 on Paper but 2.53:1 on Ink; Iris Light is the reverse
   (6.05:1 on Ink, 2.86:1 on Paper). Never use one where the other belongs —
   always reach for --sv-accent, which already resolves per theme. */
