/* ============================================
   PUBLIC DOMAIN CLASSICS — Document Template Styles
   ============================================ */

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

:root {
  --bg: #ffffff;
  --text: #2c2420;
  --accent: #6b3a2a;
  --muted: #5a4f42;
  --border: transparent;
  --nav-bg: #faf8f4;
  --max-w: 760px;
  --surface: #f0ece4;
}

html { scroll-behavior: smooth; }

/* ── SKIP LINK ─────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.skip-link:focus {
  top: 0.5rem;
}

/* ── FOCUS STYLES ──────────────────────────── */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Libre Baskerville', 'Georgia', serif;
  font-size: 21px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* ── TOP NAV ─────────────────────────────── */
#top-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#top-nav.is-idle {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}
#top-nav:hover,
#top-nav.is-active,
#top-nav.is-locked {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Hover zone to reveal top nav */
.top-nav-hover-zone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  z-index: 199;
}
.top-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 29px;
  display: flex;
  align-items: center;
  gap: 0;
}
.top-nav-brand {
  font-family: 'Libre Baskerville', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2c2420;
  padding: 14px 24px 14px 0;
  margin-right: 16px;
  white-space: nowrap;
  text-decoration: none;
}
.top-nav-brand:hover { color: var(--accent); }
/* ── BREADCRUMB NAV ─────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  font-family: 'Libre Baskerville', serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.breadcrumb-sep {
  color: rgba(44, 36, 32, 0.2);
  margin: 0 8px;
  font-size: 9px;
  user-select: none;
}
.breadcrumb a {
  color: rgba(44, 36, 32, 0.6);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.breadcrumb a:hover { color: #2c2420; }
.breadcrumb-title {
  display: inline-block;
  color: rgba(44, 36, 32, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  vertical-align: middle;
}
/* Chapter dropdown */
.breadcrumb-dropdown {
  position: relative;
}
#breadcrumb-chapter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2c2420;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 4px;
  transition: background 0.15s;
  white-space: nowrap;
}
#breadcrumb-chapter:hover {
  background: rgba(0, 0, 0, 0.06);
}
.breadcrumb-caret {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.2s;
}
.breadcrumb-caret::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%) rotate(45deg);
  width: 6px;
  height: 6px;
  border-right: 2px solid #2c2420;
  border-bottom: 2px solid #2c2420;
  transition: transform 0.2s;
}
.breadcrumb-dropdown.is-open .breadcrumb-caret {
  background: rgba(0, 0, 0, 0.15);
}
.breadcrumb-dropdown.is-open .breadcrumb-caret::after {
  transform: translate(-50%, -30%) rotate(-135deg);
}
#breadcrumb-chapter:hover .breadcrumb-caret {
  background: rgba(0, 0, 0, 0.15);
}
/* Dropdown panel */
.breadcrumb-dropdown-list {
  position: absolute;
  top: calc(100% + 10px);
  left: -8px;
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--nav-bg, #faf8f4);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  display: none;
  z-index: 300;
}
.breadcrumb-dropdown.is-open .breadcrumb-dropdown-list {
  display: block;
}
.breadcrumb-dropdown-list li a {
  display: block;
  padding: 7px 16px;
  font-family: 'Libre Baskerville', serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(44, 36, 32, 0.65);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.breadcrumb-dropdown-list li a:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #2c2420;
}
.breadcrumb-dropdown-list li a.active {
  color: #2c2420;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
}

