:root {
  color-scheme: dark;
  --bg: #07070a;
  --bg-2: #101015;
  --panel: #101014;
  --panel-soft: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6efe5;
  --muted: rgba(246, 239, 229, 0.64);
  --dim: rgba(246, 239, 229, 0.42);
  --gold: #d9ad72;
  --gold-strong: #f2c98b;
  --maya: #d7a96b;
  --maya-deep: #2a1c13;
  --leo: #d9dee8;
  --leo-deep: #161922;
  --danger: #e56f6f;
  --green: #8ce1b1;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% -12rem, rgba(217, 173, 114, 0.18), transparent 30rem),
    radial-gradient(circle at 100% 18%, rgba(115, 97, 131, 0.14), transparent 26rem),
    linear-gradient(180deg, #141217, #07070a 42rem);
  color: var(--text);
}

body[data-premium="true"]:not(.access-granted) main {
  visibility: hidden;
}

::selection {
  background: rgba(217, 173, 114, 0.32);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid rgba(242, 201, 139, 0.78);
  outline-offset: 3px;
}

.site-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.narrow-shell {
  width: min(720px, 100%);
}

.topbar,
.story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav-link,
.back-link {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  gap: 28px;
  min-height: calc(100svh - 92px);
  align-items: center;
  padding: 36px 0 24px;
}

.hero-copy h1,
.page-panel h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.65rem, 13vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.page-panel h1 {
  font-size: clamp(2.2rem, 10vw, 4.8rem);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.lede {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 4vw, 1.18rem);
  line-height: 1.7;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 20px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover,
.choice-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: rgba(242, 201, 139, 0.42);
  background: linear-gradient(135deg, #e3b978, #8c6638);
  box-shadow: 0 12px 30px rgba(217, 173, 114, 0.18);
  color: #17100c;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero-card,
.page-panel,
.phone-frame {
  border: 1px solid var(--line);
  background: rgba(7, 7, 10, 0.78);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
}

.hero-card {
  overflow: hidden;
  margin: 0;
}

.hero-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.hero-card figcaption {
  padding: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  gap: 12px;
  padding: 24px 0 42px;
}

.feature-grid article,
.clue-card,
.evidence-card,
.price-card {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 18px;
}

.feature-grid h2,
.clue-card h2,
.price-card strong {
  margin: 10px 0 0;
  font-size: 1.1rem;
}

.feature-grid p,
.clue-card p,
.price-card p,
.page-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.number,
.evidence-card span,
.price-card span {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.story-app {
  position: relative;
  min-height: 100svh;
  padding: 14px;
  overflow: hidden;
}

.story-app::before {
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 8%, rgba(217, 173, 114, 0.14), transparent 28rem),
    radial-gradient(circle at 12% 78%, rgba(96, 88, 114, 0.16), transparent 22rem);
  content: "";
}

.story-header {
  width: min(520px, 100%);
  margin: 0 auto 12px;
  text-align: center;
}

.story-header h1 {
  margin: 0;
  font-size: 1.15rem;
}

.story-header .eyebrow {
  margin-bottom: 4px;
  font-size: 0.62rem;
}

.phone-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(520px, 100%);
  min-height: calc(100svh - 92px);
  margin: 0 auto;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 18%),
    linear-gradient(145deg, rgba(13, 13, 18, 0.98), rgba(5, 5, 8, 0.98));
  box-shadow:
    0 30px 95px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 52px rgba(217, 173, 114, 0.08);
}

.phone-frame::before {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 84px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  content: "";
  transform: translateX(-50%);
}

.phone-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 18px 16px 14px;
  color: var(--dim);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.18);
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 18px 14px 24px;
  scrollbar-color: rgba(217, 173, 114, 0.22) transparent;
  scrollbar-width: thin;
}

