/* ==========================================================================
   白塔木作 · 视觉系统
   A digital field guide to Yongjing Baita woodcarving.
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #f3eddf;
  --paper-warm: #ece2cf;
  --paper-light: #fbf8f0;
  --ink: #1d1c17;
  --ink-soft: #4e4a40;
  --ink-muted: #686154;
  --cinnabar: #9f3f2f;
  --cinnabar-deep: #7b2d22;
  --moss: #4b5747;
  --moss-deep: #26352b;
  --gold: #ae8a51;
  --gold-light: #d8bf8b;
  --line: rgba(29, 28, 23, 0.17);
  --line-light: rgba(247, 241, 226, 0.18);
  --shadow-soft: 0 24px 70px rgba(46, 37, 24, 0.13);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --page: min(1280px, calc(100vw - 96px));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-height: 82px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 252, 242, 0.85), transparent 32%),
    radial-gradient(circle at 85% 24%, rgba(191, 165, 122, 0.12), transparent 31%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--cinnabar);
  color: var(--paper-light);
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
blockquote,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--cinnabar);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 5000;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4000;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cinnabar);
  transform-origin: left;
}

.section-shell {
  width: var(--page);
  margin-inline: auto;
}

.section {
  padding: 128px 0;
  position: relative;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
}

.eyebrow-index {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.58fr);
  align-items: end;
  gap: 64px;
  margin-bottom: 54px;
}

.section-heading h2 {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 4.15vw, 4.3rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.section-intro {
  max-width: 460px;
  padding-bottom: 8px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.95;
}

.section-heading.light {
  color: var(--paper-light);
}

.section-heading.light .eyebrow,
.section-heading.light .section-intro {
  color: rgba(251, 248, 240, 0.69);
}

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s var(--ease);
}

.button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.button:hover svg {
  transform: translateX(4px);
}

.button:active {
  transform: translateY(1px);
}

.button-ink {
  background: var(--ink);
  color: var(--paper-light);
  border-color: var(--ink);
}

.button-ink:hover {
  background: var(--cinnabar-deep);
  border-color: var(--cinnabar-deep);
}

.button-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.button-ghost:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.34);
}

.button-note {
  padding-left: 17px;
  border-left: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.button-small {
  min-height: 44px;
  padding-inline: 19px;
  font-size: 13px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
}

.text-link span {
  transition: transform 0.3s var(--ease);
}

.text-link:hover span {
  transform: translateX(5px);
}

.light-link {
  color: var(--paper-light);
}

.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.inline-link span {
  font-size: 17px;
  transition: transform 0.3s var(--ease);
}

.inline-link:hover span {
  transform: translateX(5px);
}

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

.js-ready .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

.js-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Header ------------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    height 0.35s ease;
}

.site-header.is-scrolled {
  height: 70px;
  background: rgba(243, 237, 223, 0.9);
  border-color: var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1440px, calc(100vw - 56px));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cinnabar);
  background: var(--cinnabar);
  color: var(--paper-light);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 0 0 3px rgba(249, 243, 230, 0.15);
}

.brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-type strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-type small {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(22px, 2.6vw, 40px);
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 3px;
  height: 1px;
  background: var(--cinnabar);
  transition:
    left 0.3s var(--ease),
    right 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  left: 0;
  right: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}

.text-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-action:hover {
  color: var(--cinnabar);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 19px;
  height: 1px;
  margin: 4px auto;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(2.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-2.5px) rotate(-45deg);
}

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 900px;
  padding: calc(var(--header-height) + 66px) 0 45px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, transparent 0 49.94%, rgba(29, 28, 23, 0.075) 49.94% 50%, transparent 50%),
    linear-gradient(rgba(29, 28, 23, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 100% 84px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.hero::after {
  content: "白塔木作";
  position: absolute;
  right: 2.5vw;
  top: 104px;
  z-index: -1;
  color: rgba(56, 47, 33, 0.042);
  font-family: var(--serif);
  font-size: clamp(9rem, 21vw, 20rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.1em;
  writing-mode: vertical-rl;
  pointer-events: none;
}

.hero-grid {
  width: var(--page);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(470px, 0.82fr);
  align-items: center;
  gap: clamp(54px, 7vw, 118px);
  flex: 1;
}

.hero-copy {
  padding-top: 8px;
}

.hero-title {
  margin: 37px 0 31px;
  font-family: var(--serif);
  font-size: clamp(4.25rem, 8.4vw, 8.5rem);
  font-weight: 600;
  letter-spacing: -0.095em;
  line-height: 0.98;
}

.title-line {
  display: block;
  white-space: nowrap;
}

.title-indent {
  margin-left: 0.76em;
}

.accent-ink {
  position: relative;
  z-index: 1;
  color: var(--cinnabar);
}

.accent-ink::after {
  content: "";
  position: absolute;
  left: -0.06em;
  right: -0.08em;
  bottom: 0.03em;
  z-index: -1;
  height: 0.16em;
  background: rgba(159, 63, 47, 0.16);
  transform: rotate(-1.3deg);
}

.hero-intro {
  max-width: 590px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 2.08;
  letter-spacing: 0.015em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  margin-top: 37px;
}

.hero-proof {
  display: flex;
  gap: clamp(32px, 4.2vw, 62px);
  margin-top: 54px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.hero-proof > div {
  display: grid;
  gap: 2px;
}

.proof-number {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
}

.proof-label {
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.hero-visual {
  position: relative;
  min-height: 614px;
}

.hero-photo {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, 480px);
  height: 590px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow-soft);
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 248, 235, 0.23);
  pointer-events: none;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
  filter: saturate(0.74) contrast(1.08) sepia(0.08);
  transition: transform 1.2s var(--ease);
}

.hero-visual:hover .hero-photo img {
  transform: scale(1.028);
}

.photo-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 16, 13, 0.04), transparent 48%, rgba(13, 16, 13, 0.56)),
    linear-gradient(90deg, rgba(97, 48, 32, 0.16), transparent 62%);
}

.photo-caption,
.photo-coordinate {
  position: absolute;
  z-index: 1;
  color: rgba(255, 249, 238, 0.85);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.photo-caption {
  left: 30px;
  bottom: 27px;
}

.photo-coordinate {
  right: 27px;
  bottom: 27px;
  opacity: 0.68;
}

.hero-seal {
  position: absolute;
  top: 30px;
  left: -34px;
  z-index: 3;
  width: 72px;
  height: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid rgba(255, 246, 230, 0.33);
  background: var(--cinnabar);
  color: var(--paper-light);
  box-shadow: 0 13px 35px rgba(84, 31, 22, 0.23);
  transform: rotate(-2.5deg);
}

.hero-seal span {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
}

.hero-seal small {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.35em;
  line-height: 1;
}

.today-card {
  position: absolute;
  z-index: 4;
  left: -76px;
  bottom: 38px;
  width: min(355px, 68%);
  padding: 21px 23px 18px;
  border: 1px solid var(--line);
  background: rgba(250, 247, 238, 0.96);
  box-shadow: 0 20px 55px rgba(47, 37, 23, 0.16);
  backdrop-filter: blur(14px);
}

.today-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--moss);
}

.live-dot i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 4px rgba(75, 87, 71, 0.1);
}

.today-card-body {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 17px;
  padding: 16px 0 12px;
}

.today-glyph {
  width: 49px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--cinnabar);
}

.today-glyph svg {
  width: 35px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.today-card-body h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.today-card-body p {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.75;
}

.vertical-note {
  position: absolute;
  right: -36px;
  top: 48%;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.4em;
  writing-mode: vertical-rl;
}

.hero-footer {
  width: var(--page);
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.scroll-line {
  width: 65px;
  height: 1px;
  background: var(--line);
}

.hero-rule {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  gap: 13px;
  transform: translateY(-50%);
}

.hero-rule span {
  width: 9px;
  height: 1px;
  background: var(--line);
}

.hero-rule span:nth-child(2) {
  width: 18px;
}

.hero-rule span:nth-child(3) {
  width: 28px;
  background: var(--cinnabar);
}

/* Manifesto --------------------------------------------------------------- */
.manifesto {
  position: relative;
  z-index: 2;
  background: var(--ink);
  color: var(--paper-light);
}

