:root {
  --bg: #efe7dc;
  --ink: #1f1a16;
  --accent: #c46a1a;
  --pane-bg: #fffaf2;
  --border: #d4c8ba;
  --highlight: rgba(255, 214, 64, 0.2);
  --font-display: "Georgia", "Times New Roman", serif;
  --font-ui: "Trebuchet MS", "Verdana", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 10% 10%, #fff6e6 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: var(--font-ui);
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

body::before {
  content: "";
  position: absolute;
  inset: -20% -20% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(196, 106, 26, 0.15), rgba(196, 106, 26, 0));
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: absolute;
  inset: auto auto -25% -15%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(60, 90, 120, 0.12), rgba(60, 90, 120, 0));
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.95), rgba(239, 231, 220, 0.85));
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(30, 22, 14, 0.08);
}

.landing-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 2.5rem 2.5rem 2rem;
  overflow: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: #8a7054;
  margin: 0 0 0.6rem;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4.2vw, 3.6rem);
  margin: 0 0 0.8rem;
}

.hero-subtitle {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: #6b5843;
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #c46a1a, #e2a559);
  color: #fff7ee;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(196, 106, 26, 0.25);
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 106, 26, 0.35);
  color: #6a4b27;
  text-decoration: none;
  background: rgba(255, 250, 242, 0.75);
  font-weight: 600;
}

.hero-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: #82694f;
  font-weight: 600;
  font-size: 0.85rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.visual-card {
  width: min(360px, 100%);
  background: #fff9f0;
  border-radius: 24px;
  border: 1px solid rgba(212, 200, 186, 0.7);
  box-shadow: 0 18px 40px rgba(30, 22, 14, 0.12);
  padding: 1.4rem;
  display: grid;
  gap: 1.2rem;
}

.visual-header {
  display: flex;
  gap: 0.4rem;
}

.visual-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(196, 106, 26, 0.4);
}

.visual-body {
  display: grid;
  gap: 0.6rem;
}

.visual-line {
  height: 10px;
  border-radius: 999px;
  background: rgba(196, 106, 26, 0.18);
}

.visual-line.short {
  width: 60%;
}

.visual-highlight {
  height: 12px;
  border-radius: 999px;
  background: rgba(196, 106, 26, 0.35);
}

.visual-rsvp {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #4b3418;
}

.visual-left {
  text-align: right;
  opacity: 0.55;
}

.visual-orp {
  color: var(--accent);
  font-weight: 700;
}

.visual-right {
  text-align: left;
  opacity: 0.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: rgba(255, 250, 242, 0.85);
  border: 1px solid rgba(212, 200, 186, 0.7);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 12px 28px rgba(30, 22, 14, 0.08);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.feature-card p {
  margin: 0;
  color: #6b5843;
}

.cta-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.8rem 2rem;
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(255, 246, 230, 0.9), rgba(245, 232, 214, 0.95));
  border: 1px solid rgba(212, 200, 186, 0.8);
  box-shadow: 0 16px 32px rgba(30, 22, 14, 0.12);
}

.cta-panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.cta-panel p {
  margin: 0;
  color: #6b5843;
}

.faq-section {
  display: grid;
  gap: 1.8rem;
  padding: 2.2rem 2rem;
  border-radius: 28px;
  background: rgba(255, 250, 242, 0.9);
  border: 1px solid rgba(212, 200, 186, 0.7);
  box-shadow: 0 18px 38px rgba(30, 22, 14, 0.08);
}

.faq-header h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
}

.faq-intro {
  margin: 0;
  color: #6b5843;
  max-width: 34rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.2rem;
}

.faq-item {
  border-radius: 18px;
  border: 1px solid rgba(212, 200, 186, 0.7);
  background: rgba(255, 247, 235, 0.9);
  padding: 1rem 1.2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: #4f3a24;
  list-style: none;
}

.faq-item summary::marker,
.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 700;
  color: #9a6a36;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin: 0.75rem 0 0;
  color: #6b5843;
  line-height: 1.5;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #c46a1a, #e2a559);
  color: #fff7ee;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 20px rgba(196, 106, 26, 0.25);
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-tag {
  font-size: 0.8rem;
  color: #7c6b56;
  letter-spacing: 0.02em;
}

.site-nav-toggle {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-nav-toggle summary {
  list-style: none;
}

.site-nav-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(196, 106, 26, 0.35);
  background: linear-gradient(140deg, rgba(255, 251, 244, 0.95), rgba(245, 230, 210, 0.9));
  color: #6a4b27;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(196, 106, 26, 0.15);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.site-nav-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(196, 106, 26, 0.2);
}

.site-nav-button:focus-visible {
  outline: 2px solid rgba(196, 106, 26, 0.5);
  outline-offset: 2px;
}

.hamburger-line {
  position: relative;
  width: 20px;
  height: 2px;
  background: #7a5732;
  border-radius: 999px;
}

.hamburger-line::before,
.hamburger-line::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: #7a5732;
  border-radius: 999px;
}

.hamburger-line::before {
  top: -6px;
  width: 14px;
}

.hamburger-line::after {
  top: 6px;
  width: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-nav {
  display: flex;
  gap: 1.2rem;
  font-weight: 600;
}

.site-nav-toggle > .site-nav {
  display: flex;
}

.site-nav a {
  text-decoration: none;
  color: #5a4733;
  position: relative;
  padding-bottom: 0.2rem;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width 160ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  width: 100%;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 250, 242, 0.9), rgba(255, 245, 230, 0.6));
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(30, 22, 14, 0.08);
  z-index: 11;
}

