:root {
  --bg: #0a0806;
  --ink: #f3ead9;
  --muted: #a89a83;
  --brass: #d8ab4a;
  --brass-deep: #8a6420;
  --card: rgba(20, 14, 9, 0.72);
  --line: rgba(216, 171, 74, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
}

.scene-wrap {
  position: absolute;
  inset: 0;
}

.scene-wrap[hidden] { display: none; }

#gl {
  width: 100%;
  height: 100%;
  display: block;
}

.fallback-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(to top, rgba(5,3,2,0.88) 0%, rgba(5,3,2,0.45) 42%, rgba(5,3,2,0) 68%);
  pointer-events: none;
}

.overlay > * { pointer-events: auto; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
}

h1 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 18px rgba(0,0,0,0.8);
}

.triage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin-bottom: 14px;
}

.triage button {
  appearance: none;
  min-height: 64px;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.triage button:active { transform: scale(0.96); }

.triage button:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

body.engaged .triage button {
  border-color: var(--brass);
  background: rgba(58, 40, 14, 0.8);
}

.status {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--brass);
  max-width: 420px;
  line-height: 1.45;
}

.status[hidden] { display: none; }

.call {
  display: block;
  width: 100%;
  max-width: 420px;
  padding: 14px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: #1d1305;
  background: linear-gradient(180deg, #f0d488, var(--brass));
  border-radius: 16px;
  box-shadow: 0 6px 28px rgba(216, 171, 74, 0.35);
  line-height: 1.5;
}

.call span {
  font-size: 20px;
  letter-spacing: 1px;
}

.brand {
  margin: 0;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.below {
  padding: 72px 24px;
  max-width: 560px;
  margin: 0 auto;
}

.below h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 16px;
  color: var(--brass);
}

.below p {
  font-size: 16px;
  line-height: 1.65;
  color: #cfc2ab;
  margin: 0 0 16px;
}

.stats {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  font: 11px/1.5 monospace;
  color: #8f8;
  background: rgba(0,0,0,0.65);
  padding: 6px 8px;
  border-radius: 6px;
  pointer-events: none;
  white-space: pre;
}

.stats[hidden] { display: none; }

/* Fallback still, repair choreography */
#fallback .coupling {
  transition: transform 3s cubic-bezier(0.55, 0, 0.25, 1);
}
#fallback.repaired .coupling {
  transform: translateY(185px);
}
#fallback .spray {
  transition: opacity 1.2s ease;
}
#fallback.repaired .spray {
  opacity: 0;
}
#fallback .drop {
  animation: hover 4s ease-in-out infinite;
}
#fallback .drop:nth-of-type(2) { animation-delay: -1s; }
#fallback .drop:nth-of-type(3) { animation-delay: -2s; }
#fallback .drop:nth-of-type(4) { animation-delay: -0.5s; }
#fallback .drop:nth-of-type(5) { animation-delay: -2.7s; }
#fallback .drop:nth-of-type(6) { animation-delay: -1.6s; }
#fallback .drop:nth-of-type(7) { animation-delay: -3.1s; }
#fallback .drop:nth-of-type(8) { animation-delay: -0.9s; }
#fallback.repaired .drop {
  animation: dropfall 2.4s ease-in forwards;
}
@keyframes hover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes dropfall {
  to { transform: translateY(320px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #fallback .drop { animation: none; }
  #fallback .coupling { transition-duration: 0.01s; }
}

@media (min-width: 700px) {
  h1 { font-size: 44px; }
  .triage { grid-template-columns: repeat(4, 1fr); max-width: 720px; }
  .triage button { min-height: 72px; }
}
