:root {
  --bg: #ece2cf;
  --bg-deep: #d5c19d;
  --panel: rgba(250, 245, 235, 0.88);
  --panel-strong: rgba(34, 27, 20, 0.9);
  --ink: #241d17;
  --muted: #62564a;
  --line: rgba(55, 43, 31, 0.2);
  --gold: #b98941;
  --gold-soft: #dfc08e;
  --blue: #244e70;
  --red: #8d4332;
  --shadow: 0 20px 50px rgba(30, 20, 10, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Source Serif 4", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 232, 179, 0.7), transparent 26%),
    radial-gradient(circle at top right, rgba(109, 147, 183, 0.2), transparent 22%),
    linear-gradient(180deg, #f1e7d4 0%, #dfcfb2 38%, #c8b08d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(68, 54, 40, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 54, 40, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.site-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(35, 27, 21, 0.97), rgba(50, 37, 25, 0.95)),
    url("./assets/cover_concept_v1.png") center / cover;
  color: #f4ead7;
  border-right: 1px solid rgba(255, 236, 209, 0.14);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.78), rgba(24, 19, 14, 0.84));
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.brand-mark {
  margin-bottom: 24px;
  padding: 16px 14px 18px;
  border: 1px solid rgba(255, 220, 171, 0.22);
  background: rgba(255, 244, 225, 0.06);
}

.brand-mark h1 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 2rem;
  line-height: 1.05;
}

.brand-mark p {
  margin: 10px 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #dbcdb4;
}

.book-nav-title,
.section-nav-title {
  margin: 0 0 10px;
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1d39f;
}

.book-nav,
.section-nav {
  display: grid;
  gap: 10px;
}

.page-rail .section-nav {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.rail-card--subsections-long .section-nav {
  max-height: 520px;
}

.book-button,
.section-button,
.hero-button,
.mini-button {
  border: 1px solid transparent;
  cursor: pointer;
}

.book-button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 14px 14px 13px;
  text-align: left;
  color: inherit;
  background: rgba(255, 245, 223, 0.06);
}

.book-button:hover,
.book-button.is-active {
  border-color: rgba(241, 211, 159, 0.48);
  background: rgba(255, 241, 211, 0.12);
}

.book-button strong {
  font-family: "Cinzel", serif;
  font-size: 1rem;
}

.book-button span {
  font-size: 0.9rem;
  color: #d7c7a9;
}

.sidebar-footer {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 229, 190, 0.14);
  font-size: 0.9rem;
  line-height: 1.5;
  color: #d7c7a9;
}

.content-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 242, 231, 0.78);
  backdrop-filter: blur(10px);
}

.topbar h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1.25rem;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(71, 55, 33, 0.14);
  background: rgba(255, 247, 233, 0.7);
  color: var(--muted);
  white-space: nowrap;
}

.topbar-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d7a252, #8d5f21);
}

.page-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  padding: 24px 24px 30px;
  min-height: calc(100vh - 88px);
  align-items: start;
}

.main-stage {
  min-width: 0;
  max-height: calc(100vh - 142px);
  overflow: auto;
  padding-right: 6px;
}

.landing-hero,
.content-card,
.rail-card {
  background: var(--panel);
  border: 1px solid rgba(67, 51, 34, 0.12);
  box-shadow: var(--shadow);
}

.landing-hero {
  overflow: hidden;
}

.landing-art {
  min-height: 340px;
  background:
    linear-gradient(180deg, rgba(24, 18, 13, 0.18), rgba(24, 18, 13, 0.55)),
    url("./assets/cover_concept_v1.png") center / cover;
}

