/* Spellmade: a kitchen garden at dusk. Pale bay-leaf paper, herb ink, one candle-amber accent. */
:root {
  --paper: #e9ede5;
  --paper-deep: #dde4d7;
  --card: #f7f8f3;
  --ink: #1d2a23;
  --ink-soft: #4a5a50;
  --rule: #c6d0c0;
  --flame: #b5691c;
  --flame-ink: #8a4e12;
  --moon-lit: #f4f1e3;
  --moon-dark: #2c3a32;
  --button: #1d2a23;
  --button-text: #f7f8f3;
  --focus: #8a4e12;
  --danger: #8f2d1f;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --measure: 36rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131c16; --paper-deep: #19241d; --card: #1e2a23; --ink: #e6ebe1; --ink-soft: #a8b6aa; --rule: #34433a;
    --flame: #e3a04f; --flame-ink: #eab06a; --moon-lit: #f1eedf; --moon-dark: #0d1410; --button: #e6ebe1; --button-text: #131c16;
    --focus: #eab06a; --danger: #f08a77; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131c16; --paper-deep: #19241d; --card: #1e2a23; --ink: #e6ebe1; --ink-soft: #a8b6aa; --rule: #34433a;
  --flame: #e3a04f; --flame-ink: #eab06a; --moon-lit: #f1eedf; --moon-dark: #0d1410; --button: #e6ebe1; --button-text: #131c16;
  --focus: #eab06a; --danger: #f08a77; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--flame-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.1rem, 6.2vw, 3.7rem); }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.35rem); }
h3 { font-size: 1.35rem; }
p { margin: 0; }
.wrap { width: 100%; max-width: 70rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.measure { max-width: var(--measure); }
.soft { color: var(--ink-soft); }
.small { font-size: 0.9rem; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; text-decoration: none; letter-spacing: 0.005em; }
.wordmark:hover { color: var(--ink); }
.header-link { font-weight: 500; font-size: 1rem; }
.site-footer { margin-top: 96px; padding: 40px 0 56px; border-top: 1px solid var(--rule); font-size: 0.95rem; color: var(--ink-soft); }
.site-footer .wrap { display: grid; gap: 18px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.preview-ribbon { background: var(--ink); color: var(--paper); text-align: center; font-size: 0.85rem; padding: 6px 16px; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 52px; padding: 0.8rem 1.5rem; border-radius: 6px; border: 1px solid var(--button);
  background: var(--button); color: var(--button-text); font: 700 1.05rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer; transition: transform 0.12s ease, opacity 0.12s ease;
}
.button:hover { color: var(--button-text); opacity: 0.92; }
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: 0.55; cursor: progress; }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.button.quiet:hover { color: var(--ink); border-color: var(--ink); }
.button.wide { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }

/* Hero */
.hero { padding: 28px 0 72px; }
.hero .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.35fr 1fr; gap: 56px; } .hero { padding-top: 56px; } }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 1.25rem; font-size: 1.25rem; max-width: 34rem; }
.hero .actions { margin-top: 2rem; display: grid; gap: 0.75rem; justify-items: start; }
.tonight { display: grid; gap: 14px; justify-items: start; }
@media (min-width: 900px) { .tonight { justify-items: center; text-align: center; } }
.moon { width: clamp(150px, 42vw, 280px); height: auto; filter: drop-shadow(0 0 28px rgba(181, 105, 28, 0.18)); }
.tonight .label { font-family: var(--serif); font-size: 1.3rem; }
.tonight .energy { color: var(--ink-soft); max-width: 22rem; }

/* Sections */
.section { padding: 64px 0; }
.section.deep { background: var(--paper-deep); }
.section h2 { max-width: 22ch; }
.steps { margin: 2.25rem 0 0; padding: 0; list-style: none; display: grid; gap: 28px; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; }
.steps li::before { content: counter(step); font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--flame-ink); }
.steps h3 { font-size: 1.3rem; }
.reasons { margin: 2rem 0 0; padding: 0; list-style: none; display: grid; gap: 18px; max-width: 40rem; }
.reasons li { padding-left: 1.4rem; position: relative; }
.reasons li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--flame); }
.reasons strong { font-weight: 700; }
.two-col { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; gap: 64px; } }
.honest { font-family: var(--serif); font-size: clamp(1.45rem, 3.6vw, 2rem); line-height: 1.35; max-width: 30ch; }

