/* Michael Beaumont – author site */
:root {
  /* Design tokens from the reference design */
  --paper: #f7f3ea;        /* --color-cream */
  --paper-deep: #f0e9d8;   /* --color-cream-deep */
  --ink: #262626;          /* --color-neutral-800 */
  --ink-soft: #5a5650;
  --accent: #262626;
  --accent-dark: #000000;
  --sea: #262626;
  --line: #e4dccb;
  --white: #ffffff;
  /* Reference uses Adobe's "ivyora-display"; Instrument Serif is the free stand-in */
  --serif: "ivyora-display", "Instrument Serif", Georgia, serif;
  --sans: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(36px, 5.3125vw, 68px); }
h2 { font-size: clamp(30px, 3.6vw, 46px); }
h3 { font-size: 1.75rem; }
p { margin: 0 0 1.1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.eyebrow {
  font-family: var(--sans);
  letter-spacing: .03em;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: .9em;
}
.lead { font-size: 1.3rem; color: var(--ink-soft); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 16px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.6rem; font-weight: 600;
  color: var(--ink); text-decoration: none;
}
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 1rem;
  color: var(--ink); cursor: pointer;
}
.site-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 500;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-color: var(--accent); color: var(--ink); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px 20px 16px; }
  .site-nav li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
}

/* Buttons */
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 4px;
  background: var(--accent); color: var(--white); text-decoration: none;
  font-weight: 600; font-size: 1rem; border: 2px solid var(--accent);
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 1.4em; }

