/* Foretold Books: design system
   Palette derived from the cover of The Nebuchadnezzar Project:
   saffron ground, oxblood title, ink-black linework, indigo and red accents. */

:root {
  --ink: #170909;
  --ink-2: #241010;
  --maroon: #5a0d0d;
  --oxblood: #7a1414;
  --saffron: #f9b84e;
  --saffron-2: #fcd58f;
  --paper: #fbf3e1;
  --paper-2: #f3e6c8;
  --indigo: #3b34d6;
  --red: #d8281b;
  --ember: #e0642b;
  --muted-on-ink: #d9c9b0;
  --muted-on-paper: #4a3030;

  --f-display: "EB Garamond", "Cormorant Garamond", Garamond, Georgia, "Times New Roman", serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem; --s-9: 6.5rem;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-display); font-size: 1.1875rem; line-height: 1.6;
  overflow-x: hidden; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .2em; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.05; margin: 0 0 var(--s-4); letter-spacing: -.01em; }
p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0; padding: 0; }

:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; }
.on-ink :focus-visible, .site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--saffron); }

.skip-link {
  position: absolute; left: var(--s-4); top: -4rem; z-index: 100;
  background: var(--saffron); color: var(--ink); padding: var(--s-3) var(--s-4);
  font-family: var(--f-ui); font-weight: 600;
}
.skip-link:focus { top: var(--s-4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--s-8); }
@media (min-width: 900px) { .section { padding-block: var(--s-9); } }

.on-ink { background: var(--ink); color: var(--paper); }
.on-saffron { background: var(--saffron); color: var(--maroon); }
.on-paper-2 { background: var(--paper-2); }

.eyebrow {
  font-family: var(--f-ui); font-size: .75rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; margin: 0 0 var(--s-4);
}
.on-ink .eyebrow { color: var(--saffron); }
.on-saffron .eyebrow { color: var(--ink); }
.eyebrow--rule { display: flex; align-items: center; gap: var(--s-3); }
.eyebrow--rule::before { content: ""; width: 2.5rem; height: 2px; background: currentColor; }

.h-xl { font-size: clamp(2.6rem, 9vw, 5.6rem); }
.h-lg { font-size: clamp(2rem, 6vw, 3.6rem); }
.h-md { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.lede { font-size: clamp(1.25rem, 2.4vw, 1.5rem); line-height: 1.45; }
.on-ink .lede, .on-ink p { color: var(--muted-on-ink); }
.on-ink h1, .on-ink h2, .on-ink h3 { color: var(--paper); }
.prose p { max-width: 38em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 3rem; padding: .8rem 1.6rem; border: 2px solid transparent;
  font-family: var(--f-ui); font-size: .9rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border-radius: var(--radius);
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--saffron); color: var(--ink); }
.btn--primary:hover { background: var(--saffron-2); }
.on-saffron .btn--primary, .on-paper .btn--primary, .btn--dark { background: var(--maroon); color: var(--paper); }
.on-saffron .btn--primary:hover, .btn--dark:hover { background: var(--ink); }
.btn--ghost { border-color: currentColor; color: inherit; background: transparent; }
.on-ink .btn--ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.on-saffron .btn--ghost:hover, .btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.btn-row .btn { flex: 1 1 14rem; }
@media (min-width: 640px) { .btn-row .btn { flex: 0 0 auto; } }
.text-link { font-family: var(--f-ui); font-weight: 600; font-size: .9rem; letter-spacing: .04em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--paper); border-bottom: 1px solid rgba(249,184,78,.25); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: var(--s-4); }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; letter-spacing: .14em; }
.brand__sub { font-family: var(--f-ui); font-size: .6rem; letter-spacing: .5em; color: var(--saffron); margin-top: .3rem; }
.nav-toggle {
  min-width: 3rem; min-height: 3rem; background: transparent; color: var(--paper);
  border: 1px solid rgba(251,243,225,.4); border-radius: var(--radius); font-family: var(--f-ui);
  font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 0 var(--s-4); cursor: pointer;
}
.site-nav { display: none; }
.site-nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--ink); border-bottom: 1px solid rgba(249,184,78,.25); padding: var(--s-4) var(--gutter) var(--s-6);
}
.site-nav ul { list-style: none; display: grid; }
.site-nav a { display: block; padding: var(--s-4) 0; border-bottom: 1px solid rgba(251,243,225,.12); text-decoration: none; font-family: var(--f-ui); font-size: 1rem; font-weight: 500; }
.site-nav a[aria-current="page"] { color: var(--saffron); }
.site-nav .nav-cta { margin-top: var(--s-5); border: 0; text-align: center; }
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: flex; align-items: center; gap: var(--s-6); position: static; padding: 0; border: 0; background: none; }
  .site-nav ul { display: flex; gap: var(--s-5); }
  .site-nav a { padding: var(--s-3) 0; border: 0; font-size: .85rem; letter-spacing: .06em; }
  .site-nav a:hover { color: var(--saffron); }
  .site-nav .nav-cta { margin: 0; padding: .7rem 1.2rem; min-height: 2.75rem; display: inline-flex; align-items: center; }
  .site-nav .nav-cta:hover { color: var(--ink); }
}
.launch-back { display: none; font-family: var(--f-ui); font-size: .85rem; font-weight: 600; text-decoration: none; }
.is-launch .nav-toggle, .is-launch .site-nav { display: none !important; }
.is-launch .launch-back { display: inline-block; padding: var(--s-3) 0; }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: var(--s-7) var(--s-8); }
.hero::before { /* faint brush-red wash echoing the cover's linework */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 85% 20%, rgba(216,40,27,.22), transparent 70%),
    radial-gradient(50% 60% at 10% 100%, rgba(249,184,78,.10), transparent 70%);
}
.hero__grid { position: relative; display: grid; gap: var(--s-7); align-items: center; }
.hero__copy .h-xl { color: var(--saffron); margin-bottom: var(--s-5); }
.hero__title { font-family: var(--f-ui); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--paper); margin-bottom: var(--s-4); }
.hero__meta { font-family: var(--f-ui); font-size: .85rem; letter-spacing: .04em; color: var(--paper); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid rgba(251,243,225,.2); }
.hero__meta strong { color: var(--saffron); font-weight: 600; }
.hero__cover { justify-self: center; width: min(78%, 22rem); }
@media (min-width: 900px) {
  .hero { padding-block: var(--s-8) var(--s-9); }
  .hero__grid { grid-template-columns: 1.15fr .85fr; }
  .hero__cover { width: min(100%, 25rem); justify-self: end; }
}
.cover {
  position: relative; display: block; background: var(--saffron);
  box-shadow: 0 30px 60px -18px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.4), inset 6px 0 8px -6px rgba(0,0,0,.45);
  transform: rotate(-2deg); transition: transform .5s ease;
}
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(0,0,0,0) 4%, rgba(255,255,255,.12) 5%, rgba(0,0,0,0) 8%); pointer-events: none; }
.cover:hover { transform: rotate(0deg) translateY(-4px); }
.cover img { width: 100%; }

