/* Ragnity — CORE — docs/design-system.md */

/* Never hardcode a value in a component; add a token here instead.  [docs/design-system.md] */

:root {
  /* If you retune a colour by hand, the figures do not follow it: re-derive them.  [docs/design-system.md] */

  --color-ink:            #0C0D13;  /* near-black, a whisper of blue */
  --color-paper:          #FBFAF9;  /* off-white, reads as white, warmer than #fff */
  --color-lavender:       #C2B2F8;  /* first accent — signal, CTAs, emphasis */

  /* Amber — the second accent, chosen 2026-08-08 and DECLARED BUT NOT IN… — docs/design-system.md */
  --color-amber:          #EFC174;

  /* Two band colours meant a rule about which chapter got which, and the rule was doing no work: one quiet surface says "new chapter" just as well and never has to be adjudicated. Keep it warm if it is ever retuned — a cool value here puts it back in conflict with paper, which is the thing mist could never solve.  [docs/design-system.md] */
  --color-linen:          #F0EEE7;

  /* Interaction states */
  --color-lavender-deep:  #B3A1F5;  /* lavender pressed/hover */
  --color-amber-deep:     #ECB354;  /* amber pressed/hover; ink still 10.29:1 on it */
  --color-linen-deep:     #E4E0D3;  /* dividers on linen, and its pressed state */
  --color-ink-lift:       #191A22;  /* raised surface inside an ink box */

  /* Text */
  --color-text:           var(--color-ink);
  --color-text-muted:     #5B5C64;  /* secondary text on paper AND linen (>=5:1 both) */
  --color-text-on-ink:    var(--color-paper);
  --color-text-on-ink-muted: #999AA3;

  /* Lines. Hairlines are decorative — never rely on them to convey meaning. */
  --color-hairline:       #E3E4E0;
  --color-hairline-ink:   rgba(251, 250, 249, 0.14);

  /* The hairline for a box sitting on a linen band. — docs/design-system.md */
  --color-hairline-linen: #D9D3C1;
  --color-border-strong:  var(--color-ink);  /* the "white box, black border" rule */

  /* Focus — must be visible on every surface */
  --color-focus:          #5C3DF4;
  --color-focus-on-ink:   var(--color-lavender);

  /* TYPE — docs/design-system.md */

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Fluid scale. Headlines set tight and negative-tracked; body stays calm. — docs/design-system.md */
  /* Ceiling 5.5rem -> 5rem on 2026-08-10: a touch smaller, still the display — docs/design-system.md */
  --text-display:   clamp(2.125rem, 7.2vw, 5rem);
  --text-h2:        clamp(2.1rem, 4.4vw, 3.75rem);
  --text-h3:        clamp(1.3rem, 1.8vw, 1.6rem);
  --text-lead:      clamp(1.05rem, 1.35vw, 1.3rem);
  /* The section lead is a step down from the hero's: 16px on a phone, 18px — docs/design-system.md */
  --text-lead-section: clamp(1rem, 1.05vw, 1.125rem);
  --text-body:      1rem;
  --text-small:     0.9375rem;
  --text-label:     0.75rem;    /* mono, uppercase, tracked */
  /* 13px. Mono, lowercase, untracked — a different job from --text-label, — docs/design-system.md */
  --text-meta:      0.8125rem;
  --text-numeral:   clamp(2.4rem, 4vw, 3.4rem);

  --leading-tight:  0.96;
  --leading-snug:   1.12;
  --leading-normal: 1.55;
  --leading-relaxed: 1.65;

  --tracking-display: -0.045em;
  --tracking-h2:      -0.035em;
  --tracking-h3:      -0.02em;
  --tracking-normal:  0;
  --tracking-label:   0.13em;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;

  /* ---------------------------------------------------------------------
     SPACE — 4px base
     --------------------------------------------------------------------- */

  --space-1:  0.25rem;   /*   4 */
  --space-2:  0.5rem;    /*   8 */
  --space-3:  0.75rem;   /*  12 */
  --space-4:  1rem;      /*  16 */
  --space-5:  1.5rem;    /*  24 */
  --space-6:  2rem;      /*  32 */
  --space-7:  3rem;      /*  48 */
  --space-8:  4rem;      /*  64 */
  --space-9:  6rem;      /*  96 */
  --space-10: 8rem;      /* 128 */
  --space-11: 10rem;     /* 160 */

  /* Vertical rhythm between major sections, fluid */
  --section-gap: clamp(var(--space-8), 9vw, var(--space-11));

  /* ---------------------------------------------------------------------
     LAYOUT
     --------------------------------------------------------------------- */

  --container-max:   82.5rem;  /* 1320px */
  --container-text:  46rem;    /* comfortable measure for prose */
  --gutter:          clamp(var(--space-4), 4vw, var(--space-7));
  --header-height:   4.5rem;

  /* RADIUS — the rounded-box language. — docs/design-system.md */

  --radius-sm:   0.5rem;    /*  8 — inputs, tags */
  --radius-md:   0.875rem;  /* 14 — small cards */
  --radius-lg:   1.5rem;    /* 24 — cards */
  --radius-xl:   2rem;      /* 32 — section boxes */
  --radius-2xl:  clamp(1.75rem, 3vw, 2.75rem); /* hero, fluid */
  --radius-pill: 999px;

  /* --shadow-sm and --shadow-md were declared here and never referenced by a single rule, on any surface, in the life of the project.  [docs/design-system.md] */

  /* ---------------------------------------------------------------------
     MOTION — short, eased, never bouncy.
     --------------------------------------------------------------------- */

  --ease:         cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration-fast: 140ms;
  --duration-base: 220ms;
  /* Long enough that a surface travelling the height of a card reads as one
     movement. Only the tile flood uses it; a colour change never should. */
  --duration-slow: 420ms;
}

