:root {
  --paper: #f4efe5;
  --paper-deep: #e9e1d2;
  --sheet: #fffdf8;
  --ink: #27241f;
  --ink-soft: #665f55;
  --ink-faint: #8d8579;
  --annotation-ink: #27241f;
  --indigo: #293047;
  --indigo-light: #444d6d;
  --cinnabar: #9b3f31;
  --gold: #b8863f;
  --rule: #d9d0c1;
  --rule-dark: #beb19f;
  --shadow: 0 22px 70px rgba(49, 40, 27, 0.1);
  --sans: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  --sanskrit: "Noto Serif Devanagari", "Noto Serif", "Times New Roman", serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 9.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  border: 10px solid rgba(41, 48, 71, 0.035);
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  background: var(--indigo);
  color: white;
  transform: translateY(-150%);
}

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

.masthead {
  position: relative;
  z-index: 30;
  border-bottom: 1px solid rgba(190, 177, 159, 0.72);
  background: rgba(244, 239, 229, 0.97);
}

.masthead__inner {
  width: min(1180px, calc(100% - 3rem));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.masthead__brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-width: 0;
}

.site-back {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-back svg {
  flex-shrink: 0;
  display: block;
}

.site-back:hover,
.site-back:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.wordmark__mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--indigo);
  color: var(--indigo);
  font-family: Georgia, serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 3px var(--paper);
}

