:root {
  --ink: #050508;
  --night: #101118;
  --paper: #f4ead5;
  --muted: rgba(244, 234, 213, 0.66);
  --faint: rgba(244, 234, 213, 0.36);
  --line: rgba(244, 234, 213, 0.14);
  --gold: #d3b466;
  --red: #d94b38;
  --blue: #6ba4d8;
  --green: #65efad;
  --mode: var(--red);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
  color: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--sans);
  background: var(--ink);
  color: var(--paper);
  overflow-x: hidden;
  text-rendering: geometricPrecision;
}

body.choice-red { --mode: var(--red); }
body.choice-oracle { --mode: var(--gold); }
body.choice-blue { --mode: var(--blue); }

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

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

.field {
  position: fixed;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
  background: var(--ink);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.16;
  mix-blend-mode: soft-light;
  background-image:
    repeating-radial-gradient(circle at 17% 23%, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(96deg, transparent 0 9px, rgba(255, 255, 255, 0.05) 9px 10px);
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 42px;
  transition: background 220ms ease, border-color 220ms ease;
}

.topbar.is-scrolled {
  background: rgba(5, 5, 8, 0.72);
  border-bottom: 1px solid rgba(244, 234, 213, 0.1);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: var(--serif);
  font-size: 21px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  position: relative;
  flex: 0 0 auto;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.brand-mark::before {
  left: 5px;
  background: var(--red);
}

.brand-mark::after {
  right: 5px;
  background: var(--blue);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--paper);
  background: rgba(244, 234, 213, 0.08);
}

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 110px 72px 86px;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(5, 5, 8, 0.98) 0%, rgba(5, 5, 8, 0.72) 48%, rgba(5, 5, 8, 0.9) 100%),
    url("book/cover.webp") center / cover;
  opacity: 0.5;
  filter: saturate(0.8) contrast(1.08);
  transform: scale(1.04);
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 51%;
  width: 880px;
  height: 880px;
  border: 1px solid rgba(211, 180, 102, 0.18);
  transform: translate(-50%, -50%) rotate(45deg);
  z-index: -1;
  mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent);
}

.cover-echo {
  position: absolute;
  right: 5%;
  top: 18%;
  width: 430px;
  aspect-ratio: 1086 / 1448;
  border: 1px solid rgba(211, 180, 102, 0.22);
  background: url("arcani/18-la-soglia.webp") center / cover;
  opacity: 0.28;
  transform: rotate(7deg);
  filter: saturate(0.7) brightness(0.66);
}

.hero-art {
  position: absolute;
  right: 8%;
  top: 50%;
  width: 390px;
  transform: translateY(-46%) rotateY(-7deg) rotateX(2deg);
  transform-style: preserve-3d;
  border: 1px solid rgba(211, 180, 102, 0.42);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.58);
}

.hero-copy {
  max-width: 820px;
  position: relative;
  z-index: 2;
}

.eyebrow,
.section-code {
  margin: 0 0 18px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 116px;
  line-height: 0.88;
}

.subtitle {
  margin: 24px 0 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.05;
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-action,
.quiet-action,
.lead-form button {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(244, 234, 213, 0.16);
}

.primary-action,
.lead-form button {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 700;
}

.lead-form button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.quiet-action {
  background: rgba(244, 234, 213, 0.04);
  color: var(--paper);
}

.pill-control {
  position: absolute;
  z-index: 3;
  left: 72px;
  right: 72px;
  bottom: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 210px));
  gap: 12px;
}

.pill-choice {
  --choice-color: var(--gold);
  min-height: 84px;
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--choice-color), transparent 62%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--choice-color), transparent 92%), rgba(244, 234, 213, 0.035)),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(244, 234, 213, 0.025) 17px 18px);
  box-shadow: inset 0 0 0 1px rgba(244, 234, 213, 0.04), 0 14px 38px rgba(0, 0, 0, 0.26);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.pill-choice[data-choice="red"] { --choice-color: var(--red); }
.pill-choice[data-choice="oracle"] { --choice-color: var(--gold); }
.pill-choice[data-choice="blue"] { --choice-color: var(--blue); }

.pill-choice::before,
.pill-choice::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.pill-choice::before {
  inset: 8px;
  border: 1px solid color-mix(in srgb, var(--choice-color), transparent 78%);
  opacity: 0.72;
}

.pill-choice::after {
  width: 80px;
  height: 1px;
  right: 16px;
  top: 16px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--choice-color), white 18%), transparent);
  opacity: 0.7;
}

