/* ============================================================
   Doctor Molchan — site styles
   Warm-literary palette, Playfair Display + Spectral + DM Mono.
   Light + dark theme via [data-theme] on <html>.
   ============================================================ */

:root, [data-theme="light"] {
  --parchment:   #FAF5EC;
  --parchment-2: #F2EBD9;
  --parchment-3: #E8DFC8;
  --navy:        #1A2845;
  --navy-2:      #243358;
  --oak:         #8B6F47;
  --oak-2:       #A38560;
  --ink:         #1F1A14;
  --ink-2:       #463C30;
  --muted:       #7A6F5E;
  --rule:        rgba(31, 26, 20, 0.12);
  --rule-strong: rgba(31, 26, 20, 0.24);
  --shadow:      rgba(31, 26, 20, 0.08);
  --state-error: #8B2C1E;
  --state-success: #3F5E3A;
}
[data-theme="dark"] {
  --parchment:   #1A1813;
  --parchment-2: #25221C;
  --parchment-3: #2D2A23;
  --navy:        #B8C5DE;
  --navy-2:      #9CABC8;
  --oak:         #C9AB80;
  --oak-2:       #A38560;
  --ink:         #F4EFE2;
  --ink-2:       #C8C0AE;
  --muted:       #8A7F6E;
  --rule:        rgba(244, 239, 226, 0.12);
  --rule-strong: rgba(244, 239, 226, 0.24);
  --shadow:      rgba(0, 0, 0, 0.4);
  --state-error: #E08B7F;
  --state-success: #A8C49D;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--parchment);
  color: var(--ink);
  font-family: 'Spectral', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 300ms cubic-bezier(0.4, 0, 0.2, 1),
              color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
button { font-family: inherit; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
              color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
a:hover { text-decoration-color: var(--navy); color: var(--navy); }

img { max-width: 100%; height: auto; display: block; }
hr { border: 0; height: 1px; background: var(--rule); margin: 48px 0; }

/* ============================================================
   NAV (sticky, parchment with backdrop blur)
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(250, 245, 236, 0.78);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: background-color 300ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] .nav { background: rgba(26, 24, 19, 0.78); }

.nav-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo:hover { color: var(--navy); text-decoration: none; }
.nav-logo em { font-style: italic; color: var(--navy); font-weight: 500; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.is-current { color: var(--navy); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 200ms, color 200ms, border-color 300ms;
}
.theme-toggle:hover { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.theme-icon { display: none; width: 16px; height: 16px; }
[data-theme="light"] .theme-icon--moon { display: block; }
[data-theme="dark"] .theme-icon--sun { display: block; }

.nav-toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-toggle[data-state="open"] span:nth-child(1) {
  transform: translateY(2.75px) rotate(45deg);
}
.nav-toggle[data-state="open"] span:nth-child(2) {
  transform: translateY(-2.75px) rotate(-45deg);
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-logo { font-size: 1.15rem; }
}

/* Mobile menu (full-screen overlay) */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--parchment);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 24px;
  clip-path: circle(0% at calc(100% - 64px) 36px);
  transition: clip-path 600ms cubic-bezier(0.76, 0, 0.24, 1);
  pointer-events: none;
}
.menu-overlay[data-state="open"] {
  clip-path: circle(160% at calc(100% - 64px) 36px);
  pointer-events: auto;
}
.menu-overlay-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
  list-style: none;
  text-align: center;
}
.menu-overlay-links a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
}
.menu-overlay[data-state="open"] .menu-overlay-links a {
  transform: translateY(0);
  opacity: 1;
}
.menu-overlay[data-state="open"] .menu-overlay-links li:nth-child(1) a { transition-delay: 160ms; }
.menu-overlay[data-state="open"] .menu-overlay-links li:nth-child(2) a { transition-delay: 200ms; }
.menu-overlay[data-state="open"] .menu-overlay-links li:nth-child(3) a { transition-delay: 240ms; }
.menu-overlay[data-state="open"] .menu-overlay-links li:nth-child(4) a { transition-delay: 280ms; }
.menu-overlay[data-state="open"] .menu-overlay-links li:nth-child(5) a { transition-delay: 320ms; }
.menu-overlay[data-state="open"] .menu-overlay-links li:nth-child(6) a { transition-delay: 360ms; }
.menu-overlay[data-state="open"] .menu-overlay-links li:nth-child(7) a { transition-delay: 400ms; }
.menu-overlay[data-state="open"] .menu-overlay-links li:nth-child(8) a { transition-delay: 440ms; }

