/* ============================================================
   ISLAND INVENTIONS — corporate site
   Aesthetic: AI-infrastructure dark · editorial serif x technical mono
   ============================================================ */

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  /* color */
  --bg:        #02050d;
  --bg-1:      #06091a;
  --bg-2:      #0a1024;
  --bg-3:      #101935;
  --surface:   rgba(255,255,255,0.025);
  --surface-2: rgba(255,255,255,0.045);
  --text:      #eef2fb;
  --text-mute: #93a3c4;
  --text-faint:#586378;

  --rule:      rgba(127,217,197,0.10);
  --rule-2:    rgba(127,217,197,0.18);
  --rule-warm: rgba(251,191,36,0.22);

  --c-cyan:      #5eead4;
  --c-cyan-2:    #67e8f9;
  --c-cyan-dim:  #2dd4bf;
  --c-amber:     #fbbf24;
  --c-amber-2:   #f59e0b;
  --c-rose:      #fb7185;
  --c-orange:    #fb923c;
  --c-emerald:   #34d399;
  --c-violet:    #a78bfa;

  /* page background washes */
  --body-wash-a: rgba(94,234,212,0.07);
  --body-wash-b: rgba(251,191,36,0.05);

  /* nav surface */
  --nav-grad-top: rgba(2,5,13,0.85);
  --nav-grad-bot: rgba(2,5,13,0.35);
  --nav-border:   rgba(255,255,255,0.04);

  /* hero atmospheric */
  --hero-glow-a: rgba(94,234,212,0.16);
  --hero-glow-b: rgba(251,191,36,0.10);
  --vignette-edge: rgba(2,5,13,0.85);
  --vignette-radial: rgba(2,5,13,0.45);

  /* signal field SVG gradient stops */
  --g-cool-edge:      rgba(94,234,212,0);
  --g-cool-soft:      rgba(94,234,212,0.08);
  --g-cool-mid:       rgba(94,234,212,0.32);
  --g-cool-end:       rgba(196,245,255,0.18);
  --g-cool-soft2:     rgba(103,232,249,0.20);
  --g-cool-mid2:      rgba(103,232,249,0.30);

  --g-warm-edge:      rgba(251,191,36,0);
  --g-warm-soft:      rgba(251,191,36,0.10);
  --g-warm-mid:       rgba(251,191,36,0.28);
  --g-warm-end:       rgba(252,211,77,0.18);
  --g-warm-soft2:     rgba(249,168,38,0.20);
  --g-warm-mid2:      rgba(252,211,77,0.30);

  /* thread / packet / contour colors */
  --thread-cool: rgba(94,234,212,0.55);
  --thread-warm: rgba(251,191,36,0.50);
  --contour-cool: rgba(94,234,212,0.55);
  --contour-warm: rgba(251,191,36,0.55);
  --packet-cool-fill: rgba(196,245,255,0.95);
  --packet-cool-glow: rgba(94,234,212,0.9);
  --packet-warm-fill: rgba(255,225,160,0.95);
  --packet-warm-glow: rgba(251,191,36,0.95);

  /* lake colors */
  --lake-core-1: rgba(242,253,255,0.55);
  --lake-core-2: rgba(173,232,247,0.32);
  --lake-core-3: rgba(104,172,196,0.18);
  --lake-core-4: rgba(34,81,104,0.14);
  --lake-sheen-cool: rgba(198,245,255,0.32);
  --lake-sheen-warm: rgba(251,191,36,0.18);
  --lake-ring-a: rgba(183,233,246,0.20);
  --lake-ring-b: rgba(251,191,36,0.18);
  --lake-ring-c: rgba(183,233,246,0.10);

  /* snippet card */
  --snip-bg: rgba(6,9,26,0.78);
  --snip-border: rgba(94,234,212,0.20);
  --snip-border-warm: rgba(251,191,36,0.22);
  --snip-tag-cool-bg: rgba(94,234,212,0.10);
  --snip-tag-warm-bg: rgba(251,191,36,0.10);

  /* decision stream panel */
  --stream-bg-a: rgba(6,9,26,0.85);
  --stream-bg-b: rgba(6,9,26,0.55);
  --stream-shadow: rgba(0,0,0,0.6);
  --stream-divider: rgba(127,217,197,0.06);

  /* product card backgrounds */
  --product-grad-a: var(--bg-1);
  --product-grad-b: rgba(6,9,26,0.4);
  --module-bg: rgba(255,255,255,0.012);
  --module-bg-hover: rgba(255,255,255,0.025);
  --tng-card-a: rgba(10,14,28,0.92);
  --tng-card-b: rgba(6,9,26,0.92);
  --tng-card-glow: rgba(251,191,36,0.18);

  /* runtime diagram fills/strokes */
  --rt-node-fill: rgba(255,255,255,0.025);
  --rt-node-stroke: rgba(94,234,212,0.30);
  --rt-node-warm-stroke: rgba(251,191,36,0.40);
  --rt-nexus-fill: rgba(94,234,212,0.06);
  --rt-aux-fill: rgba(255,255,255,0.02);
  --rt-aux-stroke: rgba(94,234,212,0.20);
  --rt-label: #eef2fb;
  --rt-sub: #8590a9;
  --rt-foot: #6a7693;
  --rt-aux-sub: #93a3c4;
  --rt-aux-foot: #586378;
  --rt-grad-edge: #5eead4;
  --rt-grad-mid: #5eead4;
  --rt-grad-warm-mid: #fbbf24;
  --rt-grad-mid-op: 0.8;
  --rt-grad-warm-mid-op: 0.7;
  --rt-cross-line: rgba(251,191,36,0.35);

  /* lake (runtime diagram) */
  --water-top:  rgba(94,234,212,0.32);
  --water-mid:  rgba(45,122,141,0.55);
  --water-deep: rgba(15,52,68,0.80);
  --lake-rim-color: rgba(94,234,212,0.45);
  --wave-back:  rgba(255,255,255,0.04);
  --wave-mid:   rgba(255,255,255,0.07);
  --wave-front: rgba(255,255,255,0.12);
  --shimmer:    rgba(255,255,255,0.55);
  --lake-title-color: rgba(238,242,251,0.96);
  --lake-sub-color:   rgba(238,242,251,0.55);
  --chip-bg:     rgba(255,255,255,0.08);
  --chip-border: rgba(255,255,255,0.28);
  --chip-text:   rgba(238,242,251,0.92);

  /* form */
  --field-bg: rgba(255,255,255,0.02);
  --field-bg-focus: rgba(94,234,212,0.04);
  --field-focus-ring: rgba(94,234,212,0.10);

  /* selection */
  --sel-bg: var(--c-cyan);
  --sel-fg: var(--bg);
}