.manifesto-grid {
  min-height: 300px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 260px;
  align-items: center;
  gap: 54px;
  padding-block: 50px;
}

.manifesto-index {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-right: 1px solid var(--line-light);
  color: rgba(251, 248, 240, 0.52);
  font-size: 10px;
  letter-spacing: 0.24em;
  writing-mode: vertical-rl;
}

.manifesto-index strong {
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.manifesto-text p {
  max-width: 760px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.55vw, 35px);
  line-height: 1.65;
  letter-spacing: 0.015em;
}

.manifesto-aside {
  padding-left: 27px;
  border-left: 1px solid var(--line-light);
}

.manifesto-aside p {
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.12em;
}

.manifesto-aside span {
  display: block;
  margin-top: 10px;
  color: rgba(251, 248, 240, 0.52);
  font-size: 10px;
  letter-spacing: 0.16em;
}

/* Courses ----------------------------------------------------------------- */
.courses-section {
  overflow: hidden;
}

.courses-section::before {
  content: "传习";
  position: absolute;
  right: -0.08em;
  top: 80px;
  color: rgba(49, 40, 28, 0.032);
  font-family: var(--serif);
  font-size: 20vw;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.learning-path {
  display: grid;
  grid-template-columns: 1fr 40px 1fr 40px 1fr 40px 1fr;
  align-items: center;
  margin-bottom: 68px;
  padding: 28px 31px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.path-step {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  align-items: center;
  gap: 14px;
  opacity: 0.55;
}

.path-step.is-current {
  opacity: 1;
}

.path-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 12px;
}

.is-current .path-number {
  border-color: var(--cinnabar);
  background: var(--cinnabar);
  color: var(--paper-light);
}

.path-step h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.path-step p {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.6;
}

.path-state {
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.path-connector {
  width: 100%;
  height: 1px;
  background: var(--line);
}

.course-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 26px;
}

.filter-tab {
  position: relative;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.25s ease;
}

.filter-tab span {
  margin-left: 5px;
  font-family: var(--serif);
  font-size: 10px;
  vertical-align: super;
}

.filter-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: var(--cinnabar);
  transition: right 0.3s var(--ease);
}

.filter-tab:hover,
.filter-tab.is-active {
  color: var(--ink);
}

.filter-tab.is-active::after {
  right: 0;
}

.course-count {
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.course-count span {
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 15px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 48px;
}

.course-card {
  position: relative;
  min-width: 0;
  border-top: 1px solid var(--ink);
  transition:
    transform 0.45s var(--ease),
    opacity 0.3s ease;
}

.course-card.is-filtered {
  display: none;
}

.course-card:hover {
  transform: translateY(-7px);
}

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.card-hit:focus-visible {
  outline-offset: -3px;
}

.course-visual {
  position: relative;
  height: 238px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: rgba(251, 248, 240, 0.79);
}

.course-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, transparent 49.8%, rgba(255, 255, 255, 0.08) 50%, transparent 50.2%),
    linear-gradient(transparent 49.8%, rgba(255, 255, 255, 0.08) 50%, transparent 50.2%);
  background-size: 42px 42px;
  opacity: 0.4;
}

.course-visual::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.15;
}

.course-visual-wood {
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 233, 193, 0.23), transparent 28%),
    #8a6848;
  color: #f3e5cf;
}

.course-visual-paper {
  border: 1px solid var(--line);
  border-top: 0;
  background:
    repeating-linear-gradient(6deg, transparent 0 9px, rgba(86, 63, 40, 0.06) 9px 10px),
    #e4d7c1;
  color: #5f4935;
}

.course-visual-red {
  background:
    radial-gradient(circle at 22% 76%, rgba(234, 183, 139, 0.16), transparent 29%),
    #853a2e;
  color: #edc7ae;
}

.course-visual-moss {
  background:
    radial-gradient(circle at 77% 16%, rgba(205, 208, 170, 0.14), transparent 25%),
    #405043;
  color: #d8dcc9;
}

.course-visual-ink {
  background:
    radial-gradient(circle at 18% 18%, rgba(188, 157, 105, 0.13), transparent 28%),
    #252723;
  color: #c6b590;
}

.course-visual-clay {
  background:
    repeating-linear-gradient(105deg, transparent 0 16px, rgba(70, 49, 34, 0.06) 16px 17px),
    #b89b7b;
  color: #4c3324;
}

.course-order {
  position: absolute;
  top: 17px;
  left: 19px;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  opacity: 0.8;
}

.course-glyph {
  position: relative;
  z-index: 1;
  width: 137px;
  height: 120px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.65s var(--ease);
}

.course-card:hover .course-glyph {
  transform: scale(1.035) rotate(-1deg);
}

.course-duration {
  position: absolute;
  right: 17px;
  bottom: 15px;
  padding: 5px 9px;
  border: 1px solid currentColor;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.course-body {
  padding: 20px 1px 23px;
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.course-meta span:last-child {
  color: var(--cinnabar);
}

.course-body h3 {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.course-body > p {
  min-height: 66px;
  margin-top: 9px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.8;
}

.course-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.mini-progress {
  width: 58px;
  height: 2px;
  overflow: hidden;
  background: rgba(29, 28, 23, 0.12);
}

.mini-progress span {
  display: block;
  height: 100%;
  background: var(--cinnabar);
}

/* Atlas ------------------------------------------------------------------- */
.atlas-section {
  background:
    radial-gradient(circle at 25% 20%, rgba(151, 102, 67, 0.17), transparent 33%),
    radial-gradient(circle at 85% 80%, rgba(94, 106, 76, 0.14), transparent 30%),
    #172019;
  color: var(--paper-light);
  overflow: hidden;
}

.atlas-section::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(90deg, var(--paper-light) 1px, transparent 1px),
    linear-gradient(var(--paper-light) 1px, transparent 1px);
  background-size: 82px 82px;
  mask-image: radial-gradient(circle at 24% 52%, black, transparent 58%);
}

.atlas-section .section-shell {
  position: relative;
}

.atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(320px, 0.72fr);
  border: 1px solid var(--line-light);
  min-height: 680px;
}

.atlas-stage {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-light);
  background:
    radial-gradient(circle at 48% 44%, rgba(182, 128, 78, 0.12), transparent 39%),
    rgba(6, 12, 8, 0.22);
}