/* ============================================================
   LAYOUT WRAPPERS
   ============================================================ */
.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.wrap-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
main {
  flex: 1;
  padding-top: 96px;  /* clears fixed nav */
}

/* ============================================================
   TYPE
   ============================================================ */
.eyebrow {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
  margin-bottom: 20px;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
h1 {
  font-size: 4.5rem;
  line-height: 1.0;
  letter-spacing: -0.018em;
  margin-bottom: 24px;
}
h1 em { font-style: italic; color: var(--navy); font-weight: 500; }
h2 {
  font-size: 2.5rem;
  line-height: 1.1;
  margin-bottom: 24px;
}
h2 em { font-style: italic; color: var(--navy); }
h3 {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  margin-bottom: 12px;
}
h4 {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
  margin-bottom: 10px;
}

.lede {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 32px;
}

p { margin-bottom: 16px; max-width: 70ch; }
p em { font-style: italic; }
strong { font-weight: 600; }

ul, ol { padding-left: 22px; margin-bottom: 16px; }
li { margin-bottom: 6px; max-width: 70ch; }

/* Pull-quote */
.pullquote {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.75rem;
  line-height: 1.35;
  color: var(--navy);
  border-left: 2px solid var(--oak);
  padding: 12px 0 12px 24px;
  margin: 32px 0;
  max-width: 60ch;
}
.pullquote-attribution {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
  margin-top: 16px;
  display: block;
}

@media (max-width: 720px) {
  h1 { font-size: 2.85rem; }
  h2 { font-size: 1.85rem; }
  .lede { font-size: 1.15rem; }
  .pullquote { font-size: 1.35rem; padding-left: 18px; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 4px;
  font-family: 'Spectral', Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
              color 200ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.btn .arrow { transition: transform 200ms; display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: var(--parchment); }
.btn-primary:hover { background: var(--navy); color: var(--parchment); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--parchment); text-decoration: none; }
.btn-oak { background: var(--oak); color: var(--parchment); }
.btn-oak:hover { background: var(--oak-2); color: var(--parchment); text-decoration: none; }

/* ============================================================
   PAGE HERO (used on inner pages)
   ============================================================ */
.page-hero {
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 64px;
}
.page-hero h1 {
  font-size: 4rem;
  margin-bottom: 24px;
}
.page-hero .lede { margin-bottom: 0; }
@media (max-width: 720px) {
  .page-hero h1 { font-size: 2.6rem; }
  .page-hero { padding: 40px 0 48px; margin-bottom: 48px; }
}

/* ============================================================
   HOME HERO
   ============================================================ */
.home-hero {
  padding: 80px 0 96px;
}
.home-hero h1 {
  font-size: 5.5rem;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  max-width: 14ch;
}
.home-hero .lede {
  font-size: 1.35rem;
  margin-bottom: 40px;
  max-width: 56ch;
}
.home-cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .home-hero { padding: 32px 0 56px; }
  .home-hero h1 { font-size: 3.25rem; }
  .home-hero .lede { font-size: 1.15rem; }
}

/* ============================================================
   SECTIONS / CONTENT
   ============================================================ */
section.section { padding: 64px 0; border-bottom: 1px solid var(--rule); }
section.section:last-of-type { border-bottom: none; }
@media (max-width: 720px) {
  section.section { padding: 48px 0; }
}

.section-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
}
.section-grid .eyebrow { margin-top: 8px; margin-bottom: 0; }
@media (max-width: 720px) {
  .section-grid { grid-template-columns: 1fr; gap: 12px; }
  .section-grid .eyebrow { margin-bottom: 0; }
}