/* ============================================================ THEME-AGNOSTIC TOKENS
   typography, layout, motion — shared across light & dark
============================================================ */
:root {
  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, ui-serif, serif;
  --font-sans: 'Mona Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --maxw: 1480px;
  --maxw-hero: 1760px;
  --gutter: clamp(24px, 5vw, 96px);
  --section-pad: clamp(80px, 12vh, 160px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============================================================ LIGHT THEME
   editorial parchment · warm cream paper + deep ink + Mediterranean teal & burnt sienna
============================================================ */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #f3ecdb;
  --bg-1:      #f9f3e3;
  --bg-2:      #fcf7e8;
  --bg-3:      #ffffff;
  --surface:   rgba(13,24,39,0.04);
  --surface-2: rgba(13,24,39,0.06);
  --text:      #0d1a2b;
  --text-mute: #5b6678;
  --text-faint:#8d97a8;

  --rule:      rgba(13,24,39,0.12);
  --rule-2:    rgba(15,118,110,0.30);
  --rule-warm: rgba(180,83,9,0.34);

  --c-cyan:      #0d7b6f;
  --c-cyan-2:    #0e7490;
  --c-cyan-dim:  #0f766e;
  --c-amber:     #b45309;
  --c-amber-2:   #92400e;
  --c-rose:      #be185d;
  --c-orange:    #c2410c;
  --c-emerald:   #047857;
  --c-violet:    #6d28d9;

  --body-wash-a: rgba(14,116,144,0.05);
  --body-wash-b: rgba(180,83,9,0.05);

  --nav-grad-top: rgba(243,236,219,0.92);
  --nav-grad-bot: rgba(243,236,219,0.55);
  --nav-border:   rgba(13,24,39,0.08);

  --hero-glow-a: rgba(14,116,144,0.16);
  --hero-glow-b: rgba(180,83,9,0.12);
  --vignette-edge: rgba(243,236,219,0.0);
  --vignette-radial: rgba(243,236,219,0.0);

  /* SVG gradient stops (deeper colors on warm paper) */
  --g-cool-edge:      rgba(13,123,111,0);
  --g-cool-soft:      rgba(13,123,111,0.10);
  --g-cool-mid:       rgba(13,123,111,0.42);
  --g-cool-end:       rgba(14,116,144,0.24);
  --g-cool-soft2:     rgba(14,116,144,0.20);
  --g-cool-mid2:      rgba(14,116,144,0.38);

  --g-warm-edge:      rgba(180,83,9,0);
  --g-warm-soft:      rgba(180,83,9,0.12);
  --g-warm-mid:       rgba(180,83,9,0.40);
  --g-warm-end:       rgba(217,119,6,0.24);
  --g-warm-soft2:     rgba(180,83,9,0.20);
  --g-warm-mid2:      rgba(217,119,6,0.38);

  --thread-cool: rgba(13,123,111,0.65);
  --thread-warm: rgba(180,83,9,0.60);
  --contour-cool: rgba(13,123,111,0.55);
  --contour-warm: rgba(180,83,9,0.55);
  --packet-cool-fill: rgba(13,123,111,1);
  --packet-cool-glow: rgba(13,123,111,0.55);
  --packet-warm-fill: rgba(180,83,9,1);
  --packet-warm-glow: rgba(180,83,9,0.55);

  --lake-core-1: rgba(255,250,236,0.85);
  --lake-core-2: rgba(228,213,178,0.55);
  --lake-core-3: rgba(150,180,170,0.35);
  --lake-core-4: rgba(13,123,111,0.22);
  --lake-sheen-cool: rgba(13,123,111,0.18);
  --lake-sheen-warm: rgba(180,83,9,0.18);
  --lake-ring-a: rgba(13,123,111,0.28);
  --lake-ring-b: rgba(180,83,9,0.24);
  --lake-ring-c: rgba(13,24,39,0.10);

  --snip-bg: rgba(255,250,236,0.92);
  --snip-border: rgba(13,123,111,0.32);
  --snip-border-warm: rgba(180,83,9,0.36);
  --snip-tag-cool-bg: rgba(13,123,111,0.12);
  --snip-tag-warm-bg: rgba(180,83,9,0.14);

  --stream-bg-a: rgba(255,250,236,0.95);
  --stream-bg-b: rgba(252,247,232,0.85);
  --stream-shadow: rgba(13,24,39,0.12);
  --stream-divider: rgba(13,24,39,0.08);

  --product-grad-a: #fffaef;
  --product-grad-b: #faf3e0;
  --module-bg: rgba(13,24,39,0.025);
  --module-bg-hover: rgba(13,24,39,0.05);
  --tng-card-a: rgba(255,250,236,0.95);
  --tng-card-b: rgba(252,247,232,0.95);
  --tng-card-glow: rgba(180,83,9,0.22);

  --rt-node-fill: rgba(255,250,236,0.7);
  --rt-node-stroke: rgba(13,123,111,0.45);
  --rt-node-warm-stroke: rgba(180,83,9,0.50);
  --rt-nexus-fill: rgba(13,123,111,0.08);
  --rt-aux-fill: rgba(255,250,236,0.7);
  --rt-aux-stroke: rgba(13,123,111,0.30);
  --rt-label: #0d1a2b;
  --rt-sub: #5b6678;
  --rt-foot: #8d97a8;
  --rt-aux-sub: #5b6678;
  --rt-aux-foot: #8d97a8;
  --rt-grad-edge: #0d7b6f;
  --rt-grad-mid: #0d7b6f;
  --rt-grad-warm-mid: #b45309;
  --rt-grad-mid-op: 0.85;
  --rt-grad-warm-mid-op: 0.75;
  --rt-cross-line: rgba(180,83,9,0.45);

  /* lake (runtime diagram) — deeper teal water on cream */
  --water-top:  rgba(94,180,170,0.45);
  --water-mid:  rgba(13,123,111,0.60);
  --water-deep: rgba(8,80,75,0.78);
  --lake-rim-color: rgba(13,123,111,0.55);
  --wave-back:  rgba(255,250,236,0.16);
  --wave-mid:   rgba(255,250,236,0.22);
  --wave-front: rgba(255,250,236,0.34);
  --shimmer:    rgba(255,250,236,0.75);
  --lake-title-color: rgba(4,52,48,0.95);
  --lake-sub-color:   rgba(7,55,50,0.62);
  --chip-bg:     rgba(255,250,236,0.20);
  --chip-border: rgba(255,250,236,0.42);
  --chip-text:   rgba(255,250,236,0.96);

  --field-bg: rgba(13,24,39,0.025);
  --field-bg-focus: rgba(13,123,111,0.06);
  --field-focus-ring: rgba(13,123,111,0.15);

  --sel-bg: #0d7b6f;
  --sel-fg: #fffaef;
}

* { box-sizing: border-box; }
*::selection { background: var(--sel-bg); color: var(--sel-fg); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { background: var(--bg); }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 380;
  font-stretch: 105%;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--body-wash-a), transparent 60%),
    radial-gradient(ellipse 70% 50% at 20% 110%, var(--body-wash-b), transparent 60%),
    var(--bg);
  transition: background-color 360ms var(--ease-out), color 360ms var(--ease-out);
}

