/* Last Light Books - aristocratic design language.
   Two palettes: body.light (paper) / body.dark (ink). */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=EB+Garamond:ital@0;1&display=swap');

:root {
  --gold: #a5843c;
  --gold-soft: #c2a869;
}

body.light {
  --bg: #fbfaf6;
  --ink: #16191f;
  --muted: #6d6a61;
  --hairline: #d9d2c0;
  --panel: #f4f1e8;
}
body.dark {
  --bg: #1e2430;
  --ink: #ece6d8;
  --muted: #98917e;
  --hairline: #39435a;
  --panel: #242c3c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  font-size: 1.32rem;
}

h1, h2, h3, .display { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 28px; }

/* Header: centered, quiet; sticky with compact mode on scroll */
header {
  padding: 14px 0 0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}
header .wordmark img {
  height: 64px;
  max-width: 86vw;
}
nav { margin-top: 10px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.88rem;
  margin: 0 22px;
  white-space: nowrap;
  display: inline-block;
}
nav a:hover { color: var(--gold); }
.header-rule {
  width: 100%; height: 1px;
  background: var(--hairline);
  margin-top: 12px;
}

/* Hero */
.hero { text-align: center; padding: 96px 24px 88px; }
.hero .tag {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.8rem, 3.8vw, 2.5rem);
  color: var(--ink);
}
.hero .sub {
  margin-top: 16px;
  color: var(--muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

/* Ornament */
.ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin: 0 auto;
  color: var(--gold);
}
.ornament::before, .ornament::after {
  content: ""; height: 1px; width: 72px; background: var(--gold-soft); opacity: 0.6;
}

/* Sections */
section { padding: 72px 0; }
.section-title {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  margin-bottom: 52px;
}

/* Catalogue */
.books {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 44px 34px;
}
.book { text-align: center; }
.book img {
  width: 100%;
  max-width: 215px;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--hairline);
  transition: opacity 0.25s ease;
}
.book a:hover img { opacity: 0.85; }
.book h3 {
  margin-top: 18px;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.book .num {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-top: 4px;
}
.book .status {
  color: var(--gold);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  margin-top: 6px;
  font-size: 1.3rem;
}

/* Author */
.author { background: var(--panel); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.author .inner {
  display: flex; gap: 56px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.author img { width: 235px; border: 1px solid var(--hairline); }
.author .bio { max-width: 520px; }
.author .bio .section-title { text-align: left; }
.author .bio p { margin-top: 18px; color: var(--ink); }
.textlink {
  display: inline-block;
  margin-top: 26px;
  color: var(--gold);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--gold-soft);
  padding-bottom: 6px;
}
.textlink:hover { color: var(--ink); border-color: var(--ink); }

/* Newsletter */
.newsletter { text-align: center; }
.newsletter p { max-width: 470px; margin: 0 auto; color: var(--muted); }
.newsletter form {
  margin-top: 34px;
  display: flex; gap: 0; justify-content: center; flex-wrap: wrap;
}
.newsletter input[type="email"] {
  padding: 13px 18px;
  font-size: 1.15rem;
  font-family: 'EB Garamond', serif;
  border: 1px solid var(--hairline);
  border-right: none;
  background: transparent;
  color: var(--ink);
  min-width: 300px;
  outline: none;
}
.newsletter input[type="email"]:focus { border-color: var(--gold); }
.newsletter button {
  padding: 13px 30px;
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: all 0.2s ease;
}
.newsletter button:hover { background: var(--gold); color: var(--bg); }

/* Footer */
footer {
  border-top: 1px solid var(--hairline);
  text-align: center;
  padding: 40px 24px 48px;
  color: var(--muted);
  font-size: 1.05rem;
}
footer .mark img { height: 40px; opacity: 0.9; margin-bottom: 14px; }

p { text-wrap: pretty; }
.lede {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 28px;
}
.prose { text-align: left; }
.prose p + p { margin-top: 20px; }

/* Featured carousel */
.featured-section { padding: 30px 0 36px; border-top: 1px solid var(--hairline); margin-top: 24px; }
.featured-shell { display: flex; align-items: center; gap: 10px; }
.car-arrow {
  background: none; border: none; cursor: pointer;
  color: var(--gold); font-family: 'Cormorant Garamond', serif;
  font-size: 3rem; line-height: 1; padding: 8px 14px;
  transition: color 0.2s ease;
}
.car-arrow:hover { color: var(--ink); }
#featured { transition: opacity 0.18s ease; flex: 1; }
.featured-section .inner { gap: 40px; }
.featured-section .author-img { width: 149px; border: 1px solid var(--hairline); }

/* Authors roster */
.author-row {
  display: flex; gap: 44px; align-items: center;
  padding: 44px 0; border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.author-row:last-of-type { border-bottom: none; }
.portrait {
  width: 168px; height: 168px; border-radius: 50%;
  flex: 0 0 168px;
  border: 1px solid var(--gold-soft);
  display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.portrait .initials {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.2rem; color: var(--gold); letter-spacing: 0.06em;
}
.author-row .info { flex: 1; min-width: 300px; }
.author-row h3 {
  font-size: 1.7rem; font-weight: 500;
}
.author-row .genre {
  color: var(--gold); font-style: italic;
  font-family: 'Cormorant Garamond', serif; font-size: 1.25rem;
  margin: 2px 0 12px;
}

footer .legal { margin-top: 12px; font-size: 0.85rem; letter-spacing: 0.04em; }
footer .legal a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
footer .legal a:hover { color: var(--gold); border-color: var(--gold-soft); }

/* Reading sample pages */
.reading { max-width: 640px; font-size: 1.25rem; }
.reading p { margin: 0 0 1.05em; text-indent: 1.4em; }
.reading .chapter-title + p, .reading p:first-of-type { text-indent: 0; }
.chapter-title {
  text-align: center; font-size: 1.6rem; font-weight: 500;
  margin: 56px 0 28px; letter-spacing: 0.06em;
}
.sample-end { border-top: 1px solid var(--hairline); background: var(--panel); }

/* Paginated book reader: open-book spread */
.reader-shell { max-width: 980px; margin: 0 auto; padding: 0 16px; }
#book-page {
  position: relative;
  background:
    linear-gradient(105deg, rgba(0,0,0,0.045) 0%, rgba(0,0,0,0) 8%, rgba(0,0,0,0) 92%, rgba(0,0,0,0.05) 100%),
    linear-gradient(180deg, #f9f5ea 0%, #f4eede 100%);
  color: #23201a;
  border: 1px solid #d8d0ba;
  border-radius: 3px;
  box-shadow:
    0 1px 0 #e6dfcc, 2px 3px 0 -1px #efe9d8, 3px 5px 0 -2px #e6dfcc,
    5px 7px 0 -3px #efe9d8, 0 24px 54px rgba(0,0,0,0.45);
  height: 66vh;
  min-height: 440px;
  overflow: hidden;
  padding: 48px 52px;
}
#book-page.spread::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 90px; transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(90,75,45,0.10) 46%, rgba(60,48,25,0.16) 50%, rgba(90,75,45,0.10) 54%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 2;
}
#book-flow {
  height: 100%;
  width: 100%;
  column-fill: auto;
  transition: transform 0.3s ease;
  font-size: 1.14rem;
  line-height: 1.7;
}
#book-flow p { margin: 0 0 0.9em; text-indent: 1.3em; color: #23201a; }
#book-flow .ch-title {
  font-family: 'Cormorant Garamond', serif;
  text-align: center; font-size: 1.55rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 6px 0 6px; text-indent: 0; color: #23201a;
}
#book-flow .ch-orn {
  text-align: center; text-indent: 0; color: #a5843c;
  margin: 0 0 20px; font-size: 1.05rem; letter-spacing: 0.4em;
}
#book-flow .ch-title + .ch-orn + p { text-indent: 0; }
#book-flow .ch-orn + p::first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.4em; float: left; line-height: 0.82;
  padding: 4px 8px 0 0; color: #1e2430;
}
#book-flow .flow-cta { text-align: center; text-indent: 0; margin-top: 30px; }
#book-flow .flow-cta .textlink { color: #8a6b25; border-color: #b39244; }
.reader-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 28px; margin-top: 24px;
}
#page-counter { color: var(--muted); font-size: 1rem; letter-spacing: 0.08em; }
@media (max-width: 760px) { #book-page { padding: 30px 24px; height: 68vh; } }

/* Homepage hero */
.home-hero { padding: 44px 0 52px; }
.home-hero .cols {
  display: flex; align-items: center; gap: 64px;
  justify-content: center; flex-wrap: wrap;
}
.home-hero .pitch { max-width: 520px; }
.home-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-weight: 500;
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.25; margin-bottom: 18px;
}
.home-hero .whatis {
  color: var(--ink); font-size: 1.25rem; line-height: 1.7;
}
.home-hero .whatis .h { color: var(--gold); }
.home-hero .cta-row { margin-top: 30px; display: flex; gap: 18px; flex-wrap: wrap; }
.btn-outline {
  display: inline-block; padding: 13px 26px;
  border: 1px solid var(--gold); color: var(--gold);
  text-decoration: none; text-transform: uppercase;
  letter-spacing: 0.2em; font-size: 0.85rem;
  transition: all 0.2s ease;
}
.btn-outline:hover { background: var(--gold); color: var(--bg); }
.btn-outline.ghost { border-color: var(--hairline); color: var(--muted); }
.btn-outline.ghost:hover { border-color: var(--gold); color: var(--gold); background: transparent; }
.home-hero .hero-cover { text-align: center; }
.home-hero .hero-cover img {
  width: 235px; border: 1px solid var(--hairline);
  box-shadow: 0 22px 48px rgba(0,0,0,0.5);
}
.home-hero .hero-cover .cap {
  margin-top: 14px; color: var(--gold);
  font-style: italic; font-family: 'Cormorant Garamond', serif; font-size: 1.15rem;
}