/* ── HERO ────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  background: #ffffff;
  color: #2c2420;
  padding: 72px 6vw 120px 6vw;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.5;
  mix-blend-mode: hard-light;
  pointer-events: none;
  z-index: 0;
}
.hero-line {
  position: absolute;
  top: 0;
  left: 6vw;
  clip-path: inset(0 0 100% 0);
  width: 2px;
  height: 100%;
  background: var(--nav-bg);
  animation: heroLine 3.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
  pointer-events: none;
  z-index: 0;
}
@keyframes metaFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroLine {
  0%   { clip-path: inset(0 0 100% 0); }
  40%  { clip-path: inset(0 0 0% 0); }
  55%  { clip-path: inset(0 0 0% 0); }
  100% { clip-path: inset(100% 0 0% 0); }
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 60px;
  width: 100%;
  padding-left: 40px;
}
.hero-content {
  flex: 1;
  min-width: 0;
}
.hero-court {
  font-family: 'IM Fell English SC', serif;
  font-size: 15px;
  color: #c4b99a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.hero-label {
  font-family: 'IM Fell English SC', serif;
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 40px;
  color: rgba(255, 255, 255, 0.75);
}
.hero-title {
  font-family: 'IM Fell French Canon', serif;
  font-size: clamp(36px, 5.5vw, 72px);
  font-weight: 400;
  color: #ffffff;
  margin: 24px 0 28px;
  letter-spacing: 0.02em;
  line-height: 1.05;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  font-family: 'Libre Baskerville', serif;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  animation: metaFadeIn 0.3s ease;
  padding-top: 24px;
  margin-top: 0;
}
.hero-meta span { display: block; }
.hero-meta span strong {
  display: block;
  font-family: 'IM Fell DW Pica SC', serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  margin-bottom: 2px;
}

/* ── HERO THUMBNAIL ─────────────────────── */
.hero-thumbnail {
  flex-shrink: 0;
  position: relative;
  display: block;
  width: clamp(200px, 22vw, 340px);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}
.hero-thumbnail:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.35);
}
.hero-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.hero-thumbnail-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 51, 204, 0.0);
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
  border-radius: 4px;
}
.hero-thumbnail:hover .hero-thumbnail-overlay {
  opacity: 1;
  background: rgba(0, 51, 204, 0.7);
}
.hero-thumbnail-overlay i {
  font-size: 40px;
  color: #ffffff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
  transition: transform 0.25s ease;
}
.hero-thumbnail:hover .hero-thumbnail-overlay i {
  transform: translateY(-2px);
}
.hero-thumbnail-overlay span {
  font-family: 'Libre Franklin', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
}

/* ── SOURCE BANNER ───────────────────────── */
/* ── THUMBNAIL CAPTION ───────────────────── */
.hero-thumbnail-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.hero-thumbnail-caption {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.4;
}
.hero-thumbnail-caption a {
  color: rgba(255,255,255,0.5);
  text-decoration: underline;
  transition: color 0.15s;
}
.hero-thumbnail-caption a:hover {
  color: #ffffff;
}