/* Countdown strip */
.countdown { background: var(--maroon); color: var(--paper); font-family: var(--f-ui); }
.countdown__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-4); }
.countdown__label { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--saffron-2); margin: 0; }
.countdown__units { display: flex; gap: var(--s-5); list-style: none; }
.countdown__units li { text-align: center; min-width: 3.2rem; }
.countdown__units b { display: block; font-family: var(--f-display); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown__units span { font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted-on-ink); }
.countdown[hidden] { display: none; }

/* Introduction */
.split { display: grid; gap: var(--s-7); }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 7fr; gap: var(--s-8); } .split--rev { grid-template-columns: 7fr 5fr; } }
.dropcap::first-letter { font-family: var(--f-display); font-weight: 700; float: left; font-size: 4.6em; line-height: .8; padding: .08em .1em 0 0; color: var(--oxblood); }
.facts { list-style: none; border-top: 2px solid var(--ink); margin-top: var(--s-5); }
.facts li { display: grid; grid-template-columns: 7rem 1fr; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid rgba(23,9,9,.2); font-family: var(--f-ui); font-size: .95rem; }
.facts b { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; padding-top: .2rem; }
.on-ink .facts { border-color: var(--saffron); }
.on-ink .facts li { border-color: rgba(251,243,225,.2); color: var(--paper); }
.on-ink .facts b { color: var(--saffron); }
.cast { list-style: none; display: grid; gap: var(--s-4); margin-top: var(--s-5); }
.cast li { border-left: 3px solid var(--oxblood); padding-left: var(--s-4); }
.cast b { font-size: 1.3rem; display: block; }

