/* ==========================================================================
   RiyalVerse — Design System
   1. Fonts  2. Tokens & themes  3. Base  4. Layout  5. Typography
   6. Components  7. Header / Nav  8. Hero  9. Sections  10. Domain visuals
   11. Process  12. Products  13. Forms  14. Footer  15. Prose  16. Motion
   ========================================================================== */

/* 1. Fonts (self-hosted, SIL OFL — see assets/fonts/OFL.txt) ------------- */
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../assets/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

/* 2. Tokens & themes ------------------------------------------------------
   Layout concept: a light, editorial research site on a 12-column grid, with
   one deep-navy band (products) and a navy footer for contrast.
   Colours derive from the logo: navy wordmark #27316D and the
   cyan → blue → violet node gradient.                                       */
:root {
  /* Light theme (default) */
  --bg: #fafbfc;                 /* soft white, not glaring pure white */
  --bg-alt: #f1f3f6;             /* cool grey band */
  --surface: #ffffff;
  --text: #0d1330;               /* deep navy ink */
  --text-muted: #4a5170;
  --text-dim: #5d6480;
  --line: rgba(13, 19, 48, 0.1);
  --line-strong: rgba(13, 19, 48, 0.2);
  --grid: rgba(13, 19, 48, 0.045);

  --accent-text: #0b6f96;        /* cyan, darkened for text on light */
  --accent: #0b8fc4;             /* cyan for graphics on light */
  --accent-2: #4058e8;           /* blue */
  --accent-3: #7c3fd9;           /* violet — used sparingly */

  --viz-line: rgba(13, 19, 48, 0.32);
  --viz-faint: rgba(13, 19, 48, 0.12);
  --viz-node-fill: #ffffff;
  --viz-node-stroke: rgba(13, 19, 48, 0.7);
  --viz-wave: rgba(13, 19, 48, 0.5);
  --hero-ink: 13, 19, 48;        /* RGB triplet read by js/hero.js */

  --btn-bg: #0d1330;
  --btn-fg: #ffffff;
  --btn-hover: #27316d;

  --status-live: #1f9d6b;
  --status-dev: var(--accent);
  --status-proto: var(--accent-3);
  --status-explore: #8a90a6;

  --ok: #1f9d6b;
  --danger: #c23b3b;
  --header-bg: rgba(250, 251, 252, 0.88);
  --selection: rgba(11, 143, 196, 0.18);

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --fs-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.1rem);
  --fs-2xl: clamp(1.85rem, 1.4rem + 2vw, 3rem);
  --fs-display: clamp(2.4rem, 1.4rem + 4vw, 4.6rem);

  /* Space & layout */
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
  --container: 1240px;
  --section-y: clamp(4rem, 2.6rem + 5.5vw, 8rem);
  --header-h: 68px;
  --radius: 6px;
  --radius-lg: 12px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 900ms;

  color-scheme: light;
}

/* Dark band: products section, product cards and the footer */
.theme-dark {
  --bg: #0a0f22;
  --bg-alt: #0d1329;
  --surface: #111832;
  --text: #e6e9f1;
  --text-muted: #a7afc4;
  --text-dim: #8089a4;
  --line: rgba(163, 178, 214, 0.14);
  --line-strong: rgba(163, 178, 214, 0.28);
  --grid: rgba(163, 178, 214, 0.05);
  --accent-text: #3cc8f5;
  --accent: #3cc8f5;
  --accent-2: #5a77f7;
  --accent-3: #9a5cf0;
  --viz-line: rgba(163, 178, 214, 0.35);
  --viz-faint: rgba(163, 178, 214, 0.14);
  --viz-node-fill: #0a0f22;
  --viz-node-stroke: rgba(236, 239, 246, 0.75);
  --viz-wave: rgba(236, 239, 246, 0.6);
  --btn-bg: #e6e9f1;
  --btn-fg: #0a0f22;
  --btn-hover: #ffffff;
  --status-live: #46d39a;
  --status-explore: #8089a4;
  --selection: rgba(60, 200, 245, 0.28);
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
}

