:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
  --mx: 50vw;
  --my: 30vh;

  --obsidian: #0b0b0d;
  --surface: #131317;
  --parchment: #f2f0ec;
  --muted: #8b8894;
  --accent-gold: #d8c39e;
  --border-subtle: rgba(255, 255, 255, 0.08);
}

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

body {
  background-color: #0b0b0d;
  color: #f2f0ec;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font-family: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid #d8c39e;
  outline-offset: 2px;
}

.font-serif { font-family: 'Cormorant Garamond', Georgia, serif; }
.font-sans { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* =========================================================
   AMBIENT ATMOSPHERIC FIELD, BLUR GLASS DEPTH & FILM GRAIN
   ========================================================= */
.ambient-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 15% 10%, rgba(232, 190, 120, 0.09) 0%, transparent 65%),
    radial-gradient(ellipse 70% 55% at 85% 22%, rgba(70, 82, 190, 0.14) 0%, transparent 68%),
    radial-gradient(ellipse 65% 50% at 72% 85%, rgba(60, 170, 235, 0.07) 0%, transparent 68%),
    radial-gradient(ellipse 60% 45% at 22% 82%, rgba(190, 50, 70, 0.08) 0%, transparent 65%),
    linear-gradient(165deg, #040406 0%, #08080c 48%, #050508 100%);
  transform: translateZ(0);
}

.ambient-orb {
  position: absolute;
  border-radius: 9999px;
  opacity: 0.85;
  pointer-events: none;
}

.ambient-orb.orb-gold {
  top: -10%;
  left: 4%;
  width: 52vw;
  height: 52vw;
  max-width: 680px;
  max-height: 680px;
  background: radial-gradient(circle, rgba(232, 190, 120, 0.15) 0%, rgba(232, 190, 120, 0.045) 42%, rgba(216, 195, 158, 0) 72%);
}

.ambient-orb.orb-indigo {
  top: 18%;
  right: -10%;
  width: 56vw;
  height: 56vw;
  max-width: 740px;
  max-height: 740px;
  background: radial-gradient(circle, rgba(80, 96, 200, 0.2) 0%, rgba(60, 70, 200, 0.065) 45%, rgba(41, 46, 145, 0) 74%);
}

.ambient-orb.orb-crimson {
  bottom: -12%;
  left: 20%;
  width: 48vw;
  height: 48vw;
  max-width: 620px;
  max-height: 620px;
  background: radial-gradient(circle, rgba(200, 60, 80, 0.15) 0%, rgba(180, 40, 60, 0.045) 44%, rgba(102, 0, 0, 0) 72%);
}

/* Lightweight frosted sheen without expensive full-viewport backdrop-filter repaints */
.glass-atmosphere-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0%, rgba(255, 255, 255, 0) 26%, rgba(8, 8, 11, 0.32) 100%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04), transparent 58%);
  transform: translateZ(0);
}

.noise-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.036;
  mix-blend-mode: overlay;
  transform: translateZ(0);
}

.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 195, 158, 0.06) 0%, rgba(255, 255, 255, 0) 68%);
  transform: translate3d(calc(var(--mx) - 320px), calc(var(--my) - 320px), 0);
  pointer-events: none;
  z-index: 1;
}

html.low-power .noise-overlay,
html.low-power .cursor-glow {
  display: none !important;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
}

.pulse-dot {
  animation: pulseDot 2.4s infinite ease-in-out;
}

/* =========================================================
   SMOKY BLUR GLASS SURFACES (NAVBAR, MOBILE HAMBURGER, MODALS)
   ========================================================= */
.smoky-navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 11, 13, 0.86);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transform: translateZ(0);
  transition: background-color 0.35s var(--ease-editorial), border-color 0.35s var(--ease-editorial);
}

.navbar-inner {
  padding: 0.85rem 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.navbar-brand {
  background: transparent;
  border: 0;
  padding: 0.25rem 0;
  color: #f2f0ec;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.16em;
  font-size: 11.5px;
  white-space: nowrap;
  min-width: 0;
  transition: opacity 0.25s var(--ease-editorial);
}

.navbar-brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar-brand:hover {
  opacity: 0.85;
}

.navbar-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-left: auto;
  letter-spacing: 0.13em;
  font-size: 10.5px;
  flex-wrap: nowrap;
}

.navbar-link-btn {
  padding: 0.42rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: #8b8894;
  white-space: nowrap;
  transition:
    color 0.28s var(--ease-editorial),
    background-color 0.28s var(--ease-editorial),
    border-color 0.28s var(--ease-editorial);
}

