/* Ex-Tax landing page (index.html only; the legal pages keep style.css alone).
   Same palette and faces as the app (Theme.swift): black and ink, cream type, red for the
   tempting moments, the serif display face and the red handwritten script line.
   Motion: one entrance for the hero, a soft rise as each piece scrolls in (site.js adds .is-in),
   a text thread that plays itself, a price staircase, a rank marquee. All of it is off under
   prefers-reduced-motion, and nothing is hidden without JavaScript (only html.js hides). */

/* iPhone Safari lets the whole page pan sideways if anything pokes out, unless the root clips. */
html {
  overflow-x: hidden;
}

@supports (overflow-x: clip) {
  html { overflow-x: clip; }
}

.hero-visual { overflow: clip; }

.home {
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1180px;
  background: var(--black);
  overflow-x: clip;
}

/* A little film grain over everything, like the art's print texture. */
.home::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.home-wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 720px) {
  .home { --gutter: 32px; }
}

.home em {
  font-style: italic;
  color: var(--red-text);
}

.red { color: var(--red-text); }
.center { text-align: center; }
.soft { color: var(--muted); }
.small { font-size: 0.9375rem; }

.kicker {
  margin: 0 0 18px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red-text-small);
}

.big {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lede-lg {
  margin: 0 0 24px;
  max-width: 34em;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: var(--cream);
  opacity: 0.86;
}

/* ---- Scroll progress (where scroll-driven animations exist) ---------------------------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 70;
  background: var(--red-text);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@supports (animation-timeline: scroll()) {
  .progress {
    animation: progress-grow linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes progress-grow {
  to { transform: scaleX(1); }
}

/* ---- Header ------------------------------------------------------------------------------ */

.home-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.home-header.is-scrolled {
  background: rgba(13, 11, 11, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line-soft);
}

.home-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.home-header .wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.home-nav {
  display: flex;
  gap: 4px;
}

.home-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--cream);
  text-decoration: none;
  font-size: 0.9375rem;
  opacity: 0.8;
  transition: opacity 0.2s, background-color 0.2s;
}

.home-nav a:hover {
  opacity: 1;
  background: rgba(243, 234, 219, 0.08);
}

@media (max-width: 719px) {
  .home-nav a:not(:last-child) { display: none; }
}

/* ---- Buttons ---------------------------------------------------------------------------- */

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background-color 0.2s;
}

.pill-btn-red {
  background: var(--red);
  color: var(--cream);
  box-shadow: 0 10px 40px -12px rgba(226, 69, 60, 0.7);
}

.pill-btn-red:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 50px -12px rgba(226, 69, 60, 0.85);
}

.pill-btn-quiet {
  border: 1px solid var(--line);
  color: var(--cream);
  opacity: 0.85;
}

.pill-btn[hidden],
.text-link[hidden] {
  display: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--cream);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--red-text);
  text-underline-offset: 0.3em;
}

/* ---- Hero --------------------------------------------------------------------------------- */

.home-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 104px 0 72px;
  background:
    radial-gradient(60% 50% at 78% 45%, rgba(181, 20, 26, 0.22), transparent 70%),
    radial-gradient(50% 40% at 10% 100%, rgba(243, 234, 219, 0.05), transparent 70%),
    var(--black);
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 32px; }
}

.hero-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 8.4vw, 7.25rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

/* Each word rises out of its own line box. */
.hero-title .w {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
  vertical-align: top;
}

.hero-title .w > span {
  display: inline-block;
  transform: translateY(105%);
  animation: word-up 1.1s var(--ease-out) forwards;
}

.hero-title .w:nth-child(2) > span { animation-delay: 0.08s; }
.hero-title .w:nth-child(3) > span { animation-delay: 0.16s; }
.hero-title .w:nth-child(4) > span { animation-delay: 0.24s; color: var(--red-text); font-style: italic; }
.hero-title .w:nth-child(5) > span { animation-delay: 0.32s; }

