:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #fcfcfd;
  --surface-strong: #ebeaf0;
  --text: #1b1a1f;
  --muted: #65636c;
  --line: #d9d7df;
  --accent: #7656bd;
  --accent-strong: #6243a7;
  --accent-soft: #e8e0f8;
  --accent-ink: #2e204f;
  --button-bg: #6243a7;
  --button-bg-hover: #7656bd;
  --button-fg: #fdfbff;
  --shadow: 0 24px 70px rgb(60 48 86 / 0.14);
  --max-width: 1240px;
  --radius: 16px;
  --nav-height: 70px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151419;
    --surface: #1d1c22;
    --surface-strong: #29272f;
    --text: #f1eff5;
    --muted: #aaa6b2;
    --line: #3b3943;
    --accent: #a58adb;
    --accent-strong: #bca4e9;
    --accent-soft: #322943;
    --accent-ink: #f2ebff;
    --button-bg: #a58adb;
    --button-bg-hover: #bca4e9;
    --button-fg: #21172f;
    --shadow: 0 24px 70px rgb(18 16 22 / 0.34);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #fcfcfd;
  --surface-strong: #ebeaf0;
  --text: #1b1a1f;
  --muted: #65636c;
  --line: #d9d7df;
  --accent: #7656bd;
  --accent-strong: #6243a7;
  --accent-soft: #e8e0f8;
  --accent-ink: #2e204f;
  --button-bg: #6243a7;
  --button-bg-hover: #7656bd;
  --button-fg: #fdfbff;
  --shadow: 0 24px 70px rgb(60 48 86 / 0.14);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151419;
  --surface: #1d1c22;
  --surface-strong: #29272f;
  --text: #f1eff5;
  --muted: #aaa6b2;
  --line: #3b3943;
  --accent: #a58adb;
  --accent-strong: #bca4e9;
  --accent-soft: #322943;
  --accent-ink: #f2ebff;
  --button-bg: #a58adb;
  --button-bg-hover: #bca4e9;
  --button-fg: #21172f;
  --shadow: 0 24px 70px rgb(18 16 22 / 0.34);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

main {
  overflow: clip;
}

body.menu-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

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

button,
.button {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

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

.page-shell {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-height);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.nav-shell {
  width: min(calc(100% - 48px), var(--max-width));
  height: 100%;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
}

.brand img {
  border-radius: 10px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  white-space: nowrap;
}

.site-nav a,
.footer-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease;
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--text);
}

.theme-toggle {
  width: 46px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.theme-track {
  display: block;
  position: relative;
  width: 46px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  transition: background 200ms ease, border-color 200ms ease;
}

.theme-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), background 200ms ease;
}

html[data-theme="dark"] .theme-track,
html:not([data-theme="light"]) .theme-toggle[aria-pressed="true"] .theme-track {
  background: var(--accent-soft);
  border-color: var(--accent);
}

html[data-theme="dark"] .theme-thumb,
.theme-toggle[aria-pressed="true"] .theme-thumb {
  transform: translateX(18px);
  background: var(--accent-strong);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 11px;
  cursor: pointer;
}

.hero-story {
  position: relative;
  height: 300dvh;
}

.hero-sticky {
  position: sticky;
  top: var(--nav-height);
  height: calc(100dvh - var(--nav-height));
  overflow: hidden;
}

.hero {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(520px, 1.08fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
  padding-block: clamp(34px, 4vh, 52px);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(230px, 1fr) auto;
  align-content: center;
}

.hero-stage-stack {
  position: relative;
  min-height: 230px;
}

.hero-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(26px);
  visibility: hidden;
  transition: opacity 520ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 520ms cubic-bezier(0.16, 1, 0.3, 1), visibility 520ms;
}

.hero-stage.is-active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.hero-stage.is-before {
  transform: translateY(-26px);
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(48px, 6.2vw, 82px);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-message {
  max-width: 590px;
  margin: 0;
  font-size: clamp(44px, 4.2vw, 60px);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: pretty;
}

.hero-message + .hero-message {
  margin-top: 18px;
}

.hero-message-small {
  max-width: 520px;
  color: var(--muted);
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 620;
  line-height: 1.35;
}

.hero-reader-title {
  font-size: clamp(44px, 3.4vw, 50px);
}

.hero-message-compact {
  font-size: clamp(38px, 3.8vw, 54px);
}

.hero-controls {
  position: relative;
  z-index: 2;
}

.hero-progress {
  display: flex;
  gap: 7px;
  width: 88px;
}

.hero-progress span {
  width: 22px;
  height: 3px;
  background: var(--line);
  transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1), background-color 220ms ease;
}