.landing-copy {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.landing-copy h3,
.section-header h3,
.content-body h4,
.rail-card h4 {
  margin: 0;
  font-family: "Cinzel", serif;
}

.landing-copy h3 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.landing-copy p,
.section-intro,
.content-block p,
.content-block li,
.rail-card li {
  font-size: 1.03rem;
  line-height: 1.6;
}

.landing-actions,
.landing-pills,
.section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-button {
  padding: 12px 18px;
  background: linear-gradient(135deg, #c2914c, #9a6930);
  color: #fff9ef;
}

.hero-button.secondary {
  background: rgba(255, 248, 235, 0.72);
  color: var(--ink);
  border-color: rgba(68, 50, 30, 0.14);
}

.pill {
  padding: 8px 12px;
  border: 1px solid rgba(83, 61, 38, 0.15);
  background: rgba(255, 249, 240, 0.75);
  color: var(--muted);
}

.content-card {
  overflow: hidden;
}

.section-banner {
  min-height: 220px;
  background-position: center;
  background-size: cover;
}

.section-header {
  display: grid;
  gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.section-header h3 {
  font-size: 2rem;
}

.section-intro {
  margin: 0;
  color: var(--muted);
}

.content-body {
  display: grid;
  gap: 18px;
  padding: 22px 24px 24px;
}

.subsection-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 116px;
  overflow: auto;
  padding-right: 4px;
}

.subsection-strip--long {
  max-height: 220px;
}

.subsection-pill {
  padding: 9px 12px;
  border: 1px solid rgba(83, 61, 38, 0.12);
  background: rgba(255, 249, 240, 0.84);
  cursor: pointer;
}

.subsection-pill.is-active {
  background: linear-gradient(135deg, rgba(196, 148, 82, 0.2), rgba(244, 233, 209, 0.82));
  border-color: rgba(130, 92, 41, 0.25);
}

.guide-blocks {
  display: grid;
  gap: 14px;
}

.guide-block {
  padding: 16px 18px;
  border: 1px solid rgba(67, 51, 34, 0.1);
  background: rgba(255, 250, 242, 0.8);
}

.guide-block--heading {
  padding: 10px 2px 0;
  border: 0;
  background: transparent;
}

.guide-block--heading h4 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  color: var(--blue);
}

.guide-block p,
.guide-block li {
  margin: 0;
  line-height: 1.58;
}

.guide-block ul,
.guide-block ol {
  margin: 0;
  padding-left: 20px;
}

.guide-table {
  display: grid;
  gap: 8px;
}

.guide-table-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 10px 12px;
  background: rgba(255, 248, 235, 0.84);
  border: 1px solid rgba(83, 61, 38, 0.1);
}

.guide-table-row--head {
  background: rgba(227, 211, 183, 0.55);
}

.guide-link-list {
  display: grid;
  gap: 10px;
}

.guide-link-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid rgba(83, 61, 38, 0.12);
  background: rgba(255, 248, 236, 0.78);
  cursor: pointer;
}

.guide-link-button:hover {
  background: linear-gradient(135deg, rgba(196, 148, 82, 0.2), rgba(244, 233, 209, 0.82));
  border-color: rgba(130, 92, 41, 0.25);
}

.guide-link-button strong {
  font-family: "Cinzel", serif;
  font-size: 0.98rem;
}

.guide-link-button span {
  color: var(--muted);
  line-height: 1.5;
}

.guide-figure {
  margin: 0;
  display: grid;
  gap: 10px;
}

.guide-inline-image {
  width: 100%;
  border: 1px solid rgba(67, 51, 34, 0.12);
  background: #fff;
}

.guide-figure figcaption {
  color: var(--muted);
  line-height: 1.5;
}

.content-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-block {
  padding: 18px;
  border: 1px solid rgba(67, 51, 34, 0.12);
  background: rgba(255, 250, 242, 0.74);
}

.content-block.wide {
  grid-column: 1 / -1;
}

.content-block h4 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.content-block p,
.content-block ul {
  margin: 0;
}

.content-block ul {
  padding-left: 20px;
}

.mini-table {
  display: grid;
  gap: 8px;
}

.mini-table-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 248, 235, 0.84);
  border: 1px solid rgba(83, 61, 38, 0.1);
}

.mini-table-row strong {
  font-weight: 700;
}

.page-rail {
  display: grid;
  gap: 18px;
  align-content: start;
  max-height: calc(100vh - 142px);
  overflow: auto;
  padding-right: 6px;
}

.rail-card {
  padding: 16px;
}

.rail-card h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.section-button {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 248, 236, 0.72);
  border-color: rgba(83, 61, 38, 0.1);
}

.section-button:hover,
.section-button.is-active {
  background: linear-gradient(135deg, rgba(196, 148, 82, 0.2), rgba(244, 233, 209, 0.82));
  border-color: rgba(130, 92, 41, 0.25);
}

.mini-button {
  width: 100%;
  padding: 10px 12px;
  background: linear-gradient(135deg, #284e6c, #173045);
  color: #f5eee0;
}

.mini-button.secondary {
  background: rgba(255, 248, 236, 0.8);
  color: var(--ink);
  border-color: rgba(83, 61, 38, 0.12);
}

.legend-image {
  width: 100%;
  border: 1px solid rgba(67, 51, 34, 0.12);
}

.landing-stack {
  display: grid;
  gap: 18px;
}

.philosophy-card {
  overflow: hidden;
}

.philosophy-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.philosophy-panel {
  padding: 18px;
  background: rgba(255, 250, 242, 0.74);
  border: 1px solid rgba(67, 51, 34, 0.12);
}

.philosophy-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.summary-card {
  padding: 18px;
  background: rgba(255, 250, 242, 0.74);
  border: 1px solid rgba(67, 51, 34, 0.12);
}

.summary-card h4 {
  margin: 0 0 8px;
  font-family: "Cinzel", serif;
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1200px) {
  .page-frame {
    grid-template-columns: 1fr;
  }

  .main-stage,
  .page-rail {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .page-rail .section-nav {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

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

@media (max-width: 980px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .content-grid,
  .philosophy-body,
  .panel-grid,
  .page-rail {
    grid-template-columns: 1fr;
  }

  .subsection-strip {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
