/* Hero tuning deck: distances are px; spring/damping are per 60 Hz frame. */
.living-hero {
  --hero-module: ready;
  --hero-bone: #eeeae2;
  --hero-ink: #11110f;
  --hero-acid: #d8ff38;
  --hero-coral: #ff5d45;
  --hero-blue: #3f60ff;
  --hero-travel: 22;
  --hero-spring: .11;
  --hero-depth: 20;
  --hero-thread-tension: .075;
  --hero-thread-damping: .88;
  --hero-fragment-travel: 55;
  --hero-window: 135px;
  --hero-blueprint-window: 115px;
  --hero-height: clamp(290px, 43svh, 470px);
  --hero-padding: clamp(18px, 3vw, 36px);
  min-width: 0;
}
.living-hero .hero-art {
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: grid;
  align-items: center;
  height: 350px;
  height: var(--hero-height);
  padding: var(--hero-padding);
  overflow: hidden;
  background: #f6f4ef;
  color: var(--hero-ink);
  touch-action: pan-y pinch-zoom;
}
.living-hero .hero-words {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  font-family: Archivo, Arial, sans-serif;
  font-size: min(12vw, 100px);
  /* Width sets the type; the last bound keeps all three lines inside short desktops. */
  font-size: min(150px, 13.5cqw, calc((var(--hero-height) - 2 * var(--hero-padding)) / 2.8));
  font-weight: 750;
  font-variation-settings: 'wdth' 78;
  line-height: .88;
  letter-spacing: -.045em;
  text-transform: uppercase;
  pointer-events: none;
}
.living-hero .hero-line { display: block; position: relative; white-space: nowrap; }
.living-hero .hero-line:last-child { margin-top: .05em; }
.living-hero .hero-layer {
  position: absolute;
  inset: 0;
  padding: inherit;
  display: grid;
  align-items: center;
  pointer-events: none;
}
/* Every replica shares one grid cell, including its baseline and available width. */
.living-hero .hero-layer > .hero-words { grid-area: 1 / 1; }
.living-hero .hero-layer .hero-face { z-index: 10; }
.living-hero .hero-art[data-hero-ready] > .hero-words { visibility: hidden; }
.living-hero .hero-glyph { display: inline-block; transform-origin: 50% 80%; }
.living-hero .hero-orbit {
  position: absolute; left: 50%; top: 50%; width: 70px; height: 70px;
  border: 1px solid var(--hero-blue); border-radius: 50%; opacity: .55;
  transform: translate(-50%, -50%); z-index: -1;
}
.living-hero [data-hero-kind="elastic"] .hero-face .hero-line:nth-child(2) { color: var(--hero-blue); }
.living-hero [data-hero-kind="depth"] { background: var(--hero-acid); perspective: 850px; }
.living-hero [data-hero-kind="depth"] .hero-layer { transform-style: preserve-3d; }
.living-hero .hero-extrusion { color: var(--hero-coral); }
.living-hero [data-hero-kind="depth"] .hero-face .hero-line:last-child {
  color: var(--hero-bone); -webkit-text-stroke: 1px var(--hero-ink);
}
.living-hero [data-hero-kind="reveal"] { background: var(--hero-ink); color: var(--hero-bone); }
.living-hero [data-hero-kind="reveal"] .hero-face { color: transparent; -webkit-text-stroke: 1px var(--hero-bone); }
.living-hero .hero-window {
  position: absolute; inset: 0; padding: inherit; display: grid; align-items: center;
  background: var(--hero-coral); color: var(--hero-ink); z-index: 12;
  clip-path: circle(var(--hero-window) at 50% 50%);
}
.living-hero .hero-window .hero-line:nth-child(2) { color: var(--hero-bone); }
.living-hero [data-hero-kind="thread"] { background: #c8bcff; }
.living-hero [data-hero-kind="thread"] .hero-face { color: transparent; -webkit-text-stroke: 1px var(--hero-ink); }
.living-hero [data-hero-kind="thread"] .hero-line:nth-child(2) { -webkit-text-stroke-color: var(--hero-blue); }
.living-hero .hero-strings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.living-hero .hero-strings path { fill: none; stroke: var(--hero-ink); stroke-width: .65; opacity: .35; }
.living-hero [data-hero-kind="alignment"] { background: var(--hero-bone); perspective: 700px; }
.living-hero [data-hero-kind="alignment"] .hero-face { color: transparent; -webkit-text-stroke: 1px #11110f28; z-index: 0; }
.living-hero .hero-slice { z-index: 2; }
.living-hero .hero-slice[data-color="0"] { color: var(--hero-blue); }
.living-hero .hero-slice[data-color="1"] { color: var(--hero-ink); }
.living-hero .hero-slice[data-color="2"] { color: var(--hero-coral); }
.living-hero [data-hero-kind="blueprint"] { background: #2445be; color: #f6f4ef; }
.living-hero [data-hero-kind="blueprint"] .hero-face { color: transparent; -webkit-text-stroke: .8px #eeeae2cc; }
.living-hero .hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(#eeeae218 1px, transparent 1px), linear-gradient(90deg, #eeeae218 1px, transparent 1px);
  background-size: 22px 22px;
}
.living-hero .hero-blueprint-fill {
  position: absolute; inset: 0; padding: inherit; display: grid; align-items: center;
  clip-path: circle(var(--hero-blueprint-window) at 50% 50%); z-index: 12;
}
.living-hero .hero-blueprint-fill .hero-line:nth-child(2) { color: var(--hero-acid); }
.living-hero .hero-guide { position: absolute; background: var(--hero-acid); opacity: .7; z-index: 13; }
.living-hero .hero-horizontal { left: 0; right: 0; top: 50%; height: 1px; }
.living-hero .hero-vertical { top: 0; bottom: 0; left: 50%; width: 1px; }
.living-hero .hero-dimension {
  position: absolute; right: 18px; bottom: 12px; z-index: 14;
  color: var(--hero-acid); font: 10px 'DM Mono', monospace; letter-spacing: .04em;
}
.hero-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #11110f; }
.hero-controls button {
  min-height: 44px; padding: 10px 14px; border: 1px solid #11110f;
  border-radius: 0; background: #eeeae2; color: #11110f;
  font: inherit; font-size: 13px; cursor: pointer; touch-action: manipulation;
}
.hero-controls button:hover, .hero-controls button[aria-pressed="true"] { background: #11110f; color: #eeeae2; }
.hero-controls button:disabled { cursor: default; opacity: .65; }
.hero-controls [hidden], .hero-controls[hidden] { display: none !important; }
.hero-controls [role="status"] { font-size: 12px; line-height: 1.4; }
.living-hero .hero-art:focus-visible, .hero-controls button:focus-visible { outline: 3px solid #3f60ff; outline-offset: 4px; }
@media (max-width: 600px) {
  .living-hero { --hero-height: 270px; --hero-padding: 18px; --hero-window: 95px; --hero-blueprint-window: 85px; }
  .living-hero .hero-words { font-size: 12vw; font-size: min(80px, 15.8cqw); }
}
@media (forced-colors: active) {
  .living-hero .hero-layer { display: none; }
  .living-hero .hero-art[data-hero-ready] > .hero-words { visibility: visible; color: CanvasText; }
}

/* A little player: the underline is the actual ten-second scene countdown. */
.hero-controls { gap: 12px; padding: 18px 0 8px; }
.hero-controls button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; min-height: 52px; padding: 12px 18px;
  border-radius: 8px; font-weight: 650; font-size: 14px;
  transition: background-color 150ms, color 150ms, transform 150ms;
}
.hero-controls button:active:not(:disabled) { transform: scale(.96); }
.hero-controls svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-controls .hero-next { overflow: hidden; background: var(--hero-acid); border-color: var(--hero-ink); }
.hero-controls .hero-next:hover { background: var(--hero-ink); color: var(--hero-acid); }
.hero-count { font: 11px 'DM Mono', monospace; opacity: .8; margin-left: 6px; white-space: nowrap; }
.hero-countdown { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: currentColor; transform: scaleX(0); transform-origin: left; }
.hero-controls .hero-play-icon { display: none; }
#heroMotion[aria-pressed="true"] .hero-pause-icon { display: none; }
#heroMotion[aria-pressed="true"] .hero-play-icon { display: block; }
.hero-controls .hero-tilt { background: var(--hero-coral); gap: 12px; text-align: left; }
.hero-tilt small { display: block; font-size: 11px; font-weight: 400; margin-top: 2px; }
.hero-tilt:not([aria-pressed="true"]) svg { animation: invite-tilt 1.6s ease-in-out 3; transform-origin: 50% 70%; }
.hero-controls .hero-tilt[aria-pressed="true"] { background: var(--hero-ink); color: var(--hero-acid); }
.hero-controls [role="status"] { flex-basis: 100%; min-height: 1.4em; }
@keyframes invite-tilt { 0%, 70%, 100% { transform: rotate(0); } 18% { transform: rotate(-18deg); } 38% { transform: rotate(18deg); } 55% { transform: rotate(-9deg); } }
@media (max-width: 600px) {
  .hero-controls { gap: 8px; }
  .hero-controls button { padding: 11px 12px; font-size: 13px; gap: 7px; }
  .hero-controls .hero-tilt { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-controls button, .hero-controls svg { animation: none !important; transition: none; }
}
@media (max-width: 600px) {
  .hero-controls button { font-size: 12px; padding: 11px 10px; gap: 6px; }
  .hero-controls svg { width: 18px; height: 18px; }
  .hero-controls .hero-count { margin-left: 2px; font-size: 10px; }
}
