/* Purple Peril — site styles. No external dependencies; system font stacks only. */
:root {
  --plum-900: #1e1029;
  --plum-800: #2a1838;
  --plum-700: #3d2452;
  --purple-600: #5b348c;
  --purple-500: #7444b0;
  --lavender-400: #ae81e3;   /* sampled from the purple label on the cover */
  --lavender-100: #f1eaf7;
  --mauve-400: #bf819e;      /* cover background */
  --mauve-100: #f6edf1;
  --ink: #221a29;
  --ink-soft: #4a4152;
  --paper: #fdfbfd;
  --line: #e4dbe9;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Source Serif Pro", "Noto Serif", Georgia, Cambria, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --radius: 10px;
  --maxw: 1120px;
  --narrow: 740px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--purple-600); text-underline-offset: 3px; }
a:hover { color: var(--purple-500); }
:focus-visible { outline: 3px solid var(--lavender-400); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--plum-800); margin: 0 0 .6em; font-weight: 700; }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.35rem); letter-spacing: -.005em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }
cite { font-style: italic; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--narrow); margin-left: auto; margin-right: auto; }
.center { text-align: center; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: #fff; color: var(--plum-800); padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(30, 16, 41, .94);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(174, 129, 227, .18);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand img { border-radius: 6px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav a { display: block; padding: 8px 12px; color: #e9dff2; text-decoration: none; font-size: .95rem; border-radius: 6px; white-space: nowrap; }
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.site-nav a.nav-cta { background: var(--lavender-400); color: var(--plum-900); font-weight: 600; margin-left: 6px; }
.site-nav a.nav-cta:hover { background: #c3a1ec; color: var(--plum-900); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font: 600 1rem/1 var(--sans); text-decoration: none; text-align: center;
  padding: 15px 26px; border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--purple-600); color: #fff; box-shadow: 0 6px 18px rgba(91, 52, 140, .28); }
.btn-primary:hover { background: var(--purple-500); color: #fff; transform: translateY(-1px); }
.hero .btn-primary { background: var(--lavender-400); color: var(--plum-900); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.hero .btn-primary:hover { background: #c3a1ec; color: var(--plum-900); }
.btn-disabled { background: transparent; color: var(--ink-soft); border-color: var(--line); cursor: default; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #efe6f6;
  background:
    radial-gradient(1000px 520px at 85% 15%, rgba(174, 129, 227, .22), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(191, 129, 158, .18), transparent 60%),
    linear-gradient(160deg, var(--plum-900) 0%, var(--plum-800) 55%, var(--plum-700) 100%);
  padding: 72px 0 84px;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; font-weight: 600; color: var(--lavender-400); margin-bottom: 18px; }
.hero-title { font-size: clamp(2.9rem, 1.6rem + 5vw, 5.2rem); color: #fff; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .2em; line-height: 1.02; }
.hero-subtitle { font-family: var(--serif); font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem); line-height: 1.35; color: #e6d8f3; margin-bottom: .7em; max-width: 30ch; }
.hero-author { font-size: 1.05rem; letter-spacing: .04em; color: var(--mauve-400); font-weight: 600; margin-bottom: 1.6em; }
.hero-hook { font-size: 1.12rem; color: #d9cde4; max-width: 56ch; margin-bottom: 2em; }
.hero-hook em { color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.release-note { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: #fff; }
.release-note .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mauve-400); box-shadow: 0 0 0 4px rgba(191,129,158,.25); }
.hero-cover { justify-self: center; width: 100%; max-width: 380px; }
.hero-cover img {
  width: 100%; border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,.25), 0 24px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
  transform: perspective(1400px) rotateY(-6deg);
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-tint { background: var(--lavender-100); }
.section-kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .8rem; font-weight: 700; color: var(--purple-600); margin-bottom: 12px; }
.lead { font-size: 1.18rem; color: var(--ink-soft); }

.blurb { font-family: var(--serif); font-size: 1.16rem; line-height: 1.75; color: var(--ink); }
.blurb p:first-child::first-letter { float: left; font-size: 3.4em; line-height: .9; padding: 6px 10px 0 0; color: var(--purple-600); font-weight: 700; }

/* Issues */
.issues { list-style: none; padding: 0; margin: 44px 0 56px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: none; }
.issues li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px 20px; position: relative; box-shadow: 0 1px 2px rgba(42,24,56,.04); }
.issues li::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, var(--purple-600), var(--mauve-400)); }
.issue-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lavender-100); color: var(--purple-600); font: 700 1rem/1 var(--serif); margin-bottom: 14px; }
.issues h3 { font-size: 1.15rem; margin-bottom: .45em; }
.issues p { font-size: .98rem; color: var(--ink-soft); margin: 0; line-height: 1.6; }