.hero-progress span.is-active {
  width: 38px;
  background: var(--accent-strong);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

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

.button-primary {
  background: var(--button-bg);
  color: var(--button-fg);
}

.button-primary:hover {
  background: var(--button-bg-hover);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--muted);
}

.hero-visual {
  position: relative;
  margin: 0 -7vw 0 0;
  padding-block: 10px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 7% 8% 2% 3%;
  border-radius: var(--radius);
  background: var(--accent-soft);
  transform: rotate(4deg);
}

.app-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.283;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: var(--radius);
  background: #f4ecd8;
  box-shadow: var(--shadow);
}

.app-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-frame .hero-shot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.025) translateY(10px);
  visibility: hidden;
  transition: opacity 620ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1), visibility 620ms;
}

.app-frame .hero-shot.is-active {
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
}

.hero-step-marker {
  position: absolute;
  left: 0;
  width: 1px;
  height: 100dvh;
  pointer-events: none;
}

.hero-step-marker[data-hero-step="0"] { top: 0; }
.hero-step-marker[data-hero-step="1"] { top: 100dvh; }
.hero-step-marker[data-hero-step="2"] { top: 200dvh; }

.facts {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 132px;
}

.facts-grid > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 26px 28px;
  border-left: 1px solid var(--line);
}

.facts-grid > div:last-child {
  border-right: 1px solid var(--line);
}

.facts-grid strong {
  font-size: 18px;
}

