/* ==========================================================================
   LinkMind — Wabi-Sabi × Clover Craft Design System
   Tactile washi paper, View Transitions ripple, vertical folio accents,
   and an interactive miniature LinkMind 3.0 Reading Studio.
   ========================================================================== */

:root {
  /* Washi Paper & Sumi Ink Palette */
  --bg: #F6F3EB;
  --bg-subtle: #ECE7DA;
  --bg-sage: #E8EFE6;
  --surface: #FAF8F2;
  --surface-elevated: #FCFBF7;
  --surface-translucent: rgba(246, 243, 235, 0.84);

  --ink: #20241F;
  --ink-secondary: #565F57;
  --ink-muted: #848B82;
  --ink-ghost: rgba(32, 36, 31, 0.22);

  /* Earthy Botanical Clover Green */
  --accent: #325C44;
  --accent-hover: #244633;
  --accent-on: #F8F6EF;
  --accent-wash: rgba(50, 92, 68, 0.08);
  --accent-wash-strong: rgba(50, 92, 68, 0.14);

  /* Architectural Hairlines */
  --rule: rgba(32, 36, 31, 0.11);
  --rule-strong: rgba(32, 36, 31, 0.21);
  --rule-faint: rgba(32, 36, 31, 0.065);

  --shadow-stage:
    0 34px 74px -30px rgba(24, 30, 24, 0.16),
    0 8px 22px -10px rgba(24, 30, 24, 0.06),
    0 0 0 1px var(--rule);
  --shadow-float:
    0 12px 30px -8px rgba(24, 30, 24, 0.16),
    0 2px 6px rgba(24, 30, 24, 0.06);

  /* Stationery Radius Scale */
  --r-xs: 4px;
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 15px;

  /* Editorial Type Stacks (0ms local render, mainland China reliable) */
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Palatino", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --container: 1060px;
  --prose: 700px;
  --nav-height: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

:root[data-theme="dark"] {
  --bg: #111613;
  --bg-subtle: #171F1A;
  --bg-sage: #1A261F;
  --surface: #161D19;
  --surface-elevated: #1B241F;
  --surface-translucent: rgba(17, 22, 19, 0.84);

  --ink: #EAEFE9;
  --ink-secondary: #A9B5AC;
  --ink-muted: #7F8E83;
  --ink-ghost: rgba(234, 239, 233, 0.18);

  --accent: #9FD5AF;
  --accent-hover: #BAE4C6;
  --accent-on: #112017;
  --accent-wash: rgba(159, 213, 175, 0.11);
  --accent-wash-strong: rgba(159, 213, 175, 0.18);

  --rule: rgba(234, 239, 233, 0.12);
  --rule-strong: rgba(234, 239, 233, 0.22);
  --rule-faint: rgba(234, 239, 233, 0.075);

  --shadow-stage:
    0 36px 84px -26px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(234, 239, 233, 0.11);
  --shadow-float:
    0 14px 36px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(234, 239, 233, 0.10);
}

/* View Transitions API — Circular Ink-Wash Ripple for Theme Toggle */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.42s;
  animation-timing-function: var(--ease);
}

:root.theme-ripple::view-transition-old(root) {
  animation: none;
  z-index: 1;
}

:root.theme-ripple::view-transition-new(root) {
  z-index: 2;
  animation: themeRipple 0.62s var(--ease) both;
}

@keyframes themeRipple {
  from {
    clip-path: circle(0px at var(--ripple-x, 85%) var(--ripple-y, 32px));
  }
  to {
    clip-path: circle(var(--ripple-r, 150vmax) at var(--ripple-x, 85%) var(--ripple-y, 32px));
  }
}

/* Language visibility */
:root[data-lang="zh"] .lang-en,
:root[data-lang="en"] .lang-zh {
  display: none !important;
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.8;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  overflow-x: clip;
  position: relative;
}