@keyframes word-up {
  to { transform: translateY(0); }
}

/* The red handwritten line writes itself in, left to right. */
.hero-script {
  margin: 18px 0 26px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(1.125rem, 2.4vw, 1.75rem);
  color: var(--red-text);
  text-transform: uppercase;
  transform: rotate(-2deg);
  transform-origin: 0 50%;
  clip-path: inset(0 100% 0 0);
  animation: write-in 1.4s 0.9s steps(28, end) forwards;
}

@media (max-width: 559px) {
  .hero-script span { display: block; }
}

@keyframes write-in {
  to { clip-path: inset(0 0 0 0); }
}

.hero-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.9s var(--ease-out) forwards;
}

.hero-in-1 { animation-delay: 0s; }
.hero-in-3 { animation-delay: 0.55s; }
.hero-in-4 { animation-delay: 0.7s; }
.hero-in-5 { animation-delay: 0.85s; }

@keyframes fade-up {
  to { opacity: 1; transform: none; }
}

.hero-lede {
  margin: 0 0 28px;
  max-width: 30em;
  font-size: clamp(1.0625rem, 1.7vw, 1.25rem);
  line-height: 1.55;
  opacity: 0.86;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.center-row { justify-content: center; }

.hero-fine {
  margin: 22px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  perspective: 1200px;
  opacity: 0;
  animation: fade-up 1.2s 0.3s var(--ease-out) forwards;
}

.nowrap { white-space: nowrap; }

/* Old-Hollywood sunburst behind the serpent, turning very slowly. */
.rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(226, 69, 60, 0.16) 0deg 6deg, transparent 6deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 18%, transparent 72%);
  mask-image: radial-gradient(closest-side, #000 18%, transparent 72%);
  animation: spin 90s linear infinite;
  pointer-events: none;
}

@keyframes spin {
  to { rotate: 360deg; }
}

.glow {
  position: absolute;
  inset: 12% 8% 10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(226, 69, 60, 0.55), transparent);
  filter: blur(40px);
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

.hero-phone {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  width: min(78vw, 340px);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.6s var(--ease-out);
  animation: float 7s ease-in-out infinite;
}

.hero-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 13%/6%;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(243, 234, 219, 0.06);
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

/* Four-point sparkles, like the stars around the serpent. */
.spark {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--cream);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: twinkle 3.2s ease-in-out infinite;
}

.spark-1 { top: 6%; left: 8%; }
.spark-2 { top: 22%; right: 4%; width: 12px; height: 12px; animation-delay: 0.8s; }
.spark-3 { bottom: 18%; left: 2%; width: 10px; height: 10px; animation-delay: 1.6s; }
.spark-4 { bottom: 6%; right: 12%; width: 22px; height: 22px; animation-delay: 2.2s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.6) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--cream);
  animation: cue 1.8s var(--ease) infinite;
}

@keyframes cue {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

@media (max-width: 899px) {
  .scroll-cue { display: none; }
}

/* ---- Scroll reveal ---------------------------------------------------------------------- */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out);
}