/* The spell card: structured like a recipe card */
.spell-card {
  position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  padding: 28px 22px 26px; box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(29, 42, 35, 0.45);
}
@media (min-width: 720px) { .spell-card { padding: 36px 40px 34px; } }
.spell-card .seal {
  position: absolute; top: -18px; right: 22px; width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d68a3c, var(--flame) 55%, #8a4e12 100%);
  color: #fbeedd; display: grid; place-items: center; font: 700 1.35rem/1 var(--serif);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.spell-card .for { color: var(--ink-soft); margin-top: 0.4rem; }
.spell-card h2, .spell-card h1 { font-size: clamp(1.7rem, 4.6vw, 2.4rem); padding-right: 52px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 0.9rem; font-size: 0.98rem; color: var(--ink-soft); }
.card-part { margin-top: 1.6rem; }
.card-part > .part-label { font-weight: 700; font-size: 0.98rem; color: var(--ink-soft); margin-bottom: 0.45rem; }
.card-part ul, .card-part ol { margin: 0; padding-left: 1.3rem; }
.card-part li + li { margin-top: 0.35rem; }
.card-part ol {
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.55em - 1px), var(--rule) calc(1.55em - 1px), var(--rule) 1.55em);
  background-position: 0 0.15em;
}
.words { font-family: var(--serif); font-style: italic; font-size: 1.32rem; line-height: 1.5; border-left: 3px solid var(--flame); padding-left: 1rem; }
.words p + p { margin-top: 0.15rem; }
.anchor { background: var(--paper-deep); border-radius: 6px; padding: 14px 16px; }
.card-note { font-size: 0.95rem; color: var(--ink-soft); }

/* Quiz */
.quiz-shell { max-width: 40rem; margin: 0 auto; padding: 8px 16px 40px; }
.progress { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.3s ease; }
.progress-label { margin-top: 10px; font-size: 0.95rem; color: var(--ink-soft); }
.question { margin-top: 28px; }
.question h1 { font-size: clamp(1.8rem, 5.4vw, 2.6rem); }
.question .help { margin-top: 0.6rem; color: var(--ink-soft); }
.options { margin-top: 22px; display: grid; gap: 10px; }
.options.chips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px;
  padding: 12px 16px; text-align: left; border: 1px solid var(--rule); border-radius: 6px; background: var(--card);
  color: var(--ink); font: 500 1.08rem/1.3 var(--sans); cursor: pointer;
}
.option:hover { border-color: var(--ink-soft); }
.option[aria-pressed="true"], .option[aria-checked="true"] { border: 2px solid var(--ink); padding: 11px 15px; background: var(--paper-deep); }
.option .tick { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--rule); }
.option[aria-pressed="true"] .tick, .option[aria-checked="true"] .tick { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 4px var(--paper-deep); }
.field { margin-top: 22px; display: grid; gap: 8px; }
.field label { font-weight: 700; }
.input, textarea.input {
  width: 100%; min-height: 54px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--card); color: var(--ink); font: 400 1.1rem/1.4 var(--sans);
}
textarea.input { min-height: 140px; resize: vertical; }
.input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.counter { font-size: 0.9rem; color: var(--ink-soft); justify-self: end; }
.error { color: var(--danger); font-weight: 500; margin-top: 12px; }
.quiz-nav { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.writing { text-align: center; padding: 48px 0; display: grid; gap: 18px; justify-items: center; }
.writing .moon { width: 160px; }
.writing-line { font-family: var(--serif); font-size: 1.5rem; min-height: 2.1rem; }

/* Teaser and offers */
.teaser .spell-card { margin-top: 26px; }
.veil { position: relative; margin-top: 1.4rem; }
.veil p { filter: blur(5px); user-select: none; color: var(--ink-soft); }
.veil p + p { margin-top: 0.45rem; }
.veil::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, var(--card) 85%); }
.offer { margin-top: 26px; border: 2px solid var(--ink); border-radius: 6px; padding: 22px; background: var(--card); display: grid; gap: 16px; }
.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; }
.bump { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px dashed var(--flame); border-radius: 6px; cursor: pointer; }
.bump input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); }
.fine { font-size: 0.9rem; color: var(--ink-soft); }
.crisis { margin-top: 26px; padding: 22px; border-radius: 6px; background: var(--card); border-left: 4px solid var(--flame); }

