:root {
  --ink: #16130f;
  --ink-soft: #4a423a;
  --ink-faint: #8a7f73;
  --paper: #fbf8f3;
  --paper-2: #f3ede3;
  --line: #e2d9cb;
  --accent: #9a3b1f;
  --accent-soft: #c46a4c;
  --accent-2: #1f4b52;
  --white: #fff;
  --radius: 6px;
  --max: 1140px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.16rem; }
p { margin: 0 0 1.1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.eyebrow {
  font-family: var(--sans); font-size: .74rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 .9rem;
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--ink); color: #d9d0c4;
  font-size: .78rem; letter-spacing: .04em;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: .5rem; }
.topbar a { color: #d9d0c4; }
.topbar span { opacity: .75; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 243, .93);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: 1rem; }

.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 50% 118%, var(--accent) 0 42%, transparent 42.5%), var(--ink);
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; left: 50%; top: 54%; transform: translateX(-50%);
  width: 27px; height: 1.5px; background: #e8ddcb; opacity: .85;
}
.brand-name { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; line-height: 1.05; }
.brand-sub { display: block; font-family: var(--sans); font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); }

.nav-links { display: flex; align-items: center; gap: 1.9rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--ink-soft); font-size: .93rem; font-weight: 500;
  padding-block: .35rem; border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--line); }
.nav-links a.active { color: var(--ink); border-bottom-color: var(--accent); }

.btn {
  display: inline-block; padding: .68rem 1.35rem; border-radius: var(--radius);
  font-size: .92rem; font-weight: 600; font-family: var(--sans);
  border: 1px solid transparent; cursor: pointer; transition: .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: #85321a; color: var(--white); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-faint); color: var(--ink); }
.btn-lg { padding: .85rem 1.7rem; font-size: 1rem; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--radius); padding: .45rem .6rem; cursor: pointer; color: var(--ink);
}

/* ---------- hero ---------- */
.hero { padding: 4.5rem 0 3.5rem; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3.5rem; align-items: center; }
.hero p.lede { font-size: 1.13rem; color: var(--ink-soft); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.shelf .book { transform: rotate(-1.4deg); }
.shelf .book:nth-child(2) { transform: rotate(1.1deg) translateY(-14px); }
.shelf .book:nth-child(3) { transform: rotate(-.4deg) translateY(6px); }

/* ---------- book covers (pure CSS) ---------- */
.book { display: block; color: inherit; }
.book:hover { text-decoration: none; }
.book:hover .cover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(22,19,15,.24); }
.cover {
  aspect-ratio: 2/3; border-radius: 3px 6px 6px 3px;
  box-shadow: 0 8px 22px rgba(22,19,15,.16);
  transition: .22s ease; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1rem .95rem; color: #fdfaf4;
}
.cover::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 9px;
  background: linear-gradient(90deg, rgba(0,0,0,.34), rgba(0,0,0,.05));
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.17), transparent 60%);
}
.cover .ct { font-family: var(--serif); font-size: 1.02rem; line-height: 1.2; position: relative; z-index: 1; }
.cover .ca { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; opacity: .82; margin-top: .35rem; position: relative; z-index: 1; }
.c1 { background: linear-gradient(155deg, #2f4858, #16323f); }
.c2 { background: linear-gradient(155deg, #9a3b1f, #5d1f0c); }
.c3 { background: linear-gradient(155deg, #4a4063, #251f38); }
.c4 { background: linear-gradient(155deg, #1f4b52, #0e2b30); }
.c5 { background: linear-gradient(155deg, #8a6d2f, #4d3a12); }
.c6 { background: linear-gradient(155deg, #6b2f4a, #3a1428); }
.c7 { background: linear-gradient(155deg, #35553a, #17301b); }
.c8 { background: linear-gradient(155deg, #7a3b2f, #421a12); }

.book-meta { margin-top: .7rem; }
.book-meta .t { font-family: var(--serif); font-size: 1rem; line-height: 1.25; }
.book-meta .a { font-size: .84rem; color: var(--ink-faint); }
.tag {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent-2);
  background: #e6eeef; border-radius: 100px; padding: .16rem .6rem; margin-top: .45rem;
}

/* ---------- sections ---------- */
.section { padding: 4rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: 2.2rem; }
.section-head p { color: var(--ink-soft); margin: 0; max-width: 42rem; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.8rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem;
}
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.card .num { font-family: var(--serif); font-size: 2rem; color: var(--accent); line-height: 1; }

.alt { background: var(--paper-2); }

/* ---------- audiobook creator page: full-bleed app view ---------- */
.page-head { padding: 3rem 0 2.2rem; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
.page-head p { color: var(--ink-soft); max-width: 46rem; margin: 0; font-size: 1.05rem; }

/* The embed gets a full screen of height, edge to edge, under a sticky menu. */
body.app-page { background: var(--white); }
body.app-page .site-header { background: var(--paper); }

body.app-page #audiobook-creator-container {
  display: block;
  width: 100%;
}
body.app-page #audiobook-creator-container iframe {
  display: block;
  width: 100%;
  border: 0;
  /* Full viewport height; JS grows this if the embed reports a taller document. */
  height: 100vh;
  height: 100dvh;
}

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #bcb2a5; padding: 3.2rem 0 1.6rem; margin-top: 0; }
.site-footer h4 { color: #f2ece2; font-family: var(--sans); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .9rem; }
.site-footer a { color: #bcb2a5; font-size: .92rem; }
.site-footer a:hover { color: var(--white); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.foot-brand .brand-name { color: #f2ece2; }
.foot-brand p { font-size: .92rem; max-width: 26rem; margin-top: .9rem; }
.foot-bottom {
  border-top: 1px solid #332c25; margin-top: 2.6rem; padding-top: 1.3rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem;
}
.demo-note { color: #8a7f73; font-size: .8rem; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero-grid, .grid-2 { grid-template-columns: 1fr; gap: 2.5rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: .5rem 1.5rem 1rem; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .nav-links a.active { border-bottom-color: var(--accent); }
  .nav .btn { display: none; }
  .grid-3, .steps { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 1.2rem; }
  .foot-grid { grid-template-columns: 1fr; }
  .topbar .wrap span:first-child { display: none; }
}