/* Tactile Washi Paper Grain (inline SVG turbulence, 0 HTTP requests) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] body::after {
  opacity: 0.045;
}

/* Ambient Komorebi (Dappled Leaf Light) Canvas Layer */
.komorebi-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
  transition: opacity 0.6s var(--ease);
}

main, header, footer {
  position: relative;
  z-index: 2;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.prose-container {
  width: 100%;
  max-width: var(--prose);
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   Navigation & Hairline Reading Progress
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-height);
  background: var(--surface-translucent);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid var(--rule-faint);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0.65;
  pointer-events: none;
  will-change: transform;
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand:hover {
  color: var(--ink);
  opacity: 0.82;
}

.brand-icon {
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--rule);
  object-fit: contain;
  transition: transform 0.35s var(--spring), background-color 0.25s ease;
}

.brand:hover .brand-icon {
  transform: rotate(-6deg);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 17.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  color: var(--ink-secondary);
  font-size: 13.8px;
  letter-spacing: 0.02em;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.lang-btn {
  padding: 3px 6px;
  border-radius: var(--r-xs);
  color: var(--ink-muted);
  transition: color 0.18s ease, background-color 0.18s ease;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.active {
  color: var(--ink);
  font-weight: 550;
  background: var(--bg-subtle);
}

.lang-sep {
  opacity: 0.35;
  user-select: none;
}

.theme-toggle {
  width: 31px;
  height: 31px;
  border-radius: var(--r-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.25s var(--spring);
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

:root:not([data-theme="dark"]) .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* Stationery Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 450;
  letter-spacing: 0.02em;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.18s var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-on);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}

.btn-secondary:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-wash);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  padding: 6px 10px;
}

.btn-ghost:hover {
  color: var(--accent);
  background: var(--accent-wash);
}

.btn-sm {
  padding: 6px 13px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 14.5px;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: var(--r-xs);
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.menu-toggle:hover {
  background: var(--bg-subtle);
}

.mobile-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 auto 0;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 14px 28px 26px;
  z-index: 55;
  flex-direction: column;
  gap: 2px;
}

.mobile-drawer.open {
  display: flex;
}

.mobile-drawer a {
  padding: 12px 0;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-faint);
}

.mobile-drawer a:last-of-type {
  border-bottom: none;
}

/* ==========================================================================
   Hero — Poetic Silence & Ma (留白)
   ========================================================================== */
.hero {
  padding: 108px 0 88px;
}

.hero-top {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 28px;
}

.hero-kicker img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  opacity: 0.92;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.7vw, 3.95rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 auto 22px;
  max-width: 19ch;
  text-wrap: balance;
}

:root[data-lang="zh"] .hero-title {
  letter-spacing: 0.045em;
  line-height: 1.26;
  max-width: 24ch;
}

.hero-subtitle {
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  line-height: 1.9;
  color: var(--ink-secondary);
  max-width: 480px;
  margin: 0 auto 38px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hero-caption {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

/* ==========================================================================
   Playable LinkMind 3.0 Studio (Unified Library ↔ Reader ↔ Streaming AI)
   ========================================================================== */
.studio-wrap {
  margin-top: 76px;
}

.studio-bar {
  max-width: 960px;
  margin: 0 auto 14px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.studio-modes {
  display: inline-flex;
  align-items: center;
  gap: 26px;
}

.studio-mode-btn {
  padding: 6px 0;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
  position: relative;
  transition: color 0.2s ease;
}

.studio-mode-btn:hover {
  color: var(--ink);
}

.studio-mode-btn.active {
  color: var(--ink);
  font-weight: 500;
}

.studio-mode-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: var(--accent);
}

.studio-hint {
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.studio-frame {
  max-width: 960px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-stage);
  overflow: hidden;
  position: relative;
  min-height: 530px;
  display: grid;
  grid-template-columns: 228px 1fr;
  text-align: left;
}

/* Left Native iPad Sidebar */
.studio-sidebar {
  padding: 24px 16px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--rule-faint);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.sidebar-app-title {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink);
}

.sidebar-badge-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.sidebar-group-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--r-xs);
  font-size: 13px;
  color: var(--ink-secondary);
  text-align: left;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.sidebar-btn:hover {
  background: var(--accent-wash);
  color: var(--ink);
}