.featured-section .bio p { font-size: 1.12rem; }
.featured-section .section-title { font-size: 0.98rem; }
.featured-section .textlink { font-size: 0.78rem; margin-top: 18px; }
.featured-section .car-arrow { font-size: 2.5rem; }
.featured-section .inner { gap: 32px; }

/* Compact newsletter */
.newsletter { padding: 38px 0 46px !important; }
.newsletter .section-title { margin-bottom: 2px; font-size: 1.02rem; }
.newsletter .section-sub { font-size: 1.25rem; margin-bottom: 0; }
.newsletter .nl-desc { margin-top: 8px; line-height: 1.5; font-size: 1.15rem; }
.newsletter form { margin-top: 20px; }
.newsletter input[type="email"] { padding: 11px 16px; }
.newsletter button { padding: 11px 26px; }

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  header { padding: 10px 0 0; }
  header .wordmark img { height: 46px; }
  nav { margin-top: 8px; display: flex; justify-content: center; gap: 4px; }
  nav a { margin: 0 8px; font-size: 0.72rem; letter-spacing: 0.16em; }
  .header-rule { margin-top: 10px; }

  .hero { padding: 44px 18px 36px; }
  section { padding: 48px 0; }

  /* newsletter: stacked form */
  .newsletter form { flex-direction: column; align-items: stretch; gap: 10px; padding: 0 8px; }
  .newsletter input[type="email"] {
    border-right: 1px solid var(--hairline);
    min-width: 0; width: 100%; text-align: center;
  }
  .newsletter input[type="email"]:focus { border-color: var(--gold); }
  .newsletter button { width: 100%; }

  /* carousel: arrows overlay the edges instead of squeezing content */
  .featured-shell { position: relative; }
  .featured-shell .car-arrow {
    position: absolute; top: 42%; z-index: 5;
    padding: 2px 6px; font-size: 2.2rem;
    background: var(--bg); border-radius: 50%;
  }
  .featured-shell .car-arrow:first-child { left: 2px; }
  .featured-shell .car-arrow:last-child { right: 2px; }
  .featured-section .inner { padding: 0 30px; gap: 22px; }

  .author .inner { gap: 26px; }
  .author-row { gap: 24px; padding: 32px 0; }
  .portrait { width: 128px; height: 128px; flex: 0 0 128px; margin: 0 auto; }
  .books { gap: 34px 18px; }
}