.navbar-link-btn:hover {
  color: #f2f0ec;
  background: rgba(255, 255, 255, 0.05);
}

.navbar-link-btn.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.navbar-meta {
  display: none;
  color: #8b8894;
  padding-left: 0.65rem;
  margin-left: 0.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

@media (min-width: 1060px) {
  .navbar-meta {
    display: inline-block;
  }
}

/* Mobile Hamburger Button & Collapsible Drawer */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f2f0ec;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.25s var(--ease-editorial),
    border-color 0.25s var(--ease-editorial);
}

.hamburger-btn:hover,
.hamburger-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(216, 195, 158, 0.38);
}

.hamburger-icon {
  position: relative;
  width: 18px;
  height: 12px;
  display: inline-block;
}

.hamburger-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background-color: #f2f0ec;
  transition:
    transform 0.28s var(--ease-editorial),
    opacity 0.2s var(--ease-editorial),
    top 0.28s var(--ease-editorial);
}

.hamburger-icon span:nth-child(1) { top: 0; }
.hamburger-icon span:nth-child(2) { top: 5px; }
.hamburger-icon span:nth-child(3) { top: 10px; }

.hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
  top: 5px;
  transform: rotate(45deg);
  background-color: #d8c39e;
}

.hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
  top: 5px;
  transform: rotate(-45deg);
  background-color: #d8c39e;
}

@keyframes mobileDrawerSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, -8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.mobile-nav-drawer {
  padding: 0.75rem 5vw 1.15rem 5vw;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 13, 17, 0.96);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  animation: mobileDrawerSlideIn 0.26s var(--ease-editorial) both;
}

.mobile-nav-item {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  color: #b4b0be;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    background-color 0.22s var(--ease-editorial),
    border-color 0.22s var(--ease-editorial),
    color 0.22s var(--ease-editorial);
}

.mobile-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.mobile-nav-item.is-active {
  background: rgba(216, 195, 158, 0.12);
  border-color: rgba(216, 195, 158, 0.34);
  color: #f2f0ec;
}

@media (max-width: 768px) {
  .navbar-inner {
    padding: 0.7rem 5vw;
  }
  .navbar-brand {
    font-size: 10.5px;
    letter-spacing: 0.12em;
  }
  .navbar-links {
    display: none;
  }
  .hamburger-btn {
    display: inline-flex;
  }
}

.smoky-glass-panel {
  background: linear-gradient(160deg, rgba(28, 25, 38, 0.97) 0%, rgba(18, 20, 31, 0.97) 100%);
  border: 1px solid rgba(216, 195, 158, 0.2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Refined, calm basic button transitions without expensive nested backdrop-filter */
.smoky-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    background-color 0.28s var(--ease-editorial),
    border-color 0.28s var(--ease-editorial),
    color 0.28s var(--ease-editorial),
    transform 0.28s var(--ease-editorial);
}

.smoky-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.smoky-pill:active {
  transform: translateY(0);
}

.btn-primary-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #d8c39e;
  color: #0b0b0d;
  border: 0;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.28s var(--ease-editorial),
    transform 0.28s var(--ease-editorial),
    box-shadow 0.28s var(--ease-editorial);
}

.btn-primary-gold:hover {
  background: #e3d1b0;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(216, 195, 158, 0.18);
}

.btn-primary-gold:active {
  transform: translateY(0);
}

.btn-subtle {
  transition:
    color 0.26s var(--ease-editorial),
    background-color 0.26s var(--ease-editorial),
    border-color 0.26s var(--ease-editorial),
    opacity 0.26s var(--ease-editorial);
}

.btn-subtle:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* =========================================================
   CINEMATIC SCROLL REVEAL & SECTION TRANSITIONS
   ========================================================= */
.reveal-meta {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 0.7s var(--ease-editorial) var(--reveal-delay, 0ms),
    transform 0.7s var(--ease-editorial) var(--reveal-delay, 0ms);
}

.reveal-heading {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 0.85s var(--ease-editorial) var(--reveal-delay, 70ms),
    transform 0.85s var(--ease-editorial) var(--reveal-delay, 70ms);
}

.reveal-block {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 0.75s var(--ease-editorial) var(--reveal-delay, 140ms),
    transform 0.75s var(--ease-editorial) var(--reveal-delay, 140ms);
}