/* Ragnity — Base — docs/design-system.md */

/* FONTS — self-hosted variable Geist. — docs/design-system.md */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-latin.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: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-latin-ext.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: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-mono-latin.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: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-mono-latin-ext.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;
}

/* --------------------------------------------------------------------------
   RESET
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The header is sticky, so an anchor that lands flush with the top of the — docs/design-system.md */
  scroll-padding-top: calc(var(--header-height) + var(--space-5));
}

body {
  background-color: var(--color-paper);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

/* --------------------------------------------------------------------------
   TYPE DEFAULTS
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-weight: var(--weight-medium);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-h2);
}

h3 {
  font-size: var(--text-h3);
  line-height: 1.25;
  letter-spacing: var(--tracking-h3);
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

strong {
  font-weight: var(--weight-medium);
}

/* --------------------------------------------------------------------------
   SHARED UTILITIES
   -------------------------------------------------------------------------- */

/* The mono microlabel. Used above every section heading and on metadata.
   This is the single most recognisable piece of the system — keep it consistent. */
.label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.label--on-ink {
  color: var(--color-text-on-ink-muted);
}

/* Small square bullet that precedes a label. Not an icon font, just a box. */
.label::before {
  content: "";
  width: 0.4em;
  height: 0.4em;
  background-color: currentColor;
  flex-shrink: 0;
}

.label--plain::before {
  display: none;
}

/* The lead under a section headline. The hero overrides both values back up —
   see .hero .lead in surfaces/landing.css — because there the lead is the
   page's second statement, not a caption. */
.lead {
  font-size: var(--text-lead-section);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  max-width: 42ch;
}

.lead--on-ink {
  color: var(--color-text-on-ink-muted);
}

/* Lavender emphasis inside an ink headline. */
.accent {
  color: var(--color-lavender);
}

.accent-linen {
  color: var(--color-linen);
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* It was never used: not on a page, not in a preview, and `git log -S` finds it in no commit in the project's history — it was written speculatively and the name that got adopted was .ink-surface.  [docs/design-system.md] */
.ink-surface :focus-visible {
  outline-color: var(--color-focus-on-ink);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background-color: var(--color-ink);
  color: var(--color-text-on-ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Layout — container, sections, and the vertical hairline grid. — docs/design-system.md */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-gap);
  position: relative;
  z-index: 1;
}

.section--tight {
  padding-block: calc(var(--section-gap) * 0.6);
}

/* Never put two different band colours next to each other. Since 2026-08-08 there are only two band colours left, so in practice this means: an ink band never touches a linen one.  [docs/design-system.md] */

.section--ink {
  background-color: var(--color-ink);
  color: var(--color-text-on-ink);
}

/* The quiet band, and the only light one. Ink text and every paper-safe token
   carry over unchanged, so a section can be switched to it without touching
   anything inside. */
.section--linen {
  background-color: var(--color-linen);
  color: var(--color-ink);
}

/* Same colour twice in a row is one chapter, so the seam between them… — docs/design-system.md */
.section--ink + .section--ink,
.section--linen + .section--linen {
  padding-top: 0;
}

/* Section header: mono label, headline, optional lead. Used by every section
   so the rhythm down the page stays identical. */
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-8);
  max-width: var(--container-text);
}