.message {
  width: fit-content;
  max-width: min(84%, 360px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 11px 14px 12px;
  color: rgba(246, 239, 229, 0.94);
  font-size: 0.98rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  animation: rise 260ms ease both;
}

.message.them {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 6px;
}

.message.you {
  align-self: flex-end;
  border-color: rgba(217, 173, 114, 0.32);
  background: rgba(217, 173, 114, 0.18);
  border-bottom-right-radius: 6px;
}

.message.system {
  align-self: center;
  max-width: 92%;
  border-color: rgba(242, 201, 139, 0.24);
  background: rgba(242, 201, 139, 0.08);
  color: var(--gold-strong);
  text-align: center;
}

.message p {
  margin: 0;
  line-height: 1.45;
}

.message.maya {
  border-color: rgba(217, 173, 114, 0.38);
  background:
    linear-gradient(135deg, rgba(217, 173, 114, 0.26), rgba(42, 28, 19, 0.9)),
    var(--maya-deep);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(217, 173, 114, 0.07);
}

.message.leo {
  border-color: rgba(217, 222, 232, 0.14);
  background:
    linear-gradient(135deg, rgba(217, 222, 232, 0.12), rgba(22, 25, 34, 0.92)),
    var(--leo-deep);
  color: rgba(241, 244, 249, 0.92);
}

.speaker {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.message.leo .speaker {
  color: rgba(217, 222, 232, 0.66);
}

.message.maya .speaker {
  color: rgba(242, 201, 139, 0.82);
}

.meta {
  display: block;
  margin-top: 6px;
  color: var(--dim);
  font-size: 0.68rem;
}

.typing-indicator {
  min-width: 82px;
  padding-right: 18px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
}

.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
  animation: typing-dot 880ms ease-in-out infinite;
}

.typing-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.typing-dots i:nth-child(3) {
  animation-delay: 240ms;
}

.choice-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
}

.choice-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(217, 173, 114, 0.36);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.choice-button.primary-choice {
  border-color: rgba(242, 201, 139, 0.48);
  background:
    linear-gradient(135deg, rgba(242, 201, 139, 0.95), rgba(151, 111, 61, 0.95)),
    rgba(217, 173, 114, 0.2);
  box-shadow: 0 12px 28px rgba(217, 173, 114, 0.16);
  color: #160f0a;
}

.choice-button:active,
.button:active {
  transform: translateY(0) scale(0.99);
}

.episode-title-card,
.final-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(217, 173, 114, 0.24);
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 173, 114, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.045);
  padding: clamp(22px, 7vw, 32px);
}

.episode-title-card h2,
.final-card h2 {
  margin: 0;
  font-size: clamp(2.3rem, 12vw, 4.4rem);
  line-height: 0.95;
}

.episode-title-card p,
.final-card p {
  color: var(--muted);
  line-height: 1.65;
}

.final-card {
  min-height: auto;
  margin-top: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.teaser-card {
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  padding: 14px;
}

.teaser-card span {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.teaser-card p {
  margin: 8px 0 0;
}

.page-panel {
  margin-top: 28px;
  padding: clamp(22px, 6vw, 42px);
}

.clue-grid {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.clue-card.locked {
  opacity: 0.54;
}

.clue-card.unlocked {
  border-color: rgba(140, 225, 177, 0.32);
}

.access-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.access-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.access-form input {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 14px;
}

.form-message {
  min-height: 24px;
  margin: 0;
}

.prose {
  margin-top: 22px;
}

.ending-panel {
  border-color: rgba(217, 173, 114, 0.26);
}

.evidence-card {
  margin: 24px 0;
}

.evidence-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.thank-you-panel {
  border-color: rgba(217, 173, 114, 0.22);
}

.access-code-card {
  margin-top: 26px;
  border: 1px solid rgba(242, 201, 139, 0.26);
  background:
    radial-gradient(circle at 16% 0%, rgba(217, 173, 114, 0.16), transparent 58%),
    rgba(255, 255, 255, 0.055);
  padding: 18px;
}

.access-code-card span,
.case-note {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.access-code-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(2rem, 13vw, 4rem);
  line-height: 1;
  letter-spacing: 0.08em;
}

.access-code-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.case-note {
  margin: 22px 0 0;
  border-left: 2px solid rgba(217, 173, 114, 0.44);
  padding-left: 12px;
  line-height: 1.5;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes typing-dot {
  0%,
  80%,
  100% {
    opacity: 0.34;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (min-width: 760px) {
  .site-shell {
    padding: 24px;
  }

  .hero {
    grid-template-columns: 1.08fr 0.92fr;
  }

  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .story-app {
    display: grid;
    align-content: center;
    min-height: 100vh;
    padding: 24px;
  }

  .story-header {
    width: min(430px, 100%);
  }

  .phone-frame {
    width: min(430px, 100%);
    min-height: min(820px, calc(100vh - 118px));
    border-radius: 38px;
  }

  .message-list {
    padding: 22px 18px 26px;
  }

  .choice-panel {
    padding: 16px;
  }
}

@media (max-width: 380px) {
  .story-app {
    padding: 8px;
  }

  .story-header h1 {
    max-width: 170px;
    font-size: 0.98rem;
    line-height: 1.15;
  }

  .message {
    max-width: 88%;
    font-size: 0.94rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