/* Sections */
section { padding: 88px 0; }
.alt { background: var(--paper-deep); }
.dark { background: var(--sea); color: #eef3f4; }
.dark h2, .dark h3 { color: var(--white); }
.dark .eyebrow { color: #d9d2c3; }
.section-head { max-width: 680px; margin-bottom: 48px; }

/* Hero */
.hero { padding: 96px 0 80px; }
.hero-home { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero-books { display: flex; justify-content: center; gap: 22px; }
.hero-books .cover:nth-child(1) { transform: rotate(-4deg) translateY(10px); }
.hero-books .cover:nth-child(2) { transform: rotate(3deg); }
@media (max-width: 860px) {
  .hero-home { grid-template-columns: 1fr; }
  .hero { padding: 56px 0; }
}

/* Book covers (image or placeholder) */
.cover {
  width: 200px; aspect-ratio: 2 / 3; border-radius: 3px 8px 8px 3px;
  box-shadow: 0 18px 36px rgba(42,38,34,.25), inset 4px 0 0 rgba(0,0,0,.15);
  overflow: hidden; flex-shrink: 0;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 22px 18px; color: var(--white); text-align: center;
  font-family: var(--serif);
}
.cover-placeholder .t { font-size: 1.5rem; font-weight: 700; line-height: 1.1; margin-top: 18px; }
.cover-placeholder .a { font-family: var(--sans); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.cover-red { background: linear-gradient(160deg, #a3473a, #6d2c22); }
.cover-blue { background: linear-gradient(160deg, #3d6573, #22393f); }
@media (max-width: 480px) { .cover { width: 150px; } .cover-placeholder .t { font-size: 1.2rem; } }

/* Book cards */
.books { display: grid; gap: 40px; }
.book {
  display: grid; grid-template-columns: 200px 1fr; gap: 44px; align-items: start;
  background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 40px;
}
.book-meta { list-style: none; padding: 0; margin: 0 0 1.2em; display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-size: .95rem; color: var(--ink-soft); }
.book-meta strong { color: var(--ink); font-weight: 600; }
.book blockquote {
  margin: 0 0 1.2em; padding-left: 18px; border-left: 3px solid var(--line);
  font-family: var(--serif); font-size: 1.3rem; font-style: italic; color: var(--ink-soft);
}
@media (max-width: 700px) {
  .book { grid-template-columns: 1fr; padding: 28px 22px; gap: 28px; }
  .book .cover { margin: 0 auto; }
}

/* About split */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: start; }
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split .portrait { max-width: 300px; width: 100%; }
}
.portrait {
  aspect-ratio: 4 / 5; border-radius: 8px; background: var(--paper-deep);
  border: 1px dashed #c9b9a1; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: .95rem; text-align: center; padding: 20px;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; border-radius: 8px; }
.portrait:has(img) { padding: 0; border: 0; box-shadow: 0 18px 40px rgba(42,38,34,.18); }
.creds { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0 0; padding: 0; list-style: none; }
.creds li {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 6px 16px; font-size: .95rem; font-weight: 500;
}

/* Poems */
.poems { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.poem {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 36px 32px;
}
.poem pre {
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.6; white-space: pre-wrap;
  margin: 0; color: var(--ink);
}
.poem .placeholder-note { font-size: .9rem; color: var(--ink-soft); font-style: italic; margin-top: 1em; }
.big-quote {
  font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-style: italic;
  line-height: 1.35; max-width: 820px; margin: 0 auto; text-align: center;
}

/* Contact form */
.form { display: grid; gap: 18px; max-width: 620px; }
.form label { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 6px; }
.form input, .form textarea, .form select {
  width: 100%; padding: 13px 14px; border: 1px solid #cdbfa9; border-radius: 4px;
  font: inherit; font-size: 1rem; background: var(--white); color: var(--ink);
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.form textarea { min-height: 170px; resize: vertical; }
.hidden { display: none; }

/* Footer */
.site-footer { background: var(--ink); color: #cfc6ba; padding: 56px 0 36px; font-size: 1rem; }
.site-footer a { color: #f0dcc4; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-brand { font-family: var(--serif); font-size: 1.6rem; color: var(--white); margin-bottom: .3em; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.copyright { border-top: 1px solid #443d36; margin-top: 40px; padding-top: 22px; font-size: .9rem; }

/* ===== Big homepage opening ===== */
.hero-big { position: relative; overflow: hidden; padding: 88px 0 0; }
.hero-big-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 28px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.55); color: var(--ink); text-decoration: none;
  font-size: .9rem; font-weight: 500; letter-spacing: .01em;
  transition: border-color .2s, background .2s;
}
.hero-badge:hover { border-color: var(--ink); background: var(--white); color: var(--ink); }
.hero-badge-label { white-space: nowrap; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 3px 10px; font-size: .78rem; }
.hero-title {
  font-size: clamp(44px, 8.4vw, 116px);
  line-height: 1;
  letter-spacing: -0.025em;
  max-width: 15ch;
  margin: 0;
}
.hero-lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 560px; margin: 0; }
.hero-actions { justify-content: center; margin-top: 4px; }

/* Books on a desk */
.desk { position: relative; margin-top: 64px; height: 400px; }
.desk-glow {
  position: absolute; left: 50%; bottom: 40px; width: min(900px, 120%); height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(214,182,128,.45) 0%, rgba(240,233,216,.35) 40%, rgba(247,243,234,0) 70%);
  pointer-events: none;
}
.desk-surface {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
}
.desk-books {
  position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%);
  display: flex; align-items: flex-end; z-index: 2;
}
.desk-books .cover { width: 220px; transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s; }
.desk-books .cover:nth-child(1) { transform: rotate(-7deg) translate(28px, 6px); z-index: 1;
  box-shadow: 0 30px 40px -12px rgba(38,38,38,.45), inset 4px 0 0 rgba(0,0,0,.15); }
.desk-books .cover:nth-child(2) { transform: rotate(5deg) translate(-28px, -8px); z-index: 2;
  box-shadow: 0 34px 44px -12px rgba(38,38,38,.5), inset 4px 0 0 rgba(0,0,0,.15); }
.desk-books:hover .cover:nth-child(1) { transform: rotate(-9deg) translate(10px, -4px); }
.desk-books:hover .cover:nth-child(2) { transform: rotate(7deg) translate(-10px, -18px); }

@media (max-width: 700px) {
  .hero-big { padding-top: 56px; }
  .hero-big-inner { gap: 22px; }
  .hero-badge { font-size: .76rem; gap: 8px; padding-right: 12px; white-space: nowrap; max-width: 100%; }
  .hero-badge-label { font-size: .7rem; padding: 3px 8px; }
  .desk { height: 290px; margin-top: 44px; }
  .desk-books .cover { width: 150px; }
  .desk-books { bottom: 56px; }
  .desk-surface { height: 90px; }
}

/* Staggered entrance */
@keyframes appear { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes appear-zoom { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.appear { opacity: 0; animation: appear .7s ease-out forwards; }
.appear-zoom { opacity: 0; animation: appear-zoom .9s ease-out forwards; }
.d1 { animation-delay: .1s; } .d2 { animation-delay: .25s; } .d3 { animation-delay: .4s; } .d4 { animation-delay: .6s; }
@media (prefers-reduced-motion: reduce) {
  .appear, .appear-zoom { opacity: 1; animation: none; }
  .desk-books .cover { transition: none; }
}

/* ===== Scroll effects (added by site.js; off when reduce-motion is set) ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease-out, transform .8s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
.quote-scroll .qw { transition: opacity .25s linear; }

/* Dropdown: own chevron, set in from the edge */
.form select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 52px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23262626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 14px;
  cursor: pointer;
}