/* ============================================================
   CARDS / SERVICES TILES
   ============================================================ */
.card {
  background: var(--parchment-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}
.card p {
  font-size: 1rem;
  color: var(--ink-2);
  margin-bottom: 0;
  flex: 1;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) {
  .card-grid, .card-grid--3 { grid-template-columns: 1fr; }
}

/* ============================================================
   LOCATIONS BLOCK
   ============================================================ */
.locations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 24px 0;
}
.location {
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.location-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}
.location-address {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.location-phone {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 14px;
  color: var(--ink);
}
.location-phone a { color: inherit; text-decoration: none; }
.location-phone a:hover { color: var(--navy); }
@media (max-width: 720px) {
  .locations { grid-template-columns: 1fr; gap: 16px; }
}

/* ============================================================
   BOOK BLOCK (used on home + book pages)
   ============================================================ */
.book-block {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.book-cover {
  background: var(--parchment-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 24px;
  aspect-ratio: 4 / 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.book-cover-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 16px;
  line-height: 1.1;
}
.book-cover-author {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
}
.book-meta {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
  margin-bottom: 16px;
}
.book-block h2 { margin-bottom: 16px; }
@media (max-width: 720px) {
  .book-block { grid-template-columns: 1fr; gap: 32px; padding: 40px 0; }
  .book-cover { max-width: 240px; margin: 0 auto; }
}

/* ============================================================
   FORM (contact)
   ============================================================ */
.form {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 16px;
  max-width: 540px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-label {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oak);
  transition: color 300ms;
}
.form input,
.form textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink);
  width: 100%;
  border-radius: 0;
  transition: border-color 200ms;
}
.form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
.form input:focus,
.form textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}
.form input::placeholder,
.form textarea::placeholder {
  color: var(--muted);
}
/* Theme-aware autofill (proven Notalu pattern with !important) */
.form input:-webkit-autofill,
.form input:-webkit-autofill:hover,
.form input:-webkit-autofill:focus,
.form input:-webkit-autofill:active,
.form select:-webkit-autofill,
.form select:-webkit-autofill:hover,
.form select:-webkit-autofill:focus,
.form textarea:-webkit-autofill,
.form textarea:-webkit-autofill:hover,
.form textarea:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--parchment) inset !important;
          box-shadow: 0 0 0 1000px var(--parchment) inset !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
  transition: background-color 99999s ease-in-out 0s, color 99999s ease-in-out 0s;
}
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ============================================================
   ABOUT PAGE — headshot layout
   ============================================================ */
.about-hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: center;
}
.about-hero h1 { margin-bottom: 16px; }
.about-hero .lede { margin-bottom: 0; }
.headshot {
  border-radius: 4px;
  overflow: hidden;
  background: var(--parchment-2);
  border: 1px solid var(--rule);
  box-shadow: 0 12px 32px var(--shadow);
  width: 100%;
}
.headshot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
@media (max-width: 880px) {
  .about-hero { grid-template-columns: 1fr; gap: 32px; }
  .headshot { max-width: 280px; margin: 0 auto; }
}

/* ============================================================
   BOOK PAGE — real cover image
   ============================================================ */
.book-cover-img {
  background: transparent;
  border: none;
  padding: 0;
  aspect-ratio: auto;
  box-shadow: 0 16px 36px var(--shadow);
  border-radius: 2px;
  overflow: hidden;
}
.book-cover-img img {
  display: block;
  width: 100%;
  height: auto;
}
.book-citation {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.book-section-caption {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--navy);
  margin-top: 16px;
}
.book-section-caption-attr {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
  display: block;
  margin-top: 6px;
}

