/* =====================================================================
   Growing Brave Press — main stylesheet
   Tokens, type, and layout for a single-page imprint site.
   Reading-column width: 640px. Mobile-first, ~15% bump at ≥768px.
   ===================================================================== */

/* ---------- Self-hosted fonts ---------- */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191,
                 U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191,
                 U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-variable.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191,
                 U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  /* Core */
  --gbp-ink: #2C2A29;
  --gbp-paper: #FAF7F2;
  --gbp-stone: #6F6A65;

  /* Accents */
  --gbp-sage: #8FA68E;
  --gbp-rust: #B8654A;
  --gbp-cream: #F0E9DD;

  /* Functional */
  --gbp-border: #E5DFD3;
  --gbp-link-hover: #5D7159;

  /* Typography */
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --reading-width: 640px;
  --page-padding: 24px;
  --section-gap: 64px;

  /* Header height (used for scroll-padding so anchors don't tuck under the sticky header) */
  --header-h: 64px;
}

@media (min-width: 768px) {
  :root {
    --page-padding: 40px;
    --section-gap: 96px;
    --header-h: 72px;
  }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--gbp-paper);
  color: var(--gbp-ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
  body { font-size: 17px; }
}

img, svg { display: block; max-width: 100%; height: auto; }

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--gbp-sage);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
a:hover, a:focus-visible { color: var(--gbp-link-hover); }

:focus-visible {
  outline: 2px solid var(--gbp-sage);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Skip link (overrides critical CSS once main.css loads) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gbp-ink);
  color: var(--gbp-paper);
  padding: 0.6rem 1rem;
  text-decoration: none;
  font-weight: 500;
  border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; z-index: 1000; }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--gbp-paper);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.is-scrolled { border-bottom-color: var(--gbp-border); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gbp-ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand .sapling { color: var(--gbp-sage); flex: none; }
.brand:hover, .brand:focus-visible { color: var(--gbp-ink); }
.wordmark { white-space: nowrap; }

@media (min-width: 768px) {
  .brand { font-size: 22px; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}
.site-nav a {
  color: var(--gbp-ink);
  text-decoration: none;
  padding: 4px 2px;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--gbp-link-hover); }

@media (min-width: 768px) {
  .site-nav { gap: 28px; font-size: 15px; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: 80px 0 32px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 7vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--gbp-ink);
  margin: 0 0 24px;
  text-wrap: balance;
}
.hero-sub {
  color: var(--gbp-stone);
  font-size: 17px;
  max-width: 56ch;
}
@media (min-width: 768px) {
  .hero { padding: 120px 0 64px; }
  .hero-sub { font-size: 18px; }
}

/* ---------- Section rhythm ---------- */
section + section {
  padding-top: var(--section-gap);
}
section { padding-bottom: 0; }
main > section:last-of-type { padding-bottom: var(--section-gap); }

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0.005em;
  color: var(--gbp-ink);
  margin: 0 0 24px;
}
@media (min-width: 768px) {
  h2 { font-size: 28px; margin-bottom: 32px; }
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  margin: 0 0 12px;
  color: var(--gbp-ink);
}
@media (min-width: 768px) {
  h3 { font-size: 18px; }
}

strong { font-weight: 600; }
em { font-style: italic; }

/* ---------- About / founder / contact (text-only sections) ---------- */
.about p,
.founder p,
.contact p { max-width: 60ch; }

.contact-note { color: var(--gbp-stone); font-size: 14px; }
.founder-link { margin-top: 20px; font-size: 15px; }

/* ---------- Book section ---------- */
.book-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 48px;
}

@media (min-width: 640px) {
  .book-grid {
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: start;
  }
}

.book-cover { margin: 0; }

.book-cover-placeholder {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  background: var(--gbp-cream);
  border: 1px solid var(--gbp-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-family: var(--serif);
  color: var(--gbp-stone);
}
.book-cover-placeholder .cover-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--gbp-ink);
  margin-bottom: 8px;
  line-height: 1.2;
}
.book-cover-placeholder .cover-meta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gbp-stone);
}

.book-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--gbp-ink);
}
@media (min-width: 768px) {
  .book-title { font-size: 30px; }
}

.book-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--gbp-stone);
  margin: 0 0 20px;
}

.book-spec {
  font-size: 14px;
  color: var(--gbp-stone);
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 4px;
}
.book-spec dt {
  font-weight: 500;
  color: var(--gbp-ink);
}
.book-spec dd { margin: 0; }

.book-blurb { max-width: 56ch; }

/* ---------- CTA / signup form ---------- */
.book-cta {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--gbp-border);
}
.cta-heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 8px;
}
.cta-lede {
  color: var(--gbp-stone);
  font-size: 15px;
  max-width: 56ch;
  margin-bottom: 20px;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
}
.signup-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gbp-stone);
  letter-spacing: 0.02em;
}
.signup-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 480px) {
  .signup-row { flex-direction: row; }
}

.signup-form input[type="email"] {
  flex: 1;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  background: var(--gbp-paper);
  color: var(--gbp-ink);
  border: 1px solid var(--gbp-border);
  border-radius: 4px;
  min-width: 0;
}
.signup-form input[type="email"]::placeholder { color: var(--gbp-stone); opacity: 0.7; }
.signup-form input[type="email"]:focus-visible {
  border-color: var(--gbp-sage);
  outline: 2px solid var(--gbp-sage);
  outline-offset: 1px;
}

.btn-primary {
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 20px;
  background: var(--gbp-rust);
  color: var(--gbp-paper);
  border: 1px solid var(--gbp-rust);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease;
}
.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled) {
  background: #A05439;
  border-color: #A05439;
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.signup-status {
  font-size: 14px;
  margin: 0;
  min-height: 1.4em;
  color: var(--gbp-stone);
}
.signup-status.ok    { color: var(--gbp-link-hover); }
.signup-status.error { color: var(--gbp-rust); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--section-gap);
  padding: 32px 0 48px;
  background: var(--gbp-cream);
  border-top: 1px solid var(--gbp-border);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.site-footer p {
  font-size: 13px;
  color: var(--gbp-stone);
  margin: 0;
}
.footer-sapling { color: var(--gbp-sage); }