.pill-choice:hover,
.pill-choice.is-active {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--choice-color), white 18%);
  background:
    radial-gradient(circle at 18% 50%, color-mix(in srgb, var(--choice-color), transparent 72%), transparent 48%),
    linear-gradient(135deg, color-mix(in srgb, var(--choice-color), transparent 88%), rgba(244, 234, 213, 0.05));
  box-shadow: 0 20px 56px color-mix(in srgb, var(--choice-color), transparent 82%), inset 0 0 0 1px rgba(244, 234, 213, 0.06);
}

.pill-sigil {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--choice-color), transparent 48%);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(244, 234, 213, 0.08), transparent 58%),
    rgba(5, 5, 8, 0.28);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.34), 0 0 26px color-mix(in srgb, var(--choice-color), transparent 82%);
}

.pill-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.pill-copy b {
  font-size: 18px;
  line-height: 1;
}

.pill-copy small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pill-shape {
  width: 34px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 4px 7px rgba(255, 255, 255, 0.2), inset 0 -7px 12px rgba(0, 0, 0, 0.28), 0 0 22px currentColor;
}

.pill-shape.red {
  color: rgba(217, 75, 56, 0.56);
  background: linear-gradient(100deg, #ff927f, var(--red) 48%, #68160f);
}

.pill-shape.blue {
  color: rgba(107, 164, 216, 0.56);
  background: linear-gradient(100deg, #b6dcff, var(--blue) 48%, #183a62);
}

.pill-shape.empty {
  width: 28px;
  height: 28px;
  color: rgba(211, 180, 102, 0.5);
  background:
    radial-gradient(circle, transparent 42%, var(--gold) 44% 48%, transparent 50%),
    conic-gradient(from 90deg, transparent, rgba(211, 180, 102, 0.46), transparent 68%);
  box-shadow: 0 0 28px rgba(211, 180, 102, 0.28);
}

.scroll-cue {
  position: absolute;
  right: 42px;
  bottom: 28px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 234, 213, 0.04);
}

.scroll-cue span {
  width: 9px;
  height: 9px;
  border-right: 1px solid var(--paper);
  border-bottom: 1px solid var(--paper);
  transform: rotate(45deg) translate(-1px, -2px);
}

section {
  position: relative;
  scroll-margin-top: 88px;
}

.section-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.synopsis,
.book,
.author,
.signup {
  padding: 116px 0;
}

.synopsis {
  background: linear-gradient(180deg, rgba(5, 5, 8, 0), rgba(16, 17, 24, 0.84) 18%, rgba(16, 17, 24, 0.64) 82%, rgba(5, 5, 8, 0));
}

.synopsis-grid,
.signup-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}

h2 {
  font-size: 72px;
  line-height: 0.95;
}

.synopsis-text {
  color: var(--muted);
  font-size: 23px;
  line-height: 1.48;
}

.synopsis-text p {
  margin: 0 0 24px;
}

.synopsis-text .thesis {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 31px;
  line-height: 1.2;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 42px;
}

.routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.route {
  min-height: 290px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(244, 234, 213, 0.035);
  overflow: hidden;
}

.route-mark {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 58px;
  border-radius: 999px;
  border: 1px solid currentColor;
  position: relative;
}

.route-mark::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  right: 5px;
  top: 9px;
  border-radius: inherit;
  background: currentColor;
  box-shadow: 0 0 24px currentColor;
}

.red-mark { color: var(--red); }
.gold-mark { color: var(--gold); }
.blue-mark { color: var(--blue); }

.route p {
  margin: 0 0 10px;
  color: currentColor;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.route h3 {
  margin-bottom: 14px;
  font-size: 36px;
  line-height: 1;
}

.route span {
  color: var(--muted);
  line-height: 1.58;
}

.arcana-strip {
  margin-top: 46px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.arcana-strip figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(211, 180, 102, 0.25);
  border-radius: 8px;
  background: #070705;
}

.arcana-strip img {
  width: 100%;
  aspect-ratio: 7 / 12;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.05);
}

.arcana-strip figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 42px 14px 14px;
  background: linear-gradient(180deg, transparent, rgba(5, 5, 8, 0.92));
  color: var(--paper);
  font-family: var(--serif);
  font-size: 20px;
}

.author {
  background:
    linear-gradient(180deg, rgba(5, 5, 8, 0), rgba(16, 17, 24, 0.88) 20%, rgba(16, 17, 24, 0.62) 84%, rgba(5, 5, 8, 0)),
    url("arcani/09-l-oracolo.webp") center / cover;
}

.author-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}

.author-portrait {
  margin: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(211, 180, 102, 0.36);
  border-radius: 8px;
  background: #080705;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.author-portrait::before,
.author-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.author-portrait::before {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(217, 75, 56, 0.08), transparent 18%, transparent 82%, rgba(107, 164, 216, 0.08));
  mix-blend-mode: screen;
}

