:root {
  /* Foreground as an RGB triplet so rgba(var(--fg), a) flips with the theme. */
  --fg: 255, 255, 255;
  --bg: #030609;
  --bg-2: #020508;
  --panel: #080d12;
  --panel-2: #0d141b;
  --panel-3: #05090d;
  --card-base: rgba(8, 13, 18, 0.75);   /* glass card base — flips in light mode */
  --header-bg: rgba(3, 6, 9, 0.82);
  --nav-bg: rgba(3, 6, 9, 0.92);
  --paper: #f7f8f9;
  --ink: #11161b;
  --white: #ffffff;
  --muted: #8d9aa5;
  --muted-light: #61707c;
  --line: rgba(var(--fg), 0.13);
  --line-light: rgba(17, 22, 27, 0.12);
  --blue: #63d6ff;
  --logo-filter: none;
  color-scheme: dark;
}

/* ===== Light theme — flips surfaces + foreground; islands re-scope back. ===== */
html[data-theme="light"] {
  --fg: 17, 22, 27;
  --bg: #eef1f5;
  --bg-2: #e4e9ef;
  --panel: #ffffff;
  --panel-2: #f5f8fb;
  --panel-3: #e9eef4;
  --card-base: var(--panel);
  --header-bg: rgba(248, 250, 252, 0.86);
  --nav-bg: rgba(252, 253, 255, 0.97);
  --paper: #ffffff;
  --ink: #11161b;
  --white: #11161b;        /* default body text flips to ink */
  --muted: #57646e;
  --muted-light: #74828d;
  --line: rgba(var(--fg), 0.14);
  --blue: #0a7fc2;         /* darker accent for contrast on light */
  --logo-filter: brightness(0);
  color-scheme: light;
}

/* The 3D demo viewport stays dark in light mode — re-scope its text vars to light. */
html[data-theme="light"] .demo-viewport,
html[data-theme="light"] .demo-subtitle {
  --fg: 255, 255, 255;
  --white: #ffffff;
  --muted: #8d9aa5;
  --blue: #63d6ff;
}

/* ===== Light version of the hero pressure-stage visual ===== */
html[data-theme="light"] .pressure-stage {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(10, 127, 194, 0.08), transparent 62%),
    linear-gradient(180deg, #eef4fb, #e2eaf3);
  border: 1px solid rgba(10, 127, 194, 0.12);
  box-shadow: 0 30px 70px rgba(40, 80, 120, 0.12);
}

