@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color: #171717;
  background: #faf9f6;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --muted: #68645f;
  --line: #e3dfd8;
  --gutter: clamp(20px, 6vw, 96px);
  --nav-height: 64px;
  --display-font: "Instrument Serif", Georgia, serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ol { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.frame { width: min(100% - 2 * var(--gutter), 1248px); margin-inline: auto; }
.site-header { position: sticky; z-index: 2; inset-block-start: 0; background: #faf9f6; border-bottom: 1px solid var(--line); }
.site-nav, .site-brand, .site-links { display: flex; align-items: center; }
.site-nav { min-height: calc(var(--nav-height) - 1px); justify-content: space-between; gap: 12px; }
.site-nav a { display: inline-flex; min-height: 44px; align-items: center; color: inherit; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { color: #8a4100; }
.site-brand { gap: 8px; font-weight: 650; }
.site-links { gap: clamp(12px, 3.6vw, 40px); font-size: .875rem; font-weight: 550; }
a:focus-visible { outline: 2px solid #8a4100; outline-offset: 3px; }

.hero {
  display: grid;
  scroll-margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  min-height: calc(100svh - var(--nav-height));
  background: #161613;
  color: #fff;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
  padding-block: 64px;
}
.hero-copy { max-width: 680px; animation: arrive 650ms var(--ease-out) both; }
h1 { font-size: clamp(3rem, 6.5vw, 5.25rem); line-height: 1.02; font-weight: 520; letter-spacing: -.045em; }
.hero h1 { font-size: clamp(2.55rem, 5.55vw, 5.25rem); }
.brand-dot { color: #ffb666; font-size: .72em; }
.brand-en { font: 400 1.13em/1 var(--display-font); white-space: nowrap; }
.hero-copy p { margin-top: 24px; color: #f0eeea; font-size: 1.125rem; line-height: 1.7; }

.guide-link {
  display: inline-flex;
  margin-top: 24px;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: #f0eeea;
  font-size: .875rem;
  text-decoration: none;
}

.guide-link:hover { color: #fff; }
.scroll-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(255 255 255 / .45);
  border-radius: 50%;
  font-size: 1.125rem;
  transition: transform 250ms var(--ease-out);
}
.guide-link:hover .scroll-arrow { transform: translateY(3px); }
.guide-link:focus-visible { outline: 2px solid #ff9f3b; outline-offset: 4px; }

.hero-practice { display: grid; min-width: 0; }
.hero-practice-title {
  margin-bottom: 20px;
  color: #f0eeea;
  font: 400 clamp(1.85rem, 3vw, 2.8rem)/1.04 var(--display-font);
}
.hero-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0;
  list-style: none;
  color: #b4aea4;
  font-size: .875rem;
  border-bottom: 1px solid #49443d;
}
.hero-steps li { padding-bottom: 10px; margin-bottom: -1px; border-bottom: 1px solid transparent; }
.hero-steps [aria-current="step"] { color: #ffb666; border-color: currentColor; }

.hero-scenes {
  display: grid;
  min-height: 14rem;
  padding-block: 24px;
  border-bottom: 1px solid #49443d;
}
.hero-scene {
  grid-area: 1 / 1;
  align-content: center;
  visibility: hidden;
  opacity: 0;
  color: #f0eeea;
  font: 400 clamp(1.7rem, 3vw, 2.8rem)/1.12 var(--display-font);
  transform: translateY(10px);
  transition: opacity 320ms var(--ease-out), transform 480ms var(--ease-out), visibility 0s 480ms;
}
.hero-source p + p { margin-top: .32em; color: #c0b5a8; }
[data-phase="recall"] .hero-source { transform: translateY(-12px) scaleY(.77); }
[data-phase="listen"] .hero-source,
[data-phase="recall"] .hero-recall,
[data-phase="feedback"] .hero-feedback {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 80ms, 80ms, 0s;
}
.hero-note { margin-bottom: 12px; color: #c0b5a8; font: 550 .875rem/1.5 system-ui, sans-serif; }
.hero-feedback .hero-note { color: #ffb666; }
.hero-feedback mark {
  background: transparent;
  color: #ffb666;
  text-decoration: underline;
  text-underline-offset: .15em;
  text-decoration-thickness: 1px;
}

.install {
  min-height: calc(100svh - var(--nav-height));
  padding-block: 64px 80px;
  scroll-margin-top: var(--nav-height);
}
.install > h2 { font-size: clamp(2.5rem, 5.5vw, 4.5rem); line-height: 1.04; font-weight: 520; letter-spacing: -.045em; }
.install-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-top: 48px; }
.install-options section { border-top: 1px solid #171717; padding-top: 24px; }
.install h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 16px; }
.install ol { display: grid; gap: 10px; padding-inline-start: 1.25em; line-height: 1.7; }
.install code { font-size: .875em; overflow-wrap: anywhere; }
.install-note { margin-top: 16px; color: var(--muted); line-height: 1.65; }
.download-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  margin-top: 24px;
  padding: 8px 16px;
  border-radius: 8px;
  color: #fff;
  background: #171717;
  text-decoration: none;
  font-weight: 600;
}
.download-link:hover { background: #38332e; }

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 24px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.65;
  scroll-margin-top: var(--nav-height);
}
.site-footer .frame { display: grid; gap: 8px; }
.site-footer a { color: #8a4100; text-underline-offset: .15em; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }

.guide { padding-block: clamp(36px, 6vw, 80px); }
.guide h1 { font-size: clamp(2.5rem, 5.5vw, 4rem); }
.guide-layout {
  display: grid;
  grid-template-columns: 11rem minmax(0, 48rem);
  gap: clamp(24px, 5vw, 72px);
  margin-top: clamp(24px, 4vw, 48px);
}
.guide-nav {
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  align-self: start;
  display: grid;
}
.guide a { color: #8a4100; text-underline-offset: .15em; }
.guide-nav a { display: flex; align-items: center; min-height: 44px; }
.guide-steps section {
  border-top: 1px solid var(--line);
  padding-block: 20px 24px;
  scroll-margin-top: calc(var(--nav-height) + 16px);
}
.guide-steps h2 { margin-bottom: 8px; font-size: 1.3rem; }
.guide-steps :is(p, ol) { line-height: 1.65; }
.guide-steps ol { padding-inline-start: 1.3em; }
.guide-steps li + li { margin-top: 4px; }
.guide-steps code, .guide-steps a { overflow-wrap: anywhere; }

.web-reading {
  display: grid;
  min-height: calc(100svh - var(--nav-height));
  scroll-margin-top: var(--nav-height);
  background: #f0ede6;
  border-top: 1px solid var(--line);
}
.web-reading-layout {
  display: grid;
  grid-template-columns: minmax(13rem, .27fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 3.6vw, 52px);
  padding-block: clamp(48px, 5vw, 72px);
}
.web-reading h2 { font-size: clamp(2.25rem, 3.45vw, 3.6rem); line-height: 1.12; font-weight: 520; letter-spacing: -.045em; }
.web-reading p { max-width: 36ch; margin-top: 20px; color: var(--muted); line-height: 1.7; }
.web-reading p strong { color: #171717; font-weight: 600; white-space: nowrap; }
.web-reading-shot {
  width: 100%;
  height: auto;
  border: 1px solid #d8d3c9;
  border-radius: 12px;
  background: #f8f7ef;
  box-shadow: 0 16px 36px rgb(43 39 26 / .09);
}
.web-reading-controls { display: none; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 840px) {
  .hero-inner { grid-template-columns: 1fr; align-content: center; padding-block: 48px 32px; }
  .hero h1 { font-size: clamp(2.55rem, 9vw, 4rem); }
  .hero-copy p { font-size: 1rem; margin-top: 16px; }
  .guide-link { margin-top: 16px; font-size: 1rem; }
  .hero-scenes { min-height: 10.5rem; }
  .install { padding-block: 48px; }
  .install-options { grid-template-columns: 1fr; gap: 32px; margin-top: 32px; }
  .web-reading-layout { grid-template-columns: 1fr; align-content: center; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
  .site-nav, .site-links { gap: 8px; }
  .site-links { font-size: .8125rem; }
}

@media (max-width: 375px) {
  .site-brand > span { display: none; }
}

@media (max-width: 360px) {
  .hero-copy p { font-size: 1rem; }
}

@media (max-width: 560px) {
  .web-reading-controls {
    display: block;
    width: min(100%, 400px);
    height: auto;
    margin: 12px auto 0;
    border: 1px solid #d8d3c9;
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy { animation: none; }
  .hero-scene, .scroll-arrow { transition: none; }
}