.sidebar-btn.active {
  background: var(--accent-wash-strong);
  color: var(--accent);
  font-weight: 500;
}

.sidebar-btn .count {
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.sidebar-article-btn {
  width: 100%;
  padding: 8px 9px;
  border-radius: var(--r-xs);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background-color 0.18s ease;
}

.sidebar-article-btn:hover {
  background: var(--accent-wash);
}

.sidebar-article-btn.active {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule-faint);
}

.sidebar-article-name {
  font-size: 12.8px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-article-domain {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.sidebar-footer-note {
  padding: 12px 8px 0;
  border-top: 1px solid var(--rule-faint);
  font-size: 11.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
  flex-shrink: 0;
}

/* Main Stage Viewport */
.studio-main {
  position: relative;
  min-height: 530px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-view {
  display: none;
  flex: 1;
  position: relative;
}

.studio-view.active {
  display: flex;
  flex-direction: column;
  animation: viewFade 0.28s var(--ease);
}

@keyframes viewFade {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- VIEW 1: LIVING READER --- */
.reader-stage {
  flex: 1;
  position: relative;
  padding: 42px 52px 92px;
  transition: background-color 0.32s var(--ease), color 0.32s var(--ease);
  --paper-bg: #FAF5E7;
  --paper-ink: #23211C;
  --paper-muted: #7B7365;
  --paper-rule: rgba(35, 33, 28, 0.11);
  --paper-bar: rgba(252, 249, 240, 0.92);
  --hl-bg: rgba(50, 92, 68, 0.09);
  --hl-bg-hover: rgba(50, 92, 68, 0.17);
  --hl-border: rgba(50, 92, 68, 0.42);
  background: var(--paper-bg);
  color: var(--paper-ink);
}

.reader-stage[data-paper="white"] {
  --paper-bg: #FDFCF9;
  --paper-ink: #1D211E;
  --paper-muted: #6E7570;
  --paper-rule: rgba(29, 33, 30, 0.10);
  --paper-bar: rgba(250, 250, 248, 0.94);
}

.reader-stage[data-paper="mist"] {
  --paper-bg: #EDF2EC;
  --paper-ink: #1D2721;
  --paper-muted: #5F6F65;
  --paper-rule: rgba(29, 39, 33, 0.11);
  --paper-bar: rgba(242, 247, 241, 0.92);
}

.reader-stage[data-paper="night"] {
  --paper-bg: #141B17;
  --paper-ink: #E2EAE3;
  --paper-muted: #899A8E;
  --paper-rule: rgba(226, 234, 227, 0.13);
  --paper-bar: rgba(23, 33, 27, 0.94);
  --hl-bg: rgba(159, 213, 175, 0.12);
  --hl-bg-hover: rgba(159, 213, 175, 0.22);
  --hl-border: rgba(159, 213, 175, 0.50);
}

.reader-article-shell {
  max-width: 520px;
  margin: 0 auto;
  transition: opacity 0.22s ease;
}

.reader-article-shell.switching {
  opacity: 0;
}

.reader-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--paper-muted);
}

.reader-title {
  font-family: var(--reader-font, var(--font-serif));
  font-size: 26px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 8px;
  color: var(--paper-ink);
}

.reader-byline {
  font-size: 12px;
  color: var(--paper-muted);
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--paper-rule);
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-prose {
  font-family: var(--reader-font, var(--font-serif));
  font-size: var(--reader-size, 16.5px);
  line-height: var(--reader-leading, 1.98);
  color: var(--paper-ink);
  transition: font-size 0.18s ease, line-height 0.18s ease;
}

.reader-stage[data-font="sans"] {
  --reader-font: var(--font-sans);
}

.reader-prose p {
  margin: 0 0 18px;
}

/* Interactive Clickable Sentence for Instant Copy / Ask AI */
.askable-quote {
  background: var(--hl-bg);
  border-bottom: 1px dashed var(--hl-border);
  border-radius: 2px;
  padding: 1px 3px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-bottom-style 0.2s ease;
}

.askable-quote:hover,
.askable-quote.selected {
  background: var(--hl-bg-hover);
  border-bottom-style: solid;
}

/* Floating iOS-Style Sentence Selection Action Popover */
.quote-popover {
  position: absolute;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-sm);
  background: #1C2520;
  color: #F2F6F2;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.10);
  opacity: 0;
  transform: translate(-50%, -6px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.2s var(--spring);
}

.quote-popover.open {
  opacity: 1;
  transform: translate(-50%, -10px) scale(1);
  pointer-events: auto;
}

.quote-popover button {
  padding: 6px 11px;
  border-radius: 5px;
  font-size: 12.5px;
  color: #EDF3EE;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.quote-popover button:hover {
  background: rgba(255, 255, 255, 0.11);
}

.quote-popover .pop-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.16);
}

