:root {
  --bg-obsidian: #0B0B0D;
  --bg-elevated: #131316;
  --text-parchment: #F4F1EA;
  --text-ink: #E6E3DC;
  --text-ash: #8C8B88;
  --accent-champagne: #D6B882;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-obsidian);
  color: var(--text-ink);
  overflow-x: clip;
}

body.menu-open {
  overflow: hidden;
}

body .font-serif { font-family: Georgia, serif; }
.font-lora { font-family: 'Lora', Georgia, serif; }
.font-merriweather { font-family: 'Merriweather', Georgia, serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* Preserve the original Tailwind monospace stack on the landing page. */
.landing-page .font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; }

.text-parchment { color: var(--text-parchment); }
.text-ink { color: var(--text-ink); }
.text-ash { color: var(--text-ash); }
.text-champagne { color: var(--accent-champagne); }
.bg-obsidian { background-color: var(--bg-obsidian); }
.bg-champagne { background-color: var(--accent-champagne); }
.border-champagne { border-color: var(--accent-champagne); }

/* =========================================================
   MOBILE BURGER BUTTON & ANIMATED DRAWER
   ========================================================= */
.burger-line {
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  transform-origin: center;
}

#mobileMenuBtn[aria-expanded="true"] .line-1 {
  transform: translateY(7px) rotate(45deg);
}

#mobileMenuBtn[aria-expanded="true"] .line-2 {
  opacity: 0;
  transform: scaleX(0);
}

