:root {
  --paper: #f4ece1;
  --paper-2: #ebdfcf;
  --ink: #2a1619;
  --ink-soft: #6b5052;
  --red: #d4352b;
  --red-deep: #a3241d;
  --blush: #f2b8b0;
  --card: #fffaf3;
  --line: rgba(42, 22, 25, 0.16);
  --display: "Fraunces", Georgia, serif;
  --hand: "Caveat", "Segoe Print", cursive;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-variation-settings: "opsz" 14;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  /* Paper grain, drawn inline so the page has no external assets. */
  background-image:
    radial-gradient(rgba(42, 22, 25, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(212, 53, 43, 0.035) 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 5px;
}

::selection { background: var(--red); color: var(--paper); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

section { padding: clamp(72px, 12vw, 140px) 16px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding-top: 48px;
}

.kicker {
  margin: 0 0 12px;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.name {
  margin: 0;
  font-size: clamp(4rem, 19vw, 15rem);
  line-height: 0.9;
  font-weight: 800;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  letter-spacing: -0.04em;
  color: var(--red);
}

.letters span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em) rotate(-6deg);
  animation: letter-in 900ms cubic-bezier(0.2, 0.9, 0.25, 1.2) forwards;
  transition: transform 250ms cubic-bezier(0.3, 1.6, 0.5, 1);
}
.letters span:hover { transform: translateY(-0.08em) rotate(-4deg); }

@keyframes letter-in {
  to { opacity: 1; transform: none; }
}

.lede {
  max-width: 30ch;
  margin: 28px auto 0;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-weight: 350;
  opacity: 0;
  animation: fade-up 800ms 900ms ease-out forwards;
}

.note {
  font-family: var(--hand);
  font-weight: 700;
  color: var(--red);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  margin: 0;
}
.note--hero {
  position: absolute;
  right: clamp(16px, 9vw, 140px);
  top: 30%;
  transform: rotate(-8deg);
  opacity: 0;
  animation: fade-up 600ms 1500ms ease-out forwards;
}

.scroll {
  margin-top: 56px;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--red);
  padding-bottom: 2px;
  opacity: 0;
  animation: fade-up 700ms 1300ms ease-out forwards;
}
.scroll::after { content: " ↓"; display: inline-block; animation: bob 1.8s ease-in-out infinite; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- Decree ---------- */
.decree { display: flex; justify-content: center; }

.paper {
  position: relative;
  width: min(640px, 100%);
  background: var(--card);
  padding: clamp(28px, 6vw, 64px);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line), 0 24px 60px -30px rgba(42, 22, 25, 0.35);
  transform: rotate(-1.2deg);
}

.decree__head {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
}
.decree__ref {
  margin: 4px 0 28px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 20px;
}

.decree__title {
  margin: 0;
  font-size: clamp(3rem, 12vw, 6.2rem);
  line-height: 0.92;
  font-weight: 800;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.03em;
}
.decree__title em {
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}
.trop {
  display: inline-block;
  color: var(--red);
  font-style: italic;
  font-size: 1.35em;
  transform-origin: left bottom;
}
.is-visible .trop { animation: overflow 1.4s 300ms cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes overflow {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.18) rotate(-3deg); }
  100% { transform: scale(1.08) rotate(-2deg); }
}

.decree__body {
  margin: 28px 0 0;
  max-width: 44ch;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.decree__foot {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.sig {
  font-family: var(--hand);
  font-size: 2.6rem;
  line-height: 1;
  transform: rotate(-4deg);
  border-bottom: 1px solid var(--ink);
  padding: 0 18px 4px 2px;
}
/* ---------- Shared section heads ---------- */
.section-title {
  margin: 0;
  text-align: center;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  font-weight: 700;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  letter-spacing: -0.02em;
}
.section-sub {
  margin: 8px 0 40px;
  text-align: center;
  color: var(--ink-soft);
}

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 14px 26px;
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--red);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--red); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--red); }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.btn--ghost { background: transparent; color: var(--ink); }

/* ---------- Gauge ---------- */
.meter { background: var(--paper-2); }