.is-revealed .reveal-meta,
.is-revealed .reveal-heading,
.is-revealed .reveal-block,
.reveal-meta.is-revealed,
.reveal-heading.is-revealed,
.reveal-block.is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes pageViewEnter {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.page-view-enter {
  animation: pageViewEnter 0.5s var(--ease-editorial) both;
}

/* =========================================================
   LAYOUT HELPERS & SUBPAGE GRIDS
   ========================================================= */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.main-container {
  position: relative;
  z-index: 10;
  max-width: 80rem;
  width: 100%;
  margin: 0 auto;
  padding-left: 5vw;
  padding-right: 5vw;
}

/* Unified Subpage Header (Series Notes & About Author) */
.subpage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.subpage-header-title-wrap {
  flex: 1 1 320px;
  min-width: 0;
}

.subpage-header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Proper 2-Column Grid for About Author */
.about-author-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 768px) {
  .about-author-grid {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }
}

.folders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem 2rem;
}

@media (min-width: 768px) {
  .folders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .folders-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   3D PHYSICAL FOLDER SYSTEM (DESKTOP HOVER + MOBILE TOUCH)
   ========================================================= */
.folder-stage {
  perspective: 1700px;
}

.folder-card {
  position: relative;
  height: 292px;
  cursor: pointer;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  --rx: 0deg;
  --ry: 0deg;
  --ty: 0px;
  --mx-pull: 0px;
  --px: 0px;
  --py: 0px;
  --lx: 50%;
  --ly: 35%;
  transform: translate3d(var(--mx-pull), var(--ty), 0) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.65s var(--ease-editorial);
}

.folder-card:hover,
.folder-card.is-touched,
.folder-card.is-pointer-active {
  will-change: transform;
}

.folder-card.upcoming-folder {
  cursor: default;
}

.folder-card.is-pointer-active {
  transition: transform 0.16s var(--ease-editorial);
}

.folder-back {
  position: absolute;
  inset: 22px 0 0 0;
  border-radius: 4px 16px 16px 16px;
  background-color: var(--folder-back);
  border: 1px solid var(--folder-border);
  box-shadow: 0 22px 45px -15px rgba(0, 0, 0, 0.78);
  backface-visibility: hidden;
  transform: translate3d(0, 0, -14px);
  transition: transform 0.55s var(--ease-out-expo), box-shadow 0.55s var(--ease-out-expo);
}

.folder-tab {
  position: absolute;
  top: -22px;
  left: -1px;
  width: auto;
  min-width: 48%;
  max-width: 78%;
  height: 23px;
  padding: 0 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--folder-back);
  border-top: 1px solid var(--folder-border);
  border-left: 1px solid var(--folder-border);
  border-right: 1px solid var(--folder-border);
  border-radius: 10px 14px 0 0;
  display: flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

.folder-tab::after {
  content: '';
  position: absolute;
  right: -12px;
  bottom: 0;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at top right, transparent 13px, var(--folder-back) 14px);
}

.paper-stack {
  position: absolute;
  inset: 28px 14px 14px 14px;
  transform-style: preserve-3d;
  pointer-events: none;
}

.paper-sheet {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 13px 16px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.6s var(--ease-spring), box-shadow 0.5s ease;
}

.paper-sheet.sheet-1 {
  background: #e6e2d8;
  color: #2c2a29;
  transform: translate3d(calc(var(--px) * -0.45), calc(var(--py) * -0.45), -6px) rotate(-1deg);
  z-index: 1;
}

.paper-sheet.sheet-2 {
  background: var(--paper-bg);
  color: var(--paper-ink);
  transform: translate3d(calc(var(--px) * -0.8), calc(4px + var(--py) * -0.8), -2px) rotate(1.1deg);
  z-index: 2;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.folder-front {
  position: absolute;
  inset: 42px 0 0 0;
  border-radius: 14px 16px 16px 16px;
  background-color: var(--folder-back);
  background-image: var(--folder-front);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backface-visibility: hidden;
  transform-origin: bottom center;
  transform: translate3d(0, 0, 8px);
  transition: transform 0.6s var(--ease-out-expo), box-shadow 0.6s var(--ease-out-expo);
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.35);
  z-index: 5;
  overflow: hidden;
}

