/* ==========================================================================
   GLIDE — CINEMATIC 3D DESIGN SYSTEM & ATMOSPHERE
   Graphite and porcelain themes, an asymmetric hero and a procedural globe
   surrounded by four synchronized telemetry cards.
   ========================================================================== */

:root {
  /* Core Cinematic Palette */
  --c-void: #040609;
  --c-bg: #05070c;
  --c-bg-subtle: #080d17;
  --c-surface: rgba(13, 19, 31, 0.72);
  --c-surface-hover: rgba(20, 28, 45, 0.85);
  --c-surface-solid: #0d131f;
  --c-border: rgba(255, 255, 255, 0.08);
  --c-border-hover: rgba(99, 221, 235, 0.35);
  --c-border-subtle: rgba(255, 255, 255, 0.04);

  /* Accents */
  --c-cyan: #63ddeb;
  --c-cyan-glow: rgba(99, 221, 235, 0.35);
  --c-cyan-soft: rgba(99, 221, 235, 0.12);
  --c-violet: #9567d8;
  --c-violet-glow: rgba(149, 103, 216, 0.35);
  --c-indigo: #6763d8;
  --c-green: #34d399;
  --c-amber: #fbbf24;
  --c-rose: #fb7185;

  /* Typography */
  --c-text-primary: #f3f5f8;
  --c-text-secondary: #8d95a5;
  --c-text-muted: #576175;
  --c-silver-gradient: linear-gradient(135deg, #f1f4f9 0%, #c8d1de 100%);

  /* Spatial & Motion */
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --glow-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.8), 0 0 30px -10px var(--c-cyan-glow);
}

/* ==================== GLOBAL OVERRIDES ==================== */
html, body {
  background-color: var(--c-void) !important;
  color: var(--c-text-primary);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

html[lang="fa"], html[lang="fa"] body {
  font-family: "Vazirmatn", "Manrope", -apple-system, sans-serif !important;
}

html[data-theme="light"],
html[data-theme="light"] body {
  background-color: #f5f6fa !important;
  color: #23253b;
}

html:has(dialog[open]) { overflow: hidden; }
dialog[open] { overscroll-behavior: contain; }

/* Cinematic Background Atmosphere */
.cinematic-bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 75% 35%, rgba(149, 103, 216, 0.08), transparent 70%),
    radial-gradient(ellipse 55% 45% at 25% 65%, rgba(99, 221, 235, 0.07), transparent 70%),
    radial-gradient(circle 800px at 50% -200px, rgba(103, 99, 216, 0.12), transparent 70%);
}

/* ==================== SITE HEADER ==================== */
:root {
  --chrome-fill: #11131deb;
  --chrome-text: #f4f4fc;
  --chrome-muted: #bcc1d5;
  --chrome-line: #9ba0c439;
  --chrome-hover: #a8a0e31c;
  --chrome-active: #aaa1f429;
  --chrome-outline: #b5a7ff;
  --chrome-action: #6258e7;
}

:root[data-theme="light"] {
  --chrome-fill: #fbfbfff2;
  --chrome-text: #23253b;
  --chrome-muted: #545b74;
  --chrome-line: #4a416b37;
  --chrome-hover: #6753a913;
  --chrome-active: #6650bb20;
  --chrome-outline: #6251ba;
  --chrome-action: #5145d0;
}

.site-header {
  position: fixed;
  inset: calc(12px + env(safe-area-inset-top, 0px)) 0 auto;
  z-index: 100;
  padding: 0 max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.header-inner-row {
  width: min(100%, 1320px);
  min-height: 56px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 1.4vw, 22px);
  padding: 5px 7px;
  padding-inline-start: clamp(12px, 1.6vw, 22px);
  border: 1px solid var(--chrome-line);
  border-radius: 999px;
  color: var(--chrome-text);
  background: var(--chrome-fill);
  box-shadow: 0 9px 30px #0808112b, inset 0 1px #ffffff11;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
}

.header-brand-wrap {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 8px;
  min-height: 44px;
  color: var(--chrome-text);
  text-decoration: none;
}

.header-brand-icon {
  display: block;
  width: 30px;
  height: 30px;
  flex: none;
}

.brand-text-name {
  color: inherit;
  font-size: 1.13rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

html[dir="rtl"] .brand-text-name { letter-spacing: 0; }

.header-capsule-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 0 auto;
  gap: 2px;
}

