/* Tokens from docs/brief.md, section 3.4 */
:root {
  --paper: #F5F1EA;
  --ink: #1E2427;
  --muted: #5C6468;
  --rule: #D8D0C4;
  --teal: #2E5B5C;
  --gears-rose: #B8434F;
  --gears-forest: #2F4A3A;
  --wards-slate: #2B3238;
  --wards-silver: #AEB6BC;
  --convent-gold: #B88A3E;   /* decorative only: fails contrast as text */
  --convent-stone: #3A2E26;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--body);
}
a { color: var(--teal); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }


/* Header and wordmark */
header.site { border-bottom: 1px solid var(--rule); }
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px;
}
.wordmark {
  font: 600 22px/1 var(--display);
  letter-spacing: .32em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  padding-right: .32em; /* balance trailing letter-space */
}
nav.main ul { list-style: none; margin: 0; padding: 0; display: none; gap: 28px; }
nav.main a { color: var(--ink); text-decoration: none; font-size: 17px; }
nav.main a:hover { color: var(--teal); text-decoration: underline; }
.menu-btn {
  font: 600 15px/1 var(--body); color: var(--ink);
  background: none; border: 1px solid var(--ink); border-radius: 4px;
  padding: 10px 14px; min-height: 44px; cursor: pointer;
}
nav.main.open ul {
  display: flex; flex-direction: column; gap: 0;
  position: absolute; left: 0; right: 0; top: 64px;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  padding: 8px 16px 16px; z-index: 5;
}
nav.main.open a { display: block; padding: 12px 0; }
header.site { position: relative; }

/* Campaign slot: hidden today (brief 3.6) */
.campaign[hidden] { display: none; }

/* Hero */
.hero { text-align: center; padding-top: 48px; padding-bottom: 32px; }
.hero h1 {
  font: 600 clamp(32px, 7vw, 56px)/1.12 var(--display);
  margin: 0 auto 16px; max-width: 18ch;
}
.hero p {
  margin: 0; font: 600 15px/1 var(--display);
  letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
  /* One row: rule, words, rule. The rules shrink on narrow phones instead of wrapping. */
  display: flex; align-items: center; justify-content: center; gap: 12px;
  white-space: nowrap;
}
.hero p::before, .hero p::after {
  content: ""; flex: 0 1 32px; min-width: 8px; height: 1px;
  background: var(--rule);
}
/* Smallest phones (320 px): keep the wordmark and subtitle on one line */
@media (max-width: 359px) {
  .wordmark { font-size: 18px; letter-spacing: .24em; white-space: nowrap; }
  .hero p { letter-spacing: .2em; font-size: 14px; }
}

