:root {
  --bg: #010101;
  --ink: #f2ebe3;
  --mute: #b2a59b;
  --red: #ff1a1a;
  --red-soft: rgba(255, 24, 24, 0.35);
  --font: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --switch-height: 50px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--ink);
  background: #250000;
  border: 1px solid var(--red);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.void {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(90, 0, 0, 0.28), transparent 34%),
    radial-gradient(circle at 50% 50%, #120404 0%, #010101 58%, #000 100%);
  pointer-events: none;
  z-index: 0;
}

.mode-bar {
  position: fixed;
  z-index: 10;
  top: calc(0.75rem + env(safe-area-inset-top));
  left: 50%;
  width: min(420px, calc(100% - 2rem));
  transform: translateX(-50%);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: var(--switch-height);
  padding: 3px;
  background: rgba(4, 0, 0, 0.88);
  border: 1px solid rgba(255, 40, 40, 0.28);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mode-tab {
  appearance: none;
  min-width: 0;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  border: 0;
  color: #958982;
  background: transparent;
  font: 600 0.68rem/1 var(--font);
  letter-spacing: 0.13em;
  cursor: pointer;
  touch-action: manipulation;
}

.mode-tab[aria-selected="true"] {
  color: var(--ink);
  background: rgba(70, 0, 0, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 45, 45, 0.45);
}

.mode-light {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: #4c4541;
}

.mode-tab[aria-selected="true"] .mode-light {
  background: var(--red);
  box-shadow: 0 0 9px var(--red);
}

.mode-tab:focus-visible {
  outline: 2px solid #ff6565;
  outline-offset: 2px;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding:
    calc(var(--switch-height) + 2.5rem + env(safe-area-inset-top))
    calc(1.25rem + env(safe-area-inset-right))
    calc(2rem + env(safe-area-inset-bottom))
    calc(1.25rem + env(safe-area-inset-left));
  text-align: center;
}

.interface-view {
  width: min(680px, 100%);
  animation: view-in 240ms ease-out both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.machine {
  display: grid;
  place-items: center;
  gap: 1.1rem;
}

.suite-link {
  color: #cfc1b8;
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-underline-offset: 0.25em;
  text-decoration-color: rgba(255, 35, 35, 0.6);
}

.suite-link:hover,
.suite-link:focus-visible {
  color: #fff;
  text-decoration-color: var(--red);
}

.eye-rig {
  width: min(38vw, 380px);
  height: min(38vw, 380px);
  display: grid;
  place-items: center;
  perspective: 900px;
  margin-bottom: 0.4rem;
}

.eye-shell {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform-style: preserve-3d;
  transition: transform 80ms linear;
  filter: drop-shadow(0 0 28px rgba(255, 20, 20, 0.28)) drop-shadow(0 0 80px rgba(120, 0, 0, 0.35));
  will-change: transform;
}

.eye-picture,
.eye {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.eye {
  user-select: none;
  pointer-events: none;
}

.glare {
  position: absolute;
  inset: 18% 22% auto auto;
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.55), rgba(255,255,255,0) 70%);
  mix-blend-mode: screen;
  transform: translate3d(0,0,0);
  pointer-events: none;
  opacity: 0.55;
}

.pulse {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(255, 0, 0, 0.25), 0 0 0 0 rgba(255, 30, 30, 0.35);
  animation: throb 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes throb {
  0%, 100% { box-shadow: inset 0 0 40px rgba(255,0,0,0.18), 0 0 0 0 rgba(255,30,30,0.0); }
  50% { box-shadow: inset 0 0 55px rgba(255,0,0,0.34), 0 0 36px 8px rgba(255,30,30,0.12); }
}

.title {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.28em;
  font-size: clamp(1rem, 2.8vw, 1.45rem);
  text-indent: 0.28em;
}
.title span { color: var(--red); }

.tagline {
  margin: 0;
  max-width: 34rem;
  color: var(--mute);
  font-size: clamp(0.85rem, 2vw, 1rem);
  line-height: 1.55;
  min-height: 3.2em;
}

.enter {
  appearance: none;
  border: 1px solid rgba(255, 40, 40, 0.45);
  background: rgba(40, 0, 0, 0.55);
  color: var(--ink);
  min-height: 48px;
  padding: 0.8rem 1.35rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

@media (hover: hover) {
  .enter:hover {
    border-color: rgba(255, 70, 70, 0.9);
    background: rgba(80, 0, 0, 0.72);
    box-shadow: 0 0 24px rgba(255, 20, 20, 0.22);
  }
}

.enter:focus-visible {
  outline: none;
  border-color: rgba(255, 70, 70, 0.9);
  background: rgba(80, 0, 0, 0.72);
  box-shadow: 0 0 24px rgba(255, 20, 20, 0.22);
}

.enter:active {
  background: rgba(96, 0, 0, 0.85);
  border-color: rgba(255, 90, 90, 0.95);
}

.enter[disabled] {
  opacity: 0.55;
  cursor: default;
}

.hint {
  margin: 0;
  color: #887b73;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.holly-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr);
  gap: 1.4rem;
  align-items: center;
  text-align: left;
}

.holly-screen {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #000;
  border: 1px solid rgba(255, 35, 35, 0.36);
  box-shadow:
    0 0 0 8px rgba(20, 2, 2, 0.9),
    0 0 0 9px rgba(255, 30, 30, 0.14),
    0 0 46px rgba(255, 0, 0, 0.18);
}

.holly-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 48px 16px #000;
  pointer-events: none;
}

.holly-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.08);
}