.wordmark__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.wordmark__text strong {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.wordmark__text small {
  margin-top: 0.2rem;
  color: var(--ink-faint);
  font-family: Georgia, serif;
  font-size: 0.875rem;
  letter-spacing: 0.035em;
}

.masthead__meta {
  display: flex;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.download-link,
.player-launch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 0.78rem;
  border: 1px solid var(--rule-dark);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.download-link:hover,
.player-launch:hover {
  border-color: var(--indigo);
  background: var(--sheet);
}

.player-launch {
  border-color: var(--indigo);
  background: var(--indigo);
  color: #fffaf0;
}

.player-launch:hover {
  background: var(--indigo-light);
  color: white;
}

.download-link svg,
.player-launch svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.player-launch svg {
  fill: currentColor;
  stroke: none;
}

.chapter-nav {
  position: sticky;
  top: 0;
  z-index: 25;
  border-bottom: 1px solid rgba(190, 177, 159, 0.7);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
}

.chapter-nav__inner {
  width: min(1180px, calc(100% - 3rem));
  min-height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.2rem;
}

.chapter-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  padding: 0 1.15rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.chapter-nav a::after {
  position: absolute;
  right: 1.1rem;
  bottom: -1px;
  left: 1.1rem;
  height: 2px;
  background: var(--cinnabar);
  content: "";
  opacity: 0;
  transform: scaleX(0.25);
  transition: opacity 160ms ease, transform 160ms ease;
}

.chapter-nav a:hover,
.chapter-nav a[aria-current="true"] {
  color: var(--indigo);
}

.chapter-nav a[aria-current="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.chapter-nav a span {
  color: var(--cinnabar);
  font-family: Georgia, serif;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

main {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
}

.intro {
  min-height: 535px;
  padding: 4.5rem 0 4rem;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  align-items: start;
  border-bottom: 1px solid var(--rule-dark);
}

.intro__heading {
  grid-column: 1 / span 7;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--cinnabar);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  color: var(--indigo);
  font-family: var(--serif);
  font-size: clamp(3.7rem, 7vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.intro__lede {
  max-width: 37rem;
  margin: 2rem 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.8;
  word-break: keep-all;
}

.reading-guide {
  grid-column: 8 / -1;
  padding: 1.7rem 1.8rem 1.65rem;
  border-top: 3px solid var(--indigo);
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.reading-guide__label {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.875rem;
  font-weight: 750;
  letter-spacing: 0.11em;
}

.reading-guide__example {
  margin: 1.15rem 0 1.25rem;
  font-size: 1.22rem;
}

.reading-guide dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.reading-guide dl div {
  padding: 0.7rem 0.45rem;
  text-align: center;
}

.reading-guide dl div + div {
  border-left: 1px solid var(--rule);
}

.reading-guide dt {
  color: var(--indigo);
  font-family: var(--sanskrit);
  font-size: 0.9rem;
  font-weight: 700;
}

.reading-guide dd {
  margin: 0.15rem 0 0;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.reading-guide__note {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.65;
}

.edition-note {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  padding-top: 1.65rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  border-top: 1px solid var(--rule);
}

.edition-note__number {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 2.45rem;
  line-height: 1;
}

.edition-note strong {
  display: block;
  color: var(--indigo);
  font-size: 0.875rem;
}

.edition-note p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.loading-state {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.8rem;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.loading-state span {
  width: 22px;
  height: 22px;
  border: 2px solid var(--rule-dark);
  border-top-color: var(--cinnabar);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.chapter {
  scroll-margin-top: 8.5rem;
}

.chapter + .chapter {
  margin-top: 7rem;
}

.chapter-header {
  min-height: 270px;
  padding: 4.6rem 0 3.5rem;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) minmax(220px, 360px);
  gap: 1.8rem;
  align-items: end;
  border-bottom: 2px solid var(--indigo);
}

.chapter-header__number {
  align-self: start;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 3.8rem;
  line-height: 0.85;
}

.chapter-header__title p,
.chapter-header__title h2 {
  margin: 0;
}

.chapter-header__title .devanagari {
  margin-bottom: 0.5rem;
  color: var(--cinnabar);
  font-family: var(--sanskrit);
  font-size: 1rem;
}

.chapter-header__title h2 {
  color: var(--indigo);
  font-family: var(--serif);
  font-size: clamp(2.15rem, 4vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.chapter-header__title .iast {
  margin-top: 0.42rem;
  color: var(--ink-faint);
  font-family: Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
}

.chapter-header__description {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.75;
  word-break: keep-all;
}

.chapter-header__count {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sutra {
  position: relative;
  scroll-margin-top: 9.2rem;
  padding: 3.8rem 0 4rem;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 1.8rem;
  border-bottom: 1px solid var(--rule);
}

.chapter-illustration {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  margin: 0 0 1.25rem;
}

.sutra__number {
  position: sticky;
  top: 9.2rem;
  align-self: start;
  margin: 0;
  color: var(--cinnabar);
  font-family: Georgia, serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sutra__number a {
  text-decoration: none;
}

.sutra__number a:hover {
  text-decoration: underline;
}

.sutra__body {
  min-width: 0;
}

.annotation-line {
  margin: 0;
  display: grid;
  gap: 0;
  color: var(--annotation-ink);
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.annotated-word {
  color: var(--annotation-ink);
  font-weight: 500;
  display: block;
  margin: 0;
  white-space: normal;
}

.annotated-word b {
  color: inherit;
  font-family: var(--sanskrit);
  font-size: 1.07em;
  font-weight: 700;
  letter-spacing: 0.008em;
}

.annotated-word em {
  color: inherit;
  font-style: normal;
  font-weight: 650;
}

.annotated-word > span {
  color: inherit;
}

.annotation-row {
  min-width: 0;
  padding: 0;
}

.annotation-note {
  max-width: 48rem;
  margin: 0.3rem 0 0.5rem;
  color: var(--annotation-ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.annotated-word--example {
  display: inline;
  white-space: nowrap;
}

.canonical-block {
  margin-top: 1.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}

.canonical-iast {
  margin: 0;
  color: var(--annotation-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9375rem;
  font-style: italic;
  line-height: 1.55;
}

.devanagari-line {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-family: var(--sanskrit);
  font-size: 1.08rem;
  line-height: 1.65;
}

.translation-block {
  margin-top: 2.4rem;
}

.translation {
  max-width: 49rem;
  margin: 0;
  color: var(--indigo);
  font-family: var(--serif);
  font-size: clamp(1.28rem, 2vw, 1.62rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.72;
  word-break: keep-all;
}

.explanation-block {
  max-width: 49rem;
  margin-top: 1.85rem;
  padding: 1.3rem 1.45rem;
  background: rgba(255, 253, 248, 0.64);
}

.explanation {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.88;
  word-break: keep-all;
}

mark {
  padding: 0.05em 0.08em;
  background: #f0d99d;
  color: inherit;
}

.rules-section {
  scroll-margin-top: 7.5rem;
  margin-top: 9rem;
  padding: 5.5rem 0 5rem;
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1.6fr);
  gap: clamp(3rem, 8vw, 8rem);
  border-top: 2px solid var(--indigo);
}

.section-heading {
  align-self: start;
  position: sticky;
  top: 9.5rem;
}

.section-heading h2,
.sources-section h2 {
  margin: 0;
  color: var(--indigo);
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  letter-spacing: -0.06em;
  line-height: 1;
}

.section-heading > p:last-child {
  margin: 1.55rem 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.8;
  word-break: keep-all;
}

.rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule-dark);
}

.rules-list li {
  padding: 1.6rem 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.8rem;
  border-bottom: 1px solid var(--rule);
}

.rules-list li > span {
  padding-top: 0.12rem;
  color: var(--cinnabar);
  font-family: Georgia, serif;
  font-size: 0.875rem;
}

.rules-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.89rem;
  line-height: 1.82;
}

.rules-list strong {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--ink);
  font-size: 0.96rem;
}

.sources-section {
  padding: 5rem 0 6rem;
  display: grid;
  grid-template-columns: 0.75fr 2fr;
  gap: clamp(3rem, 8vw, 8rem);
  border-top: 1px solid var(--rule-dark);
}

.source-links {
  border-top: 1px solid var(--rule-dark);
}

.source-links a {
  position: relative;
  padding: 1.5rem 2.7rem 1.5rem 0;
  display: grid;
  grid-template-columns: 105px 1fr;
  column-gap: 1rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.source-links a::after {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  color: var(--cinnabar);
  content: "↗";
  transform: translateY(-50%);
  transition: transform 160ms ease;
}

.source-links a[download]::after {
  content: "↓";
}

.source-links a:hover::after {
  transform: translate(3px, calc(-50% - 3px));
}

.source-links a > span {
  grid-row: 1 / span 2;
  color: var(--ink-faint);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.source-links strong {
  color: var(--indigo);
  font-family: var(--serif);
  font-size: 1rem;
}

.source-links small {
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.source-note {
  grid-column: 2;
  margin: 1rem 0 0;
  color: var(--ink-faint);
  font-size: 0.875rem;
  line-height: 1.7;
}

footer {
  width: min(1180px, calc(100% - 3rem));
  min-height: 170px;
  margin: 0 auto;
  padding: 2.8rem 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-top: 2px solid var(--indigo);
}

footer p {
  margin: 0;
  color: var(--indigo);
  font-family: var(--serif);
  line-height: 1.6;
}

footer p span {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.875rem;
}

footer a {
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
  text-decoration: underline;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.2rem;
}

.noscript {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 50;
  margin: 0;
  padding: 1rem;
  background: var(--indigo);
  color: white;
  text-align: center;
}

body.player-open {
  overflow: hidden;
}

.translation-player[hidden] {
  display: none;
}

.translation-player {
  position: fixed;
  inset: 0;
  z-index: 1000;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(86, 96, 135, 0.32), transparent 48%),
    var(--indigo);
  color: #fffaf0;
  overscroll-behavior: none;
  touch-action: none;
}

.translation-player__toolbar {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.translation-player__toolbar button {
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 250, 240, 0.82);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.translation-player__toolbar button:hover,
.translation-player__toolbar button:focus-visible {
  border-color: rgba(255, 250, 240, 0.68);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.translation-player__toolbar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.translation-player__toolbar .icon-play {
  display: none;
  fill: currentColor;
  stroke: none;
}

.translation-player.is-paused .icon-pause {
  display: none;
}

.translation-player.is-paused .icon-play {
  display: block;
}

.translation-player__close {
  margin-left: 0.45rem;
}

.translation-player__stage {
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(5rem, 10vh, 8rem) clamp(1.5rem, 8vw, 8rem);
  display: grid;
  place-items: center;
}

.translation-player__sentence {
  overflow-y: auto;
  touch-action: pan-y;
  width: min(100%, 1120px);
  margin: 0;
  color: #fffaf0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, min(4.5vw, 6.5vh), 4.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.55;
  text-align: center;
  text-wrap: balance;
  word-break: keep-all;
}

.translation-player__sentence.is-entering {
  animation: player-sentence-in 460ms ease-out both;
}

@keyframes player-sentence-in {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.translation-player__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 250, 240, 0.13);
}

.translation-player__progress span {
  width: 0;
  height: 100%;
  display: block;
  background: var(--gold);
  transition: width 260ms ease;
}

:focus-visible {
  outline: 3px solid rgba(155, 63, 49, 0.45);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .masthead__inner,
  .chapter-nav__inner,
  main,
  footer {
    width: min(100% - 2rem, 760px);
  }

  footer {
    flex-wrap: wrap;
    row-gap: 1.4rem;
  }

  .site-nav {
    flex-basis: 100%;
  }

  .chapter-nav__inner {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chapter-nav__inner::-webkit-scrollbar {
    display: none;
  }

  .chapter-nav a {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  .intro {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 2.8rem;
  }

  .intro__heading,
  .reading-guide,
  .edition-note {
    grid-column: 1;
  }

  .intro__heading {
    max-width: 650px;
  }

  .reading-guide {
    max-width: 580px;
  }

  .chapter-header {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .chapter-header__description {
    grid-column: 2;
  }

  .sutra {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .rules-section,
  .sources-section {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .section-heading {
    position: static;
  }

  .source-note {
    grid-column: 1;
  }
}

@media (max-width: 600px) {
  body::before {
    border-width: 5px;
  }

  .masthead__inner,
  .chapter-nav__inner,
  main,
  footer {
    width: calc(100% - 1.5rem);
  }

  .masthead__inner {
    min-height: 64px;
    gap: 0.75rem;
  }

  .wordmark__mark {
    width: 31px;
    height: 31px;
    font-size: 0.875rem;
  }

  .wordmark__text small,
  .masthead__meta {
    display: none;
  }

  .masthead__brand {
    gap: 0.65rem;
  }

  .site-back span {
    display: none;
  }

  .site-back::after {
    position: absolute;
    inset: -12px;
    content: "";
  }

  .download-link {
    padding: 0.48rem 0.58rem;
    font-size: 0.875rem;
  }

  .masthead__actions {
    gap: 0.35rem;
  }

  .player-launch {
    padding: 0.48rem 0.58rem;
    font-size: 0.875rem;
  }

  .download-link svg {
    width: 15px;
  }

  .translation-player__toolbar {
    top: max(0.75rem, env(safe-area-inset-top));
    right: max(0.75rem, env(safe-area-inset-right));
  }

  .translation-player__toolbar button {
    width: 44px;
    height: 44px;
  }

  .translation-player__close {
    margin-left: 0.15rem;
  }

  .translation-player__stage {
    padding: 5.5rem 1.3rem 4rem;
  }

  .translation-player__sentence {
    font-size: clamp(1.45rem, min(7vw, 6vh), 2.65rem);
    line-height: 1.62;
  }

  .chapter-nav__inner {
    min-height: 48px;
  }

  .chapter-nav a {
    min-height: 48px;
    padding: 0 0.72rem;
    font-size: 0.875rem;
  }

  .chapter-nav a::after {
    right: 0.7rem;
    left: 0.7rem;
  }

  .intro {
    padding: 3.25rem 0 2.8rem;
  }

  .intro h1 {
    font-size: clamp(3rem, 16vw, 4.35rem);
  }

  .intro__lede {
    font-size: 1rem;
    line-height: 1.75;
  }

  .reading-guide {
    padding: 1.35rem 1.15rem;
  }

  .reading-guide__example {
    font-size: 1.04rem;
  }

  .reading-guide dl div {
    padding-right: 0.2rem;
    padding-left: 0.2rem;
  }

  .edition-note {
    align-items: flex-start;
  }

  .edition-note__number {
    font-size: 2rem;
  }

  .chapter + .chapter {
    margin-top: 4.5rem;
  }

  .chapter-header {
    min-height: 220px;
    padding: 3.5rem 0 2.5rem;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 0.85rem;
  }

  .chapter-header__number {
    font-size: 2.3rem;
  }

  .chapter-header__title h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .chapter-header__description {
    grid-column: 1 / -1;
    padding-left: 59px;
    font-size: 0.88rem;
  }

  .sutra {
    padding: 2.9rem 0 3.2rem;
    display: block;
  }

  .sutra__number {
    position: static;
    margin-bottom: 1.4rem;
  }

  .annotation-line {
    font-size: 1rem;
    line-height: 1.65;
    word-break: normal;
  }

  .canonical-iast {
    font-size: 0.875rem;
  }

  .devanagari-line {
    font-size: 0.98rem;
  }

  .translation-block {
    margin-top: 2rem;
  }

  .translation {
    font-size: 1.2rem;
    line-height: 1.72;
  }

  .explanation-block {
    margin-top: 1.5rem;
    padding: 1.05rem 1rem;
  }

  .explanation {
    font-size: 1rem;
    line-height: 1.82;
    word-break: normal;
  }

  .rules-section {
    margin-top: 6rem;
    padding: 4rem 0 3.5rem;
  }

  .rules-list li {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .sources-section {
    padding: 4rem 0;
  }

  .source-links a {
    grid-template-columns: 1fr;
    row-gap: 0.2rem;
  }

  .source-links a > span {
    grid-row: auto;
  }

  footer {
    min-height: 140px;
    padding: 2.2rem 0;
  }
}

@media (max-width: 420px) {
  .download-link,
  .player-launch {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }

  .download-link span,
  .player-launch span {
    display: none;
  }
}

@media (max-height: 500px) {
  .translation-player__stage {
    padding: 4rem 1.25rem 2.5rem;
  }

  .translation-player__sentence {
    font-size: clamp(1.3rem, min(4vw, 6vh), 2.5rem);
    line-height: 1.48;
  }
}

@media print {
  :root {
    --paper: white;
    --sheet: white;
  }

  body::before,
  .masthead,
  .chapter-nav,
  .translation-player,
  footer,
  .reading-guide,
  .edition-note {
    display: none !important;
  }

  main {
    width: 100%;
  }

  .intro {
    min-height: 0;
    padding: 0 0 2rem;
    display: block;
  }

  .intro h1 {
    font-size: 42pt;
  }

  .chapter,
  .sutra {
    break-inside: avoid;
  }

  .chapter-header {
    break-before: page;
  }

  .sutra__number,
  .section-heading {
    position: static;
  }

  .rules-section,
  .sources-section {
    display: block;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 좁은 화면에서 긴 산스크리트 합성어가 칸을 넘쳐 페이지가 가로로 벌어졌다 → 그 줄만 줄바꿈을 허용한다 */
.canonical-iast, .devanagari-line { overflow-wrap: anywhere; }
