/* ─── RESET & VARIABLES ──────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy:       #0a1930;
  --navy-mid:   rgba(10, 25, 48, 0.82);
  --navy-glass: rgba(10, 25, 48, 0.88);
  --gold:       #DFD0B8;
  --gold-glow:  rgba(223, 208, 184, 0.65);
  --chrome:     #E8E9EB;
  --white:      #ffffff;
  --card-left:  5vw;
  --card-w:     min(460px, 34vw);
  --card-r:     14px;
  --header-h:   15vh;
  --track-x:    2.8vw;
}

html {
  scroll-behavior: auto;
  overflow-x: hidden;
  position: relative;
}

body {
  background: #f0f2f5;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
               'Segoe UI', system-ui, sans-serif;
  overflow-x: hidden;
  position: relative;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ─── LOADING SCREEN ─────────────────────────────────────────────────────── */

#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.loader-brand {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  letter-spacing: 0.4em;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.loader-bar-track {
  width: min(300px, 55vw);
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
}

.loader-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(243,229,171,0.6) 100%);
  transition: width 0.12s linear;
}

.loader-pct {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ─── HEADER ─────────────────────────────────────────────────────────────── */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* position: relative lets the absolutely-centered logo ignore sibling widths */
  position: fixed;
  z-index: 100;
  padding: 0 3vw;
  background: linear-gradient(
    to bottom,
    rgba(10, 25, 48, 0.90) 0%,
    rgba(10, 25, 48, 0.55) 55%,
    rgba(10, 25, 48, 0.00) 100%
  );
  pointer-events: auto;
}

/* LEFT column */
.header-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.header-wordmark {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  white-space: nowrap;
}

/* CENTER column — absolutely centered against the full header width */
.header-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  /* pointer-events: none prevents it from blocking left/right click zones */
  pointer-events: none;
}

.header-logo img {
  height: 120px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.55));
}

.logo-fallback {
  display: none;
  align-items: baseline;
  font-size: 1rem;
  letter-spacing: 0.3em;
  font-weight: 700;
  gap: 0;
}

/* ─── BRAND NAME SPLIT (gold "HYDRO" + chrome "NEXA") ─────────────────────── */

.brand-hydro {
  background: linear-gradient(135deg, #b8956a 0%, #DFD0B8 50%, #c4a878 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-nexa {
  background: linear-gradient(135deg, #a8b0bc 0%, #E8E9EB 45%, #b0bac6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2.25rem;
  flex: 1;
}

.header-nav a {
  color: var(--chrome);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  font-weight: 400;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.header-nav a:hover {
  color: var(--gold);
}

.header-nav .nav-cta {
  border: 1px solid rgba(243, 229, 171, 0.35);
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.header-nav .nav-cta:hover {
  color: var(--navy);
  background: var(--gold);
  border-color: var(--gold);
}

/* ─── CANVAS ─────────────────────────────────────────────────────────────── */

#hero-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  z-index: -1;
  display: block;
  background: #ffffff;
  will-change: transform;
  transform: translateZ(0);
}

/* ─── SCROLL DRIVER ──────────────────────────────────────────────────────── */

#scroll-driver {
  position: relative;
  height: 750vh;
  width: 100%;
}

/* ─── PROGRESS TRACK ─────────────────────────────────────────────────────── */

#progress-track {
  position: fixed;
  left: var(--track-x);
  top: 50%;
  transform: translateY(-50%);
  height: 48vh;
  width: 28px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.track-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(232, 233, 235, 0.25) 15%,
    rgba(232, 233, 235, 0.25) 85%,
    transparent 100%
  );
}

.track-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow), 0 0 20px rgba(243,229,171,0.3);
  margin-left: -4px;
  z-index: 1;
  transition: top 0.08s linear;
  will-change: top;
}

.track-node {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(232, 233, 235, 0.18);
  border: 1.5px solid rgba(232, 233, 235, 0.3);
  margin-left: -3px;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  cursor: default;
}

.track-node[data-section="0"] { top: 0%;    }
.track-node[data-section="1"] { top: 33%;   }
.track-node[data-section="2"] { top: 66%;   }
.track-node[data-section="3"] { top: 100%;  }

