/* richpwelsh.com : dark, warm, lamp-lit. */
:root {
  --bg: #0d0b0a;
  --bg-2: #15110f;
  --surface: #1c1714;
  --line: #2e2621;
  --text: #ede6dd;
  --muted: #a69a8d;
  --accent: #d6a057;
  --accent-2: #f0c27f;
  --danger: #c0563f;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
  --wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.6rem, 5.5vw, 4.4rem); }
h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); }
p { margin: 0 0 1em; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 40px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.fine { font-size: .8rem; color: var(--muted); margin-top: .75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute; left: -9999px; }
.eyebrow {
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: .9rem;
}
.lede { font-size: 1.15rem; color: #cfc5b9; max-width: 34em; }
.hook { font-family: var(--serif); font-style: italic; font-size: 1.55rem; line-height: 1.3; color: var(--accent-2); }
.subtitle { font-family: var(--serif); font-size: 1.5rem; color: #d8cfc4; margin-top: -.3em; }
.text-link { font-weight: 600; display: inline-block; margin-top: 1rem; }
.tag {
  display: inline-block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 99px; padding: .15em .7em; margin-left: .4em;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 .95rem var(--sans); padding: .85em 1.4em; border-radius: 99px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #1a120a; }
.btn-primary:hover { background: var(--accent-2); color: #1a120a; }
.btn-ghost { border-color: #4a3e35; color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); }
.btn-amazon { background: #f3ede6; color: #111; }
.btn-amazon:hover { background: #fff; color: #000; }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 11, 10, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { font-family: var(--serif); font-size: 1.65rem; font-weight: 700; color: var(--text); letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a { color: var(--muted); font-size: .93rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links .nav-cta { color: var(--accent); border: 1px solid #4a3e35; padding: .45em 1.1em; border-radius: 99px; }
.nav-links .nav-cta:hover { border-color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .2s; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 520px at 78% 30%, rgba(214, 160, 87, .14), transparent 60%),
    radial-gradient(600px 400px at 10% 90%, rgba(120, 60, 30, .12), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 4rem; align-items: center; padding: 5rem 0 4.5rem; }
.hero h1 { max-width: 12em; }
.hero-photo { position: relative; }
.hero-photo img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 18%;
  border-radius: 14px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06);
}
.hero-photo::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(13, 11, 10, .55));
}
.hero-photo::before {
  content: ""; position: absolute; inset: -14px 14px 14px -14px; border: 1px solid rgba(214, 160, 87, .35);
  border-radius: 16px; z-index: -1;
}

/* Covers */
.cover {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .06);
}
.cover-lg { max-width: 380px; }
.cover-placeholder {
  display: flex; flex-direction: column; justify-content: space-between; padding: 14% 10% 10%;
  background:
    radial-gradient(circle at 50% 38%, rgba(214, 160, 87, .28), transparent 55%),
    linear-gradient(160deg, #241b15, #0b0807 70%);
  text-align: center;
}
.cover-placeholder .ph-title {
  font-family: var(--serif); font-weight: 700; color: #f3e3c8;
  font-size: clamp(1.4rem, 3.4vw, 2.6rem); line-height: 1.05; text-transform: uppercase; letter-spacing: .06em;
}
.cover-placeholder .ph-author {
  font-family: var(--sans); font-size: .78rem; letter-spacing: .35em; text-transform: uppercase; color: var(--accent);
  border-top: 1px solid rgba(214, 160, 87, .4); padding-top: .9em;
}

/* Featured book */
.featured { background: var(--bg-2); border-block: 1px solid var(--line); }
.featured-grid { display: grid; grid-template-columns: 380px 1fr; gap: 4.5rem; padding: 5.5rem 0; align-items: start; }
.featured-cover { display: block; transition: transform .3s; }
.featured-cover:hover { transform: translateY(-4px) rotate(-.4deg); }
.blurb { color: #d4cabe; }
.blurb p { max-width: 38em; }

/* Buy box */
.buy-box { margin-top: 1.8rem; display: grid; gap: 1.5rem; }
.buy-label { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: .6rem; }
.buy-group .btn-row { margin-top: 0; }
.direct-list { display: grid; gap: .6rem; }
.direct-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem .9rem 1.2rem;
}
.direct-item strong { margin-right: .6em; }
.direct-item .price { color: var(--accent-2); font-weight: 600; margin-right: .4em; }
.coming { background: var(--surface); border: 1px dashed #4a3e35; border-radius: var(--radius); padding: 1rem 1.2rem; color: #d4cabe; }

/* Shelf and lists */
.shelf { padding: 4.5rem 0; }
.section-title { margin-bottom: 2rem; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2.2rem; }
.book-card { color: var(--text); }
.book-card .cover { transition: transform .25s; }
.book-card:hover .cover { transform: translateY(-4px); }
.book-card-title { display: block; font-family: var(--serif); font-size: 1.3rem; margin-top: .8rem; }
.book-list { display: grid; gap: 3rem; }
.book-row { display: grid; grid-template-columns: 200px 1fr; gap: 2.5rem; align-items: center; padding-bottom: 3rem; border-bottom: 1px solid var(--line); }
.book-row:last-child { border-bottom: 0; }
.book-row h2 a { color: var(--text); }

.page-head { padding: 4.5rem 0 1rem; }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: .9rem 1.2rem; border-radius: 6px; margin-top: 1.5rem; }
.notice-err { border-left-color: var(--danger); }

/* Book detail */
.book-detail { padding: 4.5rem 0; }
.book-grid-detail { display: grid; grid-template-columns: 380px 1fr; gap: 4.5rem; align-items: start; }
.book-cover-col { position: sticky; top: 100px; }

.excerpt { background: var(--bg-2); border-block: 1px solid var(--line); padding: 4.5rem 0; }
.excerpt-body { font-family: var(--serif); font-size: 1.3rem; line-height: 1.7; color: #e2d9ce; position: relative; }
.excerpt-body p:first-child::first-letter { float: left; font-size: 4.2em; line-height: .8; padding: .08em .1em 0 0; color: var(--accent); }
.excerpt-body.collapsed { max-height: 26em; overflow: hidden; }
.excerpt-body.collapsed::after {
  content: ""; position: absolute; inset: auto 0 0; height: 9em;
  background: linear-gradient(transparent, var(--bg-2));
}

.signed-pitch { padding: 4.5rem 0 1rem; }

/* About */
.about { padding: 4.5rem 0; }
.about-grid { display: grid; grid-template-columns: 380px 1fr; gap: 4rem; align-items: start; }
.about-photo { border-radius: 14px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 18%; box-shadow: 0 30px 60px -25px #000; }

/* Newsletter */
.newsletter {
  padding: 5rem 0;
  background: radial-gradient(700px 300px at 50% 0%, rgba(214, 160, 87, .12), transparent 70%);
}
.subscribe-form { display: flex; gap: .6rem; max-width: 520px; margin: 1.6rem auto 0; }
.subscribe-form input[type=email] {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid #3a3029; border-radius: 99px; padding: .8em 1.3em;
}
.subscribe-form input[type=email]:focus { outline: none; border-color: var(--accent); }
.form-msg { min-height: 1.5em; margin: .8rem 0 0; color: var(--accent-2); }
.form-msg.err { color: #e48a72; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0 2rem; background: #090807; }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--muted); font-size: .92rem; }
.footer-links a:hover { color: var(--text); }
.fine-print { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; font-size: .8rem; color: #73685d; }

/* Fade-in on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* Mobile */
@media (max-width: 900px) {
  .hero-grid, .featured-grid, .book-grid-detail, .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-grid { padding: 2.5rem 0 3.5rem; }
  .hero-photo { order: -1; max-width: 280px; margin: 0 auto; width: 100%; }
  .hero-photo img { aspect-ratio: 1 / 1; object-position: 50% 22%; }
  .hero-copy { text-align: center; }
  .hero-copy .lede { margin-inline: auto; }
  .hero-copy .btn-row { justify-content: center; }
  .hero-photo::before { inset: -10px 10px 10px -10px; }
  .featured-cover, .book-cover-col { max-width: 300px; margin: 0 auto; position: static; }
  .about-photo { max-width: 360px; }
  .book-row { grid-template-columns: 120px 1fr; gap: 1.4rem; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); display: none; padding: .5rem 20px 1.2rem;
  }
  .nav-links a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav-links .nav-cta { text-align: center; margin-top: .8rem; border-bottom: 1px solid #4a3e35; }
  .site-header.open .nav-links { display: flex; }
  .site-header.open .nav-toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .site-header.open .nav-toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
}
@media (max-width: 540px) {
  body { font-size: 16px; }
  .subscribe-form { flex-direction: column; }
  .direct-item { flex-direction: column; align-items: stretch; }
  .book-row { grid-template-columns: 1fr; }
  .book-row > a { max-width: 200px; }
}