.nav-capsule-item,
.header-tool,
.header-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding-inline: clamp(7px, 0.8vw, 13px);
  border: 0;
  border-radius: 999px;
  color: var(--chrome-muted);
  background: transparent;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
  touch-action: manipulation;
  cursor: pointer;
  transition: background-color 150ms var(--ease-cinematic), color 150ms var(--ease-cinematic),
    transform 120ms var(--ease-cinematic);
}

.nav-capsule-item[aria-current="location"] {
  color: var(--chrome-text);
  background: var(--chrome-active);
}

.header-right-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 2px;
}

.header-tool { min-width: 44px; }

.header-tool .icon, .header-download .icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.header-tool .kbd {
  padding: 3px 5px;
  border: 1px solid var(--chrome-line);
  border-radius: 5px;
  color: inherit;
  background: var(--chrome-hover);
  font: 0.65rem/1.15 var(--font-mono);
}

.header-download {
  gap: 6px;
  margin-inline-start: 4px;
  padding-inline: 14px;
  color: #fff;
  background: var(--chrome-action);
}

.header-download .icon {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
}

.btn-minimal-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
}

.btn-minimal-menu .menu-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}

.header-lang-short {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .header-inner-row :is(.nav-capsule-item, .header-tool):hover {
    color: var(--chrome-text);
    background: var(--chrome-hover);
  }

  .header-download:hover {
    color: #fff;
    background: color-mix(in srgb, var(--chrome-action) 83%, #9290ff);
  }
}

.header-inner-row :is(.nav-capsule-item, .header-tool, .header-download):active { transform: scale(0.97); }
.header-inner-row :is(a, button):focus-visible { outline: 2px solid var(--chrome-outline); outline-offset: 1px; }

@media (max-width: 1120px) {
  .header-capsule-nav { display: none; }
  .btn-minimal-menu { display: inline-flex; }
}

@media (max-width: 660px) {
  .site-header {
    inset-block-start: calc(8px + env(safe-area-inset-top, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .header-inner-row { min-height: 54px; padding: 4px 6px; padding-inline-start: 10px; gap: 4px; }
  .header-brand-wrap { gap: 6px; }
  .header-brand-icon { width: 26px; height: 26px; }
  .header-right-actions { gap: 0; }
  .header-tool { min-height: 44px; padding-inline: 6px; }
  .header-right-actions :is(.kbd, #themeText, #langText, .header-download) { display: none; }
  .header-lang-short { display: inline; font-size: 0.72rem; }
  #lang { gap: 3px; }
  #lang .icon { width: 14px; height: 14px; }
}

@media (min-width: 375px) and (max-width: 660px) {
  .header-right-actions #langText { display: inline; font-size: 0.76rem; }
  .header-lang-short { display: none; }
}


/* ==================== HERO SECTION ==================== */
.hero-cinematic {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: min(760px, 100svh);
  padding: 82px 0 28px;
  color-scheme: dark;
  background:
    radial-gradient(ellipse at 50% 0%, #121425 0%, transparent 68%),
    linear-gradient(180deg, #090a12, #080a12 72%, #070910);
  border-block-end: 1px solid #a5acda1c;
}

.hero-cinematic-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  align-items: center;
  width: min(calc(100% - clamp(40px, 8vw, 148px)), 1440px);
  margin-inline: auto;
}

.hero-typography-col {
  position: relative;
  z-index: 1;
  padding-block: 16px;
}

.hero-display-title {
  margin: 0;
  font-size: clamp(3.6rem, 5.75vw, 6rem);
  font-weight: 690;
  line-height: 0.99;
  letter-spacing: -0.059em;
  color: #f4f5f7;
}

.hero-display-title .title-line {
  display: block;
}

.hero-display-title .title-line + .title-line {
  color: #c3bfe0;
}

html[lang="en"] .hero-display-title .title-line + .title-line {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.035em;
}

html[lang="fa"] .hero-display-title {
  line-height: 1.16;
  letter-spacing: 0;
}

.hero-technical-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font: 500 0.71rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bab5d7;
}

.hero-technical-kicker::before {
  content: "";
  width: 15px;
  height: 1px;
  background: #9e8aff;
}

html[lang="fa"] .hero-technical-kicker {
  font: 500 0.8rem/1.5 Vazirmatn, sans-serif;
  letter-spacing: 0;
}

.hero-supporting-copy {
  max-width: 34ch;
  margin: 22px 0 0;
  font-size: clamp(1rem, 1.33vw, 1.2rem);
  line-height: 1.62;
  color: #b4bed0;
  text-wrap: pretty;
}

html[lang="fa"] .hero-supporting-copy {
  line-height: 1.85;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 26px;
}

.hero-mobile-download { display: none; }


/* Elite Double-Bezel Download Button */
.btn-cinematic-primary {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 28px 0 20px;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #182236 0%, #0e1422 100%);
  border: 1px solid rgba(99, 221, 235, 0.45);
  box-shadow:
    0 12px 32px -10px rgba(0, 0, 0, 0.7),
    0 0 20px -6px var(--c-cyan-glow),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 160ms var(--ease-cinematic), background-color 160ms, border-color 160ms;
}

.btn-cinematic-primary:hover {
  transform: translateY(-2px);
  border-color: var(--c-cyan);
  box-shadow:
    0 16px 40px -8px rgba(0, 0, 0, 0.8),
    0 0 30px -4px var(--c-cyan-glow),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.btn-cinematic-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-icon-bezel {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(99, 221, 235, 0.15);
  color: var(--c-cyan);
  border: 1px solid rgba(99, 221, 235, 0.3);
}

.btn-icon-bezel svg {
  width: 16px;
  height: 16px;
}

.btn-cinematic-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--c-text-secondary);
  background: rgba(14, 20, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
  text-decoration: none !important;
  transition: transform 160ms var(--ease-cinematic), color 160ms, background-color 160ms, border-color 160ms;
}

.hero-cta-group > .btn-cinematic-primary {
  color: #17152c;
  background: #c8baff;
  border-color: #c8baff;
  box-shadow: none;
}

.hero-cta-group > .btn-cinematic-primary .btn-icon-bezel {
  color: inherit;
  background: #29204b14;
  border-color: #29204b26;
}

@media (hover: hover) and (pointer: fine) {
  .hero-cta-group > .btn-cinematic-primary:hover { background: #e0d6ff; border-color: #e0d6ff; box-shadow: none; }
}

.btn-cinematic-secondary:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(22, 32, 50, 0.6);
  transform: translateY(-2px);
}

/* Technical Architecture Subtext */
.hero-meta-strip {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: #8f9bab;
  flex-wrap: wrap;
}

.hero-meta-strip a {
  color: var(--c-text-secondary);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-meta-strip a:hover {
  color: var(--c-cyan);
  border-color: var(--c-cyan);
}

/* The globe and four independent instruments share a single figure. */
.hero-demo {
  --hero-poster: url("/assets/hero-earth.svg?v=signal-loop");
  --hud-surface: linear-gradient(148deg, #1c2031fa, #121522f7 72%);
  --hud-line: #a7a6db54;
  --hud-ink: #f0eff9;
  --hud-muted: #b8bbd2;
  --hud-accent: #bcaaff;
  --hud-verified-surface: linear-gradient(148deg, #183441fa, #10212df7 78%);
  --hud-verified-line: #85dceb55;
  --hud-shadow: 0 2px 5px #0506105c, 0 15px 24px -16px #03050de6, inset 0 1px #f3edff15;
  --hud-tether: #9b9bc25c;
  --hud-width: clamp(127px, 11.2vw, 164px);
  --hud-edge: clamp(12px, 2.15vw, 34px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-inline-size: 0;
  margin: 0;
  isolation: isolate;
}

[data-theme="light"] .hero-demo {
  --hud-surface: linear-gradient(149deg, #fdfcff, #eeedf8 83%);
  --hud-line: #81749f60;
  --hud-ink: #29253c;
  --hud-muted: #514b65;
  --hud-accent: #6653a8;
  --hud-verified-surface: linear-gradient(149deg, #f9feff, #e5f3f7 83%);
  --hud-verified-line: #54848e73;
  --hud-shadow: 0 2px 6px #23194318, 0 16px 29px -16px #362b6378, inset 0 1px #fff;
  --hud-tether: #65598464;
}

.hero-demo::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -5% -12% 0;
  pointer-events: none;
  background: radial-gradient(ellipse 51% 51% at 45% 45%, #5445944f, transparent),
              radial-gradient(ellipse 43% 51% at 62% 49%, #13516c54, transparent);
}

[data-theme="light"] .hero-demo::before {
  background: radial-gradient(ellipse 48% 46% at 45% 46%, #b6a5ea8a, transparent),
              radial-gradient(ellipse 43% 52% at 62% 49%, #91c9e356, transparent);
}

.hero-art {
  position: relative;
  grid-area: 1 / 1;
  width: min(88%, 41rem, max(23rem, calc(100svh - 194px)));
  aspect-ratio: 1;
  margin-inline: auto;
  touch-action: pan-y pinch-zoom;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero-demo .hero-art:has(.is-live) { cursor: grab; }
  .hero-demo .hero-art.is-dragging { cursor: grabbing; }
}

.hero-orb-poster, .hero-canvas-container, .hero-3d-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-orb-poster {
  background: var(--hero-poster) center / contain no-repeat;
  transition: opacity 180ms var(--ease-cinematic);
}

.hero-canvas-container { opacity: 0; transition: opacity 180ms var(--ease-cinematic); }
.hero-canvas-container.is-live { opacity: 1; }
.hero-art:has(.is-live) .hero-orb-poster { opacity: 0; }

.hero-hud-layer {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  min-inline-size: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.hud-glass-panel {
  position: absolute;
  display: grid;
  align-content: center;
  gap: 6px;
  inline-size: var(--hud-width);
  min-block-size: 86px;
  padding: 10px 12px;
  border: 1px solid var(--hud-line);
  border-radius: 10px;
  color: var(--hud-ink);
  background: var(--hud-surface);
  box-shadow: var(--hud-shadow);
}

.hud-glass-panel::after {
  content: "";
  position: absolute;
  inset-block-start: 52%;
  inline-size: clamp(12px, 2vw, 26px);
  block-size: 5px;
  background: linear-gradient(var(--hud-tether), var(--hud-tether)) center / 100% 1px no-repeat,
    radial-gradient(circle, var(--hud-tether) 1.5px, transparent 2px) right center / 5px 5px no-repeat;
}

.hud-glass-panel:is([data-demo-panel="1"], [data-demo-panel="3"])::after { inset-inline-start: 100%; }
.hud-glass-panel:is([data-demo-panel="2"], [data-demo-panel="4"])::after { inset-inline-end: 100%; }
html[dir="rtl"] .hud-glass-panel:is([data-demo-panel="1"], [data-demo-panel="3"])::after,
html[dir="ltr"] .hud-glass-panel:is([data-demo-panel="2"], [data-demo-panel="4"])::after { transform: scaleX(-1); }

.hud-glass-panel[data-demo-panel="1"] { inset-block-start: 14%; inset-inline-start: var(--hud-edge); }
.hud-glass-panel[data-demo-panel="2"] { inset-block-start: 9%; inset-inline-end: var(--hud-edge); }
.hud-glass-panel[data-demo-panel="3"] { inset-block-end: 11%; inset-inline-start: calc(var(--hud-edge) + 12px); }
.hud-glass-panel[data-demo-panel="4"] { inset-block-end: 17%; inset-inline-end: calc(var(--hud-edge) + 10px); }

.hud-glass-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--hud-verified-line);
  border-radius: inherit;
  background: var(--hud-verified-surface);
  opacity: 0;
  transition: opacity 180ms var(--ease-cinematic);
}

.hero-demo.is-playing[data-demo-phase="1"] [data-demo-panel="1"]::before,
.hero-demo.is-playing[data-demo-phase="2"] [data-demo-panel="2"]::before,
.hero-demo.is-playing[data-demo-phase="3"] [data-demo-panel="3"]::before,
.hero-demo.is-playing[data-demo-phase="4"] [data-demo-panel="4"]::before { opacity: 1; }

.hud-glass-panel > * { position: relative; }

.hud-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: var(--hud-accent);
}

.hud-panel-heading bdi {
  color: var(--hud-muted);
  font: .65rem/1 var(--font-mono);
  letter-spacing: .07em;
}

.hud-feature-icon, .hero-demo-replay svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hud-glass-panel strong { font-size: .94rem; line-height: 1.2; font-weight: 760; }
.hud-feature-copy { font-size: .70rem; line-height: 1.3; color: var(--hud-muted); text-wrap: pretty; }

.hero-demo-caption {
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: 2px 8px;
  margin-block-start: -14px;
  color: var(--hud-muted);
  font: .72rem/1.4 var(--font-mono);
  letter-spacing: .02em;
}

.hero-demo-label, .hero-demo-replay { display: inline-flex; align-items: center; gap: 6px; }
.hero-demo .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero-demo-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border: 1px solid var(--hud-accent);
  border-radius: 50%;
}

html[lang="fa"] .hero-demo-caption { font: .78rem/1.4 Vazirmatn, sans-serif; letter-spacing: 0; }
.hero-demo-replay {
  min-block-size: 44px;
  min-inline-size: 44px;
  padding-inline: 8px;
  border: 0;
  border-radius: 8px;
  color: var(--hud-accent);
  background: transparent;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.hero-demo-replay[hidden], .hero-demo.is-playing .hero-loop-play,
.hero-demo:not(.is-playing) .hero-loop-pause { display: none; }
.hero-demo-replay svg { inline-size: 14px; block-size: 14px; }
.hero-demo-replay:focus-visible { outline: 2px solid var(--chrome-outline); outline-offset: 1px; }

@media (hover: hover) and (pointer: fine) {
  .hero-demo-replay:hover { color: var(--hud-ink); }
}

@media (max-width: 960px) {
  .hero-demo { --hud-width: clamp(122px, 19.5vw, 148px); --hud-edge: 0px; }
  .hero-art { width: min(87%, 29rem); }
}

@media (max-width: 600px) {
  .hero-demo { --hud-width: clamp(96px, 27vw, 132px); width: min(100%, 27rem); justify-self: center; }
  .hero-art { width: min(100%, 24rem); margin-block: -11px -17px; }
  .hud-glass-panel[data-demo-panel] { min-block-size: 58px; gap: 3px; padding: 6px 8px; border-radius: 8px; }
  .hud-glass-panel::after { inline-size: 10px; }
  .hud-glass-panel[data-demo-panel="1"] { inset-block-start: 8%; }
  .hud-glass-panel[data-demo-panel="2"] { inset-block-start: 4%; }
  .hud-glass-panel[data-demo-panel="3"] { inset-block-end: 3%; inset-inline-start: 2px; }
  .hud-glass-panel[data-demo-panel="4"] { inset-block-end: 6%; inset-inline-end: 2px; }
  .hud-panel-heading bdi { display: none; }
  .hud-glass-panel strong { font-size: .80rem; }
  .hud-feature-icon { inline-size: 13px; block-size: 13px; }
  .hud-feature-copy { font-size: .66rem; }
  .hero-demo-caption { margin-block-start: 0; gap: 2px 5px; }
}

@media (max-width: 380px) and (max-height: 670px) {
  .hero-art { width: min(100%, clamp(225px, calc(100svh - 315px), 280px)); }
}

@media (max-width: 360px) and (max-height: 620px) {
  .hero-demo { --hud-width: 103px; }
  .hero-art { width: min(100%, clamp(225px, calc(100svh - 332px), 248px)); }
  .hud-glass-panel[data-demo-panel] { padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-canvas-container.is-live { opacity: 0; }
  .hero-art:has(.is-live) .hero-orb-poster { opacity: 1; }
  .hero-demo-replay { display: none; }
}


/* Porcelain and indigo keep the globe legible in light mode. */
[data-theme="light"] .hero-cinematic {
  color-scheme: light;
  background:
    radial-gradient(ellipse at 72% 38%, #dedcf4 0%, transparent 61%),
    linear-gradient(145deg, #fbfcff, #f1f0fa 72%, #e9e9f5);
  border-block-end-color: #6d61952c;
}

[data-theme="light"] .hero-display-title { color: #24233b; }
[data-theme="light"] .hero-display-title .title-line + .title-line { color: #584889; }
[data-theme="light"] .hero-technical-kicker { color: #514176; }
[data-theme="light"] :is(.hero-supporting-copy, .hero-meta-strip, .hero-demo-caption) { color: #4b526b; }
[data-theme="light"] .hero-meta-strip a { color: #514176; border-color: #61509242; }


[data-theme="light"] .btn-cinematic-primary {
  color: #fff;
  background: #5145d0;
  border-color: #5544c9;
  box-shadow: 0 10px 22px #49399731, inset 0 1px #faf5ff36;
}

[data-theme="light"] .btn-icon-bezel {
  color: #f2efff;
  background: #ffffff22;
  border-color: #ffffff38;
}

[data-theme="light"] .btn-cinematic-secondary {
  color: #4a4265;
  background: #ffffff9e;
  border-color: #65548738;
}

@media (hover: hover) and (pointer: fine) {
  [data-theme="light"] .btn-cinematic-primary:hover { background: #4237b7; border-color: #4237b7; }
  [data-theme="light"] .btn-cinematic-secondary:hover { color: #372e52; background: #fff; border-color: #65548765; }
}

/* ==================== SECTION HEADINGS & REVEALS ==================== */
.section-cinematic-head {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 56px;
}

.cinematic-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-cyan);
  background: var(--c-cyan-soft);
  border: 1px solid rgba(99, 221, 235, 0.25);
  margin-bottom: 18px;
}

.section-cinematic-title {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--c-text-primary);
  text-wrap: balance;
}

.section-cinematic-sub {
  margin: 0;
  font-size: clamp(1.02rem, 1.2vw, 1.16rem);
  line-height: 1.65;
  color: var(--c-text-secondary);
}

/* ==================== DOUBLE-BEZEL CARDS ==================== */
.card-double-bezel {
  position: relative;
  background: rgba(14, 20, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 32px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 24px 60px -20px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.35s var(--ease-cinematic);
}

.card-double-bezel:hover {
  border-color: rgba(99, 221, 235, 0.35);
  transform: translateY(-4px);
  box-shadow:
    0 30px 70px -20px rgba(0, 0, 0, 0.9),
    0 0 30px -8px var(--c-cyan-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ==================== NAVIGATION DRAWER ==================== */
.cinematic-menu-dialog {
  position: fixed;
  inset: 0;
  width: min(calc(100% - 32px), 500px);
  max-height: min(720px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--chrome-text);
  background: var(--panel-solid);
  border: 1px solid var(--chrome-line);
  border-radius: 22px;
  box-shadow: 0 24px 80px #08081055;
}

.cinematic-menu-dialog::backdrop { background: #080a1299; }
.menu-dialog-content { padding: clamp(16px, 4vw, 28px); }

.menu-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block-end: 12px;
  margin-block-end: 10px;
  border-block-end: 1px solid var(--chrome-line);
}

.menu-title { font-size: 1.2rem; font-weight: 750; }
.menu-dialog-header .util-btn { width: 44px; height: 44px; }
.menu-nav-links-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

.menu-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: 48px;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--chrome-text);
  background: var(--chrome-hover);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  touch-action: manipulation;
}

.menu-nav-item .icon { width: 14px; height: 14px; flex: none; color: var(--chrome-muted); }
.menu-nav-item[aria-current="location"] { background: var(--chrome-active); }
.menu-nav-item:active { background: var(--chrome-active); }
.menu-dialog-footer { margin-block-start: 14px; }
.menu-dialog-footer .btn-cinematic-primary { justify-content: center; }

@media (hover: hover) and (pointer: fine) {
  .menu-nav-item:hover { color: var(--chrome-text); background: var(--chrome-active); }
}

@media (max-width: 660px) {
  .cinematic-menu-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 14px);
    margin: 0;
    padding-block-end: env(safe-area-inset-bottom, 0px);
    border-radius: 22px 22px 0 0;
  }
}


@media (max-width: 960px) {
  .hero-cinematic {
    min-height: auto;
    padding: calc(88px + env(safe-area-inset-top, 0px)) 0 28px;
  }

  .hero-cinematic-grid {
    grid-template-columns: minmax(0, 1fr);
    width: min(calc(100% - 40px), 580px);
  }

  .hero-typography-col {
    display: grid;
    justify-items: center;
    padding: 0;
    text-align: center;
  }

  .hero-display-title {
    font-size: clamp(2.55rem, 11vw, 4.8rem);
  }

  .hero-technical-kicker { margin-bottom: 12px; }
  .hero-supporting-copy { margin-top: 15px; }
  .hero-cta-group { margin-top: 19px; }
  .hero-cta-group, .hero-meta-strip { justify-content: center; }

  .hero-meta-strip {
    gap: 3px 8px;
    font-size: 0.72rem;
  }


}

@media (max-width: 600px) {
  .hero-cta-group .btn-cinematic-primary,
  .hero-cta-group .btn-cinematic-secondary {
    min-height: 46px;
    padding-inline: 13px;
    gap: 7px;
    font-size: 0.83rem;
  }

  .hero-cta-group .btn-icon-bezel {
    width: 26px;
    height: 26px;
  }


}