html[data-theme="light"] .field-node {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(10, 127, 194, 0.06), transparent 60%),
    linear-gradient(160deg, #ffffff, #f3f7fc 72%);
  border: 1px solid rgba(10, 127, 194, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(40, 80, 120, 0.10),
    0 3px 8px rgba(40, 80, 120, 0.06);
  backdrop-filter: none;
}

html[data-theme="light"] .field-node::before {
  background: linear-gradient(90deg, transparent, rgba(10, 127, 194, 0.22) 40%, rgba(10, 127, 194, 0.22) 60%, transparent);
  opacity: 0.6;
}

html[data-theme="light"] .field-node span,
html[data-theme="light"] .node-b span {
  color: var(--blue);
}

html[data-theme="light"] .field-node span::before,
html[data-theme="light"] .node-b span::before {
  box-shadow:
    0 0 0 1px rgba(10, 127, 194, 0.25),
    0 0 8px rgba(10, 127, 194, 0.55),
    0 0 16px rgba(10, 127, 194, 0.3);
}

html[data-theme="light"] .node-b {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(10, 127, 194, 0.14), transparent 66%),
    linear-gradient(160deg, #ffffff, #eaf2fb 82%);
  border-color: rgba(10, 127, 194, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 18px 40px rgba(40, 80, 120, 0.16),
    0 0 0 4px rgba(10, 127, 194, 0.05),
    0 0 44px rgba(10, 127, 194, 0.14);
}

html[data-theme="light"] .field-node:hover {
  border-color: rgba(10, 127, 194, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--white);
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2 {
  font-family: "Fraunces", "Frank Ruhl Libre", "Times New Roman", Georgia, serif;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.022em;
}

h3 {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

img,
video,
canvas {
  max-width: 100%;
}

a {
  color: inherit;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 20px;
  padding: 7px clamp(20px, 4vw, 64px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(20px);
}

.header-spacer {
  width: 40px;
  height: 40px;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

/* Brand: SAS logo centered in the header (no surrounding pill or text) */
.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--white);
  transition: opacity 0.18s ease;
}

.brand:hover,
.brand:focus-visible {
  opacity: 0.85;
  outline: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  filter: var(--logo-filter);
}

/* Hamburger-driven nav at ALL widths.
   Hidden by default; .is-open shows it as a translucent dropdown anchored
   to the top-right corner of the header. */
.main-nav {
  position: absolute;
  top: calc(100% + 10px);
  right: clamp(20px, 4vw, 64px);
  display: none;
  flex-direction: column;
  width: min(280px, calc(100vw - 36px));
  padding: 8px;
  background: var(--nav-bg);
  border: 1px solid rgba(var(--fg), 0.10);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px);
  z-index: 25;
}

.main-nav.is-open {
  display: flex;
}

.main-nav a {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  color: rgba(var(--fg), 0.74);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--white);
  background: rgba(var(--fg), 0.06);
  outline: none;
}

.main-nav .nav-contact {
  margin-top: 4px;
  color: rgba(var(--fg), 0.96);
  font-weight: 600;
  border-top: 1px solid rgba(var(--fg), 0.08);
  padding-top: 14px;
  border-radius: 0 0 8px 8px;
}

.main-nav .nav-contact:hover,
.main-nav .nav-contact:focus-visible {
  background: rgba(var(--fg), 0.08);
}

.menu-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--white);
  background: rgba(var(--fg), 0.05);
  border: 1px solid rgba(var(--fg), 0.10);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.menu-button:hover,
.menu-button:focus-visible {
  background: rgba(var(--fg), 0.08);
  border-color: rgba(var(--fg), 0.16);
  outline: none;
}

.menu-button[aria-expanded="true"] {
  background: rgba(var(--fg), 0.10);
  border-color: rgba(var(--fg), 0.20);
}

/* Theme toggle — sits in the left header cell, mirrors the menu button. */
.theme-toggle {
  justify-self: center;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--white);
  background: rgba(var(--fg), 0.05);
  border: 1px solid rgba(var(--fg), 0.10);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: rgba(var(--fg), 0.08);
  border-color: var(--blue);
  color: var(--blue);
  outline: none;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Centered hero — text stacked vertically, max-width 720, no horizontal asymmetry.
   Pressure-stage diagram lives below as a full-width band (still inside .hero so
   it inherits the hero's background gradient). */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  min-height: auto;
  padding: clamp(28px, 4vw, 56px) clamp(18px, 6vw, 86px) clamp(60px, 8vw, 100px);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
}

.hero-copy {
  width: 100%;
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero-copy h1 {
  margin: 0 auto 22px;
  max-width: 14ch;
  font-size: clamp(2rem, 7.5vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  overflow-wrap: break-word;   /* never let a long word push past the column */
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-wordmark {
  margin: 0 0 6px;
  color: var(--blue);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-logo {
  display: block;
  width: clamp(140px, 18vw, 220px);
  height: auto;
  margin: 0 auto 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(2.7rem, 5.25vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  max-width: 1060px;
  margin-bottom: clamp(28px, 5vw, 54px);
  font-size: clamp(2.25rem, 5.2vw, 6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.lede {
  max-width: 580px;
  margin: 0 auto 30px;
  color: rgba(var(--fg), 0.82);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  font-weight: 520;
  line-height: 1.6;
}

.hero-actions,
.contact-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  justify-content: center;
  padding-top: 4px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: var(--bg);
  background: var(--white);
}

.button.secondary {
  color: var(--white);
  background: rgba(var(--fg), 0.06);
  border-color: var(--line);
}

.text-link {
  color: rgba(var(--fg), 0.76);
  font-weight: 850;
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--fg), 0.28);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--white);
  border-bottom-color: var(--white);
  outline: none;
}

.pressure-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 22px 18px;
  align-items: center;
  justify-items: center;
  width: 100%;
  min-width: 0;            /* never force the hero grid wider than its column */
  max-width: 760px;
  margin: 0 auto;
  min-height: min(54vh, 540px);
  padding: clamp(20px, 3vw, 36px);
  overflow: hidden;
  background: transparent;
  border-radius: 8px;
}

.pressure-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  display: none;
}

.pressure-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* === DESKTOP HERO: 2-col text-left / stage-right (>=920px) ===
   Default mobile-first layout above is centered single-column. At desktop widths
   we flip to side-by-side: copy on the left, pressure-stage diagram on the right.
   Below 920px the column is too narrow for a clean 3x3 stage so we stay stacked. */
@media (min-width: 920px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
    align-items: center;
    gap: clamp(28px, 3.5vw, 56px);
  }
  .hero-copy {
    max-width: 520px;
    margin: 0;
    text-align: left;
    justify-self: end;
  }
  .hero-copy h1 {
    margin: 0 0 22px;
    max-width: none;
  }
  .hero-logo {
    margin: 0 0 24px;
  }
  .lede {
    margin: 0 0 30px;
  }
  .hero-actions {
    justify-content: flex-start;
  }
  /* Scoped to the hero only. The Engineering-section .pressure-stage must keep
     its centered max-width (below) — without this scope it stretched edge-to-edge. */
  .hero .pressure-stage {
    margin: 0;
    justify-self: stretch;
    max-width: none;
    padding: clamp(14px, 1.8vw, 22px);
    gap: 18px 14px;
  }
}

.field-node {
  position: relative;
  isolation: isolate;
  z-index: 2;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 6px;
  width: min(100%, 196px);
  min-width: 0;
  padding: 16px 18px 18px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(118, 222, 255, 0.10), transparent 60%),
    linear-gradient(160deg, rgba(var(--fg), 0.10), rgba(var(--fg), 0.025) 38%, rgba(3, 6, 9, 0.72) 88%),
    rgba(6, 11, 16, 0.78);
  border: 1px solid rgba(219, 248, 255, 0.16);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(var(--fg), 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    inset 0 -24px 40px rgba(0, 0, 0, 0.28),
    0 22px 48px rgba(0, 0, 0, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 38px rgba(99, 214, 255, 0.07);
  backdrop-filter: blur(14px);
  transition: transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 380ms, border-color 380ms;
}

.field-node:hover {
  transform: translateY(-3px);
  border-color: rgba(151, 229, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(var(--fg), 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    inset 0 -24px 40px rgba(0, 0, 0, 0.28),
    0 28px 60px rgba(0, 0, 0, 0.55),
    0 8px 22px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 60px rgba(99, 214, 255, 0.18);
}

.field-node::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--fg), 0.4) 40%, rgba(var(--fg), 0.4) 60%, transparent);
  border-radius: 14px 14px 0 0;
  opacity: 0.85;
  pointer-events: none;
}

.field-node span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(151, 229, 255, 0.88);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}

.field-node span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(99, 214, 255, 0.25),
    0 0 12px rgba(99, 214, 255, 0.9),
    0 0 24px rgba(99, 214, 255, 0.5);
  flex-shrink: 0;
}

.field-node strong {
  display: flex;
  align-items: flex-end;
  min-height: 2.4em;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--white);
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.field-node em {
  color: rgba(var(--fg), 0.55);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.35;
  margin-top: 2px;
}