.track-node.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow), 0 0 16px rgba(243,229,171,0.25);
}

.node-label {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 233, 235, 0.35);
  white-space: nowrap;
  transition: color 0.35s ease;
  pointer-events: none;
}

.track-node.active .node-label {
  color: rgba(243, 229, 171, 0.7);
}

/* ─── CONTENT CARDS ──────────────────────────────────────────────────────── */

#cards-container {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  pointer-events: none;
  z-index: 10;
}

.content-card {
  position: absolute;
  left: var(--card-left);
  top: 50%;
  transform: translateY(calc(-50% + 24px));
  width: var(--card-w);
  background: var(--navy-mid);
  border: 1px solid rgba(232, 233, 235, 0.1);
  border-radius: var(--card-r);
  padding: 2.25rem 2rem 2rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
  overflow: hidden;
  opacity: 0;
  will-change: opacity, transform;
  /* Subtle inner highlight on top edge */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 24px 48px rgba(0,0,0,0.3),
    0 8px 16px rgba(0,0,0,0.2);
}

.card-watermark {
  position: absolute;
  top: -0.15em;
  left: -0.04em;
  font-size: clamp(5rem, 9.5vw, 7.5rem);
  font-weight: 800;
  color: rgba(243, 229, 171, 0.065);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.02em;
}

.card-body {
  position: relative;
  z-index: 1;
}

.content-card h2 {
  font-size: clamp(1.05rem, 1.9vw, 1.4rem);
  font-weight: 400;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
}

.content-card p {
  font-size: clamp(0.78rem, 1.1vw, 0.875rem);
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.7;
}

.gold {
  color: var(--gold);
}

.card-metric {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(243, 229, 171, 0.14);
}

.metric-value {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.3;
  max-width: 80px;
}

/* ─── FILTRATION SCHEMATIC (right side, scroll-synchronized) ────────────── */

#filter-schematic {
  position: fixed;
  right: 4vw;
  top: 50%;
  transform: translateY(-50%) translateX(60px);
  z-index: 15;
  opacity: 0;
  will-change: opacity, transform;
  pointer-events: none;

  /* Solid navy backing — no transparency, reads perfectly over white video */
  background: #0a1930;
  border: 1px solid rgba(223, 208, 184, 0.12);
  border-radius: 16px;
  padding: 1.4rem 1.25rem 1.4rem 1rem;
  width: clamp(195px, 20vw, 255px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.7),
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Header */
.schem-title {
  text-align: center;
  padding-bottom: 0.8rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid rgba(223, 208, 184, 0.1);
}
.schem-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}
.schem-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.25rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Input / output flow labels */
.schem-flow-in,
.schem-flow-out {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 0.45rem 0 0.45rem 0.2rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.flow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}
.output-dot {
  background: rgba(223, 208, 184, 0.35);
  border-color: rgba(223, 208, 184, 0.5);
}

/* Stage body — vertical spine via ::before */
.schem-body {
  position: relative;
  padding-left: 1.15rem;
}
.schem-body::before {
  content: '';
  position: absolute;
  left: 0.44rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 8%,
    rgba(255, 255, 255, 0.1) 92%,
    transparent 100%
  );
}

/* Individual stage row */
.filter-stage {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0;
  position: relative;
  transition: background 0.4s ease;
}

/* Node dot on the spine */
.stage-node {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: #0a1930;
  flex-shrink: 0;
  margin-top: 0.22rem;
  position: relative;
  z-index: 1;
  transition: border-color 0.45s ease, background 0.45s ease, box-shadow 0.45s ease;
}
.filter-stage.active .stage-node {
  border-color: var(--gold);
  background: rgba(223, 208, 184, 0.12);
  box-shadow: 0 0 10px rgba(223, 208, 184, 0.55), 0 0 22px rgba(223, 208, 184, 0.2);
}

/* Stage text block */
.stage-card { flex: 1; }