.tool-left,
.tool-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tool-left {
  flex: 1;
  flex-wrap: wrap;
}

.tool-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.status {
  min-width: 140px;
}

.file-open {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-open select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  background: #fffaf2;
  border-radius: 999px;
  height: 38px;
}

.nav-controls {
  display: flex;
  gap: 0.5rem;
}

.nav-controls button {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  background: #fffaf2;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.nav-controls button:hover:enabled {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(30, 22, 14, 0.12);
}

.nav-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.wpm-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #5c4f3d;
}

.wpm-control input {
  width: 80px;
  padding: 0.2rem 0.3rem;
  border: 1px solid var(--border);
  background: #fffaf2;
  border-radius: 999px;
}

.settings-label {
  margin-left: 0.3rem;
  color: #5c4f3d;
  font-size: 0.9rem;
}


.file-label {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  background: #fffaf2;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  height: 38px;
  display: inline-flex;
  align-items: center;
}

#fileInput {
  display: none;
}

.status {
  font-variant-numeric: tabular-nums;
  color: #5c4f3d;
}

.progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 160px;
}


.page-jump {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #6a5b47;
}

.page-jump input {
  width: 70px;
  padding: 0.2rem 0.3rem;
  border: 1px solid var(--border);
  background: #fffdf8;
}

#pageGo {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  background: #fffdf8;
  cursor: pointer;
}

#pageGo:disabled,
.page-jump input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pageText {
  color: #6a5b47;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  width: 140px;
  height: 8px;
  background: #e6ddd2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #c0893a;
  transition: width 150ms ease-out;
}

.split-view {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  padding: 1rem 1.5rem 1rem;
}

.site-footer {
  position: relative;
  z-index: 2;
  padding: 0.75rem 2rem 1.2rem;
  font-size: 0.85rem;
  color: #7d6c58;
  border-top: 1px solid rgba(212, 200, 186, 0.6);
  background: linear-gradient(90deg, rgba(255, 250, 242, 0.85), rgba(240, 231, 220, 0.8));
}

.pane {
  overflow: hidden;
  height: 100%;
  border-radius: 18px;
  box-shadow: var(--shadow);
  background: var(--pane-bg);
}

.epub-pane {
  background: var(--pane-bg);
}

.pdf-container {
  height: 100%;
  overflow: auto;
  padding: 1.5rem;
  background: #f1e9dd;
  display: grid;
  justify-items: center;
  align-content: start;
}

.pdf-page {
  display: block;
  width: fit-content;
  margin-bottom: 1.5rem;
  position: relative;
}

.pdf-page canvas {
  box-shadow: 0 6px 18px rgba(30, 20, 10, 0.2);
  background: white;
  display: block;
  border-radius: 12px;
}

.pdf-textLayer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform-origin: 0 0;
  pointer-events: auto;
}

.pdf-textLayer span {
  position: absolute;
  white-space: pre;
  transform-origin: 0 0;
  color: rgba(0, 0, 0, 0);
}

.pdf-highlight-box {
  position: absolute;
  background: rgba(255, 214, 64, 0.2);
  border-radius: 2px;
  pointer-events: none;
}

.rsvp-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff8ea, #f1e2ce);
  border-left: 1px solid var(--border);
}

.rsvp-word {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  color: #4b3418;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.2rem;
  width: 80%;
  text-shadow: 0 6px 14px rgba(60, 40, 20, 0.15);
}

.rsvp-word.is-message {
  display: block;
  text-align: center;
}

.orp-left {
  text-align: right;
}

.orp-char {
  color: var(--accent);
  font-weight: bold;
}

.orp-right {
  text-align: left;
}

@media (max-width: 900px) {
  .site-header {
    padding: 0.75rem 1rem;
  }

  .brand-group {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }

  .site-nav-toggle {
    position: relative;
    margin-left: auto;
  }

  .site-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(212, 200, 186, 0.7);
    background: rgba(255, 250, 242, 0.96);
    box-shadow: 0 12px 24px rgba(30, 22, 14, 0.12);
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    z-index: 20;
  }

  .site-nav-toggle[open] .site-nav {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .cta-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .faq-section {
    padding: 1.6rem 1.4rem;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.7rem 0.9rem;
  }

  .tool-left,
  .tool-right {
    width: 100%;
    justify-content: flex-start;
  }

  .status {
    display: none;
  }

  .progress {
    gap: 0.35rem;
    flex-wrap: nowrap;
  }

  .progress-track {
    width: 90px;
    height: 6px;
  }

  #progressText,
  #pageText {
    font-size: 0.75rem;
  }

  .page-jump {
    gap: 0.2rem;
  }

  .page-jump input {
    width: 52px;
    font-size: 0.75rem;
  }

  #pageGo {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .tool-left {
    flex-wrap: nowrap;
    overflow-x: visible;
    gap: 0.4rem;
  }

  .file-label {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    height: 32px;
  }

  .file-open select {
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
    height: 32px;
  }

  .nav-controls {
    gap: 0.35rem;
  }

  .nav-controls button {
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
  }

  .wpm-control {
    gap: 0.25rem;
  }

  .wpm-control label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .wpm-control input {
    width: 56px;
    font-size: 0.75rem;
    height: 32px;
  }


  .split-view {
    grid-template-columns: 1fr;
    grid-template-rows: 3fr 1fr;
    padding: 0.75rem;
  }

  .rsvp-pane {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