.node-a {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

.node-b {
  grid-column: 2;
  grid-row: 2;
  z-index: 3;
  width: min(100%, 216px);
  padding: 18px 20px 20px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(118, 222, 255, 0.18), transparent 65%),
    linear-gradient(160deg, rgba(var(--fg), 0.13), rgba(var(--fg), 0.035) 38%, rgba(3, 6, 9, 0.8) 88%),
    rgba(8, 14, 20, 0.86);
  border-color: rgba(151, 229, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(var(--fg), 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    inset 0 -30px 52px rgba(0, 0, 0, 0.32),
    0 32px 64px rgba(0, 0, 0, 0.62),
    0 10px 28px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 0 0 5px rgba(99, 214, 255, 0.04),
    0 0 80px rgba(99, 214, 255, 0.18);
}

.node-b::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 18px;
  border: 1px solid rgba(99, 214, 255, 0.08);
  pointer-events: none;
  z-index: -1;
}

.node-b strong {
  font-size: 1.05rem;
}

.node-b span {
  color: rgba(151, 229, 255, 1);
}

.node-c {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}

.node-d {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
}

.node-e {
  grid-column: 2;
  grid-row: 3;
  align-self: start;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(99, 214, 255, 0.04), transparent),
    var(--bg);
}

.proof-strip div {
  display: grid;
  gap: 8px;
  padding: 24px clamp(18px, 3vw, 34px);
  border-right: 1px solid var(--line);
}

.proof-strip div:last-child {
  border-right: 0;
}

.proof-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.proof-strip strong {
  font-size: clamp(1rem, 1.7vw, 1.28rem);
}

.section {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 9vw, 132px) clamp(18px, 6vw, 86px);
}

.section-intro {
  position: relative;
  z-index: 2;
  max-width: 1060px;
}

.system,
.engineering {
  color: var(--white);
  background:
    radial-gradient(circle at 78% 24%, rgba(99, 214, 255, 0.12), transparent 34%),
    linear-gradient(180deg, var(--panel-3), var(--bg));
}

.system .section-kicker,
.engineering .section-kicker {
  color: var(--blue);
}

.section-visual {
  position: absolute;
  pointer-events: none;
}

.signal-orbit {
  right: clamp(18px, 7vw, 110px);
  top: clamp(70px, 10vw, 130px);
  width: min(36vw, 430px);
  aspect-ratio: 1;
  border: 1px solid rgba(99, 214, 255, 0.14);
  border-radius: 50%;
  opacity: 0.9;
}

.signal-orbit::before,
.signal-orbit::after {
  content: "";
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(99, 214, 255, 0.12);
  border-radius: 50%;
}

.signal-orbit::after {
  inset: 34%;
  background: radial-gradient(circle, rgba(99, 214, 255, 0.22), transparent 58%);
}

.signal-orbit span {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(99, 214, 255, 0.78);
}

.signal-orbit span:nth-child(1) { left: 50%; top: -4px; }
.signal-orbit span:nth-child(2) { right: -4px; top: 50%; }
.signal-orbit span:nth-child(3) { left: 50%; bottom: -4px; }
.signal-orbit span:nth-child(4) { left: -4px; top: 50%; }

.blueprint-plane {
  right: 0;
  top: 0;
  width: min(58vw, 760px);
  height: 100%;
  opacity: 0.38;
  background:
    linear-gradient(rgba(99, 214, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 214, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 58% 46%, rgba(99, 214, 255, 0.18), transparent 34%);
  background-size: 42px 42px, 42px 42px, auto;
  mask-image: linear-gradient(90deg, transparent, black 24%, black 74%, transparent);
}

.signal-track {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.signal-track::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 38px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 214, 255, 0.54), transparent);
  box-shadow: 0 0 22px rgba(99, 214, 255, 0.18);
}

.signal-step {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 196px;
  padding: clamp(16px, 2.2vw, 22px);
  background:
    linear-gradient(145deg, rgba(var(--fg), 0.1), rgba(var(--fg), 0.025)),
    var(--card-base);
  border: 1px solid rgba(var(--fg), 0.13);
  border-radius: 8px;
  backdrop-filter: blur(12px);
}

.signal-step span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 26px;
  background: rgba(99, 214, 255, 0.1);
  border: 1px solid rgba(99, 214, 255, 0.28);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 900;
}

.signal-step p,
.engineering-stack p,
.operation-grid li,
.requirements-board span,
.contact-card p {
  color: var(--muted);
  font-weight: 600;
}

.media-section {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: stretch;
  padding: clamp(72px, 9vw, 132px) clamp(18px, 6vw, 86px);
  background:
    radial-gradient(circle at 76% 44%, rgba(99, 214, 255, 0.12), transparent 32%),
    var(--panel);
}

.media-section > * {
  position: relative;
  z-index: 1;
}

.media-section h2 {
  max-width: 760px;
}

.demo-frame {
  position: relative;
  margin: 0;
  padding: clamp(14px, 1.6vw, 22px);
  background: linear-gradient(145deg, rgba(var(--fg), 0.08), rgba(var(--fg), 0.015));
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

/* === Demo viewport (cropping container around the SVG) === */

.demo-frame {
  min-width: 0;
}

.demo-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 52% 50%, rgba(99, 214, 255, 0.06), transparent 62%),
    #04080e;
}

.demo-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  /* Cinematic vignette + frame inner stroke */
  background:
    radial-gradient(ellipse at 50% 50%,
      transparent 50%,
      rgba(0, 0, 0, 0.22) 78%,
      rgba(0, 0, 0, 0.55) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--fg), 0.04),
    inset 0 -120px 180px rgba(0, 0, 0, 0.35);
}

.demo-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.demo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* === Subtitle (silent-film narration over the demo) === */

.demo-subtitle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(14px, 2vw, 26px);
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
  padding: 0 clamp(14px, 3vw, 32px);
}

