:root {
  --bg: #0f1110;
  --bg-soft: #151815;
  --panel: rgba(242, 238, 221, 0.075);
  --panel-strong: rgba(242, 238, 221, 0.115);
  --line: rgba(242, 238, 221, 0.14);
  --line-soft: rgba(242, 238, 221, 0.08);
  --text: #f2eedf;
  --muted: rgba(242, 238, 221, 0.68);
  --faint: rgba(242, 238, 221, 0.46);
  --gold: #e2b857;
  --green: #65b89b;
  --rose: #d06b7a;
  --blue: #74a7cf;
  --violet: #aa8fd8;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(101, 184, 155, 0.2), transparent 30rem),
    radial-gradient(circle at 86% 12%, rgba(226, 184, 87, 0.14), transparent 26rem),
    linear-gradient(180deg, #101210 0%, #151815 46%, #0f1110 100%);
  font-family: "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", "Songti SC", serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(242, 238, 221, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 238, 221, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 72%);
}

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

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.15;
  background-image:
    repeating-radial-gradient(circle at 17% 29%, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 8px);
  mix-blend-mode: overlay;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: linear-gradient(to bottom, rgba(15, 17, 16, 0.88), rgba(15, 17, 16, 0));
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--gold));
  box-shadow: 0 0 0 7px rgba(101, 184, 155, 0.12);
}

.step-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-dots a {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(242, 238, 221, 0.22);
  transition: width 260ms ease, background 260ms ease;
}

.step-dots a.active {
  width: 30px;
  background: var(--text);
}

main {
  position: relative;
  z-index: 2;
}

.hero {
  min-height: 80svh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
  align-items: center;
  gap: clamp(28px, 7vw, 92px);
  padding: clamp(94px, 14vw, 150px) clamp(18px, 7vw, 104px) clamp(34px, 6vw, 58px);
}

.hero-copy {
  max-width: 980px;
}

.hero > *,
.chapter > *,
.map-grid > *,
.analysis-grid > *,
.identity-board > *,
.loop-list > *,
.ending-grid > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 16px;
  color: color-mix(in srgb, var(--accent, var(--green)) 82%, var(--text));
  font-size: clamp(14px, 2.4vw, 18px);
  line-height: 1.5;
  font-weight: 800;
}

h1,
h2,
p {
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  font-weight: 900;
  text-wrap: balance;
}

h1 {
  max-width: 880px;
  font-size: clamp(46px, 7vw, 88px);
  line-height: 1.02;
}

h1 span {
  display: block;
  color: var(--gold);
}

h2 {
  max-width: 920px;
  font-size: clamp(30px, 5.6vw, 72px);
  line-height: 1.12;
}

.lead {
  max-width: 680px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.76;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-link,
.quiet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
}

.primary-link {
  color: #101210;
  background: var(--text);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
}

.quiet-link {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(242, 238, 221, 0.045);
}

.evidence-panel {
  position: relative;
  overflow: hidden;
  align-self: end;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(155deg, rgba(242, 238, 221, 0.13), rgba(242, 238, 221, 0.055)),
    rgba(10, 12, 11, 0.58);
  box-shadow: var(--shadow);
}

.evidence-panel::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(226, 184, 87, 0.36);
  border-radius: 50%;
}

.panel-kicker,
.evidence-panel p,
.proof-line {
  position: relative;
  z-index: 1;
}

.panel-kicker {
  margin: 0 0 12px;
  color: var(--faint);
  font-size: 14px;
  font-weight: 800;
}

.evidence-panel strong {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--text);
  font-size: clamp(58px, 11vw, 106px);
  line-height: 0.92;
  font-weight: 900;
}

.evidence-panel p:not(.panel-kicker) {
  max-width: 360px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 3vw, 21px);
  line-height: 1.62;
}

.proof-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 800;
}

.proof-line i {
  height: 1px;
  background: linear-gradient(90deg, var(--green), transparent);
}

.map,
.ending {
  padding: clamp(72px, 10vw, 118px) clamp(18px, 7vw, 104px);
}

.map {
  padding-top: clamp(44px, 7vw, 72px);
}

.section-head {
  max-width: 980px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 36px;
}