img, svg { display: block; max-width: 100%; }

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

/* Inline product link — subtle dotted underline, color on hover */
.inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--c-cyan);
  text-underline-offset: 4px;
  transition: color 200ms var(--ease-out), text-decoration-color 200ms var(--ease-out);
}
.inline-link:hover {
  color: var(--c-cyan);
  text-decoration-style: solid;
}
.inline-link--warm {
  text-decoration-color: var(--c-amber);
}
.inline-link--warm:hover {
  color: var(--c-amber);
}

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

/* ============================================================ texture overlays */

.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[data-theme="light"] .grain {
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.1  0 0 0 0 0.16  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.scanline {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: 0.18;
  background-image: linear-gradient(to bottom, transparent 0, transparent 2px, rgba(255,255,255,0.012) 2px, rgba(255,255,255,0.012) 3px);
}
[data-theme="light"] .scanline {
  opacity: 0.10;
  background-image: linear-gradient(to bottom, transparent 0, transparent 2px, rgba(13,24,39,0.025) 2px, rgba(13,24,39,0.025) 3px);
}

/* ============================================================ shared */

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.02;
}
.display em {
  font-style: italic;
  color: var(--c-cyan);
}

.section-frame {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

.section-head {
  position: relative;
  padding-bottom: clamp(48px, 6vw, 80px);
}
.section-num {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  color: var(--c-cyan);
  margin-bottom: 32px;
}
.section-title {
  font-size: clamp(2.4rem, 5.5vw, 5rem);
  max-width: 18ch;
}
.section-sub {
  margin-top: 24px;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: var(--text-mute);
  max-width: 60ch;
  line-height: 1.55;
}

main > section {
  padding: var(--section-pad) 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
main > section:first-of-type { border-top: none; }

main > section::before,
main > section::after {
  content: '';
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: linear-gradient(to right, transparent 0%, var(--rule-2) 10%, var(--rule-2) 90%, transparent 100%);
  opacity: 0.4;
}
main > section::before { top: 0; }
main > section::after { display: none; }

/* ============================================================ NAV */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: linear-gradient(to bottom, var(--nav-grad-top), var(--nav-grad-bot));
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--nav-border);
}
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  max-width: var(--maxw-hero);
  margin: 0 auto;
  padding: 18px var(--gutter);
}
.nav-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 500;
  font-stretch: 110%;
  letter-spacing: -0.005em;
}
.brand-mark { color: var(--c-cyan); display: inline-flex; }
.brand-name { font-size: 0.97rem; }