/* Upsell page */
.upsell { max-width: 40rem; margin: 0 auto; padding: 16px 16px 48px; }
.upsell .offer { margin-top: 22px; }
.upsell-list { margin: 0; padding-left: 1.2rem; }
.status { margin-top: 18px; font-weight: 500; }

/* Spell page */
.spell-page { max-width: 46rem; margin: 0 auto; padding: 24px 16px 48px; }
.spell-page .spell-card { margin-top: 18px; }
.reading { margin-top: 1.2rem; font-size: 1.12rem; }
.circle { margin-top: 48px; }
.plan-buttons { display: grid; gap: 10px; }
@media (min-width: 620px) { .plan-buttons { grid-template-columns: 1fr 1fr; } }
.moon-map { margin-top: 48px; }
.moon-map ol { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.moon-map li { border-top: 1px solid var(--rule); padding-top: 14px; display: grid; gap: 4px; }
.moon-map .date { font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* Long-form pages */
.prose { max-width: 42rem; margin: 0 auto; padding: 24px 16px 40px; }
.prose h1 { margin-bottom: 1rem; }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 0.6rem; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 0.8rem; }
.prose ul { padding-left: 1.2rem; }

details { border-top: 1px solid var(--rule); padding: 16px 0; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font-family: var(--serif); font-size: 1.25rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--sans); color: var(--ink-soft); }
details[open] summary::after { content: "\2212"; }
details p { margin-top: 10px; max-width: 38rem; }

/* The library: chapters of spells */
.chapter { margin-top: 36px; }
.chapter h2 { font-size: 1.55rem; margin-bottom: 6px; }

/* The owner's numbers page */
.numbers { max-width: 52rem; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 18px; }
.numbers h2 { font-size: 1.5rem; margin-top: 12px; }
.table-wrap { overflow-x: auto; }
.figures { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.figures th, .figures td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.figures th[scope="row"], .figures thead th:first-child { text-align: left; font-weight: 500; }
.figures thead th { font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; }
.figure-line strong { font-family: var(--serif); font-size: 1.3rem; }
@media (max-width: 480px) { .figures th, .figures td { padding: 9px 6px; font-size: 0.95rem; } }

/* The Circle: the members' page */
.circle-page { max-width: 46rem; margin: 0 auto; padding: 24px 16px 48px; }
.lede-line { margin-top: 0.9rem; font-size: 1.2rem; max-width: 34rem; }
.panel { margin-top: 28px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 22px; display: grid; gap: 14px; }
.panel h2 { font-size: 1.5rem; }
.panel .field { margin-top: 0; }
.panel .toolbar { margin-top: 0; align-items: center; }
.panel .status, .panel .error { margin-top: 0; }
.after-panel { margin-top: 1.4rem; }
.member-top { display: grid; gap: 18px; align-items: center; }
.member-top .moons-line { margin-top: 0.6rem; }
.member-top .moon { width: 112px; }
@media (min-width: 720px) { .member-top { grid-template-columns: 1fr auto; } }
.spell-list { list-style: none; margin: 0; padding: 0; }
.spell-list li + li { border-top: 1px solid var(--rule); }
.spell-list a { display: grid; gap: 2px; padding: 12px 0; text-decoration: none; }
.spell-list a:hover .t { text-decoration: underline; text-underline-offset: 0.18em; }
.spell-list .t { font-family: var(--serif); font-size: 1.22rem; }
.spell-list .m { font-size: 0.93rem; color: var(--ink-soft); }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .toolbar, .circle, .preview-ribbon, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .spell-card { box-shadow: none; border-color: #999; }
}
