/* Eudaimonia V5.2 design tokens
   ETHRAEON Systems. Edition 2026-11-02.
   Ground: atmospheric light blues with layered depth. White ground and flat surfaces are retired.
   Colour is authored in OKLCH with an sRGB fallback declared first on every role.
   Type foundations carried forward: Cinzel (display), Cormorant Garamond (headlines),
   Archivo (body and interface), IBM Plex Mono (technical and data).
   Accessibility foundations carried forward: visible focus, 44px targets, reduced motion, keyboard operation. */

:root {
  color-scheme: light;

  /* ---------- Atmosphere: the ground is a sky, never paper ---------- */
  --v52-sky-0: #f3f8fd;  --v52-sky-0: oklch(97.6% 0.010 240);
  --v52-sky-1: #e8f1fa;  --v52-sky-1: oklch(95.4% 0.018 240);
  --v52-sky-2: #d9e8f6;  --v52-sky-2: oklch(92.4% 0.030 242);
  --v52-sky-3: #c3d9ef;  --v52-sky-3: oklch(87.8% 0.045 244);
  --v52-glacier: #9ec2e6; --v52-glacier: oklch(80.5% 0.068 245);
  --v52-horizon: #78a6d6; --v52-horizon: oklch(71.6% 0.090 248);
  --v52-cerulean: #3f78b8; --v52-cerulean: oklch(56.4% 0.118 252);
  --v52-lapis: #1f4f8f;  --v52-lapis: oklch(43.0% 0.118 258);
  --v52-deep: #12335f;   --v52-deep: oklch(32.6% 0.092 260);
  --v52-ink: #0d2240;    --v52-ink: oklch(25.0% 0.068 260);
  --v52-ink-2: #34506f;  --v52-ink-2: oklch(42.6% 0.058 252);
  --v52-ink-3: #5b7491;  --v52-ink-3: oklch(54.4% 0.050 250);

  /* Soft companions to the blues, used for state and for identity accents with a source reason */
  --v52-dawn: #f1e3d6;   --v52-dawn: oklch(92.4% 0.025 60);
  --v52-lilac: #dcd8f2;  --v52-lilac: oklch(88.8% 0.038 290);
  --v52-sea: #cfe9e4;    --v52-sea: oklch(91.0% 0.034 180);

  /* State colours (all pass 4.5:1 on --v52-sky-0 as text) */
  --v52-ok: #1f6b4f;     --v52-ok: oklch(46% 0.090 162);
  --v52-warn: #b9502c;   --v52-warn: oklch(49% 0.110 65);
  --v52-stop: #a3262f;   --v52-stop: oklch(48% 0.160 22);
  --v52-info: var(--v52-lapis);

  /* ---------- Semantic roles ---------- */
  --v52-ground: var(--v52-sky-1);
  --v52-ground-image:
    radial-gradient(120% 80% at 12% -10%, var(--v52-sky-0) 0%, transparent 58%),
    radial-gradient(90% 70% at 100% 0%, var(--v52-sky-2) 0%, transparent 62%),
    linear-gradient(180deg, var(--v52-sky-1) 0%, var(--v52-sky-2) 100%); /* @kind color */
  --v52-plane-1: color-mix(in oklch, var(--v52-sky-0) 88%, transparent);
  --v52-plane-2: color-mix(in oklch, var(--v52-sky-0) 72%, var(--v52-sky-2));
  --v52-plane-3: var(--v52-sky-2);
  --v52-plane-inverse: var(--v52-deep);
  --v52-text: var(--v52-ink);
  --v52-text-2: var(--v52-ink-2);
  --v52-text-3: var(--v52-ink-3);
  --v52-text-inverse: var(--v52-sky-0);
  --v52-line: color-mix(in oklch, var(--v52-glacier) 55%, transparent);
  --v52-line-strong: var(--v52-horizon);
  --v52-accent: var(--v52-lapis);
  --v52-accent-2: var(--v52-lapis);
  --v52-link: var(--v52-lapis);
  --v52-focus: var(--v52-lapis);
  --v52-focus-halo: color-mix(in oklch, var(--v52-glacier) 70%, transparent);

  /* ---------- Depth: three lights (ambient, key, rim) instead of one flat drop shadow ---------- */
  --v52-depth-0: none; /* @kind other */
  --v52-depth-1:
    0 1px 0 0 color-mix(in oklch, white 70%, transparent) inset,
    0 1px 2px color-mix(in oklch, var(--v52-deep) 10%, transparent),
    0 4px 12px -4px color-mix(in oklch, var(--v52-deep) 12%, transparent);
  --v52-depth-2:
    0 1px 0 0 color-mix(in oklch, white 75%, transparent) inset,
    0 2px 4px color-mix(in oklch, var(--v52-deep) 8%, transparent),
    0 12px 32px -10px color-mix(in oklch, var(--v52-deep) 22%, transparent);
  --v52-depth-3:
    0 1px 0 0 color-mix(in oklch, white 80%, transparent) inset,
    0 4px 8px color-mix(in oklch, var(--v52-deep) 8%, transparent),
    0 28px 64px -18px color-mix(in oklch, var(--v52-deep) 30%, transparent);
  --v52-depth-hero:
    0 40px 120px -40px color-mix(in oklch, var(--v52-lapis) 40%, transparent),
    0 12px 32px -12px color-mix(in oklch, var(--v52-deep) 18%, transparent);
  --v52-blur-plane: 18px; /* @kind other */

  /* ---------- Type ---------- */
  --v52-font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --v52-font-headline: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --v52-font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --v52-font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* Fluid scale, 320px to 1440px. Minimum body size 17px. */
  --v52-step--1: clamp(0.875rem, 0.84rem + 0.17vw, 0.9375rem); /* @kind other */
  --v52-step-0: clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem); /* @kind other */
  --v52-step-1: clamp(1.25rem, 1.17rem + 0.40vw, 1.5rem); /* @kind other */
  --v52-step-2: clamp(1.5rem, 1.36rem + 0.70vw, 2rem); /* @kind other */
  --v52-step-3: clamp(1.875rem, 1.62rem + 1.25vw, 2.75rem); /* @kind other */
  --v52-step-4: clamp(2.25rem, 1.85rem + 2.00vw, 3.75rem); /* @kind other */
  --v52-step-5: clamp(2.75rem, 2.10rem + 3.25vw, 5.25rem); /* @kind other */
  --v52-step-6: clamp(3.25rem, 2.30rem + 4.75vw, 7rem); /* @kind other */
  --v52-leading-tight: 1.06; /* @kind other */
  --v52-leading-head: 1.14; /* @kind other */
  --v52-leading-body: 1.62; /* @kind other */
  --v52-measure: 68ch; /* @kind other */
  --v52-tracking-display: 0.14em; /* @kind other */
  --v52-tracking-label: 0.12em; /* @kind other */

  /* ---------- Space: a modular 8px base with Fibonacci-proportioned section rhythm ---------- */
  --v52-space-1: 4px;  --v52-space-2: 8px;  --v52-space-3: 13px; --v52-space-4: 21px;
  --v52-space-5: 34px; --v52-space-6: 55px; --v52-space-7: 89px; --v52-space-8: 144px;
  --v52-gutter: clamp(16px, 4vw, 55px); /* @kind spacing */
  --v52-page-max: 1320px;
  --v52-text-max: 760px;
  --v52-target: 44px;

  /* ---------- Shape ---------- */
  --v52-radius-1: 6px; --v52-radius-2: 12px; --v52-radius-3: 20px; --v52-radius-4: 32px; --v52-radius-pill: 999px;

  /* ---------- Motion: one token group per interaction (see 3D/4D spec section 2) ---------- */
  --v52-ease-out: cubic-bezier(.16,1,.3,1); /* @kind other */
  --v52-ease-in-out: cubic-bezier(.65,0,.35,1); /* @kind other */
  --v52-dur-1: 120ms; /* @kind other */ --v52-dur-2: 220ms; /* @kind other */ --v52-dur-3: 420ms; /* @kind other */ --v52-dur-4: 720ms; /* @kind other */
  /* Spring parameters consumed by eth-motion.js: mass, stiffness, damping ratio */
  --v52-spring-menu: "1 420 0.86"; /* @kind other */
  --v52-spring-card: "1 260 0.78"; /* @kind other */
  --v52-spring-scene: "1 120 0.92"; /* @kind other */

  /* ---------- Layers ---------- */
  --v52-z-header: 900; /* @kind other */ --v52-z-menu: 950; /* @kind other */ --v52-z-dialog: 1000; /* @kind other */
}