/* ── ARTICLE BODY ────────────────────────── */
.article-body {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 29px 96px;
  background: var(--bg);
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
@media (min-width: 1080px) {
  .article-body { margin: -60px auto 0 !important; }
}
.article-body p {
  margin-bottom: 1.68em;
}


/* ── SECTION HEADINGS ───────────────────── */
h2.section-heading {
  position: relative;
  padding: 10px 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  margin: 56px 0 16px;
  scroll-margin-top: 60px;
  font-family: 'IM Fell French Canon', serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.01em;
}
/* Nested subsections within a parent section */
.section-body h2.section-heading {
  font-size: 29px;
  margin: 40px 0 12px;
}

/* ── SECTION BODY ───────────────────────── */
.section-body {
  overflow: visible;
}

/* ── SUB-HEADINGS ────────────────────────── */
h3.sub-heading {
  scroll-margin-top: 60px;
  font-family: 'IM Fell English', serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  color: #1a1a1a;
  letter-spacing: -0.01em;
  margin: 43px 0 12px;
}
h4.sub-sub-heading {
  scroll-margin-top: 60px;
  font-family: 'IM Fell English', serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  color: #333;
  margin: 32px 0 10px;
}

/* ── LEGAL FORMATTING ────────────────────── */
.footnote-ref {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.footnote-ref:hover {
  text-decoration: underline;
}
.footnotes {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #ddd;
}
.footnote {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 12px;
  padding-left: 2em;
  text-indent: -2em;
}
.footnote-num {
  font-weight: 700;
  color: var(--text);
}
blockquote {
  margin: 1.5em 0 1.5em 2em;
  padding-left: 1em;
  border-left: 3px solid rgba(107, 58, 42, 0.25);
  font-family: 'Cormorant Unicase', serif;
  font-weight: 400;
  font-style: normal;
  color: #5a4f42;
}

/* ── DOCUMENT INTRO (DROP CAP) ───────────── */
/* Drop cap */
.drop-cap::first-letter {
  font-family: 'Cormorant Unicase', serif;
  font-size: 8.5em;
  font-weight: 700;
  color: #d4564c;
  float: left;
  line-height: 0.58;
  margin: 0 0.05em 0 -0.02em;
  padding: 0;
  position: relative;
  z-index: -1;
  mix-blend-mode: multiply;
}

/* ── FOOTER ──────────────────────────────── */
.doc-footer {
  background: var(--nav-bg);
  color: #6b6054;
  padding: 48px 29px;
  text-align: center;
  font-family: 'Libre Baskerville', serif;
  font-size: 13px;
  line-height: 1.6;
}
.doc-footer a {
  color: var(--accent);
  text-decoration: none;
}
.doc-footer a:hover { color: #2c2420; }
.doc-footer .brand {
  font-family: 'IM Fell English SC', serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2c2420;
  margin-bottom: 12px;
}
.doc-footer .disclaimer {
  max-width: 600px;
  margin: 12px auto 0;
}

/* ── LITERATURE FORMATTING ───────────────── */
.epigraph {
  margin: 0 0 2.5em 0;
  padding: 16px 0 16px 20px;
  border-left: 3px solid #C25335;
  font-family: 'Libre Franklin', sans-serif;
  font-weight: 300;
  font-style: italic;
  color: #5a4f42;
  font-size: 0.95em;
  line-height: 1.7;
}
.epigraph-attribution {
  display: block;
  margin-top: 0.5em;
  font-style: normal;
  font-weight: 400;
  font-size: 0.85em;
  color: #8a7e6e;
}
.letter-dateline {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 0.5em;
}
.letter-salutation {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 1em;
}
.poetry-block {
  margin: 1.8em 0 1.8em 2.5em;
  padding-left: 1.2em;
  border-left: 2px solid rgba(107, 58, 42, 0.2);
}
.poetry-line {
  font-style: italic;
  color: #444;
  line-height: 1.6;
  margin-bottom: 0.15em;
}
.poetry-attribution {
  font-style: normal;
  font-size: 0.85em;
  color: #8a7e6e;
  margin: 0.5em 0 1.5em 2.5em;
}
.chapter-illustration {
  margin: 2em 0;
  text-align: center;
}
.chapter-illustration img {
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.chapter-illustration figcaption {
  font-size: 0.8em;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.75em;
}

/* ── RESPONSIVE ──────────────────────────── */

/* Tablet — keep side-by-side hero, just tighten */
@media (max-width: 900px) {
  .hero-inner {
    gap: 32px;
    padding-left: 0;
  }
  .hero-content {
    padding-right: 16px;
  }
  .hero-thumbnail, .hero-thumbnail-wrap {
    width: clamp(160px, 35vw, 260px);
    flex-shrink: 0;
  }
  .breadcrumb-title {
    max-width: 180px;
  }
}

/* Mobile nav kicks in earlier to prevent cramped breadcrumb */
@media (max-width: 800px) {
  .top-nav-inner {
    padding: 0 14px;
  }
  .top-nav-brand {
    font-size: 0;
    padding: 10px 8px 10px 0;
    margin-right: 6px;
  }
  .top-nav-brand::before {
    content: 'PDC';
    font-size: 9px;
    letter-spacing: 0.1em;
  }
  .breadcrumb > li:nth-child(1),
  .breadcrumb > li:nth-child(2) {
    display: none;
  }
  .breadcrumb-title {
    display: inline-block;
    max-width: 160px;
    font-size: 9px;
  }
  .breadcrumb > li:nth-child(4) .breadcrumb-sep {
    margin: 0 5px;
  }
  .breadcrumb {
    font-size: 9px;
  }
  .mode-toggle {
    font-size: 9px;
    padding: 6px 6px;
    gap: 4px;
  }
  .mode-toggle span:first-child {
    display: none;
  }
}

/* Small mobile */
@media (max-width: 600px) {
  /* Nav — further compact */
  .top-nav-inner { padding: 0 12px; }
  .top-nav-brand { margin-right: 4px; }
  .breadcrumb-title { max-width: 90px; font-size: 8px; }
  .breadcrumb > li:nth-child(4) .breadcrumb-sep { margin: 0 4px; }
  #breadcrumb-chapter { padding: 6px 6px; margin: -6px -6px; gap: 4px; }
  .breadcrumb-chapter-label {
    display: inline-block;
    min-width: 5em;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
  .breadcrumb-progress { display: none; }
  .breadcrumb-caret { width: 16px; height: 16px; }
  .breadcrumb-caret::after { width: 5px; height: 5px; }
  .breadcrumb-dropdown-list { left: -12px; min-width: 180px; max-height: 60vh; }
  .breadcrumb-dropdown-list li a { padding: 10px 14px; font-size: 13px; }
  .mode-toggle { max-width: 90px; }
  .mode-current {
    display: inline-block;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
  .mode-dropdown-list { min-width: 160px; }
  .mode-dropdown-list li a { padding: 10px 14px; font-size: 13px; }

  /* Hero — stacked on small screens */
  .hero {
    padding: 32px 24px 36px;
  }
  .hero-inner {
    flex-direction: column !important;
    align-items: center !important;
    gap: 24px !important;
    padding: 0 !important;
  }
  .hero-content {
    text-align: center;
    width: 100%;
    padding-right: 0 !important;
  }
  .hero-thumbnail-wrap, .hero-thumbnail {
    order: -1;
    flex: none !important;
    width: auto !important;
    padding: 8px 0;
  }
  .hero-title {
    font-size: 34px !important;
    line-height: 1.08 !important;
    margin: 0 0 14px !important;
  }
  .hero-court {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }
  .hero-label {
    font-size: 11px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
  }
  .hero-meta {
    display: none;
  }

  /* Article body — optimized for mobile reading */
  body {
    font-size: 18px;
    line-height: 1.75;
  }
  .article-body {
    padding: 24px 16px 60px;
    margin-top: 0;
    border-radius: 0;
  }
  .article-body p {
    margin-bottom: 1.4em;
  }
  h2.section-heading {
    font-size: 26px;
    margin: 40px 0 12px;
  }
  .section-body h2.section-heading { font-size: 19px; }
  h3.sub-heading { font-size: 20px; }
  .poetry-block {
    margin: 1.2em 0 1.2em 1em;
    padding-left: 0.8em;
  }
  .epigraph {
    margin: 0 0 2em 0.5em;
    font-size: 0.95em;
  }
  blockquote {
    margin: 1.2em 0 1.2em 1em;
    padding-left: 0.8em;
  }

  /* Drop cap — smaller on mobile */
  .drop-cap::first-letter {
    font-size: 6.4em;
  }

  /* Floating buttons */
  .floating-actions { bottom: 16px; right: 16px; }
  .floating-btn { width: 36px; height: 36px; }

  /* Sentence reader — mobile optimized */
  .sentence-reader {
    padding-top: 40px;
  }
  .sentence-reader-body {
    padding: 20px 5vw 16px;
  }
  .sentence-reader-text {
    font-size: clamp(22px, 6vw, 34px) !important;
    line-height: 1.6;
  }
  .sentence-reader-nav {
    padding: 12px 5vw 20px;
    gap: 12px;
  }
  .sentence-reader-btn {
    width: 44px;
    height: 44px;
  }
  .sentence-reader-hint { display: none; }
  .sentence-reader-counter { font-size: 11px; }
  .sr-start-tooltip {
    font-size: 10px;
    padding: 5px 10px;
    right: calc(100% + 8px);
  }

  /* Sentence cover hero — smaller on mobile */
  .sr-cover-hero .hero-title {
    font-size: clamp(24px, 7vw, 36px) !important;
  }

  /* Footer */
  .doc-footer {
    padding: 32px 16px;
    font-size: 12px;
  }
}

/* Very small mobile (< 380px) */
@media (max-width: 380px) {
  body { font-size: 16px; }
  .article-body { padding: 20px 12px 48px; }
  h2.section-heading { font-size: 22px; }
  .hero-title { font-size: 30px !important; }
  .sentence-reader-text { font-size: 16px !important; }
}

@media print {
}

/* ── BREADCRUMB PROGRESS ────────────────── */
.breadcrumb-progress {
  margin-left: 6px;
  font-size: 9px;
  font-weight: 400;
  color: #2c2420;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* ── FLOATING ACTION BUTTONS ────────────── */
.floating-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.floating-actions.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.floating-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(44, 36, 32, 0.2);
  border-radius: 50%;
  background: rgba(250, 248, 244, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text, #2c2420);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.floating-btn:hover {
  border-color: var(--accent, #6b3a2a);
  background: rgba(250, 248, 244, 1);
}
.floating-btn:active {
  transform: scale(0.92);
}
.floating-btn svg {
  width: 18px;
  height: 18px;
}
@media (max-width: 600px) {
  .floating-actions { bottom: 16px; right: 16px; }
  .floating-btn { width: 36px; height: 36px; }
}

/* ── MODE DROPDOWN ──────────────────────── */
.mode-dropdown {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(44, 36, 32, 0.6);
  background: none;
  border: none;
  font-family: 'Libre Baskerville', serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px 0;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.mode-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #2c2420;
}
.mode-toggle .mode-current {
  color: #2c2420;
  font-weight: 600;
}
.mode-toggle .breadcrumb-caret {
  width: 14px;
  height: 14px;
}
.mode-toggle .breadcrumb-caret::after {
  width: 5px;
  height: 5px;
}
.mode-dropdown-list {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: var(--nav-bg, #faf8f4);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  display: none;
  z-index: 300;
}
.mode-dropdown.is-open .mode-dropdown-list {
  display: block;
}
.mode-dropdown.is-open .breadcrumb-caret {
  background: rgba(0, 0, 0, 0.15);
}
.mode-dropdown.is-open .breadcrumb-caret::after {
  transform: translate(-50%, -30%) rotate(-135deg);
}
.mode-dropdown-list li a {
  display: block;
  padding: 7px 16px;
  font-family: 'Libre Baskerville', serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(44, 36, 32, 0.7);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.mode-dropdown-list li a:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #2c2420;
}
.mode-dropdown-list li a.active {
  color: #2c2420;
  font-weight: 600;
}

/* ── SENTENCE READER OVERLAY ────────────── */
.sentence-reader {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: var(--bg, #faf8f4);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding-top: 44px;
}
:fullscreen .sentence-reader {
  padding-top: 0;
}
.sentence-reader.is-active {
  opacity: 1;
  pointer-events: auto;
}
/* Cover slide — exact clone of the hero */
.sentence-reader-cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.sentence-reader-cover .sr-cover-hero {
  flex: 1;
  min-height: 0;
}
/* Nav on cover — white arrow on dark bg, larger */
.sentence-reader-nav.on-cover {
  background: var(--nav-bg, #faf8f4);
  padding: 20px 8vw 28px;
}
.sentence-reader-nav.on-cover .sentence-reader-btn {
  width: 56px;
  height: 56px;
  border-color: rgba(44, 36, 32, 0.2);
  color: #2c2420;
}
.sentence-reader-nav.on-cover .sentence-reader-btn:hover {
  border-color: var(--accent);
  background: rgba(107, 58, 42, 0.06);
}
.sentence-reader-nav.on-cover .sentence-reader-btn svg {
  width: 26px;
  height: 26px;
}
/* Tooltip pointing to the next arrow */
.sr-next-wrap {
  position: relative;
  display: inline-flex;
}
.sr-start-tooltip {
  position: absolute;
  top: 50%;
  right: calc(100% + 14px);
  transform: translateY(-50%) scale(0.95);
  white-space: nowrap;
  background: #d4564c;
  color: #ffffff;
  font-family: 'Libre Baskerville', serif;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
  z-index: 10;
}
.sr-start-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #d4564c;
}
.sr-start-tooltip.is-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  pointer-events: auto;
  cursor: pointer;
  animation: tooltipBounce 2s ease-in-out infinite;
}
@keyframes tooltipBounce {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50% { transform: translateY(-50%) translateX(-4px); }
}
.sr-tooltip-mobile { display: none; }
@media (max-width: 600px) {
  .sr-tooltip-desktop { display: none; }
  .sr-tooltip-mobile { display: inline; }
}
.sr-start-tooltip kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  font-family: inherit;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.12);
}

/* Sentence body with crossfade */
.sentence-reader-body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 48px 8vw 32px;
  overflow: hidden;
  position: relative;
}
.sentence-reader-text {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(24px, 3.8vw, 40px);
  line-height: 1.55;
  color: var(--text, #2c2420);
  text-align: left;
  max-width: 1100px;
  transition: opacity 0.3s ease;
}
.sentence-reader-text.is-fading {
  opacity: 0;
}
/* Typewriter fragments — slow, subtle fade */
.sr-fragment {
  opacity: 0;
  filter: blur(2px);
  transition: opacity 0.6s ease, filter 0.6s ease;
}
.sr-fragment.is-visible {
  opacity: 1;
  filter: blur(0);
}
.sentence-reader-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 16px 8vw 28px;
  flex-shrink: 0;
}
.sentence-reader-btn {
  width: 48px;
  height: 48px;
  border: 1.5px solid rgba(44, 36, 32, 0.15);
  border-radius: 50%;
  background: none;
  color: var(--text, #2c2420);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.sentence-reader-btn:hover {
  border-color: var(--accent, #6b3a2a);
  background: rgba(107, 58, 42, 0.06);
}
.sentence-reader-btn:active {
  transform: scale(0.92);
}
.sentence-reader-btn:disabled {
  opacity: 0.25;
  cursor: default;
}
.sentence-reader-btn svg {
  width: 22px;
  height: 22px;
}
.sentence-reader-counter {
  font-family: 'Libre Baskerville', serif;
  font-size: 12px;
  color: var(--muted, #5a4f42);
  min-width: 80px;
  text-align: center;
}
.sentence-reader-hint {
  font-family: 'Libre Baskerville', serif;
  font-size: 10px;
  color: rgba(90, 79, 66, 0.35);
  margin-right: auto;
}
.sentence-reader-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgba(90, 79, 66, 0.15);
  border-radius: 3px;
  font-family: inherit;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.02);
}
@media (max-width: 600px) {
  .sentence-reader-body { padding: 60px 6vw 30px; }
  .sentence-reader-nav { padding: 16px 6vw 24px; }
  .sentence-reader-text { font-size: clamp(20px, 5vw, 32px); }
  .sentence-reader-hint { display: none; }
}

/* ── COOKIE CONSENT BANNER ────────────── */
.consent-banner {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.consent-banner.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.consent-banner-inner {
  max-width: 480px;
  width: calc(100% - 40px);
  background: #faf8f4;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.consent-banner-text {
  font-family: 'Libre Franklin', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: #5a4f42;
  flex: 1;
}
.consent-banner-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.consent-btn {
  font-family: 'Libre Franklin', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 4px;
  cursor: pointer;
  padding: 8px 20px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.consent-btn--accept {
  background: #C25335;
  color: #ffffff;
  border: 1px solid #C25335;
}
.consent-btn--accept:hover {
  background: #a8452c;
  border-color: #a8452c;
}
.consent-btn--decline {
  background: transparent;
  color: #5a4f42;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.consent-btn--decline:hover {
  border-color: rgba(0, 0, 0, 0.3);
  color: #2c2420;
}
@media (max-width: 600px) {
  .consent-banner-inner {
    padding: 22px 20px 20px;
    gap: 16px;
  }
}