/* Doors */
.doors { display: grid; gap: 24px; padding-bottom: 56px; }
.door {
  background: #fff; border: 1px solid var(--rule); border-radius: 6px;
  overflow: hidden; display: flex; flex-direction: column;
  border-top: 6px solid var(--accent-band);
  transition: transform .2s ease, box-shadow .2s ease;
}
.door:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(30,36,39,.12); }
.door.gears   { --accent-band: var(--gears-forest);  --accent-text: var(--gears-rose);   --btn: var(--gears-rose); }
.door.wards   { --accent-band: var(--wards-silver);  --accent-text: var(--wards-slate);  --btn: var(--wards-slate); }
.door.convent { --accent-band: var(--convent-gold);  --accent-text: var(--convent-stone); --btn: var(--convent-stone); }
.door .cover { display: block; padding: 20px 20px 0; }
.door img {
  display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto;
  aspect-ratio: 1707 / 2560; border-radius: 2px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.door .body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.door .genre {
  margin: 0 0 6px; color: var(--accent-text);
  font: 600 14px/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase;
}
.door h2 { font: 600 28px/1.15 var(--display); margin: 0 0 12px; }
.door .hook { margin: 0 0 16px; font-style: italic; }
.door .note {
  margin: 0 0 20px; padding: 10px 12px; font-size: 16px; line-height: 1.5;
  background: var(--paper); border-left: 3px solid var(--accent-band);
}
.door .note strong { display: block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.door .actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border-radius: 4px;
  font: 600 16px/1.2 var(--body); text-decoration: none;
}
.btn.buy { background: var(--btn); color: #fff; }
.btn.more { color: var(--ink); border: 1px solid var(--ink); }
.btn:hover { filter: brightness(1.12); text-decoration: underline; }

/* Newsletter placeholder */
.newsletter { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 48px 0; }
.newsletter .inner { max-width: 620px; margin: 0 auto; }
.newsletter h2 { font: 600 30px/1.2 var(--display); margin: 0 0 16px; }
.newsletter fieldset { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.newsletter legend, .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.newsletter label.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.newsletter input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--teal); }
.newsletter .row { display: flex; flex-wrap: wrap; gap: 12px; }
.newsletter input[type=email] {
  flex: 1 1 220px; min-height: 44px; padding: 10px 12px;
  font: 16px var(--body); border: 1px solid var(--muted); border-radius: 4px; background: #fff;
}
.newsletter button {
  min-height: 44px; padding: 10px 18px; border: 0; border-radius: 4px;
  background: var(--teal); color: #fff; font: 600 16px var(--body); opacity: .55; cursor: not-allowed;
}
.placeholder-note { font: 14px/1.4 system-ui, sans-serif; color: #4a3d00; margin: 12px 0 0; }

/* About, short */
.about-short { padding-top: 48px; padding-bottom: 48px; }
.about-short .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 20px; align-items: center; }
.about-short img { width: 96px; height: 96px; object-fit: cover; object-position: 50% 25%; border-radius: 50%; flex: none; }
.about-short p { margin: 0 0 6px; }

/* Footer */
footer.site { border-top: 1px solid var(--rule); padding: 32px 0 40px; text-align: center; }
footer.site .wordmark { font-size: 18px; }
footer.site ul { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
footer.site a { display: inline-block; padding: 8px 0; }
footer.site small { color: var(--muted); font-size: 15px; }

/* Computer width: doors side by side (brief section 5) */
@media (min-width: 900px) {
  .menu-btn { display: none; }
  nav.main ul { display: flex; }
  .doors { grid-template-columns: repeat(3, 1fr); }
  .hero { padding-top: 72px; padding-bottom: 48px; }
  .wordmark { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .door, .door:hover { transition: none; transform: none; }
}
/* Page heading (Books) */
.page-head { padding-top: 40px; padding-bottom: 24px; }
.page-head h1 { font: 600 clamp(34px, 6vw, 48px)/1.1 var(--display); margin: 0; }

/* Book page (brief section 5) */
main.book.gears   { --accent-band: var(--gears-forest);  --accent-text: var(--gears-rose);   --btn: var(--gears-rose); }
main.book.wards   { --accent-band: var(--wards-silver);  --accent-text: var(--wards-slate);  --btn: var(--wards-slate); }
main.book.convent { --accent-band: var(--convent-gold);  --accent-text: var(--convent-stone); --btn: var(--convent-stone); }
.book-hero { display: grid; gap: 28px; padding-top: 32px; padding-bottom: 48px; }
.book-cover img {
  display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto;
  border-radius: 2px; box-shadow: 0 6px 20px rgba(0,0,0,.28);
  border-top: 6px solid var(--accent-band);
}
.book-info .genre {
  margin: 0 0 6px; color: var(--accent-text);
  font: 600 14px/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase;
}
.book-info h1 { font: 600 clamp(34px, 6vw, 52px)/1.08 var(--display); margin: 0 0 14px; }
.book-info .hook { font-style: italic; font-size: 20px; margin: 0 0 20px; }
.book-info .note {
  margin: 0 0 28px; padding: 12px 14px; font-size: 16px; line-height: 1.5;
  background: #fff; border-left: 3px solid var(--accent-band);
}
.book-info .note strong { display: block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.book-info .note p { margin: 0 0 6px; }
.book-info .note p:last-child { margin: 0; }
.desc { max-width: 62ch; margin-bottom: 28px; }
.desc p { margin: 0 0 1em; }
.feature-list { list-style: none; padding: 0; margin: 0 0 1em; }
.feature-list li { margin: 0 0 4px; }
.book-info .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn.buy-alt { color: var(--btn); border: 2px solid var(--btn); }
.others { border-top: 1px solid var(--rule); padding-top: 40px; padding-bottom: 56px; }
.others h2 { font: 600 30px/1.2 var(--display); margin: 0 0 24px; }

/* About page */
.about-page { display: grid; gap: 28px; padding-top: 40px; padding-bottom: 56px; max-width: 980px; }
.about-page img { width: 100%; max-width: 320px; height: auto; border-radius: 4px; margin: 0 auto; display: block; }
.about-page h1 { font: 600 clamp(34px, 6vw, 48px)/1.1 var(--display); margin: 0 0 20px; }
.about-page p { margin: 0 0 1em; max-width: 60ch; }

nav.main a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

@media (min-width: 900px) {
  .book-hero { grid-template-columns: 320px 1fr; align-items: start; gap: 48px; padding-top: 56px; }
  .book-cover { position: sticky; top: 24px; }
  .doors.two { grid-template-columns: repeat(2, 1fr); }
  .about-page { grid-template-columns: 320px 1fr; align-items: start; gap: 48px; }
}