.nav-links {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--text-mute);
  transition: color 200ms var(--ease-out);
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 7px 12px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  color: var(--c-cyan) !important;
}
.nav-cta:hover {
  background: color-mix(in srgb, var(--c-cyan) 8%, transparent);
}

/* ============================================================ theme toggle */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.toggle-track {
  position: relative;
  width: 100%; height: 100%;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: color-mix(in srgb, var(--c-cyan) 4%, transparent);
  transition: background 280ms var(--ease-out), border-color 280ms var(--ease-out);
}
.toggle-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-cyan);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c-cyan) 60%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 360ms var(--ease-out), background 280ms var(--ease-out), box-shadow 280ms var(--ease-out);
  color: var(--bg);
}
[data-theme="light"] .toggle-thumb { left: calc(100% - 25px); }
.t-icon {
  position: absolute;
  width: 14px; height: 14px;
  transition: opacity 220ms var(--ease-out), transform 360ms var(--ease-out);
}
[data-theme="dark"]  .t-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"]  .t-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="light"] .t-sun  { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="light"] .t-moon { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-toggle:hover .toggle-thumb {
  box-shadow: 0 0 18px color-mix(in srgb, var(--c-cyan) 80%, transparent);
}
.theme-toggle:focus-visible {
  outline: none;
}
.theme-toggle:focus-visible .toggle-track {
  border-color: var(--c-cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-cyan) 25%, transparent);
}

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-emerald);
  box-shadow: 0 0 12px rgba(52,211,153,0.7);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

@media (max-width: 900px) {
  .nav { grid-template-columns: auto auto; gap: 14px; padding: 14px var(--gutter); }
  .nav-links { display: none; }
}

/* ============================================================ HERO */

.hero {
  position: relative;
  min-height: 100vh;
  padding-top: clamp(120px, 14vh, 180px);
  padding-bottom: clamp(80px, 10vh, 140px);
  overflow: hidden;
  border-top: none !important;
}
.hero::before { display: none !important; }

/* ============================================================ SIGNAL FIELD */

.signal-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/* atmospheric glows */
.sf-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.55;
  pointer-events: none;
}
.sf-glow-a {
  width: 700px; height: 700px;
  right: 6%; top: 8%;
  background: radial-gradient(circle, var(--hero-glow-a), transparent 70%);
}
.sf-glow-b {
  width: 600px; height: 600px;
  left: -5%; bottom: -10%;
  background: radial-gradient(circle, var(--hero-glow-b), transparent 70%);
}

.sf-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 35% 50%, var(--vignette-radial) 0%, transparent 55%),
    linear-gradient(to bottom, color-mix(in srgb, var(--bg) 60%, transparent) 0%, transparent 22%, transparent 78%, var(--vignette-edge) 100%);
  pointer-events: none;
}

