/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f7f6f3;
  --surface: #ffffff;
  --ink: #1c1a17;
  --ink-soft: #57534e;
  --ink-faint: #8a847c;
  --line: #e9e6e0;
  --brand: #e8542a;         /* warm "hot" orange-red */
  --brand-dark: #c73f1a;
  --brand-tint: #fdeee8;
  --accent: #1b4965;        /* deep ink-blue */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28,26,23,.06), 0 2px 8px rgba(28,26,23,.05);
  --shadow-md: 0 8px 24px rgba(28,26,23,.08), 0 2px 6px rgba(28,26,23,.05);
  --shadow-lg: 0 24px 60px rgba(28,26,23,.14);
  --maxw: 1120px;
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .74rem;
  font-weight: 700; color: var(--brand); margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-family: var(--font-sans); font-weight: 600; font-size: .95rem;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn-sm { padding: 9px 16px; font-size: .88rem; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { color: var(--brand); display: inline-flex; }
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.28rem; letter-spacing: -.01em; }
.brand-accent { color: var(--brand); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav > a { font-weight: 500; font-size: .95rem; color: var(--ink-soft); transition: color .15s; }
.nav > a:hover { color: var(--ink); }
.nav > a.btn-primary { color: #fff; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* ---------- Hero: single-book spotlight ---------- */
.hero { padding: 84px 0 88px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(620px 320px at 88% 6%, var(--brand-tint), transparent 70%),
    radial-gradient(520px 340px at 3% 92%, #eef3f6, transparent 70%);
  pointer-events: none; z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; }
.hero-copy h1 { font-size: clamp(2.8rem, 5.4vw, 4.4rem); line-height: 1; }
.subtitle { font-family: var(--font-serif); font-size: clamp(1.15rem, 2vw, 1.5rem); color: var(--ink-soft); font-style: italic; margin-top: 14px; }
.byline { margin-top: 14px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.lede { color: var(--ink-soft); font-size: 1.08rem; margin-top: 22px; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 16px; font-size: .86rem; color: var(--ink-faint); }

/* Cover */
.hero-visual { display: flex; justify-content: center; align-items: center; }
.cover-frame {
  width: min(340px, 80vw); aspect-ratio: 2/3; border-radius: 8px 14px 14px 8px;
  box-shadow: var(--shadow-lg); overflow: hidden; position: relative;
  border-left: 6px solid rgba(0,0,0,.22); transform: rotate(-2deg);
  transition: transform .3s ease;
}
.cover-frame:hover { transform: rotate(0deg) translateY(-4px); }
.cover-img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
  width: 100%; height: 100%; background: linear-gradient(160deg, #2b2f34, #14171a);
  color: #fff; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px; gap: 14px;
}
.cover-fallback .fb-title { font-family: var(--font-serif); font-weight: 700; font-size: 2.3rem; line-height: 1; letter-spacing: .02em; }
.cover-fallback .fb-sub { font-size: .9rem; opacity: .8; font-style: italic; }
.cover-fallback .fb-author { margin-top: auto; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.section-sub { color: var(--ink-soft); max-width: 34ch; }

.grid { display: grid; gap: 24px; }
.feature-grid { grid-template-columns: repeat(3, 1fr); }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow-sm); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--brand-tint);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 18px;
}
.feature h3 { font-size: 1.25rem; margin-bottom: 8px; }
.feature p { color: var(--ink-soft); }

.book-prose { max-width: 760px; margin: 0 auto 48px; }
.book-prose p { color: var(--ink-soft); font-size: 1.08rem; line-height: 1.75; }
.book-prose p + p { margin-top: 20px; }
.book-prose strong { color: var(--ink); }

.about-cta { margin-top: 44px; text-align: center; }

/* ---------- Author ---------- */
.author-grid { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: center; }
.author-photo { display: flex; justify-content: center; }
.author-img, .author-initials {
  width: 200px; height: 200px; border-radius: 50%; object-fit: cover;
  box-shadow: var(--shadow-md); border: 4px solid #fff;
}
.author-initials {
  background: linear-gradient(150deg, var(--accent), #0f2f42); color: #fff;
  align-items: center; justify-content: center; font-family: var(--font-serif);
  font-size: 3.2rem; font-weight: 700;
}
.author-copy h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 12px; }
.author-copy p { color: var(--ink-soft); max-width: 58ch; margin-top: 14px; }
.author-links { margin-top: 20px; }
.author-links a { color: var(--brand); font-weight: 600; }

/* ---------- Newsletter ---------- */
.newsletter { padding: 80px 0; background: linear-gradient(140deg, var(--accent), #0f2f42); color: #fff; }
.newsletter-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.newsletter h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.newsletter p { color: rgba(255,255,255,.78); margin-top: 12px; }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 10px; }
.newsletter-form input {
  flex: 1; min-width: 220px; padding: 15px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff; font-size: 1rem; font-family: var(--font-sans);
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.6); }
.newsletter-form input:focus { outline: none; border-color: #fff; background: rgba(255,255,255,.16); }
.form-msg { flex-basis: 100%; font-size: .88rem; color: #ffd9c9; min-height: 1.2em; margin-top: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: #17150f; color: #cfc9c0; padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand { text-align: center; }
.footer-brand .brand-name { color: #fff; font-size: 1.4rem; white-space: nowrap; }
.footer-brand p { margin-top: 12px; color: #a49e94; font-size: .92rem; white-space: nowrap; }
.footer-col h4 { font-family: var(--font-sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #7c766c; margin-bottom: 14px; }
.footer-col a { display: block; padding: 5px 0; color: #cfc9c0; font-size: .92rem; transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #2a2720; margin-top: 44px; padding-top: 24px; }
.footer-bottom p { color: #7c766c; font-size: .85rem; }
.socials { display: flex; gap: 10px; }
.socials a { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #2a2720; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 600; color: #cfc9c0; transition: .15s; }
.socials a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Chat widget ---------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px 12px 15px; border: none; border-radius: 999px;
  background: var(--brand); color: #fff; font-family: var(--font-sans);
  font-weight: 600; font-size: .95rem; cursor: pointer;
  box-shadow: 0 10px 30px rgba(232,84,42,.35), var(--shadow-md);
  transition: transform .15s ease, background .2s;
}
.chat-fab:hover { background: var(--brand-dark); transform: translateY(-2px); }
.chat-fab-icon { font-size: 1.15rem; line-height: 1; }

.chat-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 210;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}
.chat-panel[hidden] { display: none; } /* ensure a closed panel leaves the layout so it can't intercept clicks on the button */
.chat-panel.open { opacity: 1; transform: translateY(0) scale(1); }

.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; background: linear-gradient(140deg, var(--accent), #0f2f42); color: #fff;
}
.chat-head strong { font-family: var(--font-serif); font-size: 1.02rem; display: block; }
.chat-head span { font-size: .78rem; opacity: .8; }
.chat-x { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; opacity: .85; padding: 0 4px; }
.chat-x:hover { opacity: 1; }

.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-alt); }
.chat-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: .92rem; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
}
.chat-bubble.from-bot { background: #fff; border: 1px solid var(--line); color: var(--ink); align-self: flex-start; border-bottom-left-radius: 5px; }
.chat-bubble.from-user { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.chat-typing { display: inline-flex; gap: 4px; align-items: center; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: chatblink 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatblink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.chat-chip {
  background: #fff; border: 1px solid var(--line); color: var(--accent);
  border-radius: 999px; padding: 8px 13px; font-size: .84rem; font-family: var(--font-sans);
  cursor: pointer; transition: .15s;
}
.chat-chip:hover { border-color: var(--brand); color: var(--brand); }
.chat-cta {
  display: inline-block; margin-top: 10px; background: var(--brand); color: #fff;
  padding: 8px 15px; border-radius: 999px; font-size: .85rem; font-weight: 600; text-decoration: none;
}
.chat-cta:hover { background: var(--brand-dark); }

.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-form input {
  flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .92rem; font-family: var(--font-sans); background: var(--bg-alt);
}
.chat-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.chat-form button {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 1rem; transition: background .2s;
}
.chat-form button:hover { background: var(--brand-dark); }
.chat-form button:disabled { opacity: .5; cursor: default; }

@media (max-width: 640px) {
  .chat-fab-label { display: none; }
  .chat-fab { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-panel, .chat-fab { transition: none; }
  .chat-typing span { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { padding: 56px 0 60px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .lede { max-width: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .author-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 28px; }
  .author-copy p { margin-inline: auto; }
  .newsletter-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .nav.open {
    display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column;
    gap: 4px; padding: 16px 24px 22px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
  }
  .nav.open > a { padding: 8px 0; }
  .section { padding: 60px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hero-cta .btn { flex: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 14px; }
}