#mobileMenuBtn[aria-expanded="true"] .line-3 {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Closed State */
.mobile-menu-overlay {
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu-backdrop {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.mobile-menu-panel {
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Open State */
.mobile-menu-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-overlay.is-open .mobile-menu-backdrop {
  opacity: 1;
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
  transform: translateX(0);
}

/* Staggered Links & Actions Animation */
.mobile-menu-overlay .mobile-nav-link,
.mobile-menu-overlay .mobile-menu-actions {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}

.mobile-menu-overlay.is-open .mobile-nav-link,
.mobile-menu-overlay.is-open .mobile-menu-actions {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu-overlay.is-open .mobile-nav-link:nth-child(1) { transition-delay: 0.06s; }
.mobile-menu-overlay.is-open .mobile-nav-link:nth-child(2) { transition-delay: 0.10s; }
.mobile-menu-overlay.is-open .mobile-nav-link:nth-child(3) { transition-delay: 0.14s; }
.mobile-menu-overlay.is-open .mobile-nav-link:nth-child(4) { transition-delay: 0.18s; }
.mobile-menu-overlay.is-open .mobile-nav-link:nth-child(5) { transition-delay: 0.22s; }
.mobile-menu-overlay.is-open .mobile-menu-actions { transition-delay: 0.26s; }

/* Subtle Editorial Ambient Glow */
.hero-ambient {
  position: absolute;
  top: -140px;
  right: 8%;
  width: 560px;
  height: 440px;
  background: radial-gradient(circle, rgba(214, 184, 130, 0.1) 0%, rgba(11, 11, 13, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

@media (width < 640px) {
  .hero-title {
    font-size: min(2.4rem, 10.5vw);
  }
}

@media (min-width: 640px) {
  .hero-title-mobile-break {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-ambient {
    width: 300px;
    height: 240px;
    right: -40px;
    top: -60px;
  }
}

.logo {
  max-width: 50px;
}

.gold-gradient-text {
  background: linear-gradient(135deg, #F5E6C8 0%, #D6B882 55%, #B59257 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Primary Gold CTA */
.btn-gold {
  background: linear-gradient(135deg, #E2C693 0%, #C7A468 100%);
  color: #100F0D;
  box-shadow: 0 8px 28px rgba(214, 184, 130, 0.22);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(214, 184, 130, 0.34);
  filter: brightness(1.04);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.22s ease, background-color 0.22s ease;
}

.btn-ghost:hover {
  border-color: rgba(214, 184, 130, 0.45);
  background: rgba(214, 184, 130, 0.05);
}

/* =========================================================
   HERO TYPING HANDS & KEYBOARD STAGE
   ========================================================= */
.typing-stage-frame {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(214, 184, 130, 0.24);
  background: #121216;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.typing-paper-zone {
  background: linear-gradient(180deg, #F7F3EA 0%, #EFE9DC 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.typing-caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background-color: #B48A44;
  vertical-align: -0.18em;
  margin-left: 2px;
  animation: caretBlink 0.9s steps(2, start) infinite;
}

@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.typing-desk-zone {
  background: radial-gradient(circle at 50% 25%, #1A1815 0%, #0D0D10 85%);
  min-height: 188px;
  overflow: hidden;
}

.desk-key-glow {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 110px;
  background: radial-gradient(ellipse, rgba(214, 184, 130, 0.14) 0%, rgba(13, 13, 16, 0) 72%);
  pointer-events: none;
}

.v-key {
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(244, 241, 234, 0.45);
  transition: transform 0.09s ease, background-color 0.09s ease, border-color 0.09s ease, color 0.09s ease, box-shadow 0.09s ease;
  cursor: pointer;
}

@media (max-width: 420px) {
  .typing-desk-zone { min-height: 164px; }
  .v-key { height: 24px; font-size: 9px; border-radius: 5px; }
  .v-key-space { height: 22px; }
}

.v-key:hover {
  border-color: rgba(214, 184, 130, 0.35);
  color: rgba(244, 241, 234, 0.85);
}

.v-key-space {
  height: 26px;
  font-size: 9px;
  letter-spacing: 0.2em;
}

.v-key.is-pressed {
  transform: translateY(2px) scale(0.96);
  background: rgba(214, 184, 130, 0.26);
  border-color: rgba(214, 184, 130, 0.85);
  color: #F4F1EA;
  box-shadow: 0 0 16px rgba(214, 184, 130, 0.35);
}

.hands-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.hand-svg {
  width: 196px;
  height: 146px;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}

@media (max-width: 420px) {
  .hand-svg { width: 158px; height: 118px; }
}

.hand-left {
  margin-right: -14px;
  transform: translate(0px, 14px);
}

.hand-right {
  margin-left: -14px;
  transform: translate(0px, 14px);
}

.finger-node {
  transition: transform 0.09s ease, filter 0.09s ease;
  transform-origin: center bottom;
}

.finger-node.is-tapping {
  transform: translateY(6px) scaleY(0.93);
  filter: brightness(1.45);
}

/* =========================================================
   TYPESETTING BOOK SHEET DYNAMIC SIZES
   ========================================================= */
#bookPreviewSheet {
  max-width: 266px;
  aspect-ratio: 148 / 210;
  padding: 1.65rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition:
    max-width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    aspect-ratio 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

#bookPreviewSheet[data-paper="A4"] {
  max-width: 315px;
  aspect-ratio: 210 / 297;
  padding: 2rem 2.15rem;
}

#bookPreviewSheet[data-paper="B5"] {
  max-width: 292px;
  aspect-ratio: 176 / 250;
  padding: 1.85rem 1.95rem;
}

#bookPreviewSheet[data-paper="A5"] {
  max-width: 266px;
  aspect-ratio: 148 / 210;
  padding: 1.65rem 1.75rem;
}

#bookPreviewSheet[data-paper="A6"] {
  max-width: 215px;
  aspect-ratio: 105 / 148;
  padding: 1.25rem 1.35rem;
}

#bookPreviewSheet[data-paper="A6"] #sheetHeadingFont {
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
}

#bookPreviewSheet[data-paper="A6"] p {
  font-size: 9.5px;
  line-height: 1.55;
}

#bookPreviewSheet[data-paper="A6"] #sheetPageNumber {
  margin-top: 1rem;
  padding-top: 0.45rem;
  font-size: 9.5px;
}

#bookPreviewSheet[data-paper="A4"] p {
  font-size: 12px;
  line-height: 1.78;
}

/* Surface Cards with Cursor Glow */
.surface-card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.surface-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(450px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(214, 184, 130, 0.08), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.surface-card:hover::before {
  opacity: 1;
}

.surface-card:hover {
  border-color: rgba(214, 184, 130, 0.32);
}

/* Safe Scroll Reveal (Visible by default so site never disappears) */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(20px);
}

html.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0B0B0D; }
::-webkit-scrollbar-thumb { background: #27272D; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3D3B35; }
html { scroll-padding-top: 5rem; }
.section-anchor { height: 0; }
#authModal { margin: auto; width: calc(100% - 2rem); }
#authModal::backdrop { background: rgb(0 0 0 / 80%); backdrop-filter: blur(10px); }
#modalSubmitBtn:disabled { cursor: wait; opacity: .65; }
#authConfirmPasswordInput[aria-invalid="true"] { border-color: #f87171; }