/* Themes (editorial list, not cards) */
.questions { list-style: none; counter-reset: q; }
.questions li { counter-increment: q; display: grid; grid-template-columns: 3.2rem 1fr; gap: var(--s-4); padding-block: var(--s-5); border-top: 2px solid var(--maroon); }
.questions li::before { content: counter(q, decimal-leading-zero); font-family: var(--f-ui); font-weight: 700; font-size: .9rem; letter-spacing: .1em; padding-top: .55rem; }
.questions h3 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: var(--s-2); }
.questions p { margin: 0; color: var(--ink); max-width: 34em; }
.pullquote { margin: 0; font-family: var(--f-display); font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.12; font-weight: 700; }
.pullquote cite { display: block; margin-top: var(--s-4); font-family: var(--f-ui); font-style: normal; font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.on-ink .pullquote { color: var(--saffron); }
.pullquote--mark::before { content: "\201C"; display: block; font-size: 5rem; line-height: .6; color: var(--red); }
.toc { list-style: none; columns: 1; column-gap: var(--s-7); counter-reset: ch; }
@media (min-width: 700px) { .toc { columns: 2; } }
.toc li { break-inside: avoid; padding: var(--s-3) 0; border-bottom: 1px solid rgba(90,13,13,.3); font-size: 1.15rem; }
.toc li small { font-family: var(--f-ui); font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; display: block; opacity: .85; }

/* Author */
.portrait { position: relative; max-width: 24rem; }
.portrait img { width: 100%; filter: grayscale(.15) contrast(1.03); }
.portrait::after { content: ""; position: absolute; inset: auto -.9rem -.9rem auto; width: 70%; height: 70%; border: 3px solid var(--saffron); z-index: -1; }
.on-paper .portrait::after { border-color: var(--oxblood); }

/* Launch block */
.launch-card { display: grid; gap: var(--s-7); }
@media (min-width: 900px) { .launch-card { grid-template-columns: 1.1fr .9fr; align-items: center; } }
.invite { box-shadow: 0 24px 50px -20px rgba(0,0,0,.8); border: 1px solid rgba(251,243,225,.15); }

/* Closing CTA */
.closing { text-align: center; }
.closing .h-lg { max-width: 14em; margin-inline: auto; }
.closing .btn-row { justify-content: center; }
.closing p { max-width: 34em; margin-inline: auto; }

/* Inner page hero */
.page-hero { padding-block: var(--s-7) var(--s-8); }
.page-hero .split { align-items: center; }
.price-box { border: 2px solid currentColor; padding: var(--s-5); margin-top: var(--s-5); font-family: var(--f-ui); font-size: .95rem; }
.price-box h2 { font-family: var(--f-ui); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; margin-bottom: var(--s-2); }
.price-box p { margin: 0 0 var(--s-3); }
.readers { list-style: none; display: grid; gap: 0; margin-top: var(--s-5); }
.readers li { padding: var(--s-4) 0; border-top: 1px solid rgba(23,9,9,.25); font-size: 1.3rem; }
@media (min-width: 700px) { .readers { grid-template-columns: 1fr 1fr; column-gap: var(--s-7); } }
.note { font-family: var(--f-ui); font-size: .9rem; border-left: 3px solid var(--oxblood); padding-left: var(--s-4); max-width: 40rem; }

/* Registration page */
.reg-hero { padding-block: var(--s-6) var(--s-7); }
.reg-grid { display: grid; gap: var(--s-7); }
@media (min-width: 960px) { .reg-grid { grid-template-columns: 5fr 7fr; gap: var(--s-8); align-items: start; } .reg-aside { order: -1; position: sticky; top: 6rem; } }
.reg-aside .facts li { grid-template-columns: 5.5rem 1fr; }
.form-shell { background: var(--paper); color: var(--ink); padding: var(--s-4); border-radius: var(--radius); border-top: 6px solid var(--saffron); }
.form-shell h2 { font-size: 1.8rem; color: var(--ink); }
.form-shell p { color: var(--muted-on-paper); }
.form-shell a { color: var(--maroon); }
.form-frame { position: relative; width: 100%; background: #fff; border: 1px solid rgba(23,9,9,.2); }
.form-frame iframe { display: block; width: 100%; height: 1500px; border: 0; }
@media (min-width: 700px) { .form-frame iframe { height: 1350px; } .form-shell { padding: var(--s-6); } }
.form-fallback { font-family: var(--f-ui); font-size: .95rem; margin-top: var(--s-4); }
.expect { list-style: none; margin-top: var(--s-5); }
.expect li { padding: var(--s-4) 0 var(--s-4) var(--s-6); position: relative; border-top: 1px solid rgba(251,243,225,.2); color: var(--paper); }
.expect li::before { content: ""; position: absolute; left: 0; top: 1.55rem; width: 1rem; height: 2px; background: var(--saffron); }
.mini-cover { width: 6.5rem; flex: none; }
.who { display: flex; gap: var(--s-4); align-items: center; margin-bottom: var(--s-5); }
.who img.round { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 2px solid var(--saffron); }

/* Footer */
.site-footer { background: var(--ink); color: var(--muted-on-ink); font-family: var(--f-ui); font-size: .9rem; padding-block: var(--s-7) var(--s-5); }
.footer-grid { display: grid; gap: var(--s-6); }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-family: var(--f-ui); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--saffron); margin-bottom: var(--s-3); }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: var(--s-2); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--saffron); text-decoration: underline; }
.footer-brand .brand__name { color: var(--paper); }
.legal { margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid rgba(251,243,225,.15); font-size: .8rem; }

/* Motion */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .cover, .cover:hover { transform: none; }
}
@media print { .site-header, .site-nav, .countdown { display: none; } }