/* ============================================================
   SERVICE TILE (used on services page)
   ============================================================ */
.service-tile {
  background: var(--parchment-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.service-tile-eyebrow {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
}
.service-tile h3 {
  font-size: 1.5rem;
  margin-bottom: 0;
}
.service-tile p {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 0;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}
@media (max-width: 880px) {
  .service-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   EXCERPTS GRID + LIGHTBOX (book sample viewer)
   ============================================================ */
.excerpts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}
.excerpt-thumb {
  appearance: none;
  background: var(--parchment-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 12px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 200ms;
  text-align: left;
}
.excerpt-thumb:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px var(--shadow);
  border-color: var(--rule-strong);
}
.excerpt-thumb:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.excerpt-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  background: white;
}
.excerpt-thumb-label {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
}
@media (max-width: 720px) {
  .excerpts-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .excerpt-thumb { padding: 8px; gap: 8px; }
}

/* Fullscreen viewer (lightbox) */
.excerpt-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(31, 26, 20, 0.96);
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] .excerpt-viewer { background: rgba(10, 8, 5, 0.97); }
.excerpt-viewer[data-state="open"] {
  opacity: 1;
  pointer-events: auto;
}
.excerpt-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  user-select: none;
  -webkit-user-select: none;
}
.excerpt-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  background: white;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  -webkit-user-drag: none;
  user-select: none;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.excerpt-stage.is-loading img { opacity: 0; }

.excerpt-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 720px;
  margin-top: 16px;
  gap: 16px;
}
.excerpt-counter {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 239, 226, 0.8);
}
.excerpt-nav-group {
  display: flex;
  gap: 8px;
}
.excerpt-btn {
  appearance: none;
  background: rgba(244, 239, 226, 0.1);
  border: 1px solid rgba(244, 239, 226, 0.3);
  color: #F4EFE2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.excerpt-btn:hover {
  background: rgba(244, 239, 226, 0.2);
}
.excerpt-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.excerpt-close {
  position: absolute;
  top: 24px;
  right: 24px;
}

/* ============================================================
   EXCERPTS (legacy text excerpt — kept in case used elsewhere)
   ============================================================ */
.excerpt {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
}
.excerpt-num {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oak);
  margin-bottom: 12px;
}
.excerpt-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--ink);
  font-style: italic;
  max-width: 28ch;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 48px 24px 32px;
  margin-top: 64px;
  transition: border-color 300ms;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.footer-mark {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.footer-mark em { font-style: italic; color: var(--navy); font-weight: 500; }
.footer-mark:hover { color: var(--navy); text-decoration: none; }

.footer-col h4 {
  margin-bottom: 12px;
}
.footer-col p, .footer-col a {
  font-size: 0.95rem;
  color: var(--ink-2);
  margin-bottom: 4px;
  text-decoration: none;
}
.footer-col a:hover { color: var(--navy); text-decoration: underline; }
.footer-meta {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.footer-meta a { color: inherit; }
.footer-links { margin-top: 8px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-dot { color: var(--rule-strong); }

/* "Built by Notalu" credit */
.footer-built-by {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-built-by a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.footer-built-by a:hover { opacity: 1; text-decoration: none; }
.footer-built-by img { height: 14px; width: auto; display: block; }
.built-by-light { display: inline-block; }
.built-by-dark { display: none; }
[data-theme="dark"] .built-by-light { display: none; }
[data-theme="dark"] .built-by-dark { display: inline-block; }

@media (max-width: 880px) {
  .site-footer-inner { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .footer-mark { display: inline-block; }
}

/* ============================================================
   SCROLL FADE
   ============================================================ */
.section, .home-hero, .page-hero, .book-block {
  opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .section, .book-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  .section.is-visible, .book-block.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .menu-overlay { transition: none !important; }
}