html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Siblings that arrive together come in one after another. */
html.js .step-list > [data-reveal]:nth-child(2),
html.js .urge-grid > [data-reveal]:nth-child(2),
html.js .pro-grid > [data-reveal]:nth-child(2),
html.js .pass-grid > [data-reveal]:nth-child(2),
html.js .friends-cards > [data-reveal]:nth-child(2),
html.js .side-cards > [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
html.js .step-list > [data-reveal]:nth-child(3),
html.js .urge-grid > [data-reveal]:nth-child(3),
html.js .pass-grid > [data-reveal]:nth-child(3),
html.js .friends-cards > [data-reveal]:nth-child(3) { transition-delay: 0.2s; }
html.js .step-list > [data-reveal]:nth-child(4),
html.js .urge-grid > [data-reveal]:nth-child(4) { transition-delay: 0.3s; }

/* ---- Chapters ----------------------------------------------------------------------------- */

.chapter {
  position: relative;
  padding: clamp(80px, 12vw, 160px) 0;
}

.chapter-ink { background: var(--ink); }

.chapter-red {
  background:
    radial-gradient(80% 60% at 85% 0%, rgba(243, 234, 219, 0.1), transparent 60%),
    var(--red);
  --muted: rgba(243, 234, 219, 0.82);
}

.chapter-red em { color: var(--cream); }
.chapter-red .kicker { color: var(--cream); opacity: 0.85; }

.chapter-paper {
  background: var(--paper);
  color: var(--black);
  --muted: var(--muted-on-paper);
}

.chapter-paper em { color: var(--red-on-paper); }
.chapter-paper .kicker { color: var(--red-on-paper); }
.chapter-paper .dash li::before { background: var(--red-on-paper); }

.chapter-head {
  max-width: 820px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.dash {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.dash li {
  position: relative;
  padding: 0 0 12px 26px;
  line-height: 1.55;
}

.dash li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--red-text-small);
}

.chapter-red .dash li::before { background: var(--cream); }

/* ---- The line ------------------------------------------------------------------------------ */

.line-grid {
  display: grid;
  gap: 56px;
  align-items: center;
}

@media (min-width: 900px) {
  .line-grid { grid-template-columns: 1.1fr 0.9fr; gap: 72px; }
}

.thread-wrap {
  display: flex;
  justify-content: center;
}

.home .thread {
  width: min(100%, 360px);
  padding: 14px;
  border-radius: 44px;
  background: linear-gradient(160deg, #26201e, #120f0f);
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(243, 234, 219, 0.1);
}

.home .thread .phone-screen {
  min-height: 520px;
  padding: 22px 16px 26px;
  border-radius: 32px;
  background: #050404;
}

.home .phone-contact {
  flex-direction: column;
  gap: 6px;
  align-items: center;
  font-size: 0.8125rem;
}

.home .phone-avatar {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

.home .bubble { max-width: 82%; }

.typing {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #26252a;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9a9aa0;
  animation: dots 1.1s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dots {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* The thread plays once it scrolls in: your text, the dots, the line's reply, the friend's push. */
html.js .thread-wrap .bubble-out,
html.js .thread-wrap .bubble-in,
html.js .thread-wrap .push,
html.js .thread-wrap .typing {
  opacity: 0;
}

html.js .thread-wrap.is-in .bubble-out { animation: pop 0.5s 0.3s var(--ease-out) forwards; }
html.js .thread-wrap.is-in .typing { animation: show-hide 1.3s 0.9s linear forwards; }
html.js .thread-wrap.is-in .bubble-in { animation: pop 0.6s 2.1s var(--ease-out) forwards; }
html.js .thread-wrap.is-in .push { animation: drop 0.8s 3s var(--ease-out) forwards; }

@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes show-hide {
  0% { opacity: 0; }
  10%, 85% { opacity: 1; }
  100% { opacity: 0; height: 0; padding: 0; margin: 0; }
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---- Statement ---------------------------------------------------------------------------- */

.statement {
  padding: clamp(60px, 10vw, 120px) var(--gutter);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}

.statement-line {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 10vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.statement-line .red { font-style: italic; }

/* ---- Steps -------------------------------------------------------------------------------- */

.step-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .step-list { grid-template-columns: 1fr 1fr; gap: 22px; }
}

.step-list > li {
  position: relative;
  padding: 34px 28px 30px;
  border-radius: 28px;
  background: var(--ink);
  border: 1px solid var(--line-soft);
  transition: transform 0.5s var(--ease-out), border-color 0.4s, opacity 0.9s var(--ease-out);
}

.step-list > li:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 69, 60, 0.45);
}

.step-num {
  display: block;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: 3.5rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--red-text);
}

.step-list h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.15;
}

.step-list p { margin: 0 0 10px; opacity: 0.9; }
.step-list p.soft { opacity: 1; font-size: 0.9375rem; }

/* ---- The Ex Pass -------------------------------------------------------------------------- */

.pass-top {
  display: grid;
  gap: 48px;
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}

@media (min-width: 900px) {
  .pass-top { grid-template-columns: 1.2fr 0.8fr; }
}

.stairs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: clamp(190px, 42vw, 260px);
}

.stair {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 16px 14px;
  border-radius: 18px 18px 6px 6px;
  background: rgba(13, 11, 11, 0.32);
  border: 1px solid rgba(243, 234, 219, 0.25);
  transform-origin: 50% 100%;
}

.stair b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1;
}

