@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=Noto+Serif+SC:wght@400;500;600;700&display=swap");

:root {
  --bg: #fff3f7;
  --bg-soft: rgba(255, 247, 250, 0.84);
  --panel: rgba(255, 249, 251, 0.8);
  --line: rgba(28, 10, 17, 0.11);
  --ink: #140b12;
  --muted: #674d58;
  --forest: #140b12;
  --gold: #db3f7a;
  --rosewood: #ff5d94;
  --shadow: 0 24px 80px rgba(56, 15, 31, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shell: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 93, 148, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(20, 11, 18, 0.06), transparent 28%),
    linear-gradient(180deg, #fff5f8 0%, #fff1f6 52%, #fff8fb 100%);
  font-family: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
li {
  line-height: 1.75;
}

.site-shell,
.docs-shell {
  width: min(calc(100% - 32px), var(--shell));
  margin: 0 auto;
}

.landing-page {
  position: relative;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.5;
  pointer-events: none;
  animation: drift 14s ease-in-out infinite;
}

.ambient-a {
  top: 4rem;
  right: -5rem;
  width: 18rem;
  height: 18rem;
  background: rgba(255, 93, 148, 0.18);
}

.ambient-b {
  left: -4rem;
  bottom: 14rem;
  width: 16rem;
  height: 16rem;
  background: rgba(20, 11, 18, 0.09);
  animation-delay: -6s;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff9fc;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--forest), var(--rosewood));
  box-shadow: var(--shadow);
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 0.98rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.8rem;
}

.topbar-links,
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-links a,
.sidebar-back,
.doc-card,
.doc-card a {
  color: var(--forest);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 24px;
  align-items: start;
  padding: 28px 0 44px;
}

.hero-copy {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}

.hero h1,
.docs-hero h1,
.section-heading h2,
.spotlight-copy h2,
.note-band h2,
.cta-panel h2,
.not-found h1 {
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero h1 {
  font-size: clamp(3.2rem, 5.4vw, 4.9rem);
  max-width: none;
  white-space: nowrap;
}

.hero-text,
.docs-hero p,
.section-heading,
.spotlight-copy p,
.note-band p,
.cta-panel p {
  max-width: 64ch;
  color: var(--muted);
}

.hero-text {
  margin: 0;
  max-width: 78ch;
}

.hero-facts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.hero-arc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-self: start;
}

.hero-arc:last-child {
  grid-column: span 2;
}

.hero-arc {
  display: block;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 249, 251, 0.76);
  box-shadow: var(--shadow);
  transition: transform 220ms ease, border-color 220ms ease;
}

.hero-arc:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 93, 148, 0.4);
}

.hero-arc small,
.arc-card small {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
}

.hero-arc strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 1.4rem;
  line-height: 1.1;
}

.hero-arc span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.hero-card,
.feature-card,
.stack-card,
.arc-card,
.doc-card,
.doc-block,
.mini-panel,
.chapter-panel,
.docs-sidebar,
.not-found {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-card,
.doc-block,
.not-found {
  border-radius: var(--radius-lg);
}

.hero-card {
  padding: 24px;
}

.hero-card-label {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 600;
}

.stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.stat-list li strong,
.stack-card span,
.mini-panel h3 {
  display: block;
  margin-bottom: 6px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
}

.button-primary {
  color: #fff9fc;
  background: linear-gradient(135deg, var(--forest), var(--rosewood));
}

.button-secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.grid-section,
.spotlight,
.arc-section,
.note-band,
.cta-panel {
  padding: 24px 0 56px;
}

.feature-grid,
.arc-grid,
.docs-grid,
.story-grid,
.info-grid,
.definition-grid,
.timeline-list {
  display: grid;
  gap: 18px;
}

.feature-grid,
.docs-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.doc-card,
.story-card,
.definition-card,
.timeline-item {
  padding: 22px;
  border-radius: var(--radius-md);
}

.doc-card {
  display: block;
  transition: transform 220ms ease, border-color 220ms ease;
}

.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: center;
}

.stack-cards {
  display: grid;
  gap: 16px;
}

.stack-card {
  padding: 20px;
  border-radius: var(--radius-md);
  transform: translateY(0);
  transition: transform 220ms ease;
}

.stack-card:hover,
.feature-card:hover,
.doc-card:hover,
.arc-card:hover {
  transform: translateY(-4px);
}

.arc-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.arc-card {
  padding: 22px;
  border-radius: var(--radius-md);
}

.note-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.cta-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 56px;
}