.atlas-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 23px;
  border-bottom: 1px solid var(--line-light);
  color: rgba(251, 248, 240, 0.58);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.atlas-mode {
  color: var(--gold-light);
}

.atlas-canvas {
  position: relative;
  flex: 1;
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.atlas-canvas:active {
  cursor: grabbing;
}

.atlas-model {
  width: min(92%, 720px);
  height: auto;
  overflow: visible;
  transform-origin: 50% 66%;
  transition: transform 0.4s var(--ease);
  filter: drop-shadow(0 34px 28px rgba(0, 0, 0, 0.18));
}

.atlas-piece {
  transition: transform 0.8s var(--ease);
}

.atlas-piece.is-dimmed {
  opacity: 0.38;
}

.atlas-model.is-exploded .piece-beam {
  transform: translate(71px, -47px);
}

.atlas-model.is-exploded .piece-capital {
  transform: translate(36px, -22px);
}

.atlas-model.is-exploded .piece-pillar {
  transform: translate(-3px, 49px);
}

.atlas-model.is-exploded .piece-queti {
  transform: translate(-54px, 13px);
}

.atlas-model.is-exploded .piece-brace {
  transform: translate(12px, -92px);
}

.hotspot {
  cursor: pointer;
}

.hotspot circle:first-child {
  fill: rgba(159, 63, 47, 0.92);
  stroke: rgba(251, 248, 240, 0.66);
  stroke-width: 1;
  transition:
    r 0.25s ease,
    fill 0.25s ease;
}

.hotspot circle:nth-child(2) {
  fill: var(--paper-light);
}

.hotspot text {
  fill: var(--paper-light);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.1em;
  pointer-events: none;
}

.hotspot:hover circle:first-child,
.hotspot.is-active circle:first-child {
  r: 23px;
  fill: #bc5945;
}

.hotspot:hover text,
.hotspot.is-active text {
  opacity: 1;
}

.atlas-gesture {
  position: absolute;
  left: 24px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(251, 248, 240, 0.58);
  font-size: 9px;
  letter-spacing: 0.1em;
  pointer-events: none;
}

.atlas-gesture svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.atlas-controls {
  display: flex;
  gap: 8px;
  padding: 18px 23px;
  border-top: 1px solid var(--line-light);
}

.atlas-button {
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid var(--line-light);
  background: transparent;
  color: rgba(251, 248, 240, 0.63);
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.atlas-button:hover,
.atlas-button.is-active {
  border-color: rgba(251, 248, 240, 0.5);
  color: var(--paper-light);
}

.atlas-button.is-active {
  background: rgba(251, 248, 240, 0.09);
}

.atlas-notes {
  display: flex;
  flex-direction: column;
  padding: 25px 27px 24px;
}

.atlas-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-light);
  color: rgba(251, 248, 240, 0.58);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.atlas-note-head span:first-child {
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 12px;
}

.atlas-note-content {
  padding: 29px 0 28px;
}

.atlas-note-content h3 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.05em;
}

.atlas-note-content > p {
  min-height: 126px;
  margin-top: 16px;
  color: rgba(251, 248, 240, 0.63);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
}

.atlas-specs {
  margin-top: 22px;
  border-top: 1px solid var(--line-light);
}

.atlas-specs > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-light);
}

.atlas-specs dt {
  color: rgba(251, 248, 240, 0.58);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.atlas-specs dd {
  margin: 0;
  color: rgba(251, 248, 240, 0.84);
  font-size: 11px;
  line-height: 1.65;
}

.atlas-part-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: auto;
  border-top: 1px solid var(--line-light);
  border-left: 1px solid var(--line-light);
}

.atlas-part-list button {
  display: grid;
  grid-template-columns: 21px 1fr;
  align-items: center;
  gap: 6px;
  min-height: 65px;
  padding: 10px 11px;
  border: 0;
  border-right: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
  background: transparent;
  color: rgba(251, 248, 240, 0.56);
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

.atlas-part-list button:hover,
.atlas-part-list button.is-active {
  background: rgba(251, 248, 240, 0.08);
  color: var(--paper-light);
}

.atlas-part-list button > span:first-child {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 10px;
}

.atlas-part-list button > span:nth-child(2) {
  font-family: var(--serif);
  font-size: 15px;
}

.atlas-part-list small {
  grid-column: 2;
  color: rgba(251, 248, 240, 0.5);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.atlas-notes > .text-link {
  margin-top: 18px;
  align-self: flex-start;
}

/* Community --------------------------------------------------------------- */
.community-section {
  background:
    linear-gradient(90deg, rgba(117, 91, 59, 0.042) 1px, transparent 1px),
    var(--paper);
  background-size: 120px 100%;
}

.journal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(380px, 0.98fr);
  gap: 64px;
}

.feature-story {
  min-width: 0;
}

.feature-story-image {
  position: relative;
  height: 380px;
  overflow: hidden;
  background: var(--ink);
}

.feature-story-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 55%, rgba(23, 19, 13, 0.58)),
    linear-gradient(90deg, rgba(23, 19, 13, 0.18), transparent);
}

.feature-story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 52%;
  filter: saturate(0.72) contrast(1.04);
  transition: transform 1.1s var(--ease);
}

.feature-story:hover .feature-story-image img {
  transform: scale(1.025);
}

.image-stamp {
  position: absolute;
  z-index: 2;
  left: 20px;
  bottom: 18px;
  padding: 7px 11px;
  border: 1px solid rgba(251, 248, 240, 0.4);
  color: rgba(251, 248, 240, 0.86);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.feature-story-body {
  padding: 28px 0 0;
}

.story-kicker,
.game-kicker {
  color: var(--cinnabar);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.feature-story blockquote {
  max-width: 590px;
  margin-top: 17px;
  font-family: var(--serif);
  font-size: clamp(25px, 2.6vw, 35px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.55;
}

.story-author {
  margin-top: 17px;
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.feature-story .text-link {
  margin-top: 9px;
}

.journal-feed {
  border-top: 1px solid var(--ink);
}

.journal-item {
  padding: 25px 2px 26px;
  border-bottom: 1px solid var(--line);
}

.journal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.09em;
}

.journal-meta span {
  color: var(--cinnabar);
}

.journal-item h3 {
  max-width: 490px;
  margin-top: 13px;
  font-family: var(--serif);
  font-size: clamp(20px, 1.85vw, 25px);
  font-weight: 600;
  line-height: 1.55;
}

.journal-item > p {
  max-width: 500px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.journal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: 9px;
}

.round-link {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s var(--ease);
}

.round-link:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-light);
  transform: rotate(8deg);
}

.journal-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 27px;
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
}