.folder-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle 210px at var(--lx) var(--ly),
    rgba(255, 255, 255, 0.14),
    transparent 72%
  );
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.folder-front::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 75%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 80%
  );
  transform: skewX(-20deg);
  transition: left 0.85s var(--ease-out-expo);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .folder-card:not(.upcoming-folder):hover .folder-front {
    transform: translate3d(0, 5px, 14px) rotateX(-22deg);
    box-shadow: 0 28px 46px -12px rgba(0, 0, 0, 0.85);
  }

  .folder-card:not(.upcoming-folder):hover .folder-front::before {
    left: 155%;
  }

  .folder-card:not(.upcoming-folder):hover .folder-front::after {
    opacity: 1;
  }

  .folder-card:not(.upcoming-folder):hover .paper-sheet.sheet-1 {
    transform: translate3d(calc(-4px + var(--px) * -0.7), calc(-46px + var(--py) * -0.7), -4px) rotate(-4deg) scale(1.02);
  }

  .folder-card:not(.upcoming-folder):hover .paper-sheet.sheet-2 {
    transform: translate3d(calc(4px + var(--px) * -1.1), calc(-32px + var(--py) * -1.1), 2px) rotate(2.8deg) scale(1.03);
  }

  .folder-card:not(.upcoming-folder):hover .folder-back {
    transform: translate3d(0, -5px, -16px);
  }
}