/* Reader Floating Bottom Atelier Bar */
.reader-toolbar {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.reader-controls {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: var(--paper-bar);
  border: 1px solid var(--paper-rule);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(12px);
}

.paper-swatch {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid rgba(32, 36, 31, 0.22);
  transition: transform 0.18s var(--spring);
}

.paper-swatch:hover {
  transform: scale(1.12);
}

.paper-swatch.active {
  box-shadow: 0 0 0 2px var(--paper-bg), 0 0 0 3.3px var(--accent);
}

.paper-swatch[data-set-paper="cream"] { background: #FAF5E7; }
.paper-swatch[data-set-paper="white"] { background: #FDFCF9; }
.paper-swatch[data-set-paper="mist"] { background: #E3ECE2; }
.paper-swatch[data-set-paper="night"] { background: #141B17; border-color: rgba(255, 255, 255, 0.30); }

.tool-sep {
  width: 1px;
  height: 14px;
  background: var(--paper-rule);
}

.tool-btn {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--paper-ink);
  opacity: 0.74;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.tool-btn:hover,
.tool-btn.active {
  opacity: 1;
  background: rgba(128, 128, 128, 0.14);
}

.clover-chat-trigger {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 9px;
  border-radius: var(--r-sm);
  background: var(--paper-bar);
  border: 1px solid var(--paper-rule);
  box-shadow: var(--shadow-float);
  color: var(--paper-ink);
  font-size: 12.5px;
  font-weight: 450;
  transition: transform 0.2s var(--spring);
}

.clover-chat-trigger:hover {
  transform: translateY(-1.5px);
}

.clover-chat-trigger img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* --- VIEW 2: PLAYABLE LIBRARY (LIST & WATERFALL) --- */
.library-stage {
  flex: 1;
  padding: 28px 34px 34px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.library-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.library-filters {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lib-filter-btn {
  font-size: 13px;
  color: var(--ink-muted);
  padding: 3px 0;
  position: relative;
}

.lib-filter-btn:hover {
  color: var(--ink);
}

.lib-filter-btn.active {
  color: var(--accent);
  font-weight: 550;
}

.layout-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--bg-subtle);
  border-radius: var(--r-xs);
  border: 1px solid var(--rule-faint);
}

.layout-btn {
  padding: 4px 9px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--ink-muted);
}

.layout-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.library-items {
  display: flex;
  flex-direction: column;
}

.library-items.waterfall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}

.lib-entry {
  width: 100%;
  text-align: left;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-faint);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 16px;
  transition: opacity 0.2s ease, transform 0.2s var(--ease), border-color 0.2s ease;
}

.lib-entry:last-child {
  border-bottom: none;
}

.lib-entry:hover .lib-entry-title {
  color: var(--accent);
}

.library-items.waterfall .lib-entry {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface-elevated);
  min-height: 175px;
}

.library-items.waterfall .lib-entry:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.lib-entry-source {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.lib-entry-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 5px;
  transition: color 0.18s ease;
}

.lib-entry-excerpt {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-secondary);
  margin: 0;
}