.section-head__title {
  max-width: 18ch;
}

/* Do not reach for it because a section looks empty.  [docs/design-system.md] */
.section-head--center {
  align-items: center;
  margin-inline: auto;
  text-align: center;
}

/* The decorative four-column hairline grid was removed on 2026-08-06. — docs/design-system.md */

/* Button — pill-shaped, four surface variants. — docs/design-system.md */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--duration-base) var(--ease),
    border-color var(--duration-base) var(--ease),
    color var(--duration-base) var(--ease),
    transform var(--duration-fast) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

/* The trailing arrow nudges on hover — the only decorative motion on the page. */
.btn__arrow {
  display: inline-block;
  transition: transform var(--duration-base) var(--ease);
}

.btn:hover .btn__arrow {
  transform: translate(0.15em, -0.15em);
}

/* -- Variants ------------------------------------------------------------- */

/* Primary signal. Lavender box, ink text. */
.btn--primary {
  background-color: var(--color-lavender);
  color: var(--color-ink);
}

.btn--primary:hover {
  background-color: var(--color-lavender-deep);
}

/* Solid ink. The header CTA and anything on a paper surface. */
.btn--ink {
  background-color: var(--color-ink);
  color: var(--color-text-on-ink);
}

.btn--ink:hover {
  background-color: var(--color-ink-lift);
}

/* White box, black border — the third of the three core box treatments. */
.btn--outline {
  background-color: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-ink);
}

.btn--outline:hover {
  background-color: var(--color-ink);
  color: var(--color-text-on-ink);
}

/* Secondary action sitting on an ink surface. */
.btn--ghost {
  background-color: transparent;
  border-color: var(--color-hairline-ink);
  color: var(--color-text-on-ink);
}

.btn--ghost:hover {
  border-color: var(--color-paper);
}

/* -- Sizes ---------------------------------------------------------------- */

.btn--lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-body);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-label);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* No shared arrow class, and that is a decision (2026-08-21) — docs/design-system.md */

/* Site header — sticky, paper surface, hairline base. — docs/design-system.md */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-height);
}

/* -- Brand ---------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* The real mark, /assets/logo.svg, inlined as a path wherever it appears… — docs/design-system.md */
.brand__mark {
  height: 1.6rem;
  width: auto;
  aspect-ratio: 24 / 26;
  flex-shrink: 0;
}

.brand__word {
  font-size: 1.2rem;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.03em;
}

/* -- Navigation ----------------------------------------------------------- */

.site-nav {
  display: none;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.site-nav__link {
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease);
}

.site-nav__link:hover {
  color: var(--color-ink);
}

/* -- Right-hand cluster: language switch + CTA ---------------------------- */

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.lang-switch {
  display: none;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.lang-switch__item {
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease);
}

.lang-switch__item:hover {
  color: var(--color-ink);
}

.lang-switch__item[aria-current="true"] {
  color: var(--color-ink);
}

.lang-switch__sep {
  color: var(--color-hairline);
}

@media (min-width: 56rem) {
  .site-nav,
  .lang-switch {
    display: flex;
  }
}

/* Footer — paper surface, hairline structure, oversized closing wordmark. — docs/design-system.md */

.site-footer {
  border-top: 1px solid var(--color-hairline);
  padding-top: var(--space-8);
}

.site-footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  padding-bottom: var(--space-8);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 30ch;
}

.footer-brand__text {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.footer-col__title {
  margin-bottom: var(--space-4);
}

.footer-col__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-col__link {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease);
}

.footer-col__link:hover {
  color: var(--color-ink);
}

/* -- Bottom bar ----------------------------------------------------------- */

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-hairline);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

/* -- Oversized closing wordmark ------------------------------------------- */

.footer-wordmark {
  padding-bottom: var(--space-5);
  overflow: hidden;
  user-select: none;
}

/* It is purely decorative — aria-hidden, unselectable, never a heading — so the 1.11:1 it reads at on paper is the intent, not an accessibility failure.  [docs/design-system.md] */
.footer-wordmark span {
  display: block;
  font-size: clamp(4rem, 21vw, 20rem);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.05em;
  line-height: 0.82;
  color: var(--color-linen);
  white-space: nowrap;
}

@media (min-width: 48rem) {
  .site-footer__top {
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: var(--space-6);
  }
}