.map-grid a,
.analysis-block,
.identity-board > div,
.loop-list p,
.reframe-box,
.ending-grid span {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.map-grid a {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  color: var(--text);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.45;
  font-weight: 900;
}

.map-grid span,
.chapter-index,
.analysis-block span,
.identity-board span,
.reframe-box span,
.loop-list span {
  color: color-mix(in srgb, var(--accent, var(--gold)) 86%, var(--text));
}

.map-grid a span {
  font-size: 14px;
}

.chapter {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: clamp(20px, 5vw, 62px);
  padding: clamp(78px, 11vw, 128px) clamp(18px, 7vw, 104px);
  border-top: 1px solid var(--line-soft);
}

.chapter-index {
  position: sticky;
  top: 100px;
  align-self: start;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 50%;
  background: rgba(242, 238, 221, 0.045);
  font-size: 22px;
  font-weight: 900;
}

.chapter-content {
  max-width: 1080px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

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

.analysis-block {
  min-height: 210px;
  padding: clamp(18px, 3vw, 24px);
}

.analysis-block.main-block {
  grid-column: span 2;
  background: var(--panel-strong);
}

.analysis-block span,
.identity-board span,
.reframe-box span {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 900;
}

.analysis-block p,
.identity-board p,
.reframe-box p,
.loop-list p,
.closing {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.7;
  font-weight: 700;
}

.analysis-block.main-block p {
  color: var(--text);
  font-size: clamp(19px, 2.5vw, 25px);
  line-height: 1.62;
}

.comparison-rail {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--faint);
  font-size: 14px;
  font-weight: 900;
}

.comparison-rail i {
  height: 1px;
  background: linear-gradient(90deg, var(--accent), rgba(242, 238, 221, 0.1));
}

.identity-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.identity-board > div {
  padding: 22px;
}

.identity-board p {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.identity-board p:last-child {
  border-bottom: 0;
}

.loop-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.loop-list p {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  color: var(--text);
}

.loop-list span {
  display: block;
  font-size: 40px;
  line-height: 1;
}

.reframe-box {
  display: grid;
  gap: 12px;
  margin-top: 30px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(208, 107, 122, 0.13), rgba(242, 238, 221, 0.055));
}

.reframe-box p {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ending {
  min-height: 86svh;
  display: grid;
  align-content: center;
  border-top: 1px solid var(--line-soft);
}

.ending-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 36px 0 30px;
}

.ending-grid span {
  min-height: 116px;
  display: flex;
  align-items: center;
  padding: 18px;
  color: var(--text);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.5;
  font-weight: 900;
}

.closing {
  max-width: 820px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(22px, 4vw, 36px);
  line-height: 1.5;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 720ms ease, transform 720ms ease;
}

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

@media (hover: hover) {
  .primary-link,
  .quiet-link,
  .map-grid a {
    transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
  }

  .primary-link:hover,
  .quiet-link:hover,
  .map-grid a:hover {
    transform: translateY(-2px);
  }

  .map-grid a:hover,
  .quiet-link:hover {
    border-color: rgba(242, 238, 221, 0.32);
    background: var(--panel-strong);
  }
}

@media (max-width: 980px) {
  .hero,
  .chapter,
  .map-grid,
  .analysis-grid,
  .analysis-grid.compact,
  .identity-board,
  .loop-list,
  .ending-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    gap: 28px;
    padding-top: 96px;
  }

  .evidence-panel {
    align-self: stretch;
  }

  .chapter-index {
    position: static;
    width: 58px;
    height: 58px;
    font-size: 18px;
  }

  .analysis-block,
  .analysis-block.main-block {
    grid-column: auto;
    min-height: auto;
  }

  .map-grid a,
  .loop-list p,
  .ending-grid span {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 13px 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .step-dots {
    gap: 8px;
  }

  .step-dots a.active {
    width: 22px;
  }

  .hero {
    padding: 88px 18px 26px;
    gap: 22px;
  }

  .hero-copy,
  .evidence-panel {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
  }

  h1 {
    font-size: clamp(38px, 11.5vw, 48px);
    line-height: 1.08;
    max-width: 100%;
  }

  h2 {
    font-size: clamp(28px, 8.8vw, 40px);
  }

  .lead {
    font-size: 18px;
    max-width: 100%;
    word-break: break-all;
  }

  .evidence-panel {
    padding: 20px;
  }

  .evidence-panel strong {
    font-size: clamp(44px, 13vw, 54px);
    line-height: 1.05;
  }

  .evidence-panel strong br {
    display: none;
  }

  .evidence-panel p:not(.panel-kicker) {
    margin-top: 12px;
  }

  .proof-line {
    margin-top: 16px;
  }

  .primary-link,
  .quiet-link {
    width: 100%;
  }

  .chapter,
  .ending {
    padding: 68px 18px;
  }

  .map {
    padding: 28px 18px 68px;
  }

  .comparison-rail,
  .reframe-box p {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .comparison-rail i {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
