:root {
  --ink: #221f1a;          /* warm near-black */
  --ink-soft: #4c473d;
  --paper: #f5efe2;        /* cream page */
  --paper-2: #efe7d5;      /* deeper band */
  --paper-dark: #1d1b17;   /* endpaper / dramatic bands */
  --red: #c0271c;          /* brand red, print-deepened */
  --gray: #6f675a;
  --rule: #ddd2bb;         /* warm rule lines */
  --max: 1080px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Archivo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.66;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* faint paper grain */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(0,0,0,.015) 0, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(0,0,0,.015) 0, transparent 45%);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---------- Shared headings ---------- */
.section-h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(27px, 3.5vw, 39px);
  letter-spacing: -0.005em;
  line-height: 1.12;
  margin: 0 0 26px;
}
.section-lede {
  font-size: 20px; color: var(--ink-soft); font-style: italic;
  max-width: 42em; margin: -10px 0 36px;
}
.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase; letter-spacing: .22em; font-size: 12px;
  font-weight: 700; color: var(--red); margin: 0 0 16px;
}

/* ---------- Buttons ---------- */
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; font-family: var(--sans);
  padding: 13px 28px; border-radius: 2px;
  font-weight: 700; text-decoration: none; font-size: 14px;
  letter-spacing: .03em; text-transform: uppercase;
  transition: transform .06s ease, background .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 9px 18px; font-size: 12px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #9f2017; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); padding: 11.5px 26px; }