/* 3. Base ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--selection); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  border-radius: var(--radius);
}
.skip-link:focus { top: 0.75rem; }

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

/* 4. Layout -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.section {
  position: relative;
  padding-block: var(--section-y);
  background: var(--bg);
}
.section--tight { padding-block: calc(var(--section-y) * 0.65); }
.section--rule { border-top: 1px solid var(--line); }
.section--alt { background: var(--bg-alt); }

/* Section header: label column + heading column */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 2rem;
  align-items: start;
  margin-bottom: clamp(2.25rem, 1.8rem + 2vw, 3.75rem);
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: 3fr 9fr; }
  .section-head > .label { padding-top: 0.7em; }
}
.section-head__body { max-width: 50rem; min-width: 0; }
.section-head__body > * + * { margin-top: 1rem; }

.stack > * + * { margin-top: var(--stack, 1rem); }

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
}
.split > * { min-width: 0; }
@media (min-width: 960px) {
  .split { grid-template-columns: 5fr 7fr; gap: 4rem; }
  .split--even { grid-template-columns: 1fr 1fr; }
}

/* 5. Typography ---------------------------------------------------------- */
.display {
  font-size: var(--fs-display);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 500;
  text-wrap: balance;
}
.h2 {
  font-size: var(--fs-2xl);
  line-height: 1.1;
  letter-spacing: -0.028em;
  font-weight: 500;
  text-wrap: balance;
}
.h3 {
  font-size: var(--fs-xl);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
  text-wrap: balance;
}
.h4 {
  font-size: var(--fs-lg);
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 500;
  text-wrap: balance;
}
.lead {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 40rem;
}
@media (min-width: 900px) { .lead { font-size: 1.175rem; } }

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.label--accent { color: var(--accent-text); }

.mono { font-family: var(--font-mono); font-size: 0.92em; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color var(--dur) var(--ease-out);
}
.text-link:hover { border-color: var(--accent); }
.arrow { transition: transform var(--dur) var(--ease-out); }
.text-link:hover .arrow, .btn:hover .arrow { transform: translateX(3px); }

.prose-link {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur) var(--ease-out);
}
.prose-link:hover { text-decoration-color: var(--accent); }

/* 6. Components ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out);
}
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn--primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn--ghost:hover { border-color: var(--text-muted); background: var(--surface); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Status pill */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-color, var(--status-explore));
}
.status--live { --status-color: var(--status-live); }
.status--dev { --status-color: var(--status-dev); }
.status--proto { --status-color: var(--status-proto); }
.status--explore { --status-color: var(--status-explore); }

/* Definition list */
.meta-list { display: grid; border-top: 1px solid var(--line); }
.meta-list > div {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 2fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.meta-list dt {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-top: 0.15rem;
}
.meta-list dd { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .meta-list > div { grid-template-columns: 1fr; gap: 0.25rem; } }

/* Callout */
.note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-2);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.note strong { color: var(--text); font-weight: 500; }