/* SVG signal streams */
.sf-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sf-ribbons .ribbon {
  fill: none;
  stroke-linecap: round;
  filter: blur(2px);
  opacity: 0.58;
  animation: ribbon-breathe 14s var(--ease-in-out) infinite;
  animation-delay: var(--d, 0s);
  stroke-width: calc(var(--w, 18) * 1px);
}
.sf-ribbons .r-cool { stroke: url(#cool-a); }
.sf-ribbons .r-cool:nth-of-type(even) { stroke: url(#cool-b); }
.sf-ribbons .r-warm { stroke: url(#warm-a); }
.sf-ribbons .r-warm:nth-of-type(even) { stroke: url(#warm-b); }

.sf-threads .thread {
  fill: none;
  stroke-width: 1;
  opacity: 0.35;
  stroke-dasharray: 3 5;
  animation: dashFlow 28s linear infinite;
}
.sf-threads .t-cool { stroke: var(--thread-cool); }
.sf-threads .t-warm { stroke: var(--thread-warm); }

.sf-contours .contour {
  fill: none;
  stroke-width: 1;
  opacity: 0.22;
  stroke-dasharray: 2 4;
  animation: contour-pulse 9s var(--ease-in-out) infinite;
}
.sf-contours .c-cool { stroke: var(--contour-cool); animation-delay: 0s; }
.sf-contours .c-warm { stroke: var(--contour-warm); animation-delay: 4s; }

.sf-packets .pkt circle {
  animation: packet-glow 2.6s var(--ease-in-out) infinite;
}
.sf-packets .pkt-cool circle {
  fill: var(--packet-cool-fill);
  filter: drop-shadow(0 0 8px var(--packet-cool-glow));
}
.sf-packets .pkt-warm circle {
  fill: var(--packet-warm-fill);
  filter: drop-shadow(0 0 10px var(--packet-warm-glow));
}

/* SVG gradient stops (themed via classes) */
.g-cool.g-edge      { stop-color: var(--g-cool-edge); }
.g-cool.g-soft      { stop-color: var(--g-cool-soft); }
.g-cool.g-mid       { stop-color: var(--g-cool-mid); }
.g-cool.g-warm-end  { stop-color: var(--g-cool-end); }
.g-cool.g-soft2     { stop-color: var(--g-cool-soft2); }
.g-cool.g-mid2      { stop-color: var(--g-cool-mid2); }
.g-warm.g-edge      { stop-color: var(--g-warm-edge); }
.g-warm.g-soft      { stop-color: var(--g-warm-soft); }
.g-warm.g-mid       { stop-color: var(--g-warm-mid); }
.g-warm.g-warm-end  { stop-color: var(--g-warm-end); }
.g-warm.g-soft2     { stop-color: var(--g-warm-soft2); }
.g-warm.g-mid2      { stop-color: var(--g-warm-mid2); }

@keyframes ribbon-breathe {
  0%, 100% { opacity: 0.46; }
  50% { opacity: 0.72; }
}
@keyframes packet-glow {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
@keyframes contour-pulse {
  0%, 100% { opacity: 0.10; }
  50%      { opacity: 0.26; }
}

/* The NEXUS lake — central glowing convergence */
.lake {
  position: absolute;
  left: 58%;
  top: 30%;
  width: 28%;
  aspect-ratio: 1.05 / 1;
  transform: translate(0, 0) rotate(-6deg);
  pointer-events: none;
  z-index: 2;
}
@media (max-width: 1100px) {
  .lake { left: 50%; top: 38%; width: 44%; transform: translate(-50%, 0) rotate(-4deg); }
}

.lake-core {
  position: absolute; inset: 0;
  border-radius: 50% 45% 55% 48% / 48% 54% 46% 52%;
  background: radial-gradient(
    ellipse at 48% 46%,
    var(--lake-core-1) 0 5%,
    var(--lake-core-2) 16%,
    var(--lake-core-3) 34%,
    var(--lake-core-4) 54%,
    transparent 82%
  );
  filter: blur(4px);
  animation: lake-drift 22s var(--ease-in-out) infinite;
}
.lake-sheen {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg at 54% 50%,
    transparent 0 40%,
    var(--lake-sheen-cool) 50%,
    transparent 64%,
    var(--lake-sheen-warm) 74%,
    transparent 100%
  );
  filter: blur(12px);
  animation: lake-sheen 22s linear infinite;
  mix-blend-mode: screen;
}
.lake-ring {
  position: absolute; inset: 6%;
  border: 1px solid var(--lake-ring-a);
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0;
  animation: lake-ring 7.2s var(--ease-out) infinite;
}
.lake-ring-b { inset: -6%; border-color: var(--lake-ring-b); animation-delay: 2.4s; }
.lake-ring-c { inset: -18%; border-color: var(--lake-ring-c); animation-delay: 4.8s; }
[data-theme="light"] .lake-sheen { mix-blend-mode: multiply; opacity: 0.7; }
[data-theme="light"] .lake-ring { mix-blend-mode: multiply; }

@keyframes lake-drift {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
@keyframes lake-sheen {
  0%   { transform: rotate(0deg); opacity: 0.42; }
  50%  { transform: rotate(180deg); opacity: 0.6; }
  100% { transform: rotate(360deg); opacity: 0.42; }
}
@keyframes lake-ring {
  0%   { opacity: 0; transform: scale(0.9); }
  18%  { opacity: 0.34; }
  72%  { opacity: 0.16; }
  100% { opacity: 0; transform: scale(1.22); }
}

/* floating signal snippets — data callouts */
.snippets {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.snip {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 10px;
  background: var(--snip-bg);
  border: 1px solid var(--snip-border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  opacity: 0;
  animation: snip-cycle 9s var(--ease-in-out) infinite;
  animation-delay: var(--d, 0s);
  box-shadow:
    0 0 0 1px var(--surface) inset,
    0 20px 40px -20px var(--stream-shadow);
}
.snip-warm { border-color: var(--snip-border-warm); }
.snip-tag {
  text-transform: uppercase;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--snip-tag-cool-bg);
  color: var(--c-cyan);
  font-size: 0.6rem;
  letter-spacing: 0.10em;
}
.snip-warm .snip-tag { background: var(--snip-tag-warm-bg); color: var(--c-amber); }
.snip-msg { color: var(--text); text-transform: none; letter-spacing: 0.02em; }

@keyframes snip-cycle {
  0%   { opacity: 0; transform: translate(-50%, -46%); }
  12%  { opacity: 1; transform: translate(-50%, -50%); }
  78%  { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -54%); }
}

@media (max-width: 700px) {
  .snippets { display: none; }
  .sf-glow-a { width: 400px; height: 400px; }
  .sf-glow-b { width: 380px; height: 380px; }
}

.hero-inner {
  position: relative;
  z-index: 4;
  max-width: var(--maxw-hero);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: clamp(40px, 6vw, 120px);
  align-items: end;
  min-height: calc(100vh - 280px);
}
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  margin-bottom: 28px;
}
.eyebrow .bullet {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-cyan);
  box-shadow: 0 0 14px var(--c-cyan);
}
.eyebrow .mono { color: var(--c-cyan); }

h1#hero-title {
  font-size: clamp(3rem, 8.5vw, 7.5rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  max-width: 14ch;
}
h1#hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--c-cyan);
  position: relative;
}

.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--text-mute);
  max-width: 56ch;
  margin: 0 0 40px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border: 1px solid var(--rule-2);
  background: transparent;
  color: var(--text);
  transition: all 220ms var(--ease-out);
  position: relative;
  overflow: hidden;
}
.btn-arrow { transition: transform 220ms var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--c-cyan);
  color: var(--bg);
  border-color: var(--c-cyan);
}
.btn-primary:hover { background: #7ff3df; }
.btn-ghost:hover { background: rgba(94,234,212,0.07); border-color: var(--c-cyan); }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  max-width: 640px;
}
.hero-meta > div { display: flex; flex-direction: column; gap: 6px; }
.hero-meta dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero-meta dd { margin: 0; font-size: 0.92rem; color: var(--text); }

@media (max-width: 600px) {
  .hero-meta { grid-template-columns: 1fr; gap: 16px; }
}

/* hero stream column */

.hero-stream {
  background: linear-gradient(180deg, var(--stream-bg-a) 0%, var(--stream-bg-b) 100%);
  border: 1px solid var(--rule-2);
  border-radius: 14px;
  padding: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--c-cyan) 6%, transparent) inset,
    0 30px 80px -30px var(--stream-shadow);
}
.stream-head, .stream-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  color: var(--c-cyan);
}
.stream-foot {
  border-bottom: none;
  border-top: 1px solid var(--rule);
  color: var(--text-faint);
}
.stream-rate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pulse, .pulse-amber {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-cyan);
  box-shadow: 0 0 12px var(--c-cyan);
  animation: pulse 1.6s infinite;
}
.pulse-amber { background: var(--c-amber); box-shadow: 0 0 12px var(--c-amber); }