.prompt-label {
  color: var(--cinnabar);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.journal-prompt h3 {
  max-width: 390px;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.5;
}

.community-strip {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(360px, 1.4fr) auto;
  align-items: center;
  gap: 38px;
  margin-top: 73px;
  padding-top: 25px;
  border-top: 1px solid var(--ink);
}

.strip-stat {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  column-gap: 12px;
}

.strip-index {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: var(--cinnabar);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.strip-stat strong {
  font-family: var(--serif);
  font-size: 47px;
  font-weight: 400;
  line-height: 1;
}

.strip-stat p {
  max-width: 100px;
  padding-bottom: 4px;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.5;
}

.strip-question {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.strip-question span {
  display: block;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.strip-question button {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}

.strip-question button:hover {
  color: var(--cinnabar);
}

/* Games ------------------------------------------------------------------- */
.games-section {
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.games-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
  gap: 28px;
}

.game-feature {
  min-width: 0;
  border: 1px solid var(--ink);
  background: var(--paper-light);
}

.game-feature-visual {
  position: relative;
  height: 360px;
  overflow: hidden;
  background: #33251c;
}

.game-feature-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.58) sepia(0.12) contrast(1.05);
  opacity: 0.86;
  transition: transform 1s var(--ease);
}

.game-feature:hover .game-feature-visual img {
  transform: scale(1.025);
}

.game-feature-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(22, 16, 12, 0.02), rgba(22, 16, 12, 0.54)),
    linear-gradient(90deg, rgba(43, 24, 16, 0.2), transparent);
}

.game-grid-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  background-image:
    linear-gradient(90deg, transparent calc(33.333% - 1px), rgba(255, 246, 230, 0.42) 33.333%, transparent calc(33.333% + 1px)),
    linear-gradient(90deg, transparent calc(66.666% - 1px), rgba(255, 246, 230, 0.42) 66.666%, transparent calc(66.666% + 1px)),
    linear-gradient(transparent calc(33.333% - 1px), rgba(255, 246, 230, 0.42) 33.333%, transparent calc(33.333% + 1px)),
    linear-gradient(transparent calc(66.666% - 1px), rgba(255, 246, 230, 0.42) 66.666%, transparent calc(66.666% + 1px));
  opacity: 0.58;
}

.game-badge {
  position: absolute;
  z-index: 2;
  top: 19px;
  left: 19px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 248, 235, 0.4);
  color: rgba(255, 248, 235, 0.9);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.game-feature-copy {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 26px;
}

.game-number {
  align-self: start;
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 31px;
  line-height: 1;
}

.game-feature-copy h3 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
}

.game-feature-copy p:last-child {
  max-width: 410px;
  margin-top: 7px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.game-small-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 206px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.53);
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease,
    transform 0.35s var(--ease);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  background: var(--paper-light);
}

.game-icon {
  width: 44px;
  height: 44px;
  color: var(--cinnabar);
}

.game-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.game-card-copy {
  margin-top: auto;
  padding-right: 35px;
}

.game-card-copy > span {
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.game-card-copy h3 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.game-card-copy p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.game-card .round-link {
  position: absolute;
  right: 16px;
  bottom: 17px;
}

.game-record {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 5px 16px;
  min-height: 140px;
  padding: 24px;
  background: var(--ink);
  color: var(--paper-light);
}

.game-record > span {
  color: rgba(251, 248, 240, 0.6);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.game-record strong {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.game-record p {
  max-width: 250px;
  color: rgba(251, 248, 240, 0.57);
  font-size: 9px;
  line-height: 1.65;
}

/* Workshop ---------------------------------------------------------------- */
.workshop-section {
  background:
    radial-gradient(circle at 90% 15%, rgba(174, 138, 81, 0.1), transparent 25%),
    var(--paper);
}

.workshop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  gap: 64px;
  align-items: stretch;
}

.workshop-progress {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 42px;
  padding: 39px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.ring {
  --size: 190px;
  position: relative;
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--cinnabar) calc(var(--progress) * 1%), rgba(29, 28, 23, 0.09) 0);
}

.ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: var(--paper);
}

.ring::after {
  content: "";
  position: absolute;
  inset: 25px;
  border: 1px solid var(--line);
  border-radius: inherit;
}

.ring-inner {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.ring-inner strong {
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 400;
  line-height: 1;
}

.ring-inner strong small {
  margin-left: 2px;
  font-family: var(--sans);
  font-size: 12px;
}

.ring-inner span {
  margin-top: 7px;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.workshop-kicker {
  color: var(--cinnabar);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.workshop-progress-copy h3 {
  max-width: 330px;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.55;
}

.workshop-progress-copy p {
  max-width: 380px;
  margin: 10px 0 20px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
}

.workshop-ledger {
  padding: 28px 30px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.46);
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.ledger-head span:first-child {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
}

.badge-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 61px;
  padding: 10px;
  border: 1px solid var(--line);
  opacity: 0.45;
}

.badge.is-earned {
  border-color: rgba(174, 138, 81, 0.36);
  opacity: 1;
}

.badge-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 16px;
}

.is-earned .badge-mark {
  border-color: var(--cinnabar);
  background: var(--cinnabar);
  color: var(--paper-light);
}

.badge div {
  display: grid;
  gap: 2px;
}

.badge strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
}

.badge small {
  color: var(--ink-muted);
  font-size: 8px;
}

.ledger-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.ledger-stats > div {
  padding-left: 15px;
  border-left: 1px solid var(--line);
}

.ledger-stats > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.ledger-stats span {
  display: block;
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.ledger-stats strong {
  display: inline-block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
}

.ledger-stats small {
  margin-left: 3px;
  color: var(--ink-muted);
  font-size: 9px;
}

/* Closing ----------------------------------------------------------------- */
.closing-section {
  position: relative;
  padding: 130px 0 124px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 10%, rgba(216, 191, 139, 0.09), transparent 26%),
    var(--ink);
  color: var(--paper-light);
  text-align: center;
}

.closing-section::before,
.closing-section::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-light);
}

.closing-section::before {
  left: 7.5vw;
}

.closing-section::after {
  right: 7.5vw;
}

.closing-shell {
  position: relative;
  width: min(780px, calc(100vw - 80px));
  margin-inline: auto;
}

.closing-mark {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(251, 248, 240, 0.035);
  font-family: var(--serif);
  font-size: 380px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.closing-shell .eyebrow {
  position: relative;
  justify-content: center;
  color: rgba(251, 248, 240, 0.5);
}

.closing-shell h2 {
  position: relative;
  margin-top: 25px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5.1vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.35;
}

.closing-shell > p:not(.eyebrow) {
  position: relative;
  max-width: 590px;
  margin: 23px auto 0;
  color: rgba(251, 248, 240, 0.56);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
}

.closing-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 35px;
}

.closing-actions .button-ink {
  background: var(--paper-light);
  border-color: var(--paper-light);
  color: var(--ink);
}

.closing-actions .button-ink:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.closing-actions .text-link {
  color: rgba(251, 248, 240, 0.7);
}

/* Footer ------------------------------------------------------------------ */
.site-footer {
  background: #151712;
  color: var(--paper-light);
}

.footer-shell {
  width: var(--page);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  gap: 50px;
  padding: 56px 0 48px;
}

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

.footer-brand .brand-mark {
  border-color: rgba(251, 248, 240, 0.25);
  background: transparent;
}

.footer-brand strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.12em;
}

.footer-brand p {
  margin-top: 4px;
  color: rgba(251, 248, 240, 0.58);
  font-size: 9px;
  letter-spacing: 0.07em;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 25px;
  padding-top: 10px;
}