.facts-grid span {
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding-block: clamp(96px, 12vw, 156px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: clamp(44px, 7vw, 78px);
}

.section-heading h2,
.native-copy h2 {
  margin: 0;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 740;
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading > p:not(.eyebrow),
.native-copy p {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.experience {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(560px, 1.28fr);
  gap: clamp(48px, 9vw, 132px);
  align-items: start;
}

.experience .section-heading {
  position: sticky;
  top: calc(var(--nav-height) + 50px);
  margin: 0;
}

.reading-flow {
  counter-reset: flow;
  border-top: 1px solid var(--line);
}

.reading-flow article {
  display: grid;
  grid-template-columns: 52px 160px 1fr;
  gap: 20px;
  align-items: start;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.flow-index {
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
}

.reading-flow h3,
.feature h3,
.download-panel h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.reading-flow p,
.feature p {
  margin: 0;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1.22fr 0.78fr;
  grid-template-areas:
    "private mermaid"
    "math mermaid"
    "pdf themes";
  gap: 18px;
}

.feature {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature-private {
  grid-area: private;
  display: grid;
  grid-template-columns: 1fr 190px;
  align-items: center;
  min-height: 310px;
  padding: clamp(30px, 5vw, 58px);
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--accent-soft);
}

.feature-private p {
  max-width: 420px;
  margin-top: 14px;
  color: color-mix(in srgb, var(--accent-ink) 78%, var(--muted));
}

.feature-private img {
  width: 180px;
  filter: drop-shadow(0 20px 28px rgb(76 49 120 / 0.22));
  transform: rotate(4deg);
}

.feature-media {
  grid-area: mermaid;
  min-height: 638px;
  background: #f4ecd8;
}

.feature-media picture,
.feature-media img {
  width: 100%;
  height: 100%;
}

.feature-media img {
  object-fit: cover;
  object-position: 48% center;
}

.feature-media .media-copy {
  position: absolute;
  inset: auto 16px 16px;
  padding: 19px 20px;
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 13px;
  background: rgb(30 27 24 / 0.82);
  color: #f8f4ea;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.feature-media .media-copy p {
  margin-top: 6px;
  color: #d8d2c8;
}

.feature-math {
  grid-area: math;
  min-height: 310px;
}

.feature-math img {
  object-position: center 28%;
}

.feature-plain {
  grid-area: pdf;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
}

.feature-plain p {
  max-width: 430px;
  margin-top: 14px;
}

.feature-key {
  align-self: flex-end;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 34px;
  font-weight: 700;
}

.feature-themes {
  grid-area: themes;
  display: flex;
  flex-direction: column;
  padding: 34px;
  background: var(--surface-strong);
}

.feature-themes p {
  margin-top: 14px;
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-top: 28px;
}

.swatch {
  aspect-ratio: 1;
  border: 1px solid rgb(28 26 32 / 0.12);
  border-radius: 12px;
}

.swatch-light { background: #f7f7f5; }
.swatch-dark { background: #1c1c1e; }
.swatch-sepia { background: #f4ecd8; }
.swatch-green { background: #eef5ee; }

.interface-showcase {
  padding-top: 36px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: end;
  gap: 34px;
}

.showcase-main {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4ecd8;
  box-shadow: var(--shadow);
}

.showcase-main img {
  width: 100%;
  height: auto;
}

.showcase-note {
  padding-bottom: 18px;
}

.showcase-note > p {
  margin: 0 0 30px;
  color: var(--muted);
}

.showcase-note dl {
  display: grid;
  gap: 18px;
  margin: 0;
}

.showcase-note dl div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.showcase-note dt {
  color: var(--muted);
}

.showcase-note dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 650;
}

.native-section {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.native-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(560px, 1.1fr);
  gap: clamp(54px, 10vw, 140px);
  align-items: center;
}

.native-copy p + p {
  margin-top: 12px;
}

.architecture {
  display: grid;
  grid-template-columns: 1fr;
}

.architecture > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.architecture > div:nth-of-type(2) {
  margin-left: 8%;
}

.architecture > div:nth-of-type(3) {
  margin-left: 16%;
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--accent-soft);
}

.architecture span:not(.architecture-link) {
  color: var(--muted);
  font-size: 13px;
}

.architecture-link {
  width: 1px;
  height: 18px;
  margin-left: 30%;
  background: var(--line);
}

.install-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: clamp(42px, 8vw, 110px);
  align-items: start;
}

.install-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: install;
}

.install-list li {
  counter-increment: install;
  display: grid;
  grid-template-columns: 42px 175px 1fr;
  gap: 18px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.install-list li:first-child {
  border-top: 1px solid var(--line);
}

.install-list li::before {
  content: counter(install, decimal-leading-zero);
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
}

.install-list span {
  color: var(--muted);
}

.download-panel {
  position: sticky;
  top: calc(var(--nav-height) + 40px);
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--accent);
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.download-panel img {
  width: 76px;
  border-radius: 15px;
}

.download-panel h3 {
  margin-top: 7px;
}

.release-version {
  color: var(--accent-strong);
}

.release-status,
.compatibility {
  margin: 5px 0 0;
  color: color-mix(in srgb, var(--accent-ink) 72%, var(--muted));
  font-size: 13px;
}

.download-panel .button {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.download-panel .compatibility {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.faq {
  padding-top: 20px;
}

.faq .section-heading {
  margin-bottom: 36px;
}

.faq-list {
  max-width: 900px;
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list details:first-child {
  border-top: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 24px 42px 24px 0;
  font-size: 18px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 20px;
  color: var(--accent-strong);
  font-size: 24px;
  font-weight: 400;
  transition: transform 180ms ease;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list details p {
  max-width: 690px;
  margin: -5px 0 24px;
  color: var(--muted);
}

.site-footer {
  padding-block: 56px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
}

.footer-layout > div:first-child p,
.copyright {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.copyright {
  grid-column: 1 / -1;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.reveal,
[data-reveal],
.reveal-group > * {
  opacity: 1;
  transform: none;
}

.motion-ready .reveal,
.motion-ready [data-reveal],
.motion-ready .reveal-group > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 640ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 640ms cubic-bezier(0.16, 1, 0.3, 1);
}

.motion-ready .reveal.is-visible,
.motion-ready [data-reveal].is-visible,
.motion-ready .reveal-group > *.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.motion-ready .reveal-group > *:nth-child(2) { transition-delay: 70ms; }
.motion-ready .reveal-group > *:nth-child(3) { transition-delay: 140ms; }
.motion-ready .reveal-group > *:nth-child(4) { transition-delay: 210ms; }
.motion-ready .reveal-group > *:nth-child(5) { transition-delay: 280ms; }

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 0.85fr) minmax(460px, 1.15fr);
    gap: 40px;
  }

  .hero-visual {
    margin-right: -12vw;
  }

  .experience,
  .native-layout {
    grid-template-columns: 1fr;
  }

  .experience .section-heading {
    position: static;
    max-width: 720px;
  }

  .reading-flow {
    max-width: 820px;
    margin-left: auto;
  }

  .native-copy {
    max-width: 760px;
  }

  .architecture {
    max-width: 760px;
    width: 100%;
    margin-left: auto;
  }
}

@media (max-width: 860px) {
  :root {
    --nav-height: 64px;
  }

  .page-shell,
  .nav-shell {
    width: min(calc(100% - 32px), var(--max-width));
  }

  .nav-shell {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--nav-height) 0 auto;
    display: grid;
    gap: 0;
    padding: 12px 16px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    transform: translateY(-120%);
    visibility: hidden;
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), visibility 240ms;
  }

  .site-nav.is-open {
    transform: translateY(0);
    visibility: visible;
  }

  .site-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    gap: 28px;
    padding-block: 28px;
  }

  .hero-copy {
    width: 100%;
    max-width: 620px;
    grid-template-rows: 190px auto;
  }

  .hero-visual {
    width: min(520px, 100%);
    margin: 0 auto;
  }

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

  .facts-grid > div:nth-child(2) {
    border-right: 1px solid var(--line);
  }

  .facts-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .feature-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "private"
      "mermaid"
      "math"
      "pdf"
      "themes";
  }

  .feature-media {
    min-height: 560px;
  }

  .feature-math {
    min-height: 380px;
  }

  .showcase-grid,
  .install-layout {
    grid-template-columns: 1fr;
  }

  .showcase-note {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 42px;
    padding: 0;
  }

  .download-panel {
    position: static;
    max-width: 500px;
  }
}

@media (max-width: 620px) {
  .page-shell,
  .nav-shell {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .brand span {
    font-size: 17px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .theme-toggle,
  .theme-track {
    width: 42px;
  }

  .theme-toggle[aria-pressed="true"] .theme-thumb,
  html[data-theme="dark"] .theme-thumb {
    transform: translateX(14px);
  }

  .hero {
    gap: 20px;
    padding-block: 20px 14px;
  }

  .eyebrow {
    margin-bottom: 16px;
    font-size: 11px;
  }

  .hero-copy {
    grid-template-rows: 174px auto;
  }

  .hero-stage-stack {
    min-height: 174px;
  }

  .hero-message {
    max-width: 100%;
    font-size: 39px;
    line-height: 1.08;
    text-wrap: pretty;
  }

  .hero-reader-title {
    font-size: 39px;
  }

  .hero-message-compact {
    font-size: 34px;
  }

  .hero-message-small {
    font-size: 18px;
    line-height: 1.35;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
  }

  .button {
    padding-inline: 13px;
  }

  .hero-visual {
    width: min(100%, 390px);
    margin: 0 auto;
  }

  .hero-visual::before {
    inset: 8% 6% 0 2%;
  }

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

  .facts-grid > div {
    min-height: 106px;
    padding: 18px 15px;
  }

  .facts-grid strong {
    font-size: 15px;
  }

  .facts-grid span {
    font-size: 12px;
  }

  .section {
    padding-block: 82px;
  }

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

  .section-heading h2,
  .native-copy h2 {
    font-size: 38px;
  }

  .section-heading > p:not(.eyebrow),
  .native-copy p {
    font-size: 16px;
  }

  .reading-flow article {
    grid-template-columns: 38px 1fr;
    gap: 8px 12px;
    padding: 24px 0;
  }

  .reading-flow article p {
    grid-column: 2;
  }

  .feature {
    min-height: 0;
  }

  .feature-private {
    grid-template-columns: 1fr 105px;
    min-height: 260px;
    padding: 28px;
  }

  .feature-private img {
    width: 112px;
  }

  .feature-media {
    min-height: 430px;
  }

  .feature-math {
    min-height: 330px;
  }

  .feature-plain,
  .feature-themes {
    min-height: 250px;
    padding: 28px;
  }

  .showcase-note {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .architecture > div:nth-of-type(2),
  .architecture > div:nth-of-type(3) {
    margin-left: 0;
  }

  .architecture-link {
    margin-left: 28px;
  }

  .install-list li {
    grid-template-columns: 36px 1fr;
    gap: 7px 10px;
  }

  .install-list span {
    grid-column: 2;
  }

  .download-panel {
    grid-template-columns: 66px 1fr;
    padding: 24px;
  }

  .download-panel img {
    width: 66px;
  }

  .footer-layout {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}

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

  .hero-story {
    height: auto;
  }

  .hero-sticky {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
  }

  .hero {
    min-height: calc(100dvh - var(--nav-height));
    height: auto;
  }

  .hero-copy {
    display: block;
  }

  .hero-stage-stack {
    display: grid;
    gap: 28px;
    min-height: 0;
  }

  .hero-stage,
  .hero-stage.is-active,
  .hero-stage.is-before {
    position: relative;
    inset: auto;
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .hero-stage + .hero-stage {
    padding-top: 28px;
    border-top: 1px solid var(--line);
  }

  .hero-message {
    font-size: clamp(30px, 4vw, 46px);
  }

  .hero-message-small {
    font-size: 18px;
  }

  .hero-controls {
    margin-top: 36px;
  }

  .hero-progress,
  .hero-step-marker {
    display: none;
  }

  .hero-stage[aria-hidden="true"] {
    display: flex;
  }

  .hero-stage,
  .app-frame .hero-shot {
    transition: none;
  }
}

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

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

  .motion-ready .reveal,
  .motion-ready [data-reveal],
  .motion-ready .reveal-group > * {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .feature-media .media-copy {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header {
    background: var(--bg);
  }
}