.gauge {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gauge svg { width: 100%; overflow: visible; }

.gauge__arc, .gauge__fill {
  fill: none;
  stroke-width: 18;
  stroke-linecap: round;
}
.gauge__arc { stroke: rgba(42, 22, 25, 0.1); }
.gauge__fill {
  stroke: var(--red);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 2.4s cubic-bezier(0.6, 0, 0.3, 1);
}
.gauge__ticks line { stroke: var(--ink); stroke-width: 2; }
.gauge__label { font-family: var(--hand); font-size: 20px; fill: var(--ink-soft); }

.gauge__needle {
  transform-origin: 150px 150px;
  transform: rotate(-90deg);
  transition: transform 2.4s cubic-bezier(0.6, 0, 0.3, 1);
}
.gauge__needle line { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.gauge__needle circle { fill: var(--ink); }

.gauge[data-state="measuring"] .gauge__fill,
.gauge[data-state="broken"] .gauge__fill { stroke-dashoffset: 0; }
.gauge[data-state="measuring"] .gauge__needle { transform: rotate(104deg); }
.gauge[data-state="broken"] .gauge__needle { transform: rotate(104deg); animation: jitter 90ms linear infinite; }
.gauge[data-state="broken"] svg { animation: shake 400ms ease-in-out 3; }

@keyframes jitter {
  50% { transform: rotate(108deg); }
}
@keyframes shake {
  25% { transform: translateX(-6px) rotate(-1deg); }
  75% { transform: translateX(6px) rotate(1deg); }
}

.gauge__readout {
  min-height: 3.2em;
  margin: 28px 0 24px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 500;
}
.gauge__readout strong { color: var(--red); }

/* ---------- Reasons ---------- */
.reasons { display: flex; flex-direction: column; align-items: center; }

.card-stage { width: min(520px, 100%); margin-bottom: 36px; perspective: 900px; }

.card {
  margin: 0;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 32px 30px 22px;
  box-shadow: 0 20px 50px -28px rgba(42, 22, 25, 0.4);
  transform: rotate(1.5deg);
}
.card p {
  margin: 0;
  font-size: clamp(1.4rem, 4.2vw, 1.9rem);
  line-height: 1.25;
  font-weight: 400;
  font-variation-settings: "opsz" 72, "SOFT" 50;
}
.card footer {
  margin-top: 20px;
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--red);
  text-align: right;
}
.card.is-flipping { animation: flip 520ms cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes flip {
  0% { transform: rotate(1.5deg); }
  45% { transform: rotateY(90deg) rotate(1.5deg); }
  55% { transform: rotateY(-90deg) rotate(-1.5deg); }
  100% { transform: rotate(-1.5deg); }
}

/* ---------- Trop wall ---------- */
.trop-wall { padding-left: 0; padding-right: 0; background: var(--red); color: var(--paper); }

.ticker { overflow: hidden; }
.ticker__track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.ticker__track span {
  font-size: clamp(3.5rem, 13vw, 9rem);
  font-weight: 800;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  letter-spacing: -0.03em;
  padding-right: 0.35em;
  white-space: nowrap;
}
.ticker__track span:nth-child(even) { color: transparent; -webkit-text-stroke: 1.5px var(--paper); }
@keyframes marquee { to { transform: translateX(-50%); } }

.wall-note {
  margin: 28px 16px 0;
  text-align: center;
  font-family: var(--hand);
  font-size: 1.8rem;
}

/* ---------- Footer ---------- */
.colophon {
  padding: 56px 16px 64px;
  text-align: center;
  font-size: 1rem;
}
.colophon p { margin: 0; }
.colophon__small { margin-top: 8px !important; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Click hearts ---------- */
.pop {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  font-family: var(--hand);
  font-weight: 700;
  color: var(--red);
  transform: translate(-50%, -50%);
  animation: pop 1100ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.pop.on-red { color: var(--paper); }
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(var(--r)); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% - 120px)) scale(1.1) rotate(var(--r)); }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.paper.reveal { transform: translateY(24px) rotate(-1.2deg); }
.paper.reveal.is-visible { transform: rotate(-1.2deg); }

@media (max-width: 560px) {
  .note--hero { top: auto; bottom: 22%; right: 16px; }
  .sig { font-size: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
  html { scroll-behavior: auto; }
  .ticker__track { animation: none; }
}
