:root {
  color-scheme: dark;
  --ink: #f4efe4;
  --muted: #b9b0a0;
  --dim: #877e73;
  --paper: #13110f;
  --panel: #1b1814;
  --line: rgba(244, 239, 228, 0.16);
  --gold: #e3bd77;
  --copper: #bf6746;
  --cyan: #8ee8dc;
  --shadow: rgba(0, 0, 0, 0.46);
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  --sans: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

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

.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  height: 3px;
  background: rgba(244, 239, 228, 0.08);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--copper), var(--gold), var(--cyan));
}

.hero {
  position: relative;
  display: grid;
  min-height: 92vh;
  overflow: hidden;
  isolation: isolate;
  place-items: end start;
}

.hero-media,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-media {
  z-index: -3;
  background-image: url("assets/mythos-cover-v2.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.hero-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(8, 7, 6, 0.88), rgba(8, 7, 6, 0.36) 48%, rgba(8, 7, 6, 0.62)),
    linear-gradient(0deg, var(--paper) 0%, rgba(19, 17, 15, 0.12) 34%, transparent 72%);
}

.hero-content {
  width: min(960px, calc(100% - 48px));
  margin: 0 auto 13vh;
}

.eyebrow,
.chapter-kicker,
.toc-title {
  margin: 0;
  color: var(--gold);
  font: 700 12px/1.4 var(--sans);
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 16px 0 18px;
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 22px 55px var(--shadow);
}

.dek {
  width: min(690px, 100%);
  margin: 0;
  color: #efe4d0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.8;
  text-shadow: 0 18px 45px var(--shadow);
}

.scroll-cue {
  position: absolute;
  right: 36px;
  bottom: 34px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(244, 239, 228, 0.38);
  border-radius: 50%;
}

.scroll-cue::after {
  position: absolute;
  top: 13px;
  left: 14px;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 760px);
  gap: 70px;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 120px;
}

.toc {
  position: sticky;
  top: 40px;
  align-self: start;
  padding-top: 12px;
  color: var(--muted);
}

.toc nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.toc a {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 36px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.toc a span {
  color: var(--dim);
  font-size: 12px;
}

.toc a:hover,
.toc a.active {
  border-left-color: var(--gold);
  color: var(--ink);
}

.story {
  min-width: 0;
}

.chapter {
  padding: 0 0 78px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 78px;
  scroll-margin-top: 42px;
}

.chapter:last-child {
  margin-bottom: 0;
}

.chapter h2 {
  margin: 12px 0 34px;
  color: #fff8e8;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0;
}

.chapter-body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 2.08;
}

.chapter-body p {
  margin: 0 0 1.35em;
  color: #e8ddcd;
  text-align: justify;
}

.chapter-body p:first-child::first-letter {
  float: left;
  padding: 0.1em 0.14em 0 0;
  color: var(--gold);
  font-size: 3.4em;
  line-height: 0.85;
}

.chapter-body .emphasis {
  color: #fff7e6;
  font-size: 21px;
}

.chapter-body .signal {
  margin: 1.6em 0;
  padding: 22px 26px;
  border: 1px solid rgba(142, 232, 220, 0.26);
  background: rgba(142, 232, 220, 0.06);
  color: #d8fffa;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.term {
  color: #d7fff8;
  font-family: var(--sans);
  font-weight: 700;
}

.name {
  color: #ffe0aa;
  font-family: var(--sans);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 42px 24px 58px;
  color: var(--dim);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .hero {
    min-height: 86vh;
  }

  .hero-content {
    width: min(100% - 34px, 680px);
    margin-bottom: 11vh;
  }

  h1 {
    font-size: 48px;
  }

  .dek {
    font-size: 18px;
  }

  .scroll-cue {
    display: none;
  }

  .page-shell {
    display: block;
    width: min(100% - 34px, 760px);
    padding: 48px 0 84px;
  }

  .toc {
    position: relative;
    top: auto;
    margin-bottom: 42px;
    padding: 18px 0 22px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

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

  .toc a {
    grid-template-columns: 28px 1fr;
    font-size: 13px;
  }

  .chapter {
    padding-bottom: 56px;
    margin-bottom: 56px;
  }

  .chapter h2 {
    font-size: 28px;
  }

  .chapter-body {
    font-size: 18px;
    line-height: 2;
  }
}

@media (max-width: 520px) {
  .hero-media {
    background-position: 58% center;
  }

  h1 {
    font-size: 40px;
  }

  .dek {
    font-size: 17px;
  }

  .toc nav {
    grid-template-columns: 1fr;
  }

  .chapter-body p {
    text-align: left;
  }

  .chapter-body .emphasis {
    font-size: 19px;
  }

  .chapter-body .signal {
    padding: 18px;
    font-size: 19px;
  }
}