.stage-num {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 0.14rem;
  transition: color 0.45s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.filter-stage.active .stage-num { color: rgba(223, 208, 184, 0.7); }

.stage-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.2;
  transition: color 0.45s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.filter-stage.active .stage-name { color: var(--gold); }

.stage-desc {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.14rem;
  transition: color 0.45s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.filter-stage.active .stage-desc { color: rgba(255, 255, 255, 0.6); }

/* RO Membrane — special "CORE" emphasis */
.ro-stage {
  padding: 0.65rem 0;
}
.ro-stage .stage-node {
  width: 11px;
  height: 11px;
  margin-top: 0.35rem;
}
.ro-stage::before,
.ro-stage::after {
  content: '';
  position: absolute;
  left: 1.8rem;
  right: 0;
  height: 1px;
  background: rgba(223, 208, 184, 0.07);
}
.ro-stage::before { top: 0; }
.ro-stage::after  { bottom: 0; }

.stage-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(223, 208, 184, 0.55);
  border: 1px solid rgba(223, 208, 184, 0.25);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  margin-bottom: 0.18rem;
  transition: color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}
.ro-stage.active .stage-badge {
  color: var(--gold);
  border-color: rgba(223, 208, 184, 0.45);
  box-shadow: 0 0 8px rgba(223, 208, 184, 0.25);
}

/* ─── FOOTER / BOOKING PANEL ─────────────────────────────────────────────── */

/* Transparent centering stage — GSAP targets .footer-card, not this */
#footer-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 2rem;
}

/* The actual floating card — nuclear overrides ensure 100% solid navy */
.footer-card {
  width: 90%;
  max-width: 800px;
  background-color: #0a1930 !important;
  border-radius: 24px;
  padding: 4rem 3.5rem;
  border: 1px solid rgba(232, 233, 235, 0.15);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  /* Block any inherited glassmorphism */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  /* Force text to white — overrides any inherited color */
  color: #ffffff !important;
  /* GSAP sets opacity/transform via fromTo — CSS value is just pre-JS fallback */
  opacity: 0;
  will-change: opacity, transform;
}

.footer-inner {
  width: 100%;
  text-align: center;
}

.footer-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
  opacity: 0.85;
}

.footer-headline {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 300;
  line-height: 1.22;
  margin-bottom: 1.25rem;
  color: var(--white);
  letter-spacing: -0.02em;
}

.footer-subtext {
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.75;
  margin-bottom: 2.75rem;
  max-width: 460px;
  margin-inline: auto;
}

#booking-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

#booking-form input {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(232, 233, 235, 0.14);
  border-radius: 8px;
  padding: 0.875rem 1.1rem;
  color: var(--white);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color 0.25s ease, background 0.25s ease;
}

#booking-form input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

#booking-form input:focus {
  border-color: rgba(243, 229, 171, 0.5);
  background: rgba(255, 255, 255, 0.075);
}

.cta-button {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 0.35rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  align-self: center;
  width: 100%;
  max-width: 300px;
  transition: filter 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 20px rgba(243, 229, 171, 0.25);
}

.cta-button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(243, 229, 171, 0.35);
}

.cta-button:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.cta-button.success {
  background: rgba(180, 220, 170, 0.9);
  color: #0a2a12;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.footer-fine {
  margin-top: 1.75rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.22);
}

.footer-fine a {
  color: rgba(255, 255, 255, 0.38);
  text-decoration: underline;
  transition: color 0.2s;
}

.footer-fine a:hover {
  color: rgba(255, 255, 255, 0.65);
}

/* ─── ABOUT MODAL ────────────────────────────────────────────────────────── */

#about-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  /* Blurred overlay — fades site into soft focus */
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#about-modal.open {
  opacity: 1;
  visibility: visible;
}

/* The floating card box */
.modal-box {
  position: relative;
  background-color: #0a1930;
  border-radius: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 3rem 2.75rem 2.5rem;
  border: 1px solid rgba(223, 208, 184, 0.13);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.65),
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  /* GSAP sets initial state via fromTo */
  opacity: 0;
}

/* Scrollbar styling inside modal */
.modal-box::-webkit-scrollbar { width: 4px; }
.modal-box::-webkit-scrollbar-track { background: transparent; }
.modal-box::-webkit-scrollbar-thumb { background: rgba(223,208,184,0.2); border-radius: 2px; }

/* Close button */
.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: 1px solid rgba(223, 208, 184, 0.25);
  border-radius: 6px;
  color: var(--gold);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
}
.modal-close:hover {
  background: rgba(223, 208, 184, 0.1);
  border-color: rgba(223, 208, 184, 0.5);
}

