:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20211f;
  background: #f5f2ec;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; overflow: hidden; background: #f5f2ec; }

.hero-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 63% 44%, rgba(255,255,255,.96), rgba(245,242,236,.88) 38%, rgba(236,232,224,.96) 100%);
}

.hero-shell[data-hero-layer="machine"] {
  background:
    radial-gradient(circle at 50% 42%, rgba(26, 40, 58, .92), rgba(6, 13, 23, .98) 58%, rgba(2, 6, 12, 1) 100%);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hero-copy {
  position: absolute;
  left: clamp(24px, 6vw, 84px);
  top: clamp(24px, 7vh, 76px);
  width: min(360px, calc(100vw - 48px));
  z-index: 2;
  pointer-events: none;
}

/* V3.2 — brand mark in entrance-brand region (additive; no second WebGL) */
.hero-brand-mark {
  display: block;
  width: clamp(56px, 8vw, 72px);
  height: auto;
  margin: 0 0 14px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(40, 38, 32, .12), inset 0 1px 0 rgba(255,255,255,.5);
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: rgba(52, 54, 49, .62);
}

h1 {
  margin: 0;
  max-width: 360px;
  font-size: clamp(38px, 4.6vw, 60px);
  line-height: .96;
  letter-spacing: -.045em;
  font-weight: 760;
  text-wrap: balance;
}

.lede {
  width: min(340px, 100%);
  margin: 16px 0 0;
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.5;
  color: rgba(52, 54, 49, .72);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vh, 40px);
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid rgba(58, 60, 55, .10);
  border-radius: 22px;
  background: rgba(255,255,255,.63);
  box-shadow: 0 16px 40px rgba(67, 63, 56, .12), inset 0 1px 0 rgba(255,255,255,.88);
  backdrop-filter: blur(18px) saturate(115%);
  z-index: 3;
}

.control-row, .status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.status-row { margin-top: 10px; padding: 0 4px 2px; }