.demo-subtitle-text {
  display: inline-block;
  padding: 9px 18px;
  background: rgba(6, 10, 16, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  backdrop-filter: blur(14px) saturate(1.1);
  color: rgba(248, 250, 252, 0.94);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.84rem, 1.15vw, 0.96rem);
  font-weight: 400;
  letter-spacing: 0.2px;
  text-align: center;
  line-height: 1.5;
  max-width: 760px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.demo-subtitle.is-fading .demo-subtitle-text {
  opacity: 0;
  transform: translateY(8px);
}

/* === Mobile: caption drops BELOW the video as clean, theme-aware text
   (no bulky box, never covering the action) === */

@media (max-width: 760px) {
  .demo-viewport {
    min-height: 300px;
  }
  .demo-subtitle {
    position: static;
    align-items: flex-start;
    padding: 12px 14px 0;
    min-height: 3.4em;            /* reserve space so the layout doesn't jump */
  }
  .demo-subtitle-text {
    padding: 0;
    max-width: 100%;
    background: none;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
    font-size: 0.95rem;
    line-height: 1.45;
  }
  html[data-theme="dark"] .demo-subtitle-text { color: rgba(233, 239, 245, 0.92); }
  html[data-theme="light"] .demo-subtitle-text { color: rgba(20, 28, 38, 0.88); }
}

.engineering-stack {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: rgba(var(--fg), 0.12);
  border: 1px solid rgba(var(--fg), 0.14);
  border-radius: 8px;
  backdrop-filter: blur(12px);
}

.eng-step {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
  padding: clamp(22px, 3vw, 34px);
  background:
    linear-gradient(90deg, rgba(var(--fg), 0.075), rgba(var(--fg), 0.025)),
    var(--card-base);
}

.eng-illus {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 13px;
  background:
    radial-gradient(120% 100% at 30% 0%, rgba(99, 214, 255, 0.18), transparent 62%),
    rgba(99, 214, 255, 0.045);
  border: 1px solid rgba(99, 214, 255, 0.20);
  box-shadow:
    inset 0 1px 0 rgba(var(--fg), 0.12),
    0 10px 26px rgba(0, 0, 0, 0.38);
}

.eng-illus svg {
  display: block;
  width: 60px;
  height: 60px;
}

.eng-text {
  display: grid;
  gap: 6px;
  align-content: center;
}

.eng-tag {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eng-step strong {
  font-size: 1.05rem;
}

/* Illustrated motif strokes (Plan / Wire / Fit / Test) */
.ei-sheet { fill: rgba(99, 214, 255, 0.05); stroke: rgba(99, 214, 255, 0.45); stroke-width: 1.6; }
.ei-grid { stroke: rgba(99, 214, 255, 0.30); stroke-width: 1.2; }
.ei-grid-fine { stroke: rgba(99, 214, 255, 0.13); stroke-width: 1; }
.ei-route { stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(99, 214, 255, 0.55)); }
.ei-node { fill: var(--blue); }
.ei-dot { fill: rgba(99, 214, 255, 0.72); }
.ei-equip { fill: rgba(99, 214, 255, 0.10); stroke: rgba(99, 214, 255, 0.52); stroke-width: 1.6; }
.ei-wire { stroke: var(--blue); stroke-width: 2.3; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(99, 214, 255, 0.5)); }
.ei-term { fill: rgba(8, 14, 22, 0.9); stroke: var(--blue); stroke-width: 1.9; }
.ei-led { fill: #fff5d8; filter: drop-shadow(0 0 5px rgba(255, 240, 200, 0.85)); }
.ei-cal-bar, .ei-cal-jaw { stroke: rgba(99, 214, 255, 0.6); stroke-width: 2; stroke-linecap: round; }
.ei-cal-measure { stroke: var(--blue); stroke-width: 1.6; stroke-dasharray: 3 3; }
.ei-gauge { fill: rgba(8, 14, 22, 0.5); stroke: rgba(99, 214, 255, 0.22); stroke-width: 1.4; }
.ei-gauge-ring { stroke: rgba(99, 214, 255, 0.42); stroke-width: 1.7; }
.ei-gauge-arc { stroke: rgba(99, 214, 255, 0.32); stroke-width: 1.5; }
.ei-gauge-tick { stroke: rgba(99, 214, 255, 0.55); stroke-width: 1.5; stroke-linecap: round; }
.ei-needle { stroke: var(--blue); stroke-width: 2.6; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(99, 214, 255, 0.65)); }
.ei-needle-pin { fill: var(--blue); }
.ei-check { stroke: #66e09a; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(102, 224, 154, 0.65)); }

.operation {
  background:
    linear-gradient(180deg, rgba(99, 214, 255, 0.04), transparent),
    var(--panel-2);
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.operator-card {
  min-height: 360px;
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(145deg, rgba(var(--fg), 0.08), rgba(var(--fg), 0.025)),
    var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.operator-card h3 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.operation-grid p {
  padding: 12px 14px;
  color: var(--white);
  background: rgba(99, 214, 255, 0.12);
  border: 1px solid rgba(99, 214, 255, 0.22);
  border-radius: 8px;
  font-weight: 800;
}

.operation-grid ol {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 20px;
}

.requirements {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(340px, 1.38fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding: clamp(72px, 9vw, 132px) clamp(18px, 6vw, 86px);
  color: var(--white);
  background:
    radial-gradient(circle at 26% 48%, rgba(99, 214, 255, 0.1), transparent 30%),
    var(--bg);
}

.requirements-head h2 {
  margin-bottom: 36px;
}

.intake-radar {
  position: absolute;
  left: clamp(18px, 6vw, 86px);
  bottom: clamp(28px, 7vw, 90px);
  width: min(30vw, 360px);
  aspect-ratio: 1;
  border: 1px solid rgba(99, 214, 255, 0.14);
  border-radius: 50%;
  opacity: 0.7;
  pointer-events: none;
}

.intake-radar span,
.intake-radar::before,
.intake-radar::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(99, 214, 255, 0.12);
  border-radius: 50%;
}

.intake-radar span:nth-child(2) { inset: 36%; }
.intake-radar span:nth-child(3) {
  inset: auto auto 50% 50%;
  width: 45%;
  height: 1px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(99, 214, 255, 0.5), transparent);
  transform-origin: left center;
  transform: rotate(-28deg);
}

.requirements-board {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: rgba(var(--fg), 0.13);
  border: 1px solid rgba(var(--fg), 0.14);
  border-radius: 8px;
}

.requirements-board span {
  min-height: 112px;
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(var(--fg), 0.075), rgba(var(--fg), 0.025)),
    var(--card-base);
}

.contact {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 34px;
  align-items: start;
  padding: clamp(72px, 9vw, 132px) clamp(18px, 6vw, 86px);
  background:
    linear-gradient(135deg, rgba(99, 214, 255, 0.1), transparent 40%),
    var(--panel-3);
}

.contact::after {
  content: "";
  position: absolute;
  right: clamp(18px, 8vw, 120px);
  top: 18%;
  width: min(30vw, 380px);
  aspect-ratio: 1;
  border: 1px solid rgba(99, 214, 255, 0.12);
  transform: rotate(45deg);
  pointer-events: none;
}

.contact > * {
  position: relative;
  z-index: 1;
}

.contact-card {
  padding: 22px;
  background: rgba(var(--fg), 0.045);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-card p {
  width: 100%;
  margin: 4px 0 0;
  color: var(--muted);
  word-break: break-word;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px clamp(18px, 4vw, 40px);
  padding: 26px clamp(18px, 6vw, 86px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px clamp(14px, 2vw, 24px);
}

.footer-legal a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--blue);
}

@media (max-width: 620px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === SECTION-GRID COLLAPSE (1050px) ===
   Multi-column SECTIONS (media/contact/ticket/requirements) collapse to 1col.
   Hero is centered single-column at all widths now, so no hero rules here. */
@media (max-width: 1050px) {
  .media-section,
  .requirements,
  .contact,
  .ticket {
    grid-template-columns: 1fr;
  }
  .requirements-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .signal-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .signal-track::before {
    display: none;
  }
  .signal-orbit,
  .blueprint-plane,
  .intake-radar,
  .contact::after {
    opacity: 0.28;
  }
  .eng-step {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: clamp(16px, 3vw, 26px);
  }
  .eng-illus {
    width: 72px;
    height: 72px;
  }
  .eng-illus svg {
    width: 52px;
    height: 52px;
  }
}

/* === HEADER MOBILE TWEAKS (760px and down handled below) ===
   Hamburger nav is the default at all widths now. At narrow widths we hide
   the brand wordmark so just the SAS logo pill remains. */
@media (max-width: 600px) {
  .brand-name {
    display: none;
  }
  .pressure-stage {
    min-height: clamp(420px, 60vw, 600px);
  }
}

/* === MOBILE TIGHTENING (760px and down) ===
   Layout collapses already happened at 1050px. This block tightens type, spacing,
   and the pressure-stage diagram for narrower screens. */
@media (max-width: 760px) {
  .hero {
    padding-top: clamp(28px, 5vw, 40px);
    padding-bottom: clamp(44px, 6vw, 60px);
    gap: 24px;
  }
  .hero-copy h1 {
    font-size: clamp(2.2rem, 8.5vw, 3.4rem);
    max-width: 14ch;
  }
  .lede {
    font-size: 0.98rem;
  }

  h1 {
    font-size: clamp(2.6rem, 11vw, 4.4rem);
  }
  h2 {
    font-size: clamp(2rem, 8vw, 4rem);
  }

  .proof-strip,
  .signal-track,
  .operation-grid,
  .requirements,
  .requirements-board {
    grid-template-columns: 1fr;
  }

  .signal-orbit,
  .blueprint-plane,
  .intake-radar,
  .media-section::before {
    display: none;
  }

  .eng-step {
    grid-template-columns: 1fr;
    gap: 16px;
    justify-items: start;
  }

  .proof-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  /* PRESSURE STAGE: tighter at mobile */
  .pressure-stage {
    min-height: 460px;
  }
  .field-node {
    width: min(100%, 118px);
    padding: 10px 11px 11px;
  }
  .field-node strong {
    font-size: 0.78rem;
  }
  .field-node em {
    display: none;
  }
  .node-b {
    width: min(100%, 126px);
  }
}

/* === VERY-NARROW MOBILE (480px and down) ===
   The 3x3 cross-pattern grid stops working below ~480px. Stack the diagram
   vertically and drop the connecting curves (they don't make sense without
   left/right neighbors). */
@media (max-width: 480px) {
  .pressure-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
    gap: 12px;
    padding: 10px 0;
  }
  .pressure-stage canvas {
    display: none;
  }
  .field-node {
    width: 100%;
    max-width: 360px;
    transform: none !important;
  }
  .field-node em {
    display: block;
  }
  /* Logical reading order on mobile, top-to-bottom narrative */
  .node-c { grid-column: 1; grid-row: 1; }  /* Visual Alert */
  .node-b { grid-column: 1; grid-row: 2; }  /* Shabbos Controller */
  .node-a { grid-column: 1; grid-row: 3; }  /* Custom Fabrication */
  .node-d { grid-column: 1; grid-row: 4; }  /* Pneumatic Unlock */
  .node-e { grid-column: 1; grid-row: 5; }  /* Air Supply */
  .node-a, .node-b, .node-c, .node-d, .node-e {
    justify-self: center;
    align-self: auto;
  }
}

.ticket {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(340px, 1.38fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding: clamp(72px, 9vw, 132px) clamp(18px, 6vw, 86px);
  background:
    radial-gradient(circle at 76% 52%, rgba(99, 214, 255, 0.09), transparent 32%),
    var(--panel);
  border-top: 1px solid var(--line);
}

.ticket-head h2 {
  margin-bottom: 0;
}

.ticket-form {
  display: grid;
  gap: 20px;
}

.ticket-fields {
  display: grid;
  gap: 14px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--white);
  background: rgba(var(--fg), 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.45;
  transition: border-color 0.15s, background 0.15s;
  resize: vertical;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: var(--muted-light);
}

.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: rgba(99, 214, 255, 0.5);
  background: rgba(99, 214, 255, 0.04);
}

.field-group input[type="file"] {
  padding: 10px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: rgba(var(--fg), 0.55);
}

.upload-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: rgba(var(--fg), 0.75);
}