.stair span {
  margin-top: 6px;
  font-size: clamp(0.6875rem, 2.6vw, 0.8125rem);
  line-height: 1.3;
  opacity: 0.85;
}

.stair-1 { height: 34%; }
.stair-2 { height: 66%; }
.stair-3 { height: 100%; background: rgba(13, 11, 11, 0.5); }

html.js .stairs .stair { transform: scaleY(0.05); transition: transform 1.1s var(--ease-out); }
html.js .stairs.is-in .stair { transform: none; }
html.js .stairs.is-in .stair-2 { transition-delay: 0.15s; }
html.js .stairs.is-in .stair-3 { transition-delay: 0.3s; }

.pass-grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 900px) {
  .pass-grid { grid-template-columns: 0.85fr 1.15fr; }
  .glass-wide { grid-column: 1 / -1; }
}

.glass {
  padding: 30px 28px;
  border-radius: 28px;
  background: rgba(13, 11, 11, 0.28);
  border: 1px solid rgba(243, 234, 219, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.glass h3,
.tile h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.625rem;
}

.home .ladder {
  margin-bottom: 12px;
}

.home .ladder caption {
  color: var(--cream);
}

.home .ladder th,
.home .ladder td {
  border-color: rgba(243, 234, 219, 0.25);
}

.home .ladder td {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

/* ---- Friends ------------------------------------------------------------------------------ */

.friends-grid {
  display: grid;
  gap: 48px;
}

@media (min-width: 900px) {
  .friends-grid { grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: start; }
}

.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.roles li {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.9375rem;
  transition: background-color 0.3s, border-color 0.3s, transform 0.4s var(--ease-out);
}

.roles li:first-child {
  background: var(--red);
  border-color: var(--red);
}

.roles li:hover {
  transform: translateY(-2px) rotate(-2deg);
  border-color: var(--red-text);
}

.friends-cards {
  display: grid;
  gap: 18px;
}

.tile {
  padding: 30px 28px;
  border-radius: 28px;
  background: var(--ink);
  border: 1px solid var(--line-soft);
}

.chapter-ink .tile { background: var(--black); }

.tile p:last-child,
.tile ul:last-child { margin-bottom: 0; }

.tile-red {
  background: var(--red);
  border-color: var(--red);
}

.tile-red .dash li::before { background: var(--cream); }

.tile-quiet { background: transparent; }

.tile-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
}

/* ---- Urge --------------------------------------------------------------------------------- */

.urge-grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 640px) {
  .urge-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1040px) {
  .urge-grid { grid-template-columns: repeat(4, 1fr); }
}

.urge-grid .tile {
  transition: transform 0.5s var(--ease-out), border-color 0.4s, opacity 0.9s var(--ease-out);
}

.urge-grid .tile:hover {
  transform: translateY(-6px);
  border-color: rgba(226, 69, 60, 0.45);
}

.tile-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: rgba(226, 69, 60, 0.14);
  color: var(--red-text-small);
  font-size: 1.25rem;
}

.tile-mark.breathe::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red-text-small);
  animation: inhale 4s ease-in-out infinite;
}