.stream-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  min-height: 360px;
  max-height: 360px;
  overflow: hidden;
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}
.stream-list li {
  padding: 9px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: baseline;
  color: var(--text-mute);
  border-bottom: 1px dashed var(--stream-divider);
  opacity: 0;
  transform: translateY(-6px);
  animation-name: streamIn;
  animation-duration: 320ms;
  animation-timing-function: var(--ease-out);
  animation-fill-mode: forwards;
}
.stream-list li .ts { color: var(--text-faint); }
.stream-list li .msg { color: var(--text); }
.stream-list li.kind-warm .msg { color: var(--c-amber); }
.stream-list li.kind-cool .msg { color: var(--c-cyan); }
.stream-list li .tag {
  font-size: 0.62rem;
  padding: 2px 6px;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  color: var(--text-faint);
}

@keyframes streamIn {
  0% { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* hero ticker */

.hero-ticker {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  z-index: 5;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  overflow: hidden;
  white-space: nowrap;
  padding: 14px 0;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ticker-track {
  display: inline-flex;
  gap: 56px;
  animation: ticker 64s linear infinite;
}
.ticker-track > span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.ticker-track > span::before {
  content: '◆';
  color: var(--c-cyan);
  opacity: 0.6;
  font-size: 0.6rem;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================ THESIS */

.thesis {
  background:
    linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--c-cyan) 3%, transparent) 50%, transparent 100%);
}

.thesis-body {
  max-width: 70ch;
  margin: 0 0 80px;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  line-height: 1.45;
  color: var(--text-mute);
}
.thesis-body em {
  color: var(--text);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08em;
}

.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}
@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr; }
}
.principle {
  background: var(--bg-1);
  padding: 32px 28px 36px;
  position: relative;
}
.principle-num {
  display: inline-block;
  color: var(--c-cyan);
  margin-bottom: 24px;
}
.principle h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 1.9vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--text);
}
.principle p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-mute);
}

/* ============================================================ PORTFOLIO */

.product {
  margin-top: 64px;
  padding: 48px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--product-grad-a) 0%, var(--product-grad-b) 100%);
  position: relative;
  overflow: hidden;
}
.product:first-of-type { margin-top: 0; }

.product::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-cyan), transparent);
  opacity: 0.4;
}
.product--tng::before { background: linear-gradient(to right, transparent, var(--c-amber), transparent); }

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}
.product-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.product-tag .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 12px var(--c);
}
.product-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text);
  padding: 8px 14px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  transition: all 220ms var(--ease-out);
}
.product-link:hover { background: color-mix(in srgb, var(--c-cyan) 10%, transparent); border-color: var(--c-cyan); }

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
}
.product-grid--reverse {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
@media (max-width: 900px) {
  .product-grid, .product-grid--reverse { grid-template-columns: 1fr; gap: 40px; }
  .product { padding: 28px; }
}

.product-name {
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  margin: 0 0 14px;
}
.product-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  font-style: italic;
  color: var(--c-cyan);
  margin: 0 0 24px;
}
.product--tng .product-tagline { color: var(--c-amber); }
.product--tng .product-tagline em { color: var(--text); }

.product-body {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-mute);
  margin: 0 0 32px;
  max-width: 50ch;
}
.product-body em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text);
}

.product-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.product-stats li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  font-size: 0.92rem;
}
.product-stats .label { color: var(--text-faint); }

/* modules grid (HotelOS) */

.modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.module {
  background: var(--module-bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px 20px 22px;
  position: relative;
  transition: all 320ms var(--ease-out);
}
.module:hover {
  background: var(--module-bg-hover);
  transform: translateY(-2px);
  border-color: var(--c);
}
.module[data-color="amber"]    { --c: var(--c-amber); }
.module[data-color="rose"]     { --c: var(--c-rose); }
.module[data-color="orange"]   { --c: var(--c-orange); }
.module[data-color="emerald"]  { --c: var(--c-emerald); }
.module[data-color="cyan"]     { --c: var(--c-cyan); }
.module--wide { grid-column: span 2; }

.module-mark {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--c);
  color: var(--c);
  font-weight: 500;
  font-size: 0.68rem;
  background: color-mix(in srgb, var(--c) 8%, transparent);
  margin-bottom: 14px;
}
.module strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text);
}
.module em {
  display: block;
  font-style: italic;
  font-family: var(--font-display);
  color: var(--c);
  font-size: 0.92rem;
  margin-bottom: 12px;
}
.module p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-mute);
}

/* Tell&Go visualization */

.tng-viz {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tng-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--tng-card-a), var(--tng-card-b));
  border: 1px solid var(--rule-warm);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--c-amber) 8%, transparent) inset,
    0 40px 100px -30px var(--tng-card-glow);
  position: relative;
}
.tng-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(ellipse 60% 50% at 0% 0%, color-mix(in srgb, var(--c-amber) 10%, transparent), transparent 50%);
  pointer-events: none;
}
.tng-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
  color: var(--c-amber);
}
.tng-matches {
  list-style: none;
  margin: 0;
  padding: 12px 0;
}
.tng-matches li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 20px;
  border-bottom: 1px dashed rgba(251,191,36,0.08);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  position: relative;
}
.tng-matches li {
  border-bottom-color: color-mix(in srgb, var(--c-amber) 12%, transparent);
}
.tng-matches li::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 60%;
  background: linear-gradient(to bottom, transparent, var(--c-amber), transparent);
  transform: translateY(-50%);
  opacity: 0;
  animation: matchFlash 4s infinite;
}
.tng-matches li:nth-child(1)::before { animation-delay: 0.2s; }
.tng-matches li:nth-child(2)::before { animation-delay: 1.2s; }
.tng-matches li:nth-child(3)::before { animation-delay: 2.2s; }
.tng-matches li:nth-child(4)::before { animation-delay: 3.2s; }
@keyframes matchFlash {
  0%, 100% { opacity: 0; }
  10%, 30% { opacity: 1; }
}
.tng-matches li .mono { color: var(--c-amber); font-style: normal; }
.tng-card-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  color: var(--text-faint);
}

/* ============================================================ RUNTIME */

.runtime {
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, color-mix(in srgb, var(--c-cyan) 5%, transparent), transparent 70%);
}

.runtime-diagram {
  margin: 0 0 64px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 32px;
  background: linear-gradient(180deg, var(--product-grad-a), var(--product-grad-b));
  overflow: hidden;
}
.runtime-svg { width: 100%; max-width: 1100px; height: auto; display: block; margin: 0 auto; }

.rt-row .rt-node rect {
  fill: var(--rt-node-fill);
  stroke: var(--rt-node-stroke);
  stroke-width: 1;
}
.rt-row .rt-node--warm rect { stroke: var(--rt-node-warm-stroke); }

.rt-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  fill: var(--rt-label);
}
.rt-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--rt-sub);
}

.rt-nexus rect {
  fill: var(--rt-nexus-fill);
  stroke: var(--c-cyan);
  stroke-width: 1.2;
}
.rt-nexus-label {
  font-family: var(--font-display);
  font-size: 32px;
  fill: var(--c-cyan);
  font-style: italic;
}
.rt-nexus-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  fill: var(--rt-label);
}
.rt-nexus-foot {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  fill: var(--rt-foot);
}

/* runtime SVG gradient stops */
.rt-grad      { stop-color: var(--rt-grad-mid); }
.rt-grad-edge { stop-opacity: 0; }
.rt-grad.rt-grad-mid { stop-opacity: var(--rt-grad-mid-op); }
.rt-grad-warm { stop-color: var(--rt-grad-warm-mid); }
.rt-grad-warm.rt-grad-warm-mid { stop-opacity: var(--rt-grad-warm-mid-op); }

/* ============================================================ LAKE DIAGRAM
   agents → dotted signal lines → literal lake (waves) ← nexus reads
============================================================ */

/* water gradient stops */
.water-top  { stop-color: var(--water-top, rgba(94,234,212,0.45)); }
.water-mid  { stop-color: var(--water-mid, rgba(45,122,141,0.62)); }
.water-deep { stop-color: var(--water-deep, rgba(15,52,68,0.85)); }

/* signal rain (dotted lines from agents to lake surface) */
.signal-line {
  fill: none;
  stroke: var(--rt-grad-mid);
  stroke-width: 1.4;
  stroke-dasharray: 2 6;
  stroke-linecap: round;
  opacity: 0.55;
  animation: signal-flow 12s linear infinite;
}
.signal-line--warm {
  stroke: var(--rt-grad-warm-mid);
}
@keyframes signal-flow {
  to { stroke-dashoffset: -200; }
}

/* drops travelling down the lines */
.drop {
  filter: drop-shadow(0 0 5px currentColor);
}
.drop-cool { fill: var(--c-cyan); color: var(--c-cyan); }
.drop-warm { fill: var(--c-amber); color: var(--c-amber); }

/* lake rim */
.lake-rim {
  fill: none;
  stroke: var(--lake-rim-color, rgba(94,234,212,0.45));
  stroke-width: 1.5;
}