.upload-list li { margin-bottom: 3px; word-break: break-all; }

.ticket-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.ticket-status {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.ticket-status.is-success {
  color: var(--blue);
}

.ticket-status.is-error {
  color: rgba(255, 120, 120, 0.9);
}

@media (max-width: 1050px) {
  .ticket {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .field-row-2 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Ticket CTA band + modal (the form lives in a popup dialog)
   ============================================================ */
.ticket-cta {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 8vw, 120px) clamp(18px, 6vw, 86px);
  background:
    radial-gradient(circle at 76% 52%, rgba(99, 214, 255, 0.09), transparent 38%),
    var(--panel);
  border-top: 1px solid var(--line);
  text-align: center;
}

.ticket-cta-inner {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.ticket-cta-inner h2 {
  margin: 0 0 8px;
}

.ticket-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--white);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.ticket-modal::backdrop {
  background: rgba(3, 6, 9, 0.62);
  backdrop-filter: blur(4px);
}

.ticket-modal[open] {
  animation: ticket-modal-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes ticket-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.ticket-modal-card {
  position: relative;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: clamp(28px, 4vw, 44px) clamp(22px, 4vw, 44px) clamp(24px, 4vw, 40px);
  display: grid;
  gap: 22px;
}

.ticket-modal-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  background: rgba(var(--fg), 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.ticket-modal-close:hover {
  color: var(--white);
  background: rgba(var(--fg), 0.1);
  border-color: rgba(99, 214, 255, 0.4);
}

.ticket-modal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.ticket-modal .ticket-head { padding-inline-end: 44px; }
.ticket-modal .ticket-head h2 { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .ticket-modal[open] { animation: none; }
}

/* ============================================================
   Scroll reveals — subtle & premium.
   JS adds .reveal to target elements (progressive enhancement:
   content stays visible if JS or IntersectionObserver is absent),
   then toggles .is-revealed as they scroll into view. Per-element
   transition-delay is set inline for a staggered cascade.
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.72s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.72s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}

.reveal.is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* === Contact form (in contact-card) + form hardening === */
.contact-form {
  display: grid;
  gap: 14px;
  width: 100%;
}

.contact-form .ticket-status {
  margin: 0;
}

.label-optional {
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Honeypot — visually gone, still in the DOM for bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* === Settings panel (gear dropdown) === */
/* Anchor the settings panel to the gear cluster (right side) at every width */
.header-actions { position: relative; }

.settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  inset-inline-start: auto;
  z-index: 60;
  min-width: 250px;
  padding: 16px 16px 18px;
  background: var(--nav-bg);
  border: 1px solid rgba(var(--fg), 0.12);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
}

.sp-title {
  margin: 0 0 12px;
  color: rgba(var(--fg), 0.55);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sp-group {
  display: grid;
  gap: 7px;
  padding: 9px 0;
  border-top: 1px solid rgba(var(--fg), 0.07);
}

.sp-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.sp-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sp-opt {
  padding: 6px 12px;
  color: rgba(var(--fg), 0.78);
  background: rgba(var(--fg), 0.05);
  border: 1px solid rgba(var(--fg), 0.10);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sp-opt:hover,
.sp-opt:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
  outline: none;
}

.sp-opt.is-active {
  color: var(--blue);
  background: rgba(99, 214, 255, 0.10);
  border-color: rgba(99, 214, 255, 0.55);
}

html[data-theme="light"] .sp-opt.is-active {
  background: rgba(10, 127, 194, 0.10);
}

/* === Text size setting — rem-based type scales from the root === */
html[data-textsize="large"] {
  font-size: 112.5%;
}

/* === Reduce-motion setting (mirrors the prefers-reduced-motion media blocks,
   driven by html[data-motion="reduce"] from the settings panel) === */
html[data-motion="reduce"] *,
html[data-motion="reduce"] *::before,
html[data-motion="reduce"] *::after {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001s !important;
}

html[data-motion="reduce"] .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

/* === RTL (Hebrew / Yiddish) — flex/grid auto-mirror with dir;
   these are the hardcoded-LTR leftovers === */
@media (min-width: 920px) {
  [dir="rtl"] .hero-copy {
    text-align: right;
  }
}

[dir="rtl"] .section-kicker,
[dir="rtl"] .eyebrow,
[dir="rtl"] .sp-title,
[dir="rtl"] .eng-tag {
  letter-spacing: 0;
}


/* demo controls (restart + narration) */
.demo-viewport { position: relative; }
.democtl { position: absolute; right: 14px; bottom: 12px; z-index: 6; display: flex; gap: 8px; }
.dbtn { font: 600 12px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .04em; color: rgba(232,238,244,.75); background: rgba(10,16,24,.55); border: 1px solid rgba(255,255,255,.16); border-radius: 99px; padding: 8px 14px; cursor: pointer; backdrop-filter: blur(6px); transition: all .2s; }
.dbtn:hover { color: #fff; border-color: rgba(103,212,255,.5); }
.dbtn.on { color: #67d4ff; border-color: rgba(103,212,255,.6); background: rgba(12,24,34,.7); }


/* header v2: brand + wordmark on the left, bare controls on the right */
.site-header { display: flex; align-items: center; justify-content: space-between; }
.brand { justify-self: auto; gap: 12px; }
.brand-mark { width: 54px; height: 54px; }
.brand-word { font-family: "Fraunces", Georgia, serif; font-size: 1.07rem; font-weight: 550; letter-spacing: .03em; color: rgba(var(--fg), .92); white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.menu-button, .theme-toggle { background: none; border: none; justify-self: auto; }
.menu-button:hover, .menu-button:focus-visible,
.theme-toggle:hover, .theme-toggle:focus-visible { background: none; border: none; opacity: .72; }
.menu-button[aria-expanded="true"] { background: none; border: none; opacity: .72; }
@media (max-width: 500px) {
  .brand-word { display: none; }
  .brand-mark { width: 46px; height: 46px; }
}


/* demo player: big first-play button, then a small pause control bottom-left */
.demo-play { position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; z-index: 7; display: grid; place-items: center; background: rgba(10,16,24,.55); border: 1px solid rgba(255,255,255,.22); border-radius: 50%; cursor: pointer; backdrop-filter: blur(8px); transition: transform .2s, border-color .2s, background .2s; }
.demo-play:hover { transform: scale(1.06); border-color: rgba(103,212,255,.6); background: rgba(12,24,34,.7); }
.demo-play-tri { width: 0; height: 0; border-left: 26px solid rgba(232,238,244,.92); border-top: 16px solid transparent; border-bottom: 16px solid transparent; margin-left: 7px; }
.democtl-left { position: absolute; left: 14px; bottom: 12px; z-index: 6; display: flex; gap: 8px; }
.demo-play.hidden, .dbtn.hidden { display: none; }


/* ============================================================
   v3 round (2026-06-12): short header · play pill · top controls
   · full-bleed cinematic demo band
   ============================================================ */

/* --- header v3: much shorter, wordmark optically centered on the mark --- */
.site-header { padding: 5px clamp(16px, 3vw, 48px); }
.brand { gap: 10px; align-items: center; }
.brand-mark { width: 34px; height: 34px; }
.brand-word { font-size: .94rem; line-height: 1; transform: translateY(1px); }
.menu-button, .theme-toggle { width: 32px; height: 32px; border-radius: 8px; }
.theme-toggle svg, .menu-button svg { width: 17px; height: 17px; }
.header-spacer { width: 32px; height: 32px; }
@media (max-width: 500px) { .brand-mark { width: 30px; height: 30px; } }

/* --- play pill: replaces the bare circle; sits under the centered logo --- */
.demo-play {
  inset: auto;
  left: 50%; top: 71%;
  transform: translate(-50%, -50%);
  width: auto; height: auto; margin: 0;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 26px 13px 20px;
  border-radius: 999px;
  background: rgba(8, 14, 22, .62);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(14px) saturate(1.1);
}
.demo-play:hover {
  transform: translate(-50%, -50%) scale(1.045);
  border-color: rgba(103, 212, 255, .55);
  background: rgba(10, 20, 30, .78);
}
.demo-play-tri {
  border-left: 12px solid #67d4ff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  margin: 0;
}
.demo-play-label {
  font: 600 13px/1 "Inter", system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(235, 242, 248, .92);
  white-space: nowrap;
}

/* --- controls to the top corners: captions own the bottom --- */
.democtl { top: 12px; right: 14px; bottom: auto; }
.democtl-left { top: 12px; left: 14px; bottom: auto; }
.dbtn { opacity: .72; }
.dbtn:hover, .dbtn.on { opacity: 1; }

/* --- demo band: full-bleed window into the scene, no box --- */
.media-section {
  display: block;
  padding: clamp(40px, 6vw, 84px) 0;
  background: none;
}
.media-section::before { display: none; }
.demo-frame {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.demo-viewport {
  width: min(100%, calc(84vh * 16 / 9));
  margin-inline: auto;
  border: 0;
  border-radius: 0;
}
.demo-viewport::after { display: none; }
.demo-canvas {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 7%, #000 93%, transparent 100%),
              linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
  mask-composite: intersect;
}

/* light theme keeps the demo contained (dark feather on light bg reads as smudge) */
html[data-theme="light"] .demo-viewport {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
html[data-theme="light"] .demo-canvas {
  -webkit-mask-image: none;
  mask-image: none;
}

/* === Fullscreen / minimize for the demo film (real API + CSS fallback) === */
body.demo-fs-lock { overflow: hidden; }
.demo-frame.is-fs {
  position: fixed; inset: 0; z-index: 9999;
  width: 100vw; height: 100dvh; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: #04080e;
}
.demo-frame:fullscreen {
  display: flex; align-items: center; justify-content: center;
  width: 100vw; height: 100vh; background: #04080e;
}
.demo-frame:fullscreen .demo-viewport,
.demo-frame.is-fs .demo-viewport {
  width: 100vw; height: 100dvh; max-width: none; min-height: 0;
  margin: 0; border: 0; border-radius: 0;
}
.demo-frame:fullscreen .demo-canvas,
.demo-frame.is-fs .demo-canvas { -webkit-mask-image: none; mask-image: none; }
.demo-frame:fullscreen .demo-viewport::after,
.demo-frame.is-fs .demo-viewport::after { display: none; }
/* caption overlays the bottom in fullscreen, larger, white over the dark film */
.demo-frame:fullscreen .demo-subtitle,
.demo-frame.is-fs .demo-subtitle {
  position: absolute; left: 0; right: 0; top: auto; bottom: 5vh;
  padding: 0 6vw; align-items: center; min-height: 0;
}
.demo-frame:fullscreen .demo-subtitle-text,
.demo-frame.is-fs .demo-subtitle-text {
  background: rgba(6, 10, 16, 0.6); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; backdrop-filter: blur(14px); padding: 12px 22px;
  color: rgba(248, 250, 252, 0.96) !important; max-width: 82vw;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
}


/* ============================================================
   v4 round (2026-06-12): the living site — hero world, Shabbos
   line, capability strip, try-it panel, engineer's view, live
   signal path, pneumatic press language
   ============================================================ */

/* --- the living hero: the demo's world breathing behind the copy --- */
.hero-living {
  position: relative;
  overflow: hidden;
  min-height: min(88vh, 780px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-world-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 62% 56% at 50% 40%, rgba(4, 8, 14, 0.66), rgba(4, 8, 14, 0.28) 58%, rgba(4, 8, 14, 0) 78%),
    linear-gradient(180deg, rgba(4, 8, 14, 0.5), transparent 26%, transparent 72%, rgba(4, 8, 14, 0.6));
}
/* daytime hero (light theme): soft light vignette so dark copy pops and the scene reads bright */
html[data-theme="light"] .hero-scrim {
  background:
    radial-gradient(ellipse 64% 58% at 50% 42%, rgba(240, 245, 251, 0.62), rgba(240, 245, 251, 0.2) 60%, rgba(240, 245, 251, 0) 80%),
    linear-gradient(180deg, rgba(240, 245, 251, 0.42), transparent 24%, transparent 70%, rgba(238, 241, 245, 0.85));
}
.hero-living .hero-copy {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.5);
}
/* daytime hero in light mode: copy flips to ink over the bright scene, with a light halo */
html[data-theme="light"] .hero-living {
  --fg: 17, 22, 27;
  --white: #11161b;
  --muted: #46566a;
  --blue: #0a7fc2;
}
html[data-theme="light"] .hero-living .hero-copy {
  text-shadow: 0 1px 18px rgba(255, 255, 255, 0.7), 0 1px 3px rgba(255, 255, 255, 0.9);
}

/* --- the Shabbos line: the site knows what time it is --- */
.shabbos-line {
  margin-top: 20px;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: rgba(255, 214, 150, 0.88);
}
.shabbos-line::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: rgba(255, 206, 130, 0.9);
  box-shadow: 0 0 12px rgba(255, 200, 120, 0.7);
  vertical-align: 1px;
}

/* --- capability strip (the five nodes, freed from the old diagram) --- */
/* Explicit column counts (not flex-wrap) so the 5 cards step 5 -> 3 -> 2 -> 1
   and never leave an orphan "4 then 1" row. */
.capability-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 196px));
  justify-content: center;
  gap: 14px;
  padding: clamp(22px, 3vw, 36px) clamp(18px, 6vw, 86px);
  border-bottom: 1px solid var(--line);
}
.capability-strip .field-node {
  width: 100%;
  align-self: stretch;            /* kill the old diagram's per-node align-self (Alert was sitting low) */
  transform: none !important;
  grid-column: auto !important;   /* override the cross-layout node-a..e placement */
  grid-row: auto !important;
}
.capability-strip .field-node em { display: block; }   /* keep subtitles at every width */
@media (max-width: 1120px) {
  .capability-strip { grid-template-columns: repeat(3, minmax(0, 200px)); }
}
@media (max-width: 720px) {
  .capability-strip {
    grid-template-columns: repeat(2, minmax(0, 220px));
    gap: 12px;
  }
  .capability-strip .field-node { padding: 12px 13px 13px; }
}
@media (max-width: 440px) {
  .capability-strip { grid-template-columns: minmax(0, 300px); }
}

/* --- try-it panel (Operation) --- */
.try-panel {
  margin: clamp(44px, 6vw, 72px) auto 0;
  max-width: 400px;
  text-align: center;
}
.try-panel .section-kicker { margin-bottom: 16px; }
.try-panel canvas {
  display: block;
  width: 100%;
  aspect-ratio: 460 / 660;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.try-panel figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- engineer's view (Engineering): always a dark drafting table --- */
.engineer-view {
  margin: clamp(30px, 4vw, 52px) 0 clamp(36px, 5vw, 60px);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(99, 214, 255, 0.05), transparent 50%),
    #070b11;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.engineer-view canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* --- live signal path --- */
.signal-track { position: relative; }
.signal-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.signal-step {
  position: relative;
  z-index: 1;
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
.signal-step.is-pulsed {
  border-color: rgba(103, 212, 255, 0.5);
  box-shadow: 0 0 34px rgba(103, 212, 255, 0.12);
}

/* --- pneumatic press language: every press feels like the plunger --- */
button:not(.demo-play):active,
.main-nav a:active {
  transform: translateY(1px);
  box-shadow:
    0 0 0 3px rgba(103, 212, 255, 0.13),
    0 0 22px rgba(103, 212, 255, 0.17);
  transition-duration: 0.05s;
}
.demo-play:active { transform: translate(-50%, -50%) scale(0.97); }

/* hero kicker reads white over the night world (user note 2026-06-12) */
.hero-living .section-kicker { color: rgba(255, 255, 255, 0.92); }
/* daytime hero (light theme): kicker + copy flip to ink */
html[data-theme="light"] .hero-living .section-kicker { color: rgba(10, 127, 194, 0.95); }
html[data-theme="light"] .hero-living h1 { color: #11161b; }
html[data-theme="light"] .hero-living .lede { color: #2c3a47; }

/* --- header floats transparent over the hero world; chrome returns on scroll --- */
.site-header {
  background: transparent;
  backdrop-filter: none;
}
.site-header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--line);
}
/* pull the hero (and its world canvas) up underneath the floating header */
.hero-living {
  margin-top: -46px;
  padding-top: 46px;
}
/* light theme at page top on the living-hero page: the hero is now a bright
   daytime scene, so the floating header keeps its ink text + dark logo for
   contrast against the daylit sky (no white override needed) */