.footer-nav a {
  min-height: 32px;
  color: rgba(251, 248, 240, 0.62);
  font-size: 11px;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--paper-light);
}

.footer-note {
  justify-self: end;
  text-align: right;
}

.footer-note p {
  color: rgba(251, 248, 240, 0.65);
  font-family: var(--serif);
  font-size: 13px;
}

.footer-note span {
  display: block;
  margin-top: 8px;
  color: rgba(251, 248, 240, 0.55);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.footer-bottom {
  width: var(--page);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 0 20px;
  border-top: 1px solid rgba(251, 248, 240, 0.1);
  color: rgba(251, 248, 240, 0.55);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.footer-bottom button {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(251, 248, 240, 0.52);
  font-size: 9px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.footer-bottom button:hover {
  color: var(--paper-light);
}

/* Lesson modal ------------------------------------------------------------ */
.modal,
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop,
.story-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 12, 0.7);
  backdrop-filter: blur(9px);
  animation: backdrop-in 0.3s ease both;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1000px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  border: 1px solid rgba(251, 248, 240, 0.16);
  background: var(--paper);
  box-shadow: 0 44px 110px rgba(0, 0, 0, 0.4);
  animation: panel-in 0.45s var(--ease) both;
}

.modal-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(251, 248, 240, 0.88);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s var(--ease);
}

.modal-close:hover {
  background: var(--ink);
  color: var(--paper-light);
  transform: rotate(6deg);
}

.lesson-panel > .modal-close {
  position: absolute;
  z-index: 3;
  top: 20px;
  right: 20px;
  border-color: rgba(251, 248, 240, 0.25);
  background: rgba(20, 22, 18, 0.34);
  color: var(--paper-light);
  backdrop-filter: blur(8px);
}

.lesson-hero {
  position: relative;
  min-height: 290px;
  padding: 39px 42px 35px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 15%, rgba(191, 148, 97, 0.22), transparent 28%),
    #1e241e;
  color: var(--paper-light);
}

.lesson-hero::after {
  content: attr(data-mark);
  position: absolute;
  right: 1.5%;
  bottom: -0.24em;
  color: rgba(251, 248, 240, 0.055);
  font-family: var(--serif);
  font-size: 220px;
  font-weight: 900;
  line-height: 1;
}

.lesson-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(251, 248, 240, 0.58);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.lesson-hero h2 {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin-top: 29px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.7vw, 58px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.22;
}

.lesson-hero > p {
  position: relative;
  z-index: 1;
  max-width: 610px;
  margin-top: 13px;
  color: rgba(251, 248, 240, 0.63);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.85;
}

.lesson-meta-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 25px;
}

.lesson-meta-row span {
  padding: 5px 10px;
  border: 1px solid rgba(251, 248, 240, 0.23);
  color: rgba(251, 248, 240, 0.7);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.lesson-body {
  display: grid;
  grid-template-columns: 1fr 285px;
  gap: 42px;
  padding: 36px 42px 42px;
}

.lesson-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.lesson-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.lesson-list {
  border-top: 1px solid var(--line);
}

.lesson-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 65px;
  border-bottom: 1px solid var(--line);
}

.lesson-item-index {
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 11px;
}

.lesson-item h4 {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.lesson-item p {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 8px;
}

.lesson-item time {
  color: var(--ink-muted);
  font-size: 9px;
}

.lesson-item.is-done .lesson-item-index {
  color: var(--moss);
}

.lesson-side {
  align-self: start;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.45);
}

.lesson-side > span {
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.lesson-side h3 {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.45;
}

.lesson-side > p {
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.75;
}

.lesson-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 17px 0 23px;
}

.lesson-tools span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 8px;
}

.lesson-side .button {
  width: 100%;
}

/* Story modal ------------------------------------------------------------- */
.story-modal {
  z-index: 2800;
}

.story-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 58px 64px 54px;
  background:
    linear-gradient(90deg, transparent 98%, rgba(80, 64, 44, 0.05) 98%),
    var(--paper-light);
  box-shadow: 0 44px 110px rgba(0, 0, 0, 0.42);
  animation: panel-in 0.45s var(--ease) both;
}

.story-panel > .modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.story-panel h2 {
  margin: 18px 0 22px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 51px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.3;
}

.story-lead {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.95;
}

.story-panel > p:not(.story-kicker, .story-lead, .story-sign) {
  margin-top: 17px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 2.05;
}

.story-rule {
  width: 48px;
  height: 1px;
  margin: 29px 0;
  background: var(--cinnabar);
}

.story-panel blockquote {
  margin: 29px 0 24px;
  padding: 22px 0 22px 24px;
  border-left: 2px solid var(--cinnabar);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.7;
}