button {
  appearance: none;
  border: 1px solid rgba(42, 44, 40, .12);
  background: rgba(255,255,255,.72);
  color: #2a2c29;
  padding: 9px 12px;
  border-radius: 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(50,48,42,.05);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.9);
  box-shadow: 0 6px 16px rgba(50,48,42,.08);
}
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}
button.primary {
  background: linear-gradient(180deg, #2f332e, #232621);
  color: #f7f5ef;
  border-color: rgba(20, 22, 18, .28);
}
button.primary:hover { background: linear-gradient(180deg, #3a3f39, #2a2d28); }
button.quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: rgba(42, 44, 40, .72);
}

#state-label, #seat-label {
  font-size: 12px;
  font-weight: 650;
  color: rgba(42, 44, 40, .72);
}

.hero-note {
  position: absolute;
  right: clamp(18px, 3vw, 36px);
  bottom: clamp(88px, 12vh, 120px);
  z-index: 2;
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(42, 44, 40, .45);
  pointer-events: none;
}

.hero-inspection {
  position: absolute;
  left: clamp(18px, 3vw, 36px);
  bottom: clamp(88px, 12vh, 120px);
  z-index: 3;
  max-width: min(520px, calc(100vw - 48px));
}
.hero-inspection__hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(42, 44, 40, .55);
}
.inspection-spine {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.spatial-parts {
  position: absolute;
  top: clamp(24px, 7vh, 76px);
  right: clamp(18px, 3vw, 36px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.far-environment {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 14px 18px 22px;
  font-size: 0.85rem;
}
.far-environment a { color: rgba(42, 44, 40, .72); text-decoration: none; }
.far-environment a:hover { text-decoration: underline; }

.hero-auth-panel {
  position: absolute;
  top: 24px;
  right: 24px;
  width: min(360px, calc(100vw - 48px));
  max-height: calc(100vh - 140px);
  overflow: auto;
  z-index: 14;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,252,246,.94);
  border: 1px solid rgba(40, 32, 22, .1);
  box-shadow: 0 24px 60px rgba(20, 16, 10, .18);
  transform: translate3d(0,-10px,0) scale(.99);
  transition: transform .2s ease, opacity .2s ease;
}
.hero-auth-panel[hidden] { display: none !important; }
.hero-auth-panel.is-open { transform: translate3d(0,0,0) scale(1); }
.hero-auth-panel label { display: block; margin: 10px 0; font-size: 0.85rem; }
.hero-auth-panel input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(40, 32, 22, .14);
  font: inherit;
}
.hero-auth-panel__tabs { display: flex; gap: 8px; margin: 8px 0 12px; }
.hero-auth-panel__status,
.hero-auth-panel__note { font-size: 0.8rem; color: rgba(42, 44, 40, .62); }

html[data-spatial-responsive="compact"] .hero-copy {
  left: 20px;
  top: 22px;
  width: min(340px, calc(100vw - 40px));
}

html[data-spatial-responsive="compact"] .hero-controls {
  width: min(760px, calc(100vw - 24px));
}

html[data-spatial-responsive="compact"] .hero-shell,
html[data-spatial-responsive="phone"] .hero-shell {
  min-height: 0;
  height: 100vh;
  height: 100dvh;
}

html[data-spatial-responsive="phone"] .hero-copy {
  left: max(16px, calc(env(safe-area-inset-left, 0px) + 12px));
  top: max(16px, calc(env(safe-area-inset-top, 0px) + 8px));
  width: calc(100vw - 32px);
}

html[data-spatial-responsive="phone"] .spatial-parts {
  top: auto;
  bottom: calc(116px + env(safe-area-inset-bottom, 0px));
  right: max(12px, calc(env(safe-area-inset-right, 0px) + 8px));
}

html[data-spatial-responsive="phone"] .hero-controls {
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  width: calc(100vw - 20px);
  padding: 8px;
  border-radius: 18px;
}

html[data-spatial-responsive="phone"] .control-row {
  gap: 6px;
}

html[data-spatial-responsive="phone"] .control-row button {
  padding: 8px 9px;
  font-size: 11px;
}

html[data-spatial-responsive="phone"] .hero-note {
  display: none;
}

html[data-spatial-responsive="phone"] .hero-auth-panel {
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
  right: max(12px, calc(env(safe-area-inset-right, 0px) + 8px));
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  width: calc(100vw - 24px);
  max-height: calc(100dvh - 120px);
  transform: translate3d(0,-10px,0) scale(.99);
}

html[data-spatial-responsive="phone"] .hero-auth-panel.is-open {
  transform: translate3d(0,0,0) scale(1);
}

/* V3.3 — Gentle Hero atmosphere (Layer A backdrop; existing .hero-aura-* owners) */
.hero-aura {
  position: absolute;
  inset: -12% -8%;
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
  opacity: calc(0.22 + var(--hero-atmosphere, 0.5) * 0.28);
  mix-blend-mode: multiply;
  will-change: transform, opacity;
}
.hero-aura-a {
  background:
    radial-gradient(ellipse 55% 42% at 62% 40%, rgba(120, 150, 180, 0.22), transparent 68%),
    radial-gradient(ellipse 40% 35% at 28% 62%, rgba(200, 170, 120, 0.14), transparent 70%);
  animation: hero-aura-drift-a 28s ease-in-out infinite alternate;
}
.hero-aura-b {
  background:
    radial-gradient(ellipse 48% 38% at 48% 28%, rgba(90, 130, 160, 0.12), transparent 72%),
    radial-gradient(ellipse 36% 30% at 72% 70%, rgba(160, 150, 130, 0.10), transparent 75%);
  animation: hero-aura-drift-b 36s ease-in-out infinite alternate;
}
@keyframes hero-aura-drift-a {
  from { transform: translate3d(-1.5%, 0.8%, 0) scale(1); }
  to   { transform: translate3d(1.8%, -1.2%, 0) scale(1.04); }
}
@keyframes hero-aura-drift-b {
  from { transform: translate3d(1.2%, -0.6%, 0) scale(1.02); }
  to   { transform: translate3d(-1.4%, 1.0%, 0) scale(1); }
}
.hero-shell[data-atmosphere-motion="static"] .hero-aura,
.hero-shell[data-atmosphere="machine"] .hero-aura {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  button:hover { transform: none; }
  .hero-auth-panel { transition: none; }
  .hero-aura { animation: none !important; opacity: 0.28; }
}

/* V3.4 — machine layer presentation (same Hero; entrance brand softens) */
.hero-shell[data-hero-layer="machine"] .hero-copy {
  /* ENT-T1: residual CSS owns full removal; keep transition hook only */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}
.hero-shell[data-hero-layer="entrance"] .hero-copy {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .hero-shell[data-hero-layer="machine"] .hero-copy { transition: none; }
}