.holly-video[hidden] { display: none; }

.holly-screen.talking {
  border-color: rgba(255, 55, 55, 0.92);
  box-shadow:
    0 0 0 8px rgba(20, 2, 2, 0.9),
    0 0 0 9px rgba(255, 30, 30, 0.4),
    0 0 64px rgba(255, 0, 0, 0.36);
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.2;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(255,255,255,0.12) 4px
  );
}

.holly-badge {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  padding: 0.32rem 0.55rem;
  background: rgba(0, 0, 0, 0.75);
  color: #d8cbc3;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.holly-badge span {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: #ff2424;
  box-shadow: 0 0 8px #ff2424;
}

.holly-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--red);
  font-size: 0.65rem;
  line-height: 1.5;
  letter-spacing: 0.16em;
}

.holly-copy h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.holly-status {
  min-height: 4.8em;
  margin: 0.9rem 0;
  color: var(--mute);
  font-size: 0.84rem;
  line-height: 1.6;
}

.holly-caption {
  margin: 0 0 1rem;
  min-height: 4.4em;
  color: #cbbfb5;
  font-size: 0.78rem;
  line-height: 1.65;
  border-left: 2px solid rgba(255, 40, 40, 0.4);
  padding-left: 0.75rem;
}

/* Before Holly speaks there is nothing to caption. */
.holly-caption:empty {
  display: none;
}

.wasted-line {
  margin: 0.85rem 0 0;
  color: var(--mute);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.wasted-line span {
  color: var(--red);
}

.meter {
  width: 100%;
  height: 3px;
  overflow: hidden;
  margin: 0 0 1rem;
  background: rgba(255,255,255,0.08);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  transition: width 70ms linear;
}

.holly-start {
  width: 100%;
}

.privacy {
  margin: 0.7rem 0 0;
  color: #887b73;
  font-size: 0.66rem;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .eye-rig {
    width: min(62vw, 340px);
    height: min(62vw, 340px);
  }

  .holly-panel {
    width: min(560px, 100%);
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  :root { --switch-height: 50px; }

  .mode-bar {
    top: calc(0.5rem + env(safe-area-inset-top));
    width: calc(100% - 1rem);
  }

  .mode-tab {
    min-height: 44px;
    padding-inline: 0.4rem;
    font-size: 0.62rem;
    letter-spacing: 0.09em;
  }

  .stage {
    padding:
      calc(var(--switch-height) + 1.25rem + env(safe-area-inset-top))
      calc(1rem + env(safe-area-inset-right))
      calc(1.25rem + env(safe-area-inset-bottom))
      calc(1rem + env(safe-area-inset-left));
  }

  .machine { gap: clamp(0.65rem, 2.5vh, 1rem); }

  .eye-rig {
    width: min(56vw, 230px, 30vh);
    height: min(56vw, 230px, 30vh);
    margin-bottom: 0;
  }

  .tagline {
    min-height: 2.5em;
    font-size: 0.82rem;
  }

  .hint { font-size: 0.68rem; }

  .holly-panel {
    grid-template-columns: 1fr;
    gap: clamp(0.75rem, 2vh, 1rem);
    width: min(360px, 100%);
    margin-inline: auto;
    text-align: center;
  }

  .holly-screen {
    width: min(62vw, 240px, 31vh);
    margin-inline: auto;
  }

  .holly-copy {
    display: flex;
    flex-direction: column;
  }

  .eyebrow { order: 1; margin-bottom: 0.4rem; }
  .holly-copy h2 { order: 2; }
  .holly-status { order: 3; min-height: 2.7em; margin: 0.6rem 0; }
  .meter { order: 4; margin-bottom: 0.8rem; }
  .holly-start { order: 5; }
  .holly-caption {
    order: 6;
    margin: 1rem 0 0;
    text-align: left;
  }
  .wasted-line { order: 7; }
  .privacy { order: 8; }
}

@media (max-height: 520px) and (orientation: landscape) {
  :root { --switch-height: 50px; }

  .mode-bar {
    top: calc(0.35rem + env(safe-area-inset-top));
  }

  .mode-tab { min-height: 44px; }

  .stage {
    padding:
      calc(var(--switch-height) + 0.8rem + env(safe-area-inset-top))
      calc(1rem + env(safe-area-inset-right))
      calc(0.75rem + env(safe-area-inset-bottom))
      calc(1rem + env(safe-area-inset-left));
  }

  .machine {
    gap: 0.45rem;
  }

  .eye-rig {
    width: min(34vh, 150px);
    height: min(34vh, 150px);
  }

  .tagline,
  .hint { min-height: 0; }

  .holly-panel {
    grid-template-columns: minmax(130px, 0.8fr) minmax(210px, 1fr);
    gap: 1.5rem;
    max-width: 620px;
    text-align: left;
  }

  .holly-screen {
    width: min(58vh, 230px);
  }

  .holly-status {
    min-height: 0;
    margin-block: 0.45rem;
  }

  .holly-caption {
    max-height: 4.8em;
    overflow: auto;
    margin-bottom: 0.5rem;
  }

  .meter { margin-bottom: 0.5rem; }
  .wasted-line { margin-top: 0.45rem; }
  .privacy { margin-top: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .eye-shell { transition: none; }
  .meter span { transition: none; }
  .interface-view { animation: none; }
  html { scroll-behavior: auto; }
}