.author-portrait::after {
  z-index: 3;
  border: 1px solid rgba(244, 234, 213, 0.08);
  box-shadow: inset 0 0 0 10px rgba(5, 5, 8, 0.08), inset 0 0 54px rgba(5, 5, 8, 0.24);
}

.author-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: none;
}

.author-copy p:not(.section-code) {
  max-width: 720px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.52;
}

.author-copy p + p {
  margin-top: 20px;
}

.signup {
  background:
    linear-gradient(180deg, rgba(5, 5, 8, 0.2), rgba(5, 5, 8, 0.94)),
    url("arcani/12-le-due-pillole.webp") center / cover;
}

.signup-copy p:not(.section-code) {
  max-width: 560px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.5;
}

.lead-form {
  align-self: center;
  border: 1px solid rgba(211, 180, 102, 0.28);
  border-radius: 8px;
  background: rgba(5, 5, 8, 0.78);
  backdrop-filter: blur(18px);
  padding: 28px;
}

.lead-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.form-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.lead-form input[type="email"] {
  min-height: 50px;
  width: 100%;
  border: 1px solid rgba(244, 234, 213, 0.18);
  border-radius: 999px;
  background: rgba(244, 234, 213, 0.06);
  color: var(--paper);
  padding: 0 18px;
}

.lead-form input[type="email"]:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.field-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 14px;
  line-height: 1.5;
}

.lead-form.is-success {
  border-color: rgba(107, 164, 216, 0.62);
  box-shadow: 0 0 40px rgba(107, 164, 216, 0.14);
}

.lead-form.is-error {
  border-color: rgba(217, 75, 56, 0.7);
  box-shadow: 0 0 40px rgba(217, 75, 56, 0.14);
}

.lead-form.is-success .form-note {
  color: rgba(183, 215, 242, 0.92);
}

.lead-form.is-error .form-note {
  color: rgba(238, 128, 112, 0.95);
}

.privacy-note {
  margin: 10px 0 0;
  color: rgba(244, 234, 213, 0.32);
  font-size: 12px;
  line-height: 1.45;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 42px;
  color: var(--faint);
  border-top: 1px solid rgba(244, 234, 213, 0.08);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-art.reveal {
  opacity: 0;
  transform: translateY(-42%) rotateY(-7deg) rotateX(2deg);
}

.hero-art.reveal.is-visible {
  opacity: 1;
  transform: translateY(-46%) rotateY(-7deg) rotateX(2deg);
}

@media (max-width: 1160px) {
  .hero {
    padding-left: 38px;
    padding-right: 38px;
  }

  .hero-art {
    width: 330px;
    right: 5%;
  }

  h1 {
    font-size: 94px;
  }

  h2 {
    font-size: 60px;
  }

  .synopsis-grid,
  .signup-shell {
    gap: 48px;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 16px 18px;
  }

  .nav {
    display: none;
  }

  .brand {
    font-size: 18px;
  }

  .hero {
    padding: 96px 18px 148px;
    align-items: start;
  }

  .hero-art {
    position: relative;
    top: auto;
    right: auto;
    width: min(76vw, 330px);
    margin: 0 auto 36px;
    transform: none;
  }

  .hero-art.reveal,
  .hero-art.reveal.is-visible {
    transform: none;
  }

  .cover-echo {
    display: none;
  }

  h1 {
    font-size: 64px;
  }

  .subtitle {
    font-size: 28px;
  }

  .lead,
  .synopsis-text,
  .signup-copy p:not(.section-code) {
    font-size: 19px;
  }

  .pill-control {
    left: 18px;
    right: 18px;
    bottom: 18px;
    grid-template-columns: repeat(3, minmax(174px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .pill-choice {
    min-height: 76px;
  }

  .scroll-cue {
    display: none;
  }

  .synopsis,
  .book,
  .author,
  .signup {
    padding: 84px 0;
  }

  .synopsis-grid,
  .author-shell,
  .signup-shell,
  .routes {
    grid-template-columns: 1fr;
  }

  .author-portrait {
    width: min(78vw, 360px);
    margin: 0 auto;
  }

  h2 {
    font-size: 46px;
  }

  .arcana-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-line {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .brand span:last-child {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  h1 {
    font-size: 52px;
  }

  h2 {
    font-size: 39px;
  }

  .subtitle {
    font-size: 24px;
  }

  .hero-actions {
    display: grid;
  }

  .primary-action,
  .quiet-action {
    width: 100%;
  }

  .synopsis-text .thesis {
    font-size: 25px;
  }

  footer {
    padding: 24px 18px;
  }
}

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