/* wave layers — slide horizontally for water motion */
.wave path {
  fill: var(--wave-fill, rgba(255,255,255,0.06));
}
.wave-back {
  animation: wave-drift-slow 22s linear infinite;
}
.wave-back path {
  fill: var(--wave-back, rgba(255,255,255,0.05));
}
.wave-mid {
  animation: wave-drift-mid 14s linear infinite;
}
.wave-mid path {
  fill: var(--wave-mid, rgba(255,255,255,0.08));
}
.wave-front {
  animation: wave-drift-fast 9s linear infinite;
}
.wave-front path {
  fill: var(--wave-front, rgba(255,255,255,0.12));
}
@keyframes wave-drift-slow { to { transform: translateX(-1200px); } }
@keyframes wave-drift-mid  { to { transform: translateX(1200px); } }
@keyframes wave-drift-fast { to { transform: translateX(-1200px); } }

/* surface shimmer */
.shimmer ellipse {
  fill: var(--shimmer, rgba(255,255,255,0.45));
  animation: shimmer-fade 4s ease-in-out infinite;
}
.shimmer ellipse:nth-child(2) { animation-delay: 1.1s; }
.shimmer ellipse:nth-child(3) { animation-delay: 2.0s; }
.shimmer ellipse:nth-child(4) { animation-delay: 2.7s; }
@keyframes shimmer-fade {
  0%, 100% { opacity: 0.20; }
  50%      { opacity: 0.85; }
}

/* lake title */
.lake-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 40px;
  fill: var(--lake-title-color, rgba(238,242,251,0.96));
  letter-spacing: -0.01em;
  paint-order: stroke;
  stroke: var(--lake-title-stroke, transparent);
  stroke-width: 0;
}
.lake-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--lake-sub-color, rgba(238,242,251,0.55));
}

/* information flow from lake DOWN to NEXUS */
.lake-to-nexus path {
  fill: none;
  stroke: var(--c-cyan);
  stroke-width: 1.4;
  stroke-dasharray: 4 5;
  opacity: 0.75;
  animation: signal-flow 4s linear infinite;
}
.flow-arrow {
  fill: var(--c-cyan);
  opacity: 0.85;
}
.flow-drop {
  fill: var(--c-cyan);
  filter: drop-shadow(0 0 8px var(--c-cyan));
}

@keyframes dashFlow {
  to { stroke-dashoffset: -200; }
}

.runtime-stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}
@media (max-width: 900px) {
  .runtime-stack { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .runtime-stack { grid-template-columns: 1fr; }
}
.runtime-stack li {
  background: var(--bg-1);
  padding: 28px 26px 32px;
}
.stack-tag {
  display: inline-block;
  color: var(--c-cyan);
  margin-bottom: 16px;
}
.runtime-stack h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.runtime-stack p {
  margin: 0;
  color: var(--text-mute);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ============================================================ WHY */

.why-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr; gap: 40px; }
}

.why-quote {
  margin: 0;
  padding: 0;
}
.why-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  line-height: 1.18;
  color: var(--text);
  margin: 0 0 24px;
  letter-spacing: -0.012em;
}
.why-quote p:last-child { color: var(--text-mute); font-size: clamp(1.2rem, 2.2vw, 1.9rem); }

.why-marks {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.why-marks li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.why-marks li:last-child {
  color: var(--c-cyan);
}
.why-marks li:last-child .mono { color: var(--c-cyan); }
.why-marks .mono { color: var(--text-faint); }

/* ============================================================ ABOUT */

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

.about-copy p {
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  line-height: 1.6;
  color: var(--text-mute);
  margin: 0 0 24px;
  max-width: 56ch;
}
.about-copy p:last-child { margin-bottom: 0; }

.about-facts {
  margin: 0;
  border-top: 1px solid var(--rule);
}
.about-facts > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.about-facts dt { color: var(--text-faint); margin: 0; }
.about-facts dd { margin: 0; color: var(--text); font-size: 0.96rem; }

/* ============================================================ CONTACT */

.contact {
  position: relative;
}
.contact-form {
  display: grid;
  gap: 24px;
  margin-top: 0;
  max-width: 880px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; gap: 18px; }
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { color: var(--text-faint); }
.field input, .field textarea, .field select {
  background: var(--field-bg);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: all 200ms var(--ease-out);
  width: 100%;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23808a9c' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--c-cyan);
  background: var(--field-bg-focus);
  box-shadow: 0 0 0 4px var(--field-focus-ring);
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.55; }

.form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.form-status { margin: 0; color: var(--text-mute); }
.form-status.is-ok { color: var(--c-emerald); }
.form-status.is-err { color: var(--c-rose); }

#contactSubmit[disabled] { opacity: 0.6; cursor: progress; }

/* ============================================================ FOOTER */

.footer {
  border-top: 1px solid var(--rule);
  padding: 56px 0 48px;
  background: var(--bg);
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
@media (max-width: 800px) {
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.footer-links {
  list-style: none;
  margin: 0; padding: 0;
  display: inline-flex;
  gap: 24px;
  justify-self: center;
}
.footer-links a { color: var(--text-mute); transition: color 200ms; }
.footer-links a:hover { color: var(--text); }
.footer-fine {
  color: var(--text-faint);
  margin: 0;
  text-transform: none;
  letter-spacing: 0.02em;
  justify-self: end;
  text-align: right;
}
@media (max-width: 800px) { .footer-fine { justify-self: start; text-align: left; } }

/* ============================================================ entrance animations */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .scanline, .grain { display: none; }
}