.btn-ghost.btn-sm { padding: 7.5px 16px; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- Sticky topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,239,226,.93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand {
  font-family: var(--sans); font-weight: 900; letter-spacing: .02em;
  font-size: 17px; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand-code { position: relative; }
.brand-code::after {
  content: ""; position: absolute; left: -3%; right: -3%; top: 52%;
  height: 2px; background: var(--red); transform: rotate(-4deg);
}

/* ---------- Hero ---------- */
.hero {
  padding: 70px 0 86px;
  border-bottom: 1px solid var(--rule);
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.02) 100%);
}
.hero-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: 64px; align-items: center; }
.hero-h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(32px, 4.8vw, 58px);
  line-height: 1.07; letter-spacing: -0.015em;
  margin: 0 0 24px; overflow-wrap: break-word;
}
.hero-sub { font-size: 20px; max-width: 30em; margin: 0 0 30px; color: var(--ink-soft); }
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-sub::first-letter {
  initial-letter: 2;
  -webkit-initial-letter: 2;
  font-weight: 700; color: var(--red); margin-right: .06em;
}
.hero-meta {
  margin: 28px 0 0; font-family: var(--sans); font-size: 12px; color: var(--gray);
  font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- 3D book (centered cuboid faces) ---------- */
.book-stage { perspective: 2200px; display: flex; justify-content: center; position: relative; }
.book {
  --w: 310px; --h: 462px; --t: 40px;
  position: relative; width: var(--w); height: var(--h);
  transform-style: preserve-3d;
  transform: rotateY(-25deg);
  transition: transform .7s cubic-bezier(.2,.7,.2,1);
}
.book--sm { --w: 208px; --h: 312px; --t: 30px; }
.book-stage:hover .book { transform: rotateY(-14deg); }
.book > * { position: absolute; }

/* front cover */
.book__cover {
  inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
  transform: translateZ(calc(var(--t) / 2));
  border-radius: 1px 3px 3px 1px;
}
/* binding shadow down the spine edge of the cover */
.book__cover { box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
/* lighting: soft diagonal sheen + a darkened binding edge, laid over the cover */
.book::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  transform: translateZ(calc(var(--t) / 2 + 0.4px));
  border-radius: 1px 3px 3px 1px;
  background:
    linear-gradient(100deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 20%, rgba(0,0,0,0) 70%, rgba(0,0,0,.18) 100%),
    linear-gradient(90deg, rgba(0,0,0,.34) 0, rgba(0,0,0,0) 7%);
}
/* back cover */
.book__back {
  inset: 0;
  transform: translateZ(calc(var(--t) / -2)) rotateY(180deg);
  background: #101d36;
  border-radius: 3px 1px 1px 3px;
}
/* fore-edge: the cut page block on the right (inset so the cover boards overhang) */
.book__pages {
  top: 4px; right: 0; width: var(--t); height: calc(100% - 8px);
  transform-origin: center;
  transform: translateX(calc(var(--t) / 2 - 1.5px)) rotateY(90deg);
  background: repeating-linear-gradient(
    to right, #c4b693 0, #c4b693 .5px, #f5eedb .5px, #f5eedb 2.5px);
  box-shadow: inset 0 7px 9px -7px rgba(0,0,0,.55), inset 0 -7px 9px -7px rgba(0,0,0,.55);
}
/* spine on the left (binding) */
.book__spine {
  top: 0; left: 0; width: var(--t); height: 100%;
  transform-origin: center;
  transform: translateX(calc(var(--t) / -2)) rotateY(-90deg);
  background: linear-gradient(90deg, #24375c 0%, #16264a 45%, #0c1730 100%);
}
/* soft ground shadow */
.book-stage::after {
  content: ""; position: absolute; z-index: -1;
  left: 12%; right: 10%; bottom: -32px; height: 36px;
  background: rgba(20,15,8,.32);
  filter: blur(24px); border-radius: 50%;
}

/* ---------- Who (band) ---------- */
.who { background: var(--paper-2); padding: 76px 0; border-block: 1px solid var(--rule); }
.persona-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.persona {
  background: var(--paper); border: 1px solid var(--rule);
  border-top: 3px solid var(--red); border-radius: 3px; padding: 26px 26px;
}
.persona-tag {
  display: block; font-family: var(--serif); font-weight: 700;
  font-size: 19px; margin-bottom: 10px;
}
.persona p { margin: 0; color: var(--ink-soft); font-size: 17px; }

/* ---------- Excerpt (endpaper / dramatic) ---------- */
.excerpt {
  background: var(--paper-dark); color: #efe7d5; padding: 96px 0;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.04), transparent 60%);
}
.excerpt-in { max-width: 820px; text-align: center; margin: 0 auto; }
.excerpt blockquote { margin: 0; }
.excerpt blockquote p {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(23px, 3.1vw, 33px); line-height: 1.5; margin: 0;
  text-wrap: balance;
}
.excerpt .q-end { font-style: normal; font-weight: 600; color: #fff; }
.excerpt cite {
  display: block; margin-top: 28px; font-style: normal; font-family: var(--sans);
  color: #b6a98e; font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
}

/* ---------- Learn ---------- */
.learn { padding: 80px 0; }
.learn-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 44px;
}
.learn-list li { position: relative; padding-left: 40px; font-size: 18.5px; line-height: 1.45; }
.learn-list li::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--red);
}
.learn-list li::after {
  content: "\2713"; position: absolute; left: 0; top: 3px;
  width: 24px; height: 24px; line-height: 24px; text-align: center;
  color: #fff; font-size: 13px; font-weight: 700; font-family: var(--sans);
}

/* ---------- Engineers (band) ---------- */
.engineers { background: var(--paper-2); padding: 82px 0; border-block: 1px solid var(--rule); }
.eng-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 30px 18px;
}
.eng-grid li { text-align: center; }
.eng-grid img {
  width: 100%; max-width: 128px; height: auto; aspect-ratio: 1;
  border-radius: 50%; object-fit: cover;
  background: #ddd; display: block; margin: 0 auto 11px;
  border: 1px solid var(--rule);
  box-shadow: 0 5px 14px rgba(30,22,10,.16);
  filter: sepia(14%);
}
.eng-name { display: block; font-family: var(--serif); font-weight: 700; font-size: 15px; line-height: 1.18; }
.eng-theme {
  display: block; font-family: var(--sans); font-size: 11px; color: var(--red);
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px;
}

/* ---------- Table of contents ---------- */
.toc { padding: 82px 0; }
.toc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.toc-part h3 {
  font-family: var(--serif); font-weight: 700; font-size: 18px; font-style: italic;
  margin: 0 0 14px; padding-bottom: 11px; border-bottom: 1px solid var(--red);
}
.toc-part ol { margin: 0; padding-left: 1.4em; }
.toc-part li { margin: 9px 0; font-size: 17px; }
.toc-part li::marker { color: var(--red); font-family: var(--sans); font-size: 13px; }