.book-figure { margin: 0 auto; max-width: 980px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 22px; box-shadow: 0 12px 36px rgba(42, 24, 56, .08); }
.book-figure img { width: 100%; border-radius: 6px; }
.book-figure figcaption { margin-top: 16px; font-size: .97rem; color: var(--ink-soft); line-height: 1.6; padding: 0 6px; }
.fig-label { display: block; text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 700; color: var(--purple-600); margin-bottom: 6px; }
.book-figure figcaption strong { color: var(--ink); font-family: var(--serif); font-size: 1.05rem; }

/* Why */
.prose p { font-family: var(--serif); font-size: 1.14rem; line-height: 1.8; }
.pullquote { margin: 34px 0; padding: 6px 0 6px 26px; border-left: 4px solid var(--mauve-400); }
.pullquote p { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem); line-height: 1.45; color: var(--plum-700); font-style: italic; margin: 0; }
.signature { font-style: italic; color: var(--ink-soft); text-align: right; }

/* Author */
.section-dark { background: linear-gradient(160deg, var(--plum-800), var(--plum-900)); color: #ddd2e7; }
.section-dark h2 { color: #fff; }
.section-dark .section-kicker { color: var(--lavender-400); }
.author-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 40px; align-items: start; }
.author-mark { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, var(--purple-500), var(--plum-700)); border: 3px solid rgba(174,129,227,.45); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.author-mark span { font: 700 3rem/1 var(--serif); color: #fff; letter-spacing: .04em; }

/* Formats */
.formats { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: center; gap: 24px; margin-top: 32px; }
.format-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; text-align: center; box-shadow: 0 8px 28px rgba(42, 24, 56, .07); display: flex; flex-direction: column; align-items: center; }
.format-card h3 { font-size: 1.45rem; margin-bottom: .3em; }
.format-card p { color: var(--ink-soft); }
.format-card .btn { margin-top: auto; }
.format-status { display: inline-block; font-size: .78rem !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; margin-bottom: 14px !important; }
.status-live { background: #e7f4ec; color: #1e6b3d !important; }
.status-soon { background: var(--mauve-100); color: #8a3f62 !important; }

/* Signup */
.signup { display: flex; gap: 10px; max-width: 520px; margin: 26px auto 10px; }
.signup input { flex: 1; min-width: 0; font: inherit; padding: 13px 18px; border-radius: 999px; border: 1.5px solid #cbbcd8; background: #fff; color: var(--ink); }
.signup input:focus { outline: none; border-color: var(--purple-600); box-shadow: 0 0 0 4px rgba(116, 68, 176, .18); }
.form-note { font-size: .9rem; color: var(--ink-soft); }

/* Footer */
.site-footer { background: var(--plum-900); color: #b9aac6; font-size: .92rem; padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.site-footer p { margin: 0; }
.site-footer a { color: #d9c6ee; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .issues { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .site-header { position: relative; }
  .header-inner { flex-direction: column; align-items: center; gap: 4px; min-height: 0; padding-top: 12px; padding-bottom: 10px; }
  .site-nav ul { flex-wrap: wrap; justify-content: center; gap: 2px 2px; }
  .site-nav a { padding: 6px 10px; font-size: .92rem; }
  .site-nav a.nav-cta { margin-left: 2px; }
  html { scroll-padding-top: 12px; }

  .hero { padding: 44px 0 60px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .hero-cover { order: -1; max-width: 270px; }
  .hero-cover img { transform: none; }
  .hero-subtitle, .hero-hook { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; flex-direction: column; }
  .section { padding: 64px 0; }
  .author-wrap { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .author-mark { margin: 0 auto; width: 120px; height: 120px; }
  .author-mark span { font-size: 2.4rem; }
  .formats { grid-template-columns: minmax(0, 420px); }
}
@media (max-width: 560px) {
  .container { padding: 0 20px; }
  body { font-size: 1rem; }
  .issues { grid-template-columns: 1fr; margin: 32px 0 40px; }
  .blurb, .prose p { font-size: 1.08rem; }
  .book-figure { padding: 10px 10px 16px; margin: 0 -8px; }
  .signup { flex-direction: column; }
  .signup .btn { width: 100%; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* Wide figures (detailed diagrams/charts) */
.book-figure-wide { max-width: 100%; margin: 40px 0 0; }
.book-figure + .issues, .book-figure-wide + .issues { margin-top: 48px; }
.book-figure a.zoom { display: block; cursor: zoom-in; border-radius: 6px; }
.zoom-hint { display: block; margin-top: 8px; font-size: .82rem; color: #7a6f84; }
.trend { margin-top: 72px; padding-top: 56px; border-top: 1px solid #d9cce4; }
.sub-heading { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.8rem); margin-bottom: .5em; }
.trend .book-figure-wide { margin-top: 28px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(20, 10, 28, .92); display: flex; align-items: center; justify-content: center; padding: 56px 16px 16px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.5); cursor: default; }
.lightbox-close { position: absolute; top: 10px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: rgba(255,255,255,.26); }
body.no-scroll { overflow: hidden; }
@media (max-width: 560px) {
  .book-figure-wide { margin-left: -8px; margin-right: -8px; }
  .trend { margin-top: 52px; padding-top: 40px; }
}

/* Figure credit line */
.fig-credit { display: block; margin-top: 8px; font-size: .85rem; color: var(--ink-soft); font-style: italic; }

/* Signup / form notes */
.form-note.is-success, .form-status.is-success { color: #1e6b3d; }
.form-note.is-error, .form-status.is-error { color: #a1263f; }
.contact-link { margin-top: 18px; font-size: .95rem; color: var(--ink-soft); }
.footer-links a + a { margin-left: 18px; }
.site-nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }

/* Contact page */
.page-hero {
  color: #efe6f6; padding: 64px 0 56px;
  background:
    radial-gradient(900px 420px at 85% 10%, rgba(174, 129, 227, .22), transparent 60%),
    linear-gradient(160deg, var(--plum-900) 0%, var(--plum-800) 60%, var(--plum-700) 100%);
}
.page-hero h1 { color: #fff; font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.1rem); margin-bottom: .35em; }
.page-hero-lead { font-size: 1.12rem; color: #d9cde4; margin: 0; max-width: 60ch; }
.contact-section { padding-top: 56px; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 34px 34px 28px; box-shadow: 0 12px 36px rgba(42, 24, 56, .08); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; color: var(--plum-800); }
.field .req { color: #a1263f; }
.field .optional { font-weight: 400; color: var(--ink-soft); font-size: .88rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  padding: 12px 14px; border: 1.5px solid #cbbcd8; border-radius: 8px;
}
.field textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--purple-600) 50%), linear-gradient(135deg, var(--purple-600) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--purple-600); box-shadow: 0 0 0 4px rgba(116, 68, 176, .18); }
.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.form-actions .btn:disabled { opacity: .6; cursor: progress; }
.form-hint { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.form-status { margin: 18px 0 0; padding: 12px 16px; border-radius: 8px; background: var(--lavender-100); color: var(--plum-800); font-size: .97rem; }
.form-status.is-success { background: #e7f4ec; }
.form-status.is-error { background: #fbeaee; }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-aside { text-align: center; margin-top: 28px; color: var(--ink-soft); }
@media (max-width: 860px) {
  .page-hero { padding: 44px 0 40px; text-align: center; }
  .page-hero-lead { margin: 0 auto; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .contact-card { padding: 24px 20px 20px; }
  .form-actions .btn { width: 100%; }
}
