:root {
  --bg: #faf7f1;
  --bg-alt: #f2ede3;
  --text: #201d1a;
  --muted: #6b6459;
  --accent: #3f4a3d;
  --border: #e3ddd0;
  --header-h: 88px;
  --header-h-mobile: 68px;
  --serif-display: "Playfair Display", Georgia, serif;
  --serif-body: "EB Garamond", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17150f;
    --bg-alt: #201d17;
    --text: #efe9dd;
    --muted: #a79f8f;
    --accent: #a9c0a3;
    --border: #322d24;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif-display);
  font-weight: 600;
  margin: 0 0 0.4em;
  letter-spacing: 0.01em;
}

p { margin: 0 0 1em; }
.muted { color: var(--muted); }

a { color: inherit; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.site-title {
  font-family: var(--serif-display);
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 2rem;
  margin-right: auto;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text);
  position: relative;
  padding-bottom: 4px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.site-nav a:hover::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  gap: 1rem;
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--text);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.social-icon:hover svg { opacity: 1; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 1px;
  background: var(--text);
  width: 100%;
}

/* Hero — fits above the fold, no forced scroll */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1.25rem, 4vw, 3rem);
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  box-shadow: 0 18px 40px -20px rgba(0,0,0,0.35);
}

.hero-text .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--serif-body);
  margin-bottom: 0.75rem;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin-bottom: 0.6em;
}

.hero-text .lede {
  font-size: 1.15rem;
  max-width: 46ch;
}

.hero-text .credit {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1.25rem;
}

.scroll-cue {
  position: absolute;
  bottom: clamp(0.75rem, 3vh, 1.75rem);
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  animation: bob 2.2s ease-in-out infinite;
}

.scroll-cue svg { width: 22px; height: 22px; }

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* Shared section layout */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem);
}

.books { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.books h2, .biography h2, .contact h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  text-align: center;
  margin-bottom: 0.3em;
}

.contact p.muted {
  text-align: center;
}

.biography .lede {
  max-width: 640px;
  margin: 1.5rem auto 0;
}

.book-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.book-card { text-align: center; }

.book-cover {
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 20px 40px -22px rgba(0,0,0,0.45);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-card h3 { font-size: 1.2rem; }

.book-card p {
  color: var(--muted);
  font-size: 0.98rem;
}

.text-link {
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  font-size: 0.92rem;
  color: var(--accent);
}

.contact { text-align: center; }

.contact-form {
  margin: 2.5rem auto 0;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.contact-form label {
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-top: 0.75rem;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form button {
  margin-top: 1.5rem;
  align-self: center;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-form button:hover {
  background: var(--bg-alt);
  border-color: var(--accent);
}

.contact-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-status {
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

.contact-status.error { color: #b3453f; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-socials { display: flex; gap: 1.25rem; }
.footer-socials a { text-decoration: none; color: var(--muted); }
.footer-socials a:hover { color: var(--text); }

/* Mobile */
@media (max-width: 860px) {
  :root { --header-h: var(--header-h-mobile); }

  .site-nav {
    position: fixed;
    top: var(--header-h-mobile);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .site-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .site-nav a {
    padding: 0.85rem clamp(1.25rem, 4vw, 3rem);
  }

  .header-actions { display: none; }
  .nav-toggle { display: flex; }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .hero-photo { max-width: 260px; margin: 0 auto; }
  .hero-text .lede { max-width: 46ch; margin-left: auto; margin-right: auto; }
  .hero { min-height: auto; padding-top: 3rem; padding-bottom: 4rem; }
  .scroll-cue { display: none; }
}