/* ---------- Dark: deep ocean, the same blues seen at night ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --v52-ground: #08182b; --v52-ground: oklch(20% 0.045 255);
    --v52-ground-image:
      radial-gradient(120% 80% at 12% -10%, #12335f 0%, transparent 58%),
      radial-gradient(90% 70% at 100% 0%, #0f2a4d 0%, transparent 62%),
      linear-gradient(180deg, #08182b 0%, #061222 100%); /* @kind color */
    --v52-plane-1: color-mix(in oklch, #12335f 62%, transparent);
    --v52-plane-2: #10294a; --v52-plane-3: #163763;
    --v52-text: #e8f1fa; --v52-text-2: #b9cfe6; --v52-text-3: #8eabc9;
    --v52-line: color-mix(in oklch, #78a6d6 30%, transparent); --v52-line-strong: #3f78b8;
    --v52-accent: #9ec2e6; --v52-accent-2: #78a6d6; --v52-link: #b6d3f0; --v52-focus: #c3d9ef;
    --v52-focus-halo: color-mix(in oklch, #3f78b8 60%, transparent);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --v52-ground: #08182b;
  --v52-ground-image: radial-gradient(120% 80% at 12% -10%, #12335f 0%, transparent 58%), linear-gradient(180deg, #08182b 0%, #061222 100%); /* @kind color */
  --v52-plane-1: color-mix(in oklch, #12335f 62%, transparent);
  --v52-plane-2: #10294a; --v52-plane-3: #163763;
  --v52-text: #e8f1fa; --v52-text-2: #b9cfe6; --v52-text-3: #8eabc9;
  --v52-line: color-mix(in oklch, #78a6d6 30%, transparent); --v52-line-strong: #3f78b8;
  --v52-accent: #9ec2e6; --v52-accent-2: #78a6d6; --v52-link: #b6d3f0; --v52-focus: #c3d9ef;
  --v52-focus-halo: color-mix(in oklch, #3f78b8 60%, transparent);
}

/* ---------- Base ---------- */
html { background: var(--v52-ground); overflow-x: clip; }
body.v52 {
  margin: 0; min-height: 100vh; color: var(--v52-text); background: var(--v52-ground);
  background-image: var(--v52-ground-image); background-attachment: fixed;
  font: 400 var(--v52-step-0)/var(--v52-leading-body) var(--v52-font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.v52 :focus-visible { outline: 3px solid var(--v52-focus); outline-offset: 3px; box-shadow: 0 0 0 7px var(--v52-focus-halo); border-radius: var(--v52-radius-1); }
.v52 a { color: var(--v52-link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.v52 a:hover { text-decoration-thickness: 2px; }
.v52 img, .v52 svg, .v52 video, .v52 canvas { max-width: 100%; height: auto; }
.v52-skip { position: absolute; left: -9999px; top: 0; z-index: calc(var(--v52-z-dialog) + 1); }
.v52-skip:focus { left: var(--v52-space-3); top: var(--v52-space-3); padding: var(--v52-space-3) var(--v52-space-4); background: var(--v52-deep); color: var(--v52-sky-0); border-radius: var(--v52-radius-2); }

@media (prefers-reduced-motion: reduce) {
  .v52 *, .v52 *::before, .v52 *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .v52 :focus-visible { outline: 3px solid CanvasText; box-shadow: none; }
}
@media print {
  body.v52 { background: #fff; color: #000; }
}