.story-sign {
  margin-top: 31px;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

/* Game shell -------------------------------------------------------------- */
.game-panel {
  width: min(1080px, 100%);
  max-height: 92vh;
  background: var(--paper);
}

.game-panel-top {
  display: grid;
  grid-template-columns: 1fr auto 44px;
  align-items: center;
  gap: 24px;
  min-height: 92px;
  padding: 17px 24px 17px 28px;
  border-bottom: 1px solid rgba(251, 248, 240, 0.13);
  background: var(--ink);
  color: var(--paper-light);
}

.game-panel-kicker {
  color: rgba(251, 248, 240, 0.55);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.game-panel-top h2 {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.game-panel-top .modal-close {
  border-color: rgba(251, 248, 240, 0.2);
  background: transparent;
  color: var(--paper-light);
}

.game-hud {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hud-item {
  min-width: 86px;
  min-height: 53px;
  display: grid;
  align-content: center;
  padding: 8px 13px;
  border: 1px solid rgba(251, 248, 240, 0.13);
}

.hud-item small {
  color: rgba(251, 248, 240, 0.55);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.hud-item strong {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

#gameContainer {
  min-height: 570px;
  background:
    linear-gradient(90deg, rgba(92, 73, 49, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 92px 100%;
}

.game-shell {
  padding: 28px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.6fr);
  gap: 28px;
}

.game-stage-wrap {
  min-width: 0;
}

.game-stage-head,
.game-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.game-stage-head strong,
.game-side-head strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.game-side {
  min-width: 0;
}

.game-side-body {
  padding-top: 18px;
}

.game-instruction {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.game-tip {
  margin-top: 15px;
  padding: 13px 14px;
  border-left: 2px solid var(--gold);
  background: rgba(174, 138, 81, 0.08);
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.7;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.game-actions .button {
  flex: 1 1 auto;
}

.game-secondary {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    color 0.25s ease,
    background-color 0.25s ease;
}

.game-secondary:hover,
.game-secondary.is-active {
  border-color: var(--ink);
  background: rgba(29, 28, 23, 0.05);
  color: var(--ink);
}

.game-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.score-list {
  display: grid;
  gap: 0;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}

.score-list > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 9px;
}

.score-list strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.game-legend {
  display: grid;
  gap: 7px;
  margin-top: 17px;
}

.game-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 8px;
}

.game-legend i {
  width: 7px;
  height: 7px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.game-legend .is-good {
  border-color: var(--moss);
  background: var(--moss);
}

.game-legend .is-warn {
  border-color: var(--cinnabar);
  background: var(--cinnabar);
}

/* Puzzle */
.puzzle-stage {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  background: #d7c6aa;
}

.puzzle-board {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  overflow: hidden;
  background: #2c241b;
  touch-action: manipulation;
}

.puzzle-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background-repeat: no-repeat;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 249, 238, 0.11);
  transition:
    transform 0.2s var(--ease),
    filter 0.2s ease;
}

.puzzle-tile::after {
  content: attr(data-index-label);
  position: absolute;
  right: 6px;
  bottom: 5px;
  padding: 2px 5px;
  background: rgba(24, 19, 14, 0.5);
  color: rgba(255, 249, 238, 0.72);
  font-size: 7px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.puzzle-board.show-hint .puzzle-tile::after {
  opacity: 1;
}

.puzzle-tile:hover {
  filter: brightness(1.08);
  transform: scale(1.005);
}

.puzzle-tile.is-movable {
  box-shadow: inset 0 0 0 2px var(--gold-light);
}

.puzzle-tile.is-hinted {
  z-index: 1;
  box-shadow:
    inset 0 0 0 3px var(--gold),
    0 0 0 3px rgba(216, 191, 139, 0.48);
  animation: hint-pulse 1.1s ease-in-out infinite;
}

.puzzle-empty {
  background: #30271e;
  box-shadow: inset 0 0 0 1px rgba(255, 249, 238, 0.14);
}

.puzzle-guide {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 18px;
  width: 31%;
  aspect-ratio: 3 / 2;
  border: 1px solid rgba(255, 249, 238, 0.65);
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  box-shadow: 0 10px 30px rgba(24, 17, 10, 0.3);
}

.puzzle-board.show-guide + .puzzle-guide {
  opacity: 0.86;
}

.game-win-tint {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(25, 30, 24, 0.56);
  color: var(--paper-light);
  font-family: var(--serif);
  font-size: 36px;
  letter-spacing: 0.2em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.puzzle-stage.is-won .game-win-tint {
  opacity: 1;
}

/* Carving */
.carving-stage {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  background: #d9c6a5;
}

.carving-canvas-wrap {
  position: relative;
  overflow: hidden;
  background: #6d4a30;
}

.carving-canvas-wrap canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  cursor: crosshair;
  touch-action: none;
}

.carving-label {
  position: absolute;
  left: 16px;
  bottom: 13px;
  color: rgba(255, 246, 231, 0.56);
  font-size: 8px;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.tool-list {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.tool-option {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.48);
  text-align: left;
  cursor: pointer;
}

.tool-option:hover,
.tool-option.is-active {
  border-color: var(--ink);
  background: var(--paper-light);
}

.tool-option svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--cinnabar);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-option strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.tool-option small {
  color: var(--ink-muted);
  font-size: 8px;
}

.carving-progress {
  margin-top: 19px;
}

.carving-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-muted);
  font-size: 8px;
}

.carving-progress-track {
  height: 3px;
  background: rgba(29, 28, 23, 0.1);
}

.carving-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cinnabar);
  transition: width 0.25s ease;
}

/* Quiz */
.quiz-shell {
  max-width: 800px;
  margin: 0 auto;
  padding: 37px 12px 20px;
}

.quiz-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.quiz-progress-top strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.quiz-track {
  height: 2px;
  margin-bottom: 34px;
  background: rgba(29, 28, 23, 0.1);
}

.quiz-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cinnabar);
  transition: width 0.35s var(--ease);
}

.quiz-question {
  min-height: 112px;
}

.quiz-question p {
  color: var(--cinnabar);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.quiz-question h3 {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 37px);
  font-weight: 600;
  line-height: 1.48;
}

.quiz-options {
  display: grid;
  gap: 9px;
  margin-top: 25px;
}

.quiz-option {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 31px 1fr 20px;
  align-items: center;
  gap: 13px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.55);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.23s ease,
    background-color 0.23s ease,
    transform 0.23s var(--ease);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--ink);
  transform: translateX(4px);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option-index {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 10px;
}

.quiz-option-text {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
}

.quiz-option-mark {
  color: var(--ink-muted);
  font-size: 16px;
}

.quiz-option.is-correct {
  border-color: var(--moss);
  background: rgba(75, 87, 71, 0.1);
}

.quiz-option.is-correct .quiz-option-index {
  border-color: var(--moss);
  background: var(--moss);
  color: var(--paper-light);
}

.quiz-option.is-wrong {
  border-color: var(--cinnabar);
  background: rgba(159, 63, 47, 0.08);
}

.quiz-option.is-wrong .quiz-option-index {
  border-color: var(--cinnabar);
  background: var(--cinnabar);
  color: var(--paper-light);
}

.quiz-explanation {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.quiz-explanation p {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.quiz-explanation .button {
  min-width: 125px;
}

/* Matching */
.matching-wrap {
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  gap: 12px;
  align-items: start;
}

.matching-column {
  display: grid;
  gap: 8px;
}

.matching-column-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.match-item {
  width: 100%;
  min-height: 59px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.52);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.22s ease,
    background-color 0.22s ease,
    transform 0.22s var(--ease);
}

.match-item:hover:not(:disabled) {
  border-color: var(--ink);
  transform: translateX(3px);
}

.match-item .match-symbol {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 17px;
}

.match-item strong {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.match-item.is-selected {
  border-color: var(--ink);
  background: var(--paper-light);
  box-shadow: inset 3px 0 0 var(--gold);
}

.match-item.is-matched {
  border-color: rgba(75, 87, 71, 0.4);
  background: rgba(75, 87, 71, 0.08);
  color: var(--moss);
  opacity: 0.68;
}

.match-item.is-wrong {
  border-color: var(--cinnabar);
  animation: nudge 0.35s ease both;
}

.matching-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
  color: var(--ink-muted);
}

.matching-middle::before,
.matching-middle::after {
  content: "";
  width: 1px;
  flex: 1;
  min-height: 30px;
  background: var(--line);
}

.matching-middle span {
  padding: 9px 0;
  font-family: var(--serif);
  font-size: 10px;
  writing-mode: vertical-rl;
}

/* Results */
.game-result {
  min-height: 500px;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  text-align: center;
}

.result-inner {
  width: min(520px, 100%);
}

.result-seal {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border: 1px solid var(--cinnabar);
  border-radius: 50%;
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 28px;
}

.result-stars {
  margin-bottom: 11px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.3em;
}

.game-result h3 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 45px);
  font-weight: 600;
  line-height: 1.35;
}

.game-result > .result-inner > p {
  max-width: 430px;
  margin: 13px auto 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.85;
}

.result-score {
  display: flex;
  justify-content: center;
  margin: 25px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-score div {
  min-width: 112px;
  padding: 16px 17px;
  border-left: 1px solid var(--line);
}

.result-score div:first-child {
  border-left: 0;
}

.result-score span {
  display: block;
  color: var(--ink-muted);
  font-size: 8px;
}

.result-score strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 27px;
}

/* Toast ------------------------------------------------------------------- */
.toast {
  position: fixed;
  z-index: 5000;
  left: 50%;
  bottom: 28px;
  max-width: min(430px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid rgba(251, 248, 240, 0.22);
  background: var(--ink);
  color: var(--paper-light);
  font-size: 11px;
  line-height: 1.55;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s var(--ease);
}

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

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  32% {
    transform: translateX(-5px);
  }
  66% {
    transform: translateX(4px);
  }
}