.docs-page {
  background:
    radial-gradient(circle at top right, rgba(255, 93, 148, 0.12), transparent 26%),
    linear-gradient(180deg, #fff5f8 0%, #fff1f6 100%);
}

.docs-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  padding: 22px 0 36px;
}

.docs-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 20px;
  border-radius: 24px;
}

.docs-brand {
  margin-bottom: 24px;
}

.sidebar-group + .sidebar-group {
  margin-top: 22px;
}

.sidebar-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.sidebar-links {
  display: grid;
  gap: 8px;
}

.sidebar-links a {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
}

.sidebar-links a.is-active {
  color: #fff8ef;
  background: linear-gradient(135deg, var(--forest), var(--rosewood));
}

.sidebar-back {
  display: inline-flex;
  margin-top: 20px;
  font-weight: 600;
}

.docs-main {
  min-width: 0;
}

.docs-hero {
  padding: 18px 0 20px;
}

.docs-hero.compact h1 {
  font-size: clamp(2.3rem, 4vw, 3.5rem);
}

.docs-hero h1 {
  font-size: clamp(2.8rem, 5vw, 4.4rem);
}

.docs-grid {
  margin-top: 16px;
  margin-bottom: 22px;
}

.doc-card:hover {
  border-color: rgba(255, 93, 148, 0.4);
}

.doc-card h2,
.doc-block h2,
.story-card h3,
.feature-card h3,
.stack-card h3,
.arc-card h3 {
  margin-top: 0;
}

.doc-block {
  padding: 24px;
  margin-bottom: 18px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.section-heading .eyebrow {
  margin: 0;
}

.section-heading h2 {
  color: var(--ink);
}

.clean-list,
.chapter-list {
  margin: 0;
  padding-left: 18px;
}

.ordered-list {
  margin: 0;
  padding-left: 22px;
}

.story-grid,
.info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.definition-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.definition-card,
.timeline-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.36);
}

.definition-card h3,
.timeline-item h3 {
  margin-top: 0;
}

.timeline-list {
  grid-template-columns: 1fr;
}

.mini-panel {
  padding: 18px;
  border-radius: var(--radius-md);
}

.compact-grid .mini-panel p {
  margin: 0;
  font-weight: 600;
}

.chapter-panel {
  margin-bottom: 14px;
  border-radius: 18px;
  overflow: hidden;
}

.chapter-panel summary {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
  padding: 18px 20px;
}

.chapter-panel summary::after {
  content: "+";
  margin-left: auto;
  color: var(--gold);
  font-size: 1.4rem;
  line-height: 1;
}

.chapter-panel summary::-webkit-details-marker {
  display: none;
}

.chapter-panel[open] summary::after {
  content: "−";
}

.chapter-panel summary p,
.chapter-summary {
  margin: 8px 0 0;
  color: var(--muted);
}

.chapter-panel summary span {
  white-space: nowrap;
  color: var(--gold);
  font-weight: 600;
}

.chapter-panel-body {
  padding: 0 20px 18px;
}

.chapter-list {
  columns: 2;
  column-gap: 28px;
}

.chapter-link {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: color 220ms ease, border-color 220ms ease;
}

.chapter-link:hover {
  color: var(--rosewood);
  border-color: rgba(255, 93, 148, 0.38);
}

.docs-pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 24px;
}

.pager {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  min-width: 180px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.46);
}

.pager span {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.centered-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.not-found {
  padding: 42px;
  text-align: center;
}

.txt-shell {
  padding-bottom: 36px;
}

.txt-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(12px, -18px, 0) scale(1.06);
  }
}

@media (max-width: 1080px) {
  .hero,
  .spotlight,
  .note-band,
  .docs-shell,
  .cta-panel {
    grid-template-columns: 1fr;
  }

  .docs-shell {
    display: block;
  }

  .docs-sidebar {
    position: static;
    margin-bottom: 20px;
  }

  .arc-grid,
  .feature-grid,
  .docs-grid,
  .story-grid,
  .info-grid,
  .definition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-arc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .cta-panel,
  .hero-actions,
  .topbar-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 18px;
  }

  .hero h1 {
    max-width: none;
    white-space: normal;
  }

  .arc-grid,
  .feature-grid,
  .docs-grid,
  .story-grid,
  .info-grid,
  .definition-grid {
    grid-template-columns: 1fr;
  }

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

  .chapter-list {
    columns: 1;
  }

  .chapter-panel summary {
    flex-direction: column;
  }
}