/* 7. Header / Nav -------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.site-header.is-scrolled,
.site-header.is-open {
  background: var(--header-bg);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { width: 160px; height: auto; }

.nav { display: none; }
.nav__list { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.85rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--text); }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 4px;
  height: 1.5px;
  background: var(--accent);
}
.header-cta { display: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-right: -10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle__bars { position: relative; width: 20px; height: 10px; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--dur) var(--ease-out), top var(--dur) var(--ease-out);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { top: 8.5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 4.25px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 4.25px; transform: rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 49;
  padding: 1.5rem max(var(--gutter), env(safe-area-inset-right, 0px)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
  background: var(--bg);
  border-top: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav__list { list-style: none; margin: 0; padding: 0; }
.mobile-nav__list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
.mobile-nav__list a[aria-current="page"] { color: var(--accent-text); }
.mobile-nav__foot { font-size: var(--fs-sm); color: var(--text-muted); }
.mobile-nav__foot a { color: var(--text); }

body.nav-open { overflow: hidden; }

@media (min-width: 900px) {
  .nav { display: block; }
  .header-cta { display: inline-flex; min-height: 38px; padding: 0.5rem 1rem; }
  .nav-toggle, .mobile-nav { display: none !important; }
  .brand img { width: 172px; }
}

/* 8. Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2rem, 1rem + 4vw, 4.5rem));
  padding-bottom: clamp(3rem, 2rem + 4vw, 5.5rem);
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
}
.hero::before {
  /* coordinate grid — visible even with JS/animation disabled */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 70% 45%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 70% at 70% 45%, #000 25%, transparent 80%);
}
.hero::after {
  /* soft brand wash behind the lattice */
  content: "";
  position: absolute;
  z-index: -2;
  width: 60vmax; height: 60vmax;
  right: -16vmax; top: 48%;
  transform: translateY(-50%);
  background: radial-gradient(closest-side, rgba(64, 88, 232, 0.08), rgba(11, 143, 196, 0.04) 55%, transparent 75%);
  pointer-events: none;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
}
.hero__content { position: relative; z-index: 2; min-width: 0; }
.hero__content > .label { margin-bottom: 1.5rem; }
.hero__title span { display: block; }
.hero__title .soft { color: var(--text-dim); }
.hero__lead { margin-top: 1.5rem; }
.hero .btn-row { margin-top: 2rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  margin-top: 3rem;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.hero__meta li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero__meta li::before {
  content: "";
  width: 5px; height: 5px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

.hero__visual {
  position: relative;
  z-index: 1;
  aspect-ratio: 1 / 1;
  width: min(100%, 560px);
  max-width: 100%;
  margin-inline: auto;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__caption {
  position: absolute;
  left: 0; right: 0; bottom: -0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.frame-ticks { position: absolute; inset: 0; pointer-events: none; }
.frame-ticks::before,
.frame-ticks::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--line-strong);
}
.frame-ticks::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.frame-ticks::after { right: 0; bottom: 1.25rem; border-left: 0; border-top: 0; }

@media (min-width: 900px) {
  .hero { min-height: min(100svh, 920px); display: flex; align-items: center; }
  .hero > .container { width: 100%; }
  .hero__grid { grid-template-columns: 6fr 6fr; gap: 1rem; }
  .hero__visual { width: 100%; max-width: 620px; }
}
@media (max-width: 899px) {
  .hero__visual { order: -1; width: min(82vw, 400px); margin-bottom: -0.5rem; }
  .hero__caption { display: none; }
}

/* Page hero (inner pages) */
.page-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3rem, 1.8rem + 5vw, 6.5rem));
  padding-bottom: clamp(2.75rem, 2rem + 3.5vw, 5rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.page-hero .label { margin-bottom: 1.25rem; }
.page-hero .display { max-width: 18ch; font-size: clamp(2.2rem, 1.5rem + 3.2vw, 4rem); }
.page-hero .lead { margin-top: 1.25rem; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.breadcrumb a:hover { color: var(--text); }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line-strong); }

/* 9. Sections ------------------------------------------------------------ */
.statement {
  font-size: clamp(1.45rem, 1.05rem + 1.7vw, 2.45rem);
  line-height: 1.24;
  letter-spacing: -0.022em;
  font-weight: 400;
  max-width: 30ch;
  text-wrap: pretty;
}
.statement strong { font-weight: 500; }
.statement em { font-style: normal; color: var(--text-dim); }

/* Text grid with hairline rules (purpose / principles) */
.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 var(--gutter);
  margin-top: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
  list-style: none;
  padding: 0;
}
.principles li { padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--line-strong); min-width: 0; }
.principles h3 { font-size: var(--fs-md); font-weight: 500; margin: 0.6rem 0 0.4rem; letter-spacing: -0.01em; }
.principles p { color: var(--text-muted); font-size: var(--fs-sm); max-width: 36ch; }
@media (min-width: 640px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .principles--3 { grid-template-columns: repeat(3, 1fr); } }