@keyframes hint-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.22);
  }
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1180px) {
  :root {
    --page: min(1120px, calc(100vw - 64px));
  }

  .header-inner {
    width: calc(100vw - 44px);
  }

  .site-nav {
    gap: 19px;
  }

  .nav-link {
    font-size: 12px;
  }

  .text-action {
    display: none;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.03fr) minmax(410px, 0.8fr);
    gap: 55px;
  }

  .hero-title {
    font-size: clamp(4rem, 8vw, 7rem);
  }

  .hero-photo {
    height: 544px;
  }

  .hero-visual {
    min-height: 580px;
  }

  .today-card {
    left: -52px;
    bottom: 24px;
  }

  .course-visual {
    height: 210px;
  }

  .atlas-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.7fr);
  }

  .journal-layout {
    gap: 42px;
  }

  .games-layout {
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  }

  .game-feature-copy {
    grid-template-columns: 44px 1fr;
  }

  .game-feature-copy > .button {
    grid-column: 2;
    justify-self: start;
  }

  .workshop-grid {
    gap: 38px;
  }

  .workshop-progress {
    grid-template-columns: 180px 1fr;
    gap: 31px;
  }

  .ring {
    --size: 170px;
  }
}

@media (max-width: 960px) {
  :root {
    --header-height: 72px;
  }

  .site-header {
    background: rgba(243, 237, 223, 0.91);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 1190;
    display: grid;
    gap: 0;
    padding: 15px 30px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(246, 240, 227, 0.98);
    box-shadow: 0 20px 50px rgba(40, 32, 20, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
      opacity 0.3s ease,
      transform 0.3s var(--ease),
      visibility 0.3s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-link {
    justify-content: space-between;
    min-height: 56px;
    border-bottom: 1px solid var(--line);
    font-family: var(--serif);
    font-size: 18px;
  }

  .nav-link::after {
    display: none;
  }

  .header-actions > .button {
    display: none;
  }

  .section {
    padding: 96px 0;
  }

  .hero {
    min-height: auto;
    padding-top: 132px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 62px;
  }

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

  .hero-title {
    font-size: clamp(4.4rem, 12.4vw, 7.1rem);
  }

  .hero-visual {
    width: min(680px, 94%);
    min-height: 600px;
    margin-left: auto;
  }

  .hero-photo {
    width: 100%;
    height: 600px;
  }

  .today-card {
    left: -46px;
    width: 330px;
  }

  .vertical-note {
    right: -26px;
  }

  .hero-footer {
    margin-top: 50px;
  }

  .manifesto-grid {
    grid-template-columns: 80px 1fr;
    gap: 35px;
  }

  .manifesto-aside {
    grid-column: 2;
    padding: 20px 0 0;
    border-top: 1px solid var(--line-light);
    border-left: 0;
  }

  .manifesto-index {
    grid-row: 1 / 3;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .section-intro {
    max-width: 610px;
    padding: 0;
  }

  .learning-path {
    grid-template-columns: 1fr 1fr;
    gap: 20px 0;
    padding: 23px 0;
  }

  .path-connector {
    display: none;
  }

  .path-step {
    padding-right: 22px;
  }

  .path-step:nth-of-type(2),
  .path-step:nth-of-type(4) {
    padding-left: 22px;
    border-left: 1px solid var(--line);
  }

  .course-grid {
    grid-template-columns: 1fr 1fr;
  }

  .course-visual {
    height: 235px;
  }

  .atlas-layout {
    grid-template-columns: 1fr;
  }

  .atlas-stage {
    min-height: 620px;
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }

  .atlas-notes {
    min-height: 580px;
  }

  .atlas-note-content > p {
    min-height: auto;
  }

  .atlas-part-list {
    margin-top: 30px;
  }

  .journal-layout {
    grid-template-columns: 1fr;
  }

  .feature-story {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 32px;
    align-items: center;
  }

  .feature-story-image {
    height: 330px;
  }

  .games-layout {
    grid-template-columns: 1fr;
  }

  .game-feature {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
  }

  .game-feature-visual {
    height: 100%;
    min-height: 330px;
  }

  .game-feature-copy {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 29px;
  }

  .game-feature-copy > .button {
    grid-column: auto;
    justify-self: start;
    margin-top: 20px;
  }

  .game-number {
    margin-bottom: 7px;
  }

  .workshop-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .workshop-progress {
    grid-template-columns: 190px 1fr;
  }

  .footer-shell {
    grid-template-columns: 1fr 1fr;
  }

  .footer-note {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-side-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .game-side-body > .game-instruction {
    grid-column: 1 / -1;
  }

  .game-actions {
    margin-top: 0;
  }

  .game-shell {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  :root {
    --page: calc(100vw - 36px);
  }

  body {
    font-size: 15px;
  }

  .header-inner {
    width: calc(100vw - 28px);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .brand-type strong {
    font-size: 17px;
  }

  .brand-type small {
    display: none;
  }

  .section {
    padding: 78px 0;
  }

  .hero {
    padding-top: 120px;
    padding-bottom: 34px;
  }

  .hero::before {
    background-size: 100% 100%, 100% 72px;
  }

  .hero-title {
    margin: 28px 0 22px;
    font-size: clamp(3.25rem, 16.3vw, 5rem);
    letter-spacing: -0.08em;
  }

  .title-indent {
    margin-left: 0.38em;
  }

  .hero-intro {
    font-size: 15px;
    line-height: 1.95;
  }

  .hero-actions {
    align-items: stretch;
    margin-top: 27px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .button-note {
    margin-left: auto;
  }

  .hero-proof {
    gap: 22px;
    margin-top: 37px;
  }

  .proof-number {
    font-size: 25px;
  }

  .proof-label {
    font-size: 8px;
  }

  .hero-visual {
    width: calc(100% - 16px);
    min-height: 430px;
    margin-left: 0;
  }

  .hero-photo {
    position: relative;
    width: 100%;
    height: 430px;
  }

  .hero-seal {
    top: 19px;
    left: auto;
    right: 17px;
    width: 55px;
    height: 73px;
  }

  .hero-seal span {
    font-size: 30px;
  }

  .today-card {
    position: relative;
    left: 16px;
    bottom: auto;
    width: calc(100% - 32px);
    margin-top: -36px;
  }

  .vertical-note {
    display: none;
  }

  .hero-footer {
    display: none;
  }

  .manifesto-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-block: 42px;
  }

  .manifesto-index {
    grid-row: auto;
    align-self: auto;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    padding-bottom: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
    writing-mode: initial;
  }

  .manifesto-index strong {
    font-size: 33px;
  }

  .manifesto-text p {
    font-size: 20px;
    line-height: 1.75;
  }

  .manifesto-aside {
    grid-column: auto;
  }

  .section-heading {
    margin-bottom: 37px;
  }

  .section-heading h2 {
    font-size: 34px;
    line-height: 1.3;
  }

  .section-intro {
    font-size: 14px;
  }

  .learning-path {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    margin-bottom: 47px;
    border-bottom: 0;
  }

  .path-step {
    padding: 17px 0;
    border-bottom: 1px solid var(--line);
  }

  .path-step:nth-of-type(2),
  .path-step:nth-of-type(4) {
    padding-left: 0;
    border-left: 0;
  }

  .path-state {
    writing-mode: initial;
  }

  .course-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .filter-tabs {
    width: 100%;
    gap: 17px;
    overflow-x: auto;
  }

  .filter-tab {
    white-space: nowrap;
  }

  .course-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .course-visual {
    height: 235px;
  }

  .course-body {
    padding-top: 17px;
  }

  .course-body > p {
    min-height: auto;
  }

  .atlas-layout {
    min-height: auto;
  }

  .atlas-stage {
    min-height: 420px;
  }

  .atlas-stage-top {
    padding: 14px 16px;
  }

  .atlas-canvas {
    min-height: 330px;
  }

  .atlas-model {
    width: 105%;
  }

  .atlas-controls {
    padding: 13px;
    overflow-x: auto;
  }

  .atlas-button {
    flex: 0 0 auto;
    min-height: 38px;
    padding-inline: 13px;
  }

  .atlas-notes {
    min-height: 0;
    padding: 21px 18px;
  }

  .atlas-note-content {
    padding: 23px 0;
  }

  .atlas-note-content h3 {
    font-size: 34px;
  }

  .atlas-part-list {
    margin-top: 16px;
  }

  .atlas-part-list button {
    min-height: 58px;
  }

  .feature-story {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .feature-story-image {
    height: 285px;
  }

  .feature-story-body {
    padding-top: 22px;
  }

  .feature-story blockquote {
    font-size: 25px;
  }

  .journal-item {
    padding-block: 22px;
  }

  .journal-item h3 {
    font-size: 21px;
  }

  .journal-prompt {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
    padding: 22px;
  }

  .journal-prompt .button {
    width: 100%;
  }

  .community-strip {
    grid-template-columns: 1fr;
    gap: 19px;
    margin-top: 50px;
  }

  .strip-question {
    padding: 17px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .community-strip > .text-link {
    justify-self: start;
  }

  .game-feature {
    display: block;
  }

  .game-feature-visual {
    height: 270px;
    min-height: 0;
  }

  .game-feature-copy {
    grid-template-columns: 39px 1fr;
    padding: 21px;
  }

  .game-feature-copy > .button {
    grid-column: 1 / -1;
    margin-top: 18px;
    width: 100%;
  }

  .game-small-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 176px;
  }

  .game-record {
    min-height: 127px;
  }

  .workshop-grid {
    gap: 21px;
  }

  .workshop-progress {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-block: 26px;
    text-align: center;
  }

  .ring {
    --size: 158px;
    margin-inline: auto;
  }

  .workshop-progress-copy h3 {
    margin-inline: auto;
    font-size: 23px;
  }

  .workshop-progress-copy p {
    margin-inline: auto;
  }

  .workshop-progress-copy .button {
    width: 100%;
  }

  .workshop-ledger {
    padding: 21px 17px;
  }

  .badge-row {
    grid-template-columns: 1fr;
  }

  .ledger-stats {
    gap: 10px;
  }

  .ledger-stats > div {
    padding-left: 10px;
  }

  .closing-section {
    padding: 91px 0 85px;
  }

  .closing-shell {
    width: calc(100vw - 40px);
  }

  .closing-shell h2 {
    font-size: 35px;
  }

  .closing-shell > p:not(.eyebrow) {
    font-size: 13px;
  }

  .closing-actions {
    flex-direction: column;
    gap: 13px;
  }

  .closing-actions .button,
  .closing-actions .text-link {
    width: 100%;
  }

  .footer-shell {
    grid-template-columns: 1fr;
    gap: 31px;
    padding: 42px 0 35px;
  }

  .footer-nav {
    gap: 7px 23px;
  }

  .footer-note {
    grid-column: auto;
  }

  .footer-bottom {
    flex-wrap: wrap;
    gap: 5px 17px;
    padding-bottom: 18px;
  }

  .footer-bottom button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .modal,
  .story-modal {
    padding: 10px;
  }

  .modal-panel {
    max-height: 94vh;
  }

  .lesson-hero {
    min-height: 270px;
    padding: 67px 21px 28px;
  }

  .lesson-hero h2 {
    margin-top: 24px;
    font-size: 34px;
  }

  .lesson-hero::after {
    font-size: 140px;
  }

  .lesson-body {
    grid-template-columns: 1fr;
    gap: 27px;
    padding: 26px 21px 28px;
  }

  .lesson-side {
    order: -1;
  }

  .story-panel {
    padding: 57px 23px 36px;
  }

  .story-panel h2 {
    font-size: 33px;
  }

  .story-lead {
    font-size: 15px;
  }

  .story-panel blockquote {
    font-size: 19px;
  }

  .game-panel-top {
    grid-template-columns: 1fr 44px;
    gap: 10px;
    min-height: 83px;
    padding: 14px 14px 14px 18px;
  }

  .game-hud {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 6px;
    width: 100%;
  }

  .hud-item {
    flex: 1;
    min-height: 45px;
    padding: 7px 10px;
  }

  .game-panel-top h2 {
    font-size: 21px;
  }

  #gameContainer {
    min-height: 480px;
  }

  .game-shell {
    padding: 15px;
  }

  .game-layout {
    gap: 21px;
  }

  .game-side-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .game-side-body > .game-instruction {
    grid-column: auto;
  }

  .puzzle-stage,
  .carving-stage {
    padding: 8px;
  }

  .puzzle-guide {
    right: 8px;
    bottom: 8px;
    width: 37%;
  }

  .quiz-shell {
    padding: 24px 2px 10px;
  }

  .quiz-question {
    min-height: 132px;
  }

  .quiz-question h3 {
    font-size: 24px;
  }

  .quiz-option {
    grid-template-columns: 27px 1fr;
    min-height: 61px;
    padding: 10px;
  }

  .quiz-option-mark {
    display: none;
  }

  .quiz-explanation {
    grid-template-columns: 1fr;
  }

  .quiz-explanation .button {
    width: 100%;
  }

  .matching-wrap {
    grid-template-columns: 1fr;
  }

  .matching-middle {
    display: none;
  }

  .match-item {
    min-height: 56px;
  }

  .match-item .match-symbol {
    width: 31px;
    height: 31px;
    font-size: 15px;
  }

  .game-result {
    min-height: 440px;
    padding-block: 28px;
  }

  .result-actions {
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .hero-title {
    font-size: 3.05rem;
  }

  .hero-proof {
    justify-content: space-between;
    gap: 10px;
  }

  .proof-number {
    font-size: 22px;
  }

  .hero-photo {
    height: 380px;
  }

  .photo-coordinate {
    display: none;
  }

  .course-visual {
    height: 205px;
  }

  .atlas-stage {
    min-height: 370px;
  }

  .atlas-canvas {
    min-height: 280px;
  }

  .game-feature-visual {
    height: 228px;
  }

  .game-record {
    grid-template-columns: 1fr;
  }

  .game-record strong {
    grid-row: auto;
    grid-column: auto;
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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