/* Eric Hertz — Author site. Ink + warm paper. */

:root {
  --paper: #f4efe6;
  --paper-deep: #ebe3d4;
  --ink: #1a1612;
  --ink-soft: #3d352c;
  --quiet: #6b6256;
  --rule: rgba(26, 22, 18, 0.14);
  --rule-strong: rgba(26, 22, 18, 0.28);
  --accent: #8b2e1f;
  --accent-hover: #6f2418;
  --accent-soft: rgba(139, 46, 31, 0.08);
  --focus: #1a1612;
  --shadow-cover: 0 18px 40px rgba(26, 22, 18, 0.18), 0 4px 10px rgba(26, 22, 18, 0.08);
  --shadow-photo: 0 22px 48px rgba(26, 22, 18, 0.22), 0 6px 14px rgba(26, 22, 18, 0.1);
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "DM Sans", "Helvetica Neue", system-ui, sans-serif;
  --wrap: 72rem;
  --radius-btn: 3px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(139, 46, 31, 0.05), transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  font-family: var(--font-ui);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--accent-hover); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.nav a:hover { color: var(--accent); }

/* —— Hero —— */
.hero {
  padding: clamp(2.75rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 8vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.tagline {
  margin: 1.1rem 0 0;
  max-width: 22ch;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  color: var(--ink-soft);
  line-height: 1.35;
}

.bio {
  margin-top: 1.75rem;
  max-width: 38rem;
  color: var(--ink-soft);
}

.bio p { margin: 0 0 0.85rem; }
.bio p:last-child { margin-bottom: 0; }

.hero-cta { margin: 1.75rem 0 0; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 0.1rem;
}

.text-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero-photo {
  display: flex;
  justify-content: flex-end;
}

.portrait {
  margin: 0;
  width: min(100%, 22rem);
  position: relative;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: auto -0.65rem -0.65rem auto;
  width: 42%;
  height: 42%;
  border-right: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  pointer-events: none;
  z-index: 0;
}

.portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
  background: #2a2430;
  box-shadow: var(--shadow-photo);
  border: 1px solid rgba(26, 22, 18, 0.16);
}

/* —— Books —— */
.books {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.section-head {
  display: grid;
  gap: 0.55rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 36rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-intro {
  margin: 0;
  color: var(--quiet);
  font-size: 1.05rem;
}

.shelf {
  display: grid;
  gap: 2.5rem;
}

.shelf-loading,
.shelf-empty {
  margin: 0;
  color: var(--quiet);
  font-size: 0.98rem;
}

.book-card {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--paper) 55%, white);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

.book-cover {
  margin: 0;
  position: relative;
  align-self: start;
  height: fit-content;
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(0,0,0,0.25));
  z-index: 1;
  pointer-events: none;
}

.book-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #2a2430;
  box-shadow: var(--shadow-cover);
  border: 1px solid rgba(26, 22, 18, 0.12);
}

.book-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.book-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.book-oneliner {
  margin: 0.7rem 0 0;
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.book-blurb-short {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  max-width: 40rem;
}

.book-blurb-short em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--quiet);
}

.book-blurb {
  margin-top: 1.15rem;
  max-width: 40rem;
}

.book-blurb p {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* —— Buy links —— */
.buy {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.35rem;
}

.buy-label {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
}

.buy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem; /* ≥48px touch */
  padding: 0.65rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-btn);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.buy-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.buy-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf6;
}

.buy-btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fffaf6;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.footer-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1rem;
}

.footer-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--quiet);
}


/* Reviews */
.review-heading {
  margin: 0 0 0.55rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
}

.review-block {
  margin: 1.35rem 0 0;
  max-width: 38rem;
}

.editorial-review .editorial-body {
  padding: 1rem 1rem 1rem 1.05rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
}

.editorial-review p {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.editorial-review p:last-of-type { margin-bottom: 0.55rem; }

.review-attr {
  margin: 0;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--quiet);
}

.customer-reviews {
  display: grid;
  gap: 0.15rem;
}

.customer-review {
  margin: 0;
  padding: 0.95rem 0 0.15rem;
  border-top: 1px solid var(--rule);
}

.customer-review:first-of-type {
  border-top: none;
  padding-top: 0.15rem;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.4rem;
}

.stars {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--accent);
}

.stars-empty { color: var(--rule-strong); }

.stars-text {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.review-source {
  font-size: 0.82rem;
  color: var(--quiet);
}

.review-title {
  margin: 0 0 0.35rem !important;
  font-weight: 650;
  font-size: 0.98rem !important;
  color: var(--ink) !important;
}

.customer-review p {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.review-verify {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.review-verify:hover {
  color: var(--accent-hover);
}
/* —— Responsive —— */
@media (max-width: 840px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-photo {
    justify-content: flex-start;
    order: -1;
  }

  .portrait {
    width: min(100%, 16rem);
  }

  .book-card {
    grid-template-columns: 1fr;
  }

  .book-cover {
    max-width: 14rem;
  }
}

/* Phones (~390px primary) */
@media (max-width: 520px) {
  html, body { overflow-x: clip; }

  .wrap { width: min(100% - 1.35rem, var(--wrap)); }

  .header-inner {
    min-height: 2.85rem;
    gap: 0.75rem;
  }

  .wordmark { font-size: 1.05rem; }

  .nav { gap: 1rem; }

  .nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem; /* ≥44px tap */
    padding: 0.35rem 0.15rem;
  }

  .hero {
    padding: 1.35rem 0 1.85rem;
  }

  .hero-grid { gap: 1.25rem; }

  .portrait {
    width: min(52vw, 12.25rem); /* prominent, not full-screen */
  }

  .portrait::after {
    inset: auto -0.45rem -0.45rem auto;
  }

  .eyebrow {
    margin-bottom: 0.55rem;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 11vw, 3.35rem);
    line-height: 0.95;
  }

  .tagline {
    margin-top: 0.85rem;
    max-width: 28ch; /* less cramped wraps on ~390 */
    font-size: 1.12rem;
    line-height: 1.42;
  }

  .bio {
    margin-top: 1.2rem;
    font-size: 1rem;
  }

  .hero-cta { margin-top: 1.25rem; }

  .text-link {
    min-height: 2.75rem;
    align-items: center;
  }

  .books { padding: 2.25rem 0 2.75rem; }

  .section-head { margin-bottom: 1.35rem; }

  .section-head h2 { font-size: clamp(1.75rem, 7vw, 2.25rem); }

  .section-intro { font-size: 1rem; }

  .book-card {
    padding: 1.1rem;
    gap: 1.15rem;
  }

  .book-cover {
    max-width: 11.5rem; /* cover visible, sell copy not crushed */
  }

  .book-title { font-size: clamp(1.55rem, 6.5vw, 1.9rem); }

  .book-oneliner {
    font-size: 1.05rem;
    margin-top: 0.55rem;
  }

  .book-blurb-short {
    font-size: 0.98rem;
    margin-top: 0.45rem;
  }

  .buy { margin-top: 1.25rem; gap: 1.1rem; }

  .buy-list { gap: 0.55rem; }

  .buy-btn {
    flex: 1 1 calc(50% - 0.55rem);
    min-width: 9rem;
    min-height: 3rem; /* 48px thumb targets */
    padding: 0.7rem 0.85rem;
    font-size: 0.92rem;
  }

  .buy-btn--primary {
    box-shadow: 0 1px 0 rgba(26, 22, 18, 0.08);
  }

  .editorial-review .editorial-body { padding: 0.9rem 0.85rem; }

  .customer-reviews { gap: 0.75rem; }

  .footer-inner { gap: 0.5rem 1rem; }

  .site-footer { padding: 1.25rem 0 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .buy-btn { transition: none; }
}