/* Logo centered at the top */
.modal-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.modal-logo img {
  width: 190px;
  height: auto;
  max-width: 100%;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.55));
}

/* Content */
.modal-content { text-align: left; }

.modal-heading {
  font-size: clamp(1.45rem, 3.5vw, 1.9rem);
  font-weight: 300;
  color: var(--gold);
  letter-spacing: -0.01em;
  line-height: 1.28;
  margin-bottom: 1.25rem;
  text-align: center;
}

.modal-subheading {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 1.75rem;
  margin-bottom: 0.85rem;
}

.modal-body {
  font-size: 0.93rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.8;
}

.modal-brand {
  color: var(--gold);
  font-weight: 500;
}

.modal-cta-text {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(223, 208, 184, 0.1);
  font-size: 0.72rem;
  color: rgba(223, 208, 184, 0.45);
  text-align: center;
  letter-spacing: 0.04em;
  font-style: italic;
  line-height: 1.6;
}

/* ─── MOBILE ─────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  :root { --card-w: min(420px, 50vw); }
}

@media (max-width: 768px) {
  /* ── Variables ─────────────────────────────────────────────────────────── */
  :root {
    --header-h: 12vh;
    --card-left: 5%;
    --card-w:    90vw;
  }

  /* ── Header ────────────────────────────────────────────────────────────── */
  #site-header {
    padding: 0 4vw;
    min-height: 70px;
    justify-content: space-between;
  }

  /* Hide text wordmark — logo image already carries the brand name */
  .header-left {
    display: none !important;
  }

  /* Logo: leave absolute flow, become the left flex item */
  .header-logo {
    position: relative !important;
    left: auto !important;
    transform: none !important;
    transform-origin: unset !important;
    pointer-events: auto;
    flex-shrink: 0;
  }

  .header-logo img {
    height: 70px;
    width: auto;
    max-width: 120px;
  }

  .header-nav {
    flex: unset;
    justify-content: flex-end;
    gap: 0.75rem;
  }
  .header-nav a {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
  }
  .header-nav .nav-cta {
    padding: 0.3rem 0.65rem;
  }

  /* ── Canvas ─────────────────────────────────────────────────────────────── */
  /* Canvas fills screen as normal; cover-scale math handles portrait */

  /* ── Progress track & schematic: hidden on mobile ───────────────────────── */
  #progress-track,
  #filter-schematic {
    display: none;
  }

  /* ── Content Cards: centered, pinned to bottom ──────────────────────────── */
  #cards-container {
    /* Keep fixed full-screen container; cards are repositioned below */
  }

  .content-card {
    /* Anchor to bottom-center so 3D video is visible above the card */
    top:       auto;
    bottom:    5vh;
    left:      50%;
    width:     90vw;
    max-width: none;
    /* translateX(-50%) centers the card; JS-controlled translateY is suppressed
       on mobile via the JS guard — so this transform is safe here */
    transform: translateX(-50%);
    padding:   1.4rem 1.25rem;
  }

  .card-watermark { font-size: 3.5rem; }
  .content-card h2 { font-size: clamp(1rem, 4.5vw, 1.25rem); }
  .content-card p  { font-size: 0.82rem; }

  /* ── Footer card ────────────────────────────────────────────────────────── */
  #footer-panel { padding: 1.5rem 1rem; }

  .footer-card {
    width:         95%;
    padding:       2.5rem 1.5rem;
    border-radius: 16px;
    max-height:    calc(100svh - 120px);
    overflow-y:    auto;
  }

  .footer-headline {
    font-size: clamp(1.6rem, 6.5vw, 2.2rem);
  }

  .footer-subtext {
    font-size: 0.875rem;
    margin-bottom: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .cta-button {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  /* Logo stays at 70px — prominence is non-negotiable */
  .header-wordmark { font-size: 0.72rem; letter-spacing: 0.06em; }
  .header-nav a    { font-size: 0.66rem; }
  .header-nav .nav-cta { padding: 0.3rem 0.55rem; }
  .content-card h2 { font-size: 1rem; }
  .card-watermark  { font-size: 3rem; }
}