@keyframes inhale {
  0%, 100% { transform: scale(0.6); opacity: 0.6; }
  50% { transform: scale(1.6); opacity: 1; }
}

/* ---- Streak: rank marquee and scene gallery ---------------------------------------------- */

.marquee {
  display: flex;
  overflow: hidden;
  margin-bottom: clamp(40px, 6vw, 64px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  flex-shrink: 0;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: slide 38s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-track li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 22px 34px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  white-space: nowrap;
}

.marquee-track li::after {
  content: "";
  align-self: center;
  width: 10px;
  height: 10px;
  margin-left: 34px;
  background: var(--red-text);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}

.marquee-track span {
  font-family: var(--font);
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-text-small);
}

@keyframes slide {
  to { transform: translateX(-100%); }
}

.gallery {
  display: flex;
  gap: 18px;
  margin: 0 0 28px;
  padding: 8px 4px 24px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar { display: none; }

.gallery li {
  flex: 0 0 min(72vw, 300px);
  scroll-snap-align: center;
}

.gallery figure {
  margin: 0;
  transition: transform 0.6s var(--ease-out);
}

.gallery li:nth-child(odd) figure { transform: rotate(-1.5deg); }
.gallery li:nth-child(even) figure { transform: rotate(1.5deg) translateY(10px); }
.gallery li figure:hover { transform: rotate(0) translateY(-6px) scale(1.02); }

.gallery img {
  display: block;
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.9);
}

.gallery figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.gallery figcaption span {
  font-family: var(--font);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Pro ---------------------------------------------------------------------------------- */

.pro-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}

@media (min-width: 760px) {
  .pro-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Honest limits ------------------------------------------------------------------------ */

.limits-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 900px) {
  .limits-grid { grid-template-columns: 0.8fr 1.2fr; gap: 64px; align-items: start; }
}

.limits-art {
  display: block;
  width: 150px;
  margin-top: 12px;
  border-radius: 20px;
  mix-blend-mode: multiply;
}

.chapter-paper a { color: var(--red-on-paper); }

/* ---- Finale ------------------------------------------------------------------------------- */

.finale {
  padding: clamp(80px, 12vw, 150px) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(60% 50% at 50% 20%, rgba(181, 20, 26, 0.25), transparent 70%),
    var(--black);
}

.finale-inner {
  text-align: center;
  margin-bottom: clamp(56px, 8vw, 96px);
}

.finale-art {
  width: min(80vw, 390px);
  margin: 0 auto 8px;
}

.finale-title {
  margin: 0 0 32px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.side-cards {
  display: grid;
  gap: 18px;
}

@media (min-width: 760px) {
  .side-cards { grid-template-columns: 1fr 1fr; }
}

.tile-help {
  border-color: rgba(226, 69, 60, 0.45);
}

/* ---- Footer ------------------------------------------------------------------------------- */

.home-footer {
  padding: 24px 0 calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-mark {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 20vw, 16rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243, 234, 219, 0.22);
  user-select: none;
}

.home-footer .footer-nav {
  margin: 0 0 12px;
}

.home-footer p {
  max-width: 60em;
  margin: 0 0 8px;
}

/* ---- Reduced motion: everything in place, nothing moving --------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .home *,
  .home *::before,
  .home *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-title .w > span,
  .hero-in,
  .hero-visual {
    transform: none;
    opacity: 1;
  }

  .hero-script { clip-path: none; }

  html.js [data-reveal],
  html.js .thread-wrap .bubble-out,
  html.js .thread-wrap .bubble-in,
  html.js .thread-wrap .push {
    opacity: 1;
    transform: none;
  }

  html.js .thread-wrap .typing { display: none; }
  html.js .stairs .stair { transform: none; }

  .marquee { mask-image: none; -webkit-mask-image: none; }
  .marquee-track { flex-wrap: wrap; }
  .marquee-track[aria-hidden="true"] { display: none; }
  .progress { display: none; }
}