.lib-entry-tag {
  font-size: 11.5px;
  color: var(--accent);
  white-space: nowrap;
}

/* --- SLIDE-IN STREAMING LOCAL AI SHEET --- */
.ai-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(410px, 100%);
  background: #151D18;
  color: #E7EEE8;
  border-left: 1px solid rgba(231, 238, 232, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transform: translateX(102%);
  visibility: hidden;
  box-shadow: none;
  transition: transform 0.36s var(--ease), box-shadow 0.36s var(--ease), visibility 0s linear 0.36s;
}

.ai-drawer.open {
  transform: translateX(0);
  visibility: visible;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.32);
  transition: transform 0.36s var(--ease), box-shadow 0.36s var(--ease), visibility 0s;
}

.ai-drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(231, 238, 232, 0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #EFF5F0;
}

.ai-drawer-title img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.ai-drawer-sub {
  font-size: 11px;
  color: #96B59F;
}

.ai-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9FB0A5;
}

.ai-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.ai-thread {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-article-chip {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #B4C2B8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-article-chip strong {
  color: #F0F6F1;
  font-weight: 500;
}

.ai-msg-user {
  align-self: flex-end;
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 10px 10px 2px 10px;
  background: rgba(159, 213, 175, 0.14);
  border: 1px solid rgba(159, 213, 175, 0.22);
  font-size: 13.5px;
  line-height: 1.65;
  color: #F2F7F3;
}

.ai-msg-assistant {
  font-size: 13.5px;
  line-height: 1.8;
  color: #DCE6DE;
}

.ai-msg-assistant .cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: #9FD5AF;
  vertical-align: -2px;
  margin-left: 3px;
  animation: blink 0.9s infinite;
}

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

.ai-prompts {
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(231, 238, 232, 0.09);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-chip {
  padding: 5px 10px;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #D2DFD6;
  font-size: 12px;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.ai-chip:hover {
  background: rgba(159, 213, 175, 0.16);
  border-color: rgba(159, 213, 175, 0.34);
  color: #FFFFFF;
}

.ai-local-foot {
  font-size: 11px;
  color: #7E9285;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Three-Act Editorial Book Spreads (Vertical Folio Seal + Unboxed Art)
   ========================================================================== */
.section {
  padding: 136px 0;
}

.section-tight {
  padding: 86px 0;
}

.section-rule {
  border-top: 1px solid var(--rule);
}

.section-header {
  max-width: 640px;
  margin: 0 0 80px;
}

.section-header.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: 680px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

:root[data-lang="zh"] .section-title {
  letter-spacing: 0.035em;
}

.story-acts {
  display: flex;
  flex-direction: column;
  gap: 132px;
}

.story-act {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: 88px;
  position: relative;
}

.story-act.reverse .act-visual {
  order: 2;
}

.story-act.reverse .act-copy {
  order: 1;
}

/* Japanese Book-Binding Vertical Margin Seal (Desktop) */
.act-seal {
  position: absolute;
  top: 8px;
  right: -36px;
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--ink-ghost);
  user-select: none;
  pointer-events: none;
}

.story-act.reverse .act-seal {
  right: auto;
  left: -36px;
}

.act-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  will-change: transform;
}

.act-visual img {
  max-height: 410px;
  width: auto;
  object-fit: contain;
  transition: transform 0.7s var(--ease);
}

:root[data-theme="dark"] .act-visual img {
  filter: brightness(0.94);
}

.act-index {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.act-index::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.42;
}

.act-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 2.9vw, 2.48rem);
  font-weight: 400;
  line-height: 1.28;
  color: var(--ink);
  margin: 0 0 20px;
  text-wrap: balance;
}

:root[data-lang="zh"] .act-title {
  letter-spacing: 0.03em;
}

.act-lead {
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-secondary);
  margin: 0 0 26px;
  max-width: 40ch;
}

.act-notes {
  padding-top: 18px;
  border-top: 1px solid var(--rule-faint);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

/* ==========================================================================
   Editorial Spec Index — Hairline Grid with Whisper Hover Warmth
   ========================================================================== */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}

.spec-item {
  padding: 36px 32px 36px 0;
  border-bottom: 1px solid var(--rule-faint);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 0.28s ease;
}

.spec-item:nth-child(3n+2),
.spec-item:nth-child(3n) {
  padding-left: 32px;
  border-left: 1px solid var(--rule-faint);
}

.spec-item:nth-child(3n) {
  padding-right: 0;
}

.spec-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
}

.spec-item h3 {
  font-family: var(--font-serif);
  font-size: 18.5px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  color: var(--ink);
}

.spec-item p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-secondary);
  margin: 0;
}

/* ==========================================================================
   Pricing — Quiet Two-Column Comparison
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 820px;
  margin: 0 auto;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.price-card.featured {
  background: var(--bg-sage);
  border-color: rgba(50, 92, 68, 0.28);
}

:root[data-theme="dark"] .price-card.featured {
  border-color: rgba(159, 213, 175, 0.26);
}

.price-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

.price-name {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-faint);
  color: var(--ink);
}

.price-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14.2px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.price-list li::before {
  content: "—";
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
}

.price-footnote {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ==========================================================================
   Twilight Night Window — Full-Bleed Artwork Plate with Gentle Parallax
   ========================================================================== */
.twilight-cta {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 430px;
  display: flex;
  align-items: center;
  background-color: #162338;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-stage);
}

.twilight-bg {
  position: absolute;
  inset: -6% 0;
  width: 100%;
  height: 112%;
  object-fit: cover;
  object-position: right center;
  will-change: transform;
}

.twilight-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 64% 110% at 16% 50%, rgba(15, 23, 38, 0.72) 0%, rgba(15, 23, 38, 0.28) 54%, rgba(15, 23, 38, 0) 80%);
  pointer-events: none;
}

.twilight-cta-copy {
  position: relative;
  z-index: 2;
  padding: 64px 60px;
  max-width: 480px;
  color: #F4EFE4;
}

.twilight-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #E2B878;
  margin-bottom: 16px;
  display: block;
}

.twilight-cta h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.1vw, 2.55rem);
  font-weight: 400;
  line-height: 1.32;
  margin: 0 0 30px;
  color: #F8F4EA;
  text-wrap: balance;
}

:root[data-lang="zh"] .twilight-cta h2 {
  letter-spacing: 0.03em;
}

.btn-warm {
  background: #F2E8D4;
  color: #1D231E;
}

.btn-warm:hover {
  background: #FFFFFF;
  color: #1D231E;
}

/* ==========================================================================
   Subpages (Privacy Policy & Support)
   ========================================================================== */
.page-hero {
  padding: 76px 0 40px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 400;
  line-height: 1.24;
  margin: 0 0 14px;
  color: var(--ink);
  text-wrap: balance;
}

.page-hero p {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink-secondary);
  margin: 0;
  max-width: 580px;
}

.page-meta-row {
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
}

.page-meta-sep {
  opacity: 0.45;
}

.summary-box {
  background: var(--bg-sage);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 26px 28px;
  margin-bottom: 44px;
}

.summary-box h2 {
  font-family: var(--font-serif);
  font-size: 18.5px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--ink);
}

.summary-box ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-secondary);
  font-size: 14.5px;
  line-height: 1.78;
}

.summary-box strong {
  color: var(--ink);
  font-weight: 550;
}

.prose {
  padding-bottom: 96px;
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 500;
  color: var(--ink);
  margin: 44px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-faint);
}

.prose h2:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.prose p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-secondary);
  margin: 0 0 16px;
}

.prose ul {
  margin: 0 0 20px;
  padding-left: 20px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.85;
}

.prose li {
  margin-bottom: 8px;
}

.prose strong {
  color: var(--ink);
  font-weight: 550;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.support-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.support-card h2 {
  font-family: var(--font-serif);
  font-size: 19.5px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--ink);
}