/* Research domains */
.domains {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 720px) and (max-width: 1023px) {
  .domains { grid-template-columns: 1fr 1fr; }
  .domains > :last-child { grid-column: span 2; }
}
@media (min-width: 1024px) { .domains { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }

.domain {
  --domain-color: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}
.domain--bci { --domain-color: var(--accent-2); }
.domain--spatial { --domain-color: var(--accent-3); }
.domain:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -18px rgba(13, 19, 48, 0.25);
}
.domain__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.domain__visual {
  position: relative;
  height: 190px;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
  overflow: hidden;
}
.domain__visual svg { width: 100%; height: 100%; }
.domain__title { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; }
.domain__text { margin-top: 0.7rem; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.65; }
.domain__foot { margin-top: auto; padding-top: 1.5rem; }
.domain .text-link { font-size: var(--fs-sm); }
.domain .text-link:hover { border-color: var(--domain-color); }

/* Detail block (research page) */
.detail {
  --domain-color: var(--accent);
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-block: clamp(3rem, 2.2rem + 3.5vw, 5.5rem);
  border-top: 1px solid var(--line);
}
.detail:first-child { border-top: 0; padding-top: 0; }
.detail > * { min-width: 0; }
.detail--bci { --domain-color: var(--accent-2); }
.detail--spatial { --domain-color: var(--accent-3); }
.detail__aside .label { color: var(--domain-color); }
.detail--ai .detail__aside .label { color: var(--accent-text); }
.detail__aside .h2 { margin-top: 0.9rem; }
.detail__aside .domain__visual { height: 230px; margin: 1.75rem 0 0; }
.detail__body > * + * { margin-top: 1.25rem; }
.detail__body h3 { font-size: var(--fs-md); font-weight: 500; letter-spacing: -0.01em; margin-top: 2.25rem; }
@media (min-width: 960px) {
  .detail { grid-template-columns: 5fr 7fr; gap: 4rem; }
  .detail__aside { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
}

.focus-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.focus-list li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.focus-list .mono { color: var(--text-dim); font-size: var(--fs-xs); padding-top: 0.2rem; }
.focus-list strong { display: block; font-weight: 500; }
.focus-list span:not(.mono) { color: var(--text-muted); font-size: var(--fs-sm); }

.horizon {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.horizon > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; min-width: 0; }
.horizon h4 { margin-bottom: 0.75rem; }
.horizon ul { margin: 0; padding-left: 1.1rem; color: var(--text-muted); font-size: var(--fs-sm); }
.horizon li + li { margin-top: 0.35rem; }
@media (min-width: 640px) { .horizon { grid-template-columns: 1fr 1fr; } }

/* Collaborations */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 560px; }
.table th, .table td { text-align: left; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-alt);
}
.table tr:last-child td { border-bottom: 0; }
.table td.mono { color: var(--text-muted); white-space: nowrap; }

.inst-list {
  display: grid;
  grid-template-columns: 1fr;
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}
.inst-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}
.inst-list .label { flex-shrink: 0; }
@media (min-width: 760px) { .inst-list { grid-template-columns: 1fr 1fr; column-gap: var(--gutter); } }

/* CTA band */
.cta__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: end;
}
.cta__inner > * { min-width: 0; }
.cta .h2 { max-width: 16ch; }
.cta__channels { list-style: none; padding: 0; border-top: 1px solid var(--line-strong); }
.cta__channels li { border-bottom: 1px solid var(--line-strong); }
.cta__channels a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
  transition: color var(--dur-fast) var(--ease-out);
}
.cta__channels a:hover { color: var(--accent-text); }
.cta__channels .value { text-align: right; overflow-wrap: anywhere; }
@media (min-width: 960px) { .cta__inner { grid-template-columns: 7fr 5fr; gap: 4rem; } }