/* ---------- Buy (endpaper) ---------- */
.buy { background: var(--paper-dark); color: #efe7d5; padding: 88px 0; }
.buy .section-h2 { color: #fff; }
.buy-in { display: flex; align-items: center; gap: 64px; justify-content: center; }
.buy-cover { flex-shrink: 0; }
.buy-sub { color: #c3b79c; font-style: italic; margin: 0 0 26px; font-size: 19px; }
.note { margin-top: 22px; color: #8c8270; font-size: 14px; font-style: italic; }

/* ---------- Author (band) ---------- */
.author { background: var(--paper-2); padding: 80px 0; border-top: 1px solid var(--rule); }
.author-grid { display: grid; grid-template-columns: 190px 1fr; gap: 44px; align-items: center; }
.author-photo {
  width: 190px; height: 190px; object-fit: cover; border-radius: 50%;
  filter: grayscale(100%) sepia(18%);
  border: 3px solid var(--paper); box-shadow: 0 6px 18px rgba(30,22,10,.2);
}
.author p { font-size: 18.5px; margin: 0; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { padding: 34px 0; color: var(--gray); font-size: 14px; border-top: 1px solid var(--rule); }
.footer-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-nav a { color: var(--gray); text-decoration: none; font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.footer-nav a:hover { color: var(--ink); }

/* ---------- FAQ page ---------- */
.faq-page { padding: 60px 0 80px; }
.faq-wrap { max-width: 720px; }
.faq-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(31px, 4.4vw, 47px); letter-spacing: -0.01em; margin: 8px 0 20px;
}
.faq-intro { font-size: 20px; color: var(--ink-soft); font-style: italic; margin: 0 0 42px; }
.faq-item { padding: 26px 0; border-top: 1px solid var(--rule); }
.faq-item:first-child { border-top: 2px solid var(--red); }
.faq-item h2 { font-family: var(--serif); font-weight: 700; font-size: 22px; margin: 0 0 10px; }
.faq-item p { margin: 0; font-size: 17.5px; color: var(--ink-soft); }
.faq-back { margin-top: 44px; }
.faq-back a { color: var(--red); font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
.faq-back a:hover { text-decoration: underline; }

/* ---------- Quiz CTA band (home) ---------- */
.quiz-cta { background: var(--paper-dark); color: #efe7d5; padding: 60px 0; text-align: center; }
.quiz-cta .eyebrow { color: #d98a82; }
.quiz-cta h2 {
  font-family: var(--serif); font-weight: 600; color: #fff;
  font-size: clamp(24px, 3.2vw, 34px); margin: 0 0 12px; letter-spacing: -0.01em;
}
.quiz-cta p { color: #c3b79c; font-style: italic; max-width: 34em; margin: 0 auto 26px; font-size: 18px; }
.quiz-cta .btn-ghost { color: #fff; border-color: #fff; }
.quiz-cta .btn-ghost:hover { background: #fff; color: var(--ink); }

/* ---------- Quiz page ---------- */
.quiz-page { padding: 56px 0 84px; }
.quiz-wrap { max-width: 680px; }
.quiz-card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  padding: 40px clamp(22px, 5vw, 48px); box-shadow: 0 1px 3px rgba(30,22,10,.05);
}
.quiz-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(28px, 4.2vw, 44px); letter-spacing: -0.01em; line-height: 1.1; margin: 8px 0 18px;
}
.quiz-lede { font-size: 19px; color: var(--ink-soft); margin: 0 0 30px; }
.quiz-meta {
  margin: 18px 0 0; font-family: var(--sans); font-size: 12px; color: var(--gray);
  letter-spacing: .08em; text-transform: uppercase;
}

/* intro honesty note */
.quiz-note {
  background: var(--paper-2); border-left: 3px solid var(--red);
  padding: 16px 18px; border-radius: 0 3px 3px 0; margin: 0 0 28px;
  font-size: 16.5px; color: var(--ink); line-height: 1.5;
}
.quiz-note strong { display: block; margin-bottom: 4px; }

/* heading receives focus programmatically (screen readers); suppress outline */
.quiz-band:focus { outline: none; }

/* assessment form */
.quiz-form {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  padding: 30px clamp(20px, 4vw, 42px) 36px;
}
.quiz-form-reminder { margin: 0 0 8px; font-style: italic; color: var(--ink-soft); font-size: 16px; }
.quiz-part-head {
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red); margin: 40px 0 4px;
}
.quiz-part-head:first-child { margin-top: 22px; }
.quiz-part-head span { color: var(--gray); }

.quiz-item { border: 0; margin: 0; padding: 22px 0; border-top: 1px solid var(--rule); }
.quiz-item__stem {
  display: block; width: 100%; padding: 0; margin: 0 0 14px;
  font-family: var(--serif); font-weight: 600; font-size: 18.5px; line-height: 1.35; color: var(--ink);
}
.quiz-item.is-missing .quiz-item__stem { color: var(--red); }
.quiz-item.is-missing .quiz-scale__opt span { border-color: #e3b4ae; }

.quiz-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.quiz-scale__opt { position: relative; display: flex; }
.quiz-scale__opt input {
  position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer;
}
.quiz-scale__opt span {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 6px 4px; cursor: pointer;
  border: 1.5px solid var(--rule); border-radius: 4px; background: var(--paper-2);
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft); line-height: 1.2;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.quiz-scale__opt:hover span { border-color: var(--red); }
.quiz-scale__opt input:checked + span { border-color: var(--red); background: var(--red); color: #fff; font-weight: 700; }
.quiz-scale__opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.quiz-error { margin: 18px 0 0; color: var(--red); font-family: var(--sans); font-weight: 600; font-size: 14px; }
.quiz-submit-row { display: flex; align-items: center; gap: 20px; margin-top: 28px; flex-wrap: wrap; }
.quiz-count { font-family: var(--sans); font-size: 13px; color: var(--gray); letter-spacing: .03em; }

/* results */
.quiz-score { font-family: var(--sans); color: var(--gray); letter-spacing: .04em; }
.quiz-band {
  font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4.6vw, 46px);
  letter-spacing: -0.01em; margin: 4px 0 16px; line-height: 1.08;
}
.quiz-band-desc { font-size: 19px; color: var(--ink-soft); margin: 0 0 30px; }

/* band meter (where you fall, low -> high) */
.quiz-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 26px; padding-bottom: 32px; }
.quiz-meter__seg {
  height: 8px; border-radius: 2px; background: var(--rule); position: relative;
}
.quiz-meter__seg.is-active { background: var(--red); }
.quiz-meter__label {
  position: absolute; top: 14px; left: 0; right: 0; text-align: center;
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase;
  color: var(--gray); line-height: 1.2;
}
.quiz-meter__seg.is-active .quiz-meter__label { color: var(--red); font-weight: 700; }

.quiz-section-head {
  font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink); margin: 44px 0 18px;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}

/* per-area breakdown bars */
.quiz-breakdown { margin: 0 0 8px; }
.quiz-bd__row { margin-bottom: 20px; }
.quiz-bd__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.quiz-bd__name { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.quiz-bd__word {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.quiz-bd__word--strong { color: #2f7d4f; }
.quiz-bd__word--mixed { color: #b07a16; }
.quiz-bd__word--building { color: var(--red); }
.quiz-bd__track { height: 7px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.quiz-bd__fill { height: 100%; background: var(--ink); border-radius: 4px; transition: width .5s ease; }
.quiz-bd__sub { margin: 6px 0 0; font-size: 14px; color: var(--gray); font-style: italic; }

.quiz-focus { list-style: none; margin: 0 0 36px; padding: 0; }
.quiz-focus li { padding: 18px 0; border-top: 1px solid var(--rule); }
.quiz-focus li:first-child { border-top: none; padding-top: 4px; }
.quiz-focus__ch {
  display: inline-block; font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--red);
  vertical-align: middle; margin-right: 12px;
}
.quiz-focus__title { font-family: var(--serif); font-weight: 700; font-size: 20px; }
.quiz-focus__why { margin: 6px 0 0; color: var(--ink-soft); font-size: 16.5px; }
.quiz-focus__tip {
  margin: 10px 0 0; font-size: 16px; color: var(--ink);
  background: var(--paper-2); border-left: 3px solid var(--red);
  padding: 10px 14px; border-radius: 0 3px 3px 0;
}
.quiz-focus__tip strong { font-family: var(--sans); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.quiz-actions { margin-top: 4px; }
.quiz-disclaimer { margin-top: 22px; font-size: 14px; font-style: italic; color: var(--gray); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .eng-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 52px; }
  .hero-cover { order: -1; }
  .book { --w: 250px; --h: 375px; }
  .persona-grid { grid-template-columns: 1fr; }
  .learn-list { grid-template-columns: 1fr; }
  .toc-grid { grid-template-columns: 1fr; gap: 30px; }
  .buy-in { flex-direction: column; text-align: center; gap: 44px; }
  .buy-in .cta-row { justify-content: center; }
  .author-grid { grid-template-columns: 1fr; text-align: center; }
  .author-photo { margin: 0 auto; }
}
@media (max-width: 820px) {
  .quiz-actions { flex-direction: column; align-items: stretch; }
  .quiz-actions .btn { text-align: center; }
}
@media (max-width: 520px) {
  .eng-grid { grid-template-columns: repeat(3, 1fr); gap: 24px 12px; }
  .brand { font-size: 14px; }
  .quiz-meter__label { font-size: 9px; letter-spacing: 0; }
  .quiz-scale { gap: 4px; }
  .quiz-scale__opt span { font-size: 10.5px; padding: 6px 2px; min-height: 48px; }
}