.support-card p {
  font-size: 14.2px;
  color: var(--ink-secondary);
  margin: 0;
  line-height: 1.78;
}

.support-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.faq-section {
  padding-bottom: 96px;
}

.faq-section-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  margin: 0 0 20px;
  color: var(--ink);
}

.faq-list {
  border-top: 1px solid var(--rule);
}

.faq-item {
  border-bottom: 1px solid var(--rule);
}

.faq-item summary {
  list-style: none;
  padding: 22px 4px;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.faq-item summary::after {
  content: "+";
  font-size: 19px;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
  transition: transform 0.22s var(--ease);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 4px 24px;
  font-size: 14.8px;
  line-height: 1.88;
  color: var(--ink-secondary);
}

.faq-answer p {
  margin: 0 0 10px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.copy-toast {
  font-size: 12.5px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.copy-toast.show {
  opacity: 1;
}

/* Floating Studio Toast */
.studio-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translate(-50%, 16px);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.25s var(--ease);
}

.studio-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Footer — Quiet Colophon
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 48px 0 56px;
  margin-top: 24px;
  color: var(--ink-muted);
  font-size: 13px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--ink-secondary);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--rule-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.footer-bottom a {
  color: var(--ink-muted);
}

.footer-bottom a:hover {
  color: var(--accent);
}

/* ==========================================================================
   Scroll Reveal & Motion Preferences
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .komorebi-canvas { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (min-width: 821px) {
  .mobile-drawer.open {
    display: none;
  }
}

@media (max-width: 1160px) {
  .act-seal {
    display: none;
  }
}

@media (max-width: 960px) {
  .nav-links {
    gap: 20px;
  }
  .studio-frame {
    grid-template-columns: 1fr;
  }
  .studio-sidebar {
    display: none;
  }
  .reader-stage {
    padding: 34px 28px 88px;
  }
  .library-items.waterfall {
    grid-template-columns: repeat(2, 1fr);
  }
  .story-act {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .story-act.reverse .act-visual,
  .story-act.reverse .act-copy {
    order: initial;
  }
  .act-visual img {
    max-height: 320px;
  }
  .spec-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .spec-item,
  .spec-item:nth-child(3n+2),
  .spec-item:nth-child(3n) {
    padding: 28px 24px 28px 0;
    border-left: none;
  }
  .spec-item:nth-child(even) {
    padding-left: 24px;
    padding-right: 0;
    border-left: 1px solid var(--rule-faint);
  }
  .twilight-cta {
    min-height: 360px;
  }
  .twilight-cta::after {
    background: linear-gradient(180deg, rgba(15, 23, 38, 0.78) 0%, rgba(15, 23, 38, 0.58) 60%, rgba(15, 23, 38, 0.35) 100%);
  }
  .twilight-cta-copy {
    padding: 46px 34px;
  }
}

@media (max-width: 820px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  .container,
  .prose-container {
    padding: 0 22px;
  }
  .hero {
    padding: 68px 0 48px;
  }
  .section {
    padding: 84px 0;
  }
  .story-acts {
    gap: 78px;
  }
  .spec-grid,
  .pricing-grid,
  .support-grid,
  .library-items.waterfall {
    grid-template-columns: 1fr;
  }
  .spec-item,
  .spec-item:nth-child(even),
  .spec-item:nth-child(3n+2),
  .spec-item:nth-child(3n) {
    padding: 24px 0;
    border-left: none;
  }
  .library-stage {
    padding: 24px 20px 26px;
  }
  .lib-entry {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .reader-toolbar {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .clover-chat-trigger span {
    display: none;
  }
  .clover-chat-trigger {
    padding: 7px;
  }
  .hide-mobile {
    display: none;
  }
  .price-card {
    padding: 28px 24px;
  }
  .twilight-cta-copy {
    padding: 40px 26px;
  }
}

@media (max-width: 560px) {
  .page-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-meta-sep {
    display: none;
  }
}