/* 10. Domain visuals (SVG) ---------------------------------------------- */
.viz { color: var(--domain-color, var(--accent)); }
.viz .v-line { stroke: var(--viz-line); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.viz .v-faint { stroke: var(--viz-faint); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.viz .v-node { fill: var(--viz-node-fill); stroke: var(--viz-node-stroke); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viz .v-node--hot { fill: currentColor; stroke: currentColor; }
.viz .v-text { fill: var(--text-dim); }
.viz .v-axis { stroke: var(--viz-line); }
.viz .v-flow {
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 6 120;
  vector-effect: non-scaling-stroke;
  animation: flow 3.2s linear infinite;
}
.viz .v-flow:nth-of-type(2n) { animation-duration: 4.1s; animation-delay: -1.3s; }
.viz .v-flow:nth-of-type(3n) { animation-duration: 3.6s; animation-delay: -2.2s; }
@keyframes flow { from { stroke-dashoffset: 126; } to { stroke-dashoffset: 0; } }

.viz .v-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 3.2s var(--ease-out) infinite; }
@keyframes pulse {
  0% { opacity: 0.55; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(3.2); }
}

.viz .v-wave { stroke: var(--viz-wave); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.viz .v-wave--hot { stroke: currentColor; stroke-width: 1.25; }
.viz .v-track { transform-box: fill-box; animation: wave 9s linear infinite; }
.viz .v-track:nth-child(2) { animation-duration: 12s; }
.viz .v-track:nth-child(3) { animation-duration: 7.5s; }
.viz .v-track:nth-child(4) { animation-duration: 10.5s; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.viz .v-scan { animation: scanx 4.5s var(--ease-in-out) infinite alternate; }
@keyframes scanx { from { transform: translateX(0); } to { transform: translateX(var(--scan-dist, 260px)); } }

.viz .v-plane { fill: currentColor; fill-opacity: 0.08; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; animation: plane 5s var(--ease-in-out) infinite alternate; }
@keyframes plane { from { transform: translateY(0); } to { transform: translateY(58px); } }
.viz .v-orbit { animation: orbit 20s linear infinite; }
@keyframes orbit { to { stroke-dashoffset: -160; } }

.viz.is-paused * { animation-play-state: paused !important; }

/* 11. Process ------------------------------------------------------------ */
.process { position: relative; --progress: 0; }
.process__track { position: absolute; background: var(--line-strong); }
.process__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  transform-origin: left center;
  transform: scaleX(var(--progress));
}
.process__list { list-style: none; margin: 0; padding: 0; display: grid; }
.process__step { position: relative; min-width: 0; }
.process__node {
  position: relative;
  z-index: 1;
  display: block;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}
.section--alt .process__node { background: var(--bg-alt); }
.process__step.is-active .process__node {
  background: var(--text);
  border-color: var(--text);
  box-shadow: 0 0 0 4px var(--line);
}
.process__num { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.1em; color: var(--text-dim); }
.process__title { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.015em; margin: 0.35rem 0 0.6rem; }
.process__text { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.65; max-width: 30ch; }
.process__body { transition: opacity var(--dur-slow) var(--ease-out); }
.js .process__step:not(.is-active) .process__body { opacity: 0.55; }

@media (max-width: 899px) {
  .process__track { left: 5px; top: 6px; bottom: 6px; width: 1px; }
  .process__fill { transform-origin: center top; transform: scaleY(var(--progress)); background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3)); }
  .process__step { display: grid; grid-template-columns: 11px 1fr; gap: 1.25rem; padding-bottom: 2.25rem; }
  .process__step:last-child { padding-bottom: 0; }
  .process__node { margin-top: 0.25rem; }
}
@media (min-width: 900px) {
  .process__track { left: 0; right: 0; top: 5px; height: 1px; }
  .process__list { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
  .process__node { margin-bottom: 1.75rem; }
}

/* 12. Products ----------------------------------------------------------- */
.product {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.product__media {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
}
.product__media img,
.product__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.product__body { padding: clamp(1.4rem, 1.1rem + 1.4vw, 2.5rem); display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.product__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.product__name { font-size: var(--fs-xl); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.product__value { color: var(--text-muted); max-width: 46ch; }
@media (min-width: 960px) {
  .product { grid-template-columns: 7fr 5fr; }
  .product__media { aspect-ratio: auto; min-height: 100%; }
}

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 0.85rem; list-style: none; padding: 0; }
.thumbs li { min-width: 0; }
.thumbs figure { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.thumbs img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.thumbs figcaption { padding: 0.6rem 0.75rem; font-size: var(--fs-xs); color: var(--text); }
.thumbs figcaption .mono { display: block; color: var(--text-dim); font-size: 0.6875rem; }
@media (max-width: 600px) { .thumbs { grid-template-columns: 1fr 1fr; } .thumbs li:last-child { grid-column: span 2; } }

.pipeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.pipeline__slot {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
}
.pipeline__slot p { color: var(--text-muted); font-size: var(--fs-sm); max-width: 36ch; }
@media (min-width: 760px) { .pipeline { grid-template-columns: repeat(3, 1fr); } }

.status-legend { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.status-legend li {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  align-items: center;
}
.status-legend .status { justify-self: start; }
@media (max-width: 560px) { .status-legend li { grid-template-columns: 1fr; gap: 0.5rem; } }

/* 13. Forms -------------------------------------------------------------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(1.4rem, 1rem + 2vw, 2.5rem);
  min-width: 0;
}
.form { display: grid; gap: 1.25rem; }
.form__row { display: grid; gap: 1.25rem; }
.form__row > * { min-width: 0; }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.5rem; }
.field label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field label .opt { color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--fs-base);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--text-dim); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--selection);
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__error { font-size: var(--fs-xs); color: var(--danger); }
.field__error:empty { display: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.form__fine { font-size: var(--fs-xs); color: var(--text-dim); max-width: 34rem; }

.form-status {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
}
.form-status[hidden] { display: none; }
.form-status--ok { border-color: var(--ok); }
.form-status--err { border-color: var(--danger); }
.form-status strong { display: block; font-weight: 500; margin-bottom: 0.2rem; }
.form-status a { text-decoration: underline; text-underline-offset: 3px; }

/* 14. Footer ------------------------------------------------------------- */
.site-footer {
  padding-top: clamp(3.5rem, 2.5rem + 4vw, 5.5rem);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  font-size: var(--fs-sm);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.footer-grid > * { min-width: 0; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 4fr 2fr 2fr 3fr; gap: 3rem; } }
.footer-brand img { width: 164px; }
.footer-brand p { margin-top: 1.25rem; color: var(--text-muted); max-width: 32ch; line-height: 1.65; }
.footer-col h2 {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.footer-col a { color: var(--text-muted); transition: color var(--dur-fast) var(--ease-out); }
.footer-col a:hover { color: var(--text); }
.footer-col address { font-style: normal; color: var(--text-muted); line-height: 1.65; }
.footer-col address + address { margin-top: 0.75rem; }

.social { display: flex; gap: 0.5rem; margin-top: 1.25rem; list-style: none; padding: 0; }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.social a:hover { color: var(--text); border-color: var(--line-strong); }
.social svg { width: 16px; height: 16px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: var(--fs-xs);
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; padding: 0; margin: 0; }
.footer-bottom a:hover { color: var(--text); }

/* 15. Prose (legal pages) ----------------------------------------------- */
.prose { max-width: 46rem; color: var(--text-muted); line-height: 1.75; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { margin-top: 2.75rem; font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.015em; color: var(--text); }
.prose strong { color: var(--text); font-weight: 500; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.4rem; }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose .last-updated { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }

/* 16. Motion ------------------------------------------------------------- */
/* Content stays visible at rest; reveals only add a short rise into place. */
.js [data-reveal] {
  transform: translateY(16px);
  transition: transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}
.js [data-reveal].is-in { transform: none; }

.js .hero [data-intro] {
  opacity: 0;
  transform: translateY(14px);
  animation: intro 1s var(--ease-out) forwards;
  animation-delay: calc(var(--intro-delay, 0) * 110ms + 120ms);
}
@keyframes intro { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal], .js .hero [data-intro] { opacity: 1; transform: none; }
  .viz .v-flow { stroke-dasharray: none; stroke-opacity: 0.6; }
  .viz .v-pulse { display: none; }
}