/* Mobile & Touch 3D Folder Open / Peek State */
.folder-card:not(.upcoming-folder).is-touched {
  transform: translate3d(var(--mx-pull, 0px), -8px, 0) rotateX(var(--rx, 4deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.18s var(--ease-editorial);
}

.folder-card:not(.upcoming-folder).is-touched .folder-front {
  transform: translate3d(0, 6px, 16px) rotateX(-25deg);
  box-shadow: 0 28px 46px -12px rgba(0, 0, 0, 0.85);
}

.folder-card:not(.upcoming-folder).is-touched .folder-front::before {
  left: 155%;
}

.folder-card:not(.upcoming-folder).is-touched .folder-front::after {
  opacity: 1;
}

.folder-card:not(.upcoming-folder).is-touched .paper-sheet.sheet-1 {
  transform: translate3d(calc(-5px + var(--px) * -0.7), calc(-50px + var(--py) * -0.7), -4px) rotate(-4.5deg) scale(1.02);
}

.folder-card:not(.upcoming-folder).is-touched .paper-sheet.sheet-2 {
  transform: translate3d(calc(5px + var(--px) * -1.1), calc(-36px + var(--py) * -1.1), 2px) rotate(3deg) scale(1.03);
}

.folder-card:not(.upcoming-folder).is-touched .folder-back {
  transform: translate3d(0, -6px, -16px);
}

/* =========================================================
   CINEMATIC READER & POP-UP TRANSITIONS (SILKY SMOOTH)
   ========================================================= */
@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modalShellIn {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(0.982);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes modalShellOut {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.985);
  }
}

.animate-modal-backdrop {
  animation: modalBackdropIn 0.36s var(--ease-editorial) both;
}

.animate-modal-backdrop.is-closing {
  animation: modalBackdropOut 0.24s var(--ease-editorial) forwards;
}

.animate-modal-shell {
  animation: modalShellIn 0.42s var(--ease-editorial) both;
  will-change: transform, opacity;
}

.animate-modal-shell.is-closing {
  animation: modalShellOut 0.22s var(--ease-editorial) forwards;
}

.manuscript-sheet {
  transition:
    opacity 0.2s var(--ease-editorial),
    transform 0.24s var(--ease-editorial);
  will-change: transform, opacity;
}

.manuscript-sheet.phase-exiting-next {
  opacity: 0;
  transform: translate3d(-18px, 0, 0);
}

.manuscript-sheet.phase-exiting-prev {
  opacity: 0;
  transform: translate3d(18px, 0, 0);
}

@keyframes manuscriptEnterNext {
  from {
    opacity: 0;
    transform: translate3d(18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes manuscriptEnterPrev {
  from {
    opacity: 0;
    transform: translate3d(-18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.manuscript-sheet.phase-entering-next {
  animation: manuscriptEnterNext 0.34s var(--ease-editorial) both;
}

.manuscript-sheet.phase-entering-prev {
  animation: manuscriptEnterPrev 0.34s var(--ease-editorial) both;
}

@keyframes literaryMetaReveal {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to { opacity: 0.75; transform: translate3d(0, 0, 0); }
}

@keyframes literaryTitleReveal {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes literaryQuoteReveal {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes literaryBodyReveal {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 0.96; transform: translate3d(0, 0, 0); }
}

@keyframes literaryHighlightReveal {
  from {
    opacity: 0;
    transform: translate3d(-8px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.literary-meta-in { animation: literaryMetaReveal 0.42s var(--ease-editorial) 0.03s both; }
.literary-title-in { animation: literaryTitleReveal 0.52s var(--ease-editorial) 0.06s both; }
.literary-quote-in { animation: literaryQuoteReveal 0.58s var(--ease-editorial) 0.08s both; }
.literary-body-in { animation: literaryBodyReveal 0.56s var(--ease-editorial) 0.12s both; }
.literary-highlight-in { animation: literaryHighlightReveal 0.5s var(--ease-editorial) 0.18s both; }

.paper-texture {
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.028) 1px, transparent 0),
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}

.editorial-dropcap::first-letter {
  float: left;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.55rem;
  line-height: 0.85;
  margin-right: 0.45rem;
  margin-top: 0.12rem;
  font-weight: 700;
}

/* =========================================================
   READER 1:1 SQUARE CARDS & RESPONSIVE MOBILE TYPOGRAPHY
   ========================================================= */
.reader-modal-backdrop {
  padding: 0.75rem;
}

.reader-topbar {
  padding: 0.75rem 1.25rem;
}

.reader-topbar-title {
  font-size: 11.5px;
  letter-spacing: 0.14em;
}

.reader-topbar-btn {
  font-size: 10.5px;
  padding: 0.4rem 0.75rem;
}

.reader-tabstrip {
  padding: 0.625rem 1.25rem;
}

.reader-tab-btn {
  font-size: 11px;
  padding: 0.375rem 0.75rem;
}

.reader-viewport-area {
  padding: 1.25rem 1.5rem;
}

.reader-footer-bar {
  padding: 0.75rem 1.25rem;
}

.reader-nav-btn {
  font-size: 12px;
  padding: 0.5rem 1rem;
}

.reader-page-counter {
  font-size: 12px;
}

/* 1:1 Square Aspect Ratio for Opening Cover & Each Issue (Desktop & Mobile) */
.manuscript-square-card {
  width: 100%;
  max-width: var(--card-max-w, 445px);
  aspect-ratio: 1 / 1;
  overflow-y: auto;
}

.manuscript-opening-card {
  padding: 2rem 2.25rem;
}

.manuscript-issue-card {
  padding: 1.75rem 2rem;
}

.manuscript-closing-card {
  width: 100%;
  max-width: var(--card-max-w, 445px);
  padding: 1.75rem 2rem;
}

.manuscript-card-header {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  padding-bottom: 0.625rem;
}

.manuscript-body-text {
  font-size: var(--body-fs, 13px);
  line-height: var(--body-lh, 1.7);
}

.manuscript-highlight-pill {
  padding: 0.35rem 0.85rem;
  font-size: 16px;
}

.manuscript-meaning-btn {
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.75rem;
}

.manuscript-card-footer {
  font-size: 10px;
  letter-spacing: 0.12em;
}

.subpage-card {
  padding: 1.75rem 2rem;
}

.subpage-body-text {
  font-size: 15px;
  line-height: 1.85;
}

@media (max-width: 640px) {
  .hero-eyebrow {
    font-size: 9.5px !important;
    letter-spacing: 0.18em !important;
  }

  .hero-desc {
    font-size: 13px !important;
    line-height: 1.72 !important;
  }

  .hero-action-btn {
    font-size: 10.5px !important;
    padding: 0.55rem 0.95rem !important;
    letter-spacing: 0.08em !important;
  }

  .hero-search-input {
    font-size: 11px !important;
    padding: 0.48rem 0.9rem !important;
  }

  .hero-progress-row {
    font-size: 9.5px !important;
  }

  .continue-strip {
    padding: 0.65rem 0.85rem !important;
  }

  .continue-strip-meta {
    font-size: 10.5px !important;
  }

  .folder-card {
    height: 268px;
  }

  .folder-tab {
    font-size: 8.5px;
    padding: 0 10px;
  }

  .folder-front {
    padding: 1.05rem 1.15rem;
  }

  .folder-badge-text {
    font-size: 9px !important;
  }

  .folder-question-text {
    font-size: 11.5px !important;
  }

  .folder-footer-text {
    font-size: 8.5px !important;
  }

  .subpage-card {
    padding: 1.25rem 1.2rem !important;
  }

  .subpage-eyebrow {
    font-size: 9.5px !important;
    letter-spacing: 0.15em !important;
  }

  .subpage-body-text {
    font-size: 13px !important;
    line-height: 1.75 !important;
  }

  .subpage-small-text {
    font-size: 11.5px !important;
    line-height: 1.6 !important;
  }

  .subpage-meta-text {
    font-size: 10px !important;
  }

  /* Mobile Reader Modal & 1:1 Square Issue Sizing */
  .reader-modal-backdrop {
    padding: 0.45rem;
  }

  .reader-topbar {
    padding: 0.6rem 0.85rem;
    gap: 0.4rem;
  }

  .reader-topbar-title {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .reader-topbar-btn {
    font-size: 9.5px;
    padding: 0.32rem 0.58rem;
  }

  .reader-tabstrip {
    padding: 0.5rem 0.85rem;
    gap: 0.3rem;
  }

  .reader-tab-btn {
    font-size: 10px;
    padding: 0.3rem 0.6rem;
  }

  .reader-viewport-area {
    padding: 0.75rem;
  }

  .reader-footer-bar {
    padding: 0.6rem 0.85rem;
  }

  .reader-nav-btn {
    font-size: 10px;
    padding: 0.42rem 0.7rem;
  }

  .reader-page-counter {
    font-size: 10.5px;
  }

  .manuscript-opening-card {
    padding: 1.25rem 1.35rem;
  }

  .manuscript-opening-meta {
    font-size: 9px !important;
    letter-spacing: 0.12em !important;
  }

  .manuscript-opening-footer {
    font-size: 10px !important;
    padding-top: 0.65rem !important;
  }

  .manuscript-issue-card {
    padding: 1.15rem 1.2rem;
    gap: 0.6rem !important;
  }

  .manuscript-closing-card {
    padding: 1.25rem 1.3rem;
    gap: 0.95rem !important;
  }

  .manuscript-card-header {
    font-size: 9px;
    letter-spacing: 0.08em;
    padding-bottom: 0.45rem;
  }

  .manuscript-body-text {
    font-size: var(--body-fs-mobile, 11.5px);
    line-height: var(--body-lh-mobile, 1.56);
  }

  .editorial-dropcap::first-letter {
    font-size: 2.05rem;
    margin-right: 0.36rem;
    margin-top: 0.08rem;
  }

  .manuscript-highlight-pill {
    padding: 0.25rem 0.65rem;
    font-size: 13.5px;
  }

  .manuscript-meaning-btn {
    font-size: 9px;
    letter-spacing: 0.09em;
    padding: 0.28rem 0.6rem;
  }

  .manuscript-card-footer {
    font-size: 8.5px;
    letter-spacing: 0.08em;
  }

  .popup-body-text {
    font-size: 13px !important;
    line-height: 1.7 !important;
  }

  .popup-meta-text {
    font-size: 10px !important;
  }
}

/* Inline Glossary Term: Subtle underline + smooth color/glow on hover */
.glossary-inline-term {
  display: inline;
  background: none !important;
  border: 0;
  border-bottom: 1px dotted var(--term-underline, currentColor);
  color: inherit;
  font: inherit;
  font-style: italic;
  padding: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  transition:
    color 0.28s var(--ease-editorial),
    border-bottom-color 0.28s var(--ease-editorial),
    text-shadow 0.28s var(--ease-editorial);
}

.glossary-inline-term:hover {
  background: none !important;
  color: var(--term-hover-color, #8a5a19);
  border-bottom-color: var(--term-hover-color, #8a5a19);
  text-shadow: 0 0 14px var(--term-glow, rgba(180, 130, 50, 0.35));
}

.glossary-inline-term:focus:not(:focus-visible) {
  outline: none;
}

/* Timeline Progressive Rail */
.timeline-rail {
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 1.1s var(--ease-out-expo) 0.15s;
}

.is-revealed .timeline-rail {
  transform: scaleY(1);
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* Back-to-top button */
.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d8c39e;
  background: rgba(19, 19, 23, 0.72);
  border: 1px solid rgba(216, 195, 158, 0.28);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s ease, background 0.2s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  border-color: rgba(216, 195, 158, 0.6);
  background: rgba(30, 30, 36, 0.9);
}
.back-to-top svg { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor-glow, .ambient-field {
    display: none;
  }
  .reveal-meta, .reveal-heading, .reveal-block {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
  .timeline-rail {
    transform: scaleY(1) !important;
  }
}

/* Vibrant gradient accent for the italic SKETSA wordmark */
.accent-sketsa {
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(100deg, #f1dcaa 0%, #e2bf7c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #e6bd6e;
  padding-right: 0.06em;
}
