:root {
  --brand-width: clamp(190px, 17vw, 216px);
  color-scheme: light;
  --ink: #172e4f;
  --muted: #526981;
  --blue: #195cce;
  --iris: #6354d5;
  --mint: #40cbb3;
  --line: #dbe7f3;
  --display: "Inter", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: var(--sans);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 22px; }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1,h2,h3,p,figure,dl,dd { margin: 0; }
h1,h2,h3 { text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, summary { cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #2968dc; outline-offset: 4px; }
::selection { color: #12355a; background: #aaf1e0; }
img { display: block; max-width: 100%; }
svg { display: inline-block; }
.shell { width: min(1280px, calc(100% - clamp(40px,10vw,160px))); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; padding: 8px 16px; transform: translateY(-170%); z-index: 12; border-radius: 12px; background: white; }
.skip:focus { transform: none; }
.masthead { background: white; position: relative; z-index: 2; }
.masthead-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; color: #1b2b54; white-space: nowrap; }
.brand-lockup { width: var(--brand-width); height: auto; max-width: 100%; }
.footer-inner .brand-lockup { width: calc(var(--brand-width) * .75); }
.masthead .wordmark { min-width: 0; gap: 14px; }
.masthead .brand-zh { font: 750 calc(var(--brand-width) * .145)/1.12 var(--display); letter-spacing: .015em; color: #182e50; }
footer a:hover { color: var(--blue); }

.language { display: flex; flex: none; white-space: nowrap; gap: 1px; align-items: center; background: #f1f5fa; border-radius: 20px; padding: 3px; }
.language a { display: block; padding: 2px 8px; border-radius: 13px; color: var(--muted); font-size: 12px; font-weight: 650; }
.language span { display: none; }
.language a[aria-current] { background: #fff; color: #153f78; box-shadow: 0 1px 4px #bac9d980; }


.cover { position: relative; isolation: isolate; overflow: hidden; background: #f5fbff; }
.cover::before { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 90% 16%, #e0f1ff 0, transparent 45%), radial-gradient(ellipse at 82% 91%, #dcfaf3 0, transparent 40%), linear-gradient(90deg,#f7fcff 0%,#f0f9ff 60%,#edf9fd 100%); }
.cover-spread { display: grid; grid-template-columns: .86fr 1.14fr; gap: clamp(15px,2.8vw,44px); align-items: center; padding-block: clamp(48px,5.1vw,85px) clamp(55px,5.3vw,87px); }
.cover-copy { z-index: 1; min-width: 0; }
.cover-label { display: flex; align-items: center; gap: 8px; margin-bottom: clamp(19px,2vw,30px); color: #246486; font-size: 13px; letter-spacing: .04em; font-weight: 700; }
.cover-label > span { width: 15px; height: 15px; position: relative; }
.cover-label > span::before, .cover-label > span::after { content: ""; position: absolute; border-radius: 50%; width: 10px; height: 10px; }
.cover-label > span::before { background: #7291ff; top: 1px; left: 0; }
.cover-label > span::after { background: #44cfb4; bottom: 0; right: 0; mix-blend-mode: multiply; }
h1 { font: 800 clamp(65px,6.55vw,105px)/1.05 var(--display); letter-spacing: -.025em; color: #172a4d; }
h1 > span { display: block; width: fit-content; }
h1 .accent { position: relative; isolation: isolate; color: #2763db; }
h1 .accent::after { content: ""; position: absolute; z-index: -1; bottom: .01em; height: .10em; left: 1%; right: 20%; background: #7be4d1; border-radius: 75% 48% 68% 45%; transform: rotate(-2deg); opacity: .94; }
html[lang="en"] h1 { font-size: clamp(60px,6.4vw,99px); line-height: .97; letter-spacing: -.083em; }
html[lang="en"] h1 .accent::after { right: 3%; bottom: -.02em; }
.subline { font-size: clamp(22px,2.1vw,33px); letter-spacing: -.045em; line-height: 1.38; font-weight: 720; margin-top: clamp(16px,1.7vw,27px); }
.lede { font-size: clamp(15px,1.12vw,18px); line-height: 1.86; color: #4c6480; margin-top: 12px; max-width: 34em; }
.cover-actions { display: flex; align-items: center; gap: clamp(18px,2vw,31px); flex-wrap: wrap; margin-top: clamp(22px,2.3vw,36px); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 100px; font-size: 15px; font-weight: 700; text-align: center; }
.button svg { width: 17px; height: 17px; flex-shrink: 0; }
.primary-button { color: white; padding: 13px 22px; background: #235ed4; box-shadow: 0 7px 16px #236bd125; transition: transform .15s, background .15s; }
.primary-button:hover { transform: translateY(-2px); background: #154fbf; }
.text-action { color: #245289; font-size: 14px; font-weight: 700; }
.text-action:hover { color: var(--blue); }
.text-action span { display: inline-block; margin-left: 3px; }
.cover-meta { margin-top: 14px; color: #5d738a; font-size: 11px; }
.hero-art { position: relative; min-width: 0; isolation: isolate; padding-bottom: clamp(17px,2.3vw,36px); }
.art-frame { position: relative; overflow: hidden; margin-inline: -2%; border-radius: 22% 12% 22% 9% / 12% 15% 13% 25%; background: #d6edfb; }
.art-frame img { width: 100%; height: auto; aspect-ratio: 1.5; object-fit: cover; }
.hero-art::before { content: ""; position: absolute; z-index: -1; width: 62%; height: 46%; background: #bcefe6; border-radius: 54% 47% 35% 53%; right: -3%; bottom: 1%; transform: rotate(4deg); }
.hero-art::after { content: "✧"; font-family: Arial,sans-serif; color: #6599e0; font-size: clamp(24px,2.2vw,35px); font-weight: 700; line-height: 1; position: absolute; top: -4%; left: 5.3%; }
.chat-exchange { position: absolute; inset: 0; pointer-events: none; }
.chat-exchange p { position: absolute; display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-radius: 19px; box-shadow: 0 8px 21px #2c609a22; color: #183150; font-size: clamp(14px,1.17vw,19px); font-weight: 670; letter-spacing: -.015em; }
.chat-invite { left: -2.9%; bottom: 14%; background: #fff; border-bottom-left-radius: 5px!important; transform: rotate(-2deg); }
.chat-reply { right: 0; bottom: 0; background: #b1f1e2; border-bottom-right-radius: 5px!important; transform: rotate(2deg); }
.msg-lang { font: 700 10px/1.5 var(--sans); color: #526c86; border-right: 1px solid #a8bdd3; padding-right: 8px; }
.chat-reply .msg-lang { color: #216254; border-color: #6fbfb0; }
@font-face {
  font-family: "TypeDuo Metric";
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
.stat-band { background: #fff; }
.stat-grid { display: grid; grid-template-columns: .92fr 1.36fr .8fr 1.23fr; gap: 8px; padding-block: clamp(27px,3.2vw,50px); border-bottom: 1px solid var(--line); }
.stat-grid > div { display: flex; min-width: 0; flex-direction: column-reverse; justify-content: flex-start; align-items: flex-start; padding-inline: clamp(10px,2.5vw,38px); border-left: 1px solid var(--line); }
.stat-grid > div:first-child { padding-left: 0; border: 0; }
.stat-grid dd {
  max-width: 100%; color: #253c67; font-family: "TypeDuo Metric", var(--sans); font-style: normal;
  font-size: clamp(25px,2.65vw,39px); font-weight: 560;
  letter-spacing: -.015em; line-height: 1.12;
}
:root { --stat-figure-size: clamp(39px,4.1vw,62px); }
.stat-grid .stat-figure dd, .lex-count strong {
  font: normal 540 var(--stat-figure-size)/1.12 "TypeDuo Metric", var(--sans);
  font-variant-numeric: proportional-nums lining-nums; letter-spacing: 0;
}
.stat-exams dd em { display: inline-block; font-style: normal; font-size: .79em; }
.stat-exams [lang="zh-Hans"] { font: 520 .9em/1.22 var(--sans); letter-spacing: .055em; }
.stat-platforms dd { font-weight: 520; }
.stat-rest { display: inline-block; }
.stat-sign { color: #317578; font-weight: 420; }
.stat-grid dt { font-size: 12px; margin-top: 5px; color: #596d84; }
@media (min-width: 901px) {
  [lang="en"] .stat-exams dd { font-size: clamp(22px, 2.05vw, 31px); }
}
@supports (grid-template-rows: subgrid) {
  .stat-grid > div { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
  .stat-grid dd { grid-row: 1; align-self: end; }
  .stat-grid dt { grid-row: 2; align-self: start; }
}
.chapter { padding-block: clamp(52px,5.8vw,91px); }
.section-rule { margin: 0 0 9px; }
.kicker,.privacy-label { color: #286ba6; font-size: 12px; font-weight: 750; letter-spacing: .085em; }
.chapter-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: clamp(20px,4vw,60px); margin-bottom: clamp(23px,2.4vw,36px); }
h2 { color: var(--ink); font-family: var(--display); font-size: clamp(33px,3.55vw,60px); font-weight: 740; line-height: 1.16; letter-spacing: -.065em; }
.chapter-intro h2 { max-width: 17em; }
.chapter-intro > p { width: min(34%,390px); flex-shrink: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }
details > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary > span { transform: rotate(45deg); }
code { font-family: var(--mono); font-size: .88em; overflow-wrap: anywhere; }
@media (max-width: 980px) {
  .masthead-inner { min-height: 65px; gap: 22px; }
  .cover-spread { grid-template-columns: .9fr 1.1fr; gap: 20px; }
  .chat-exchange p { padding: 8px 11px; gap: 6px; }
}
@media (max-width: 760px), (max-width: 950px) and (orientation: landscape) and (pointer: coarse) {
  .cover-spread { grid-template-columns: 1fr; padding-block: 36px 31px; gap: 20px; }
  .cover h1 > span { display: inline-block; }
  .cover h1 { font-size: clamp(48px,10.3vw,76px); }
  html[lang="en"] .cover h1 { font-size: clamp(50px,10.6vw,68px); max-width: 10em; }
  html[lang="en"] .cover h1 > span { display: block; }
  .cover-label { margin-bottom: 14px; }
  .subline { margin-top: 11px; }
  .lede { margin-top: 8px; }
  .cover-actions { margin-top: 18px; }
  .cover-meta { margin-top: 10px; }
  .hero-art { grid-row: 1; width: 93%; justify-self: center; }
  .art-frame img { aspect-ratio: 1.8; object-position: center top; }
  .chat-invite { bottom: 12%; }
  .chat-reply { right: -2%; }
}
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: .95fr 1.2fr .75fr 1.2fr; }
  .stat-grid > div { padding-inline: 10px; }
  .stat-grid dd { font-size: clamp(22px,3vw,29px); }
  :root { --stat-figure-size: clamp(36px,4.9vw,45px); }
  .stat-grid dt { font-size: 11px; }
  .chapter-intro { align-items: flex-start; flex-direction: column; gap: 8px; }
  .chapter-intro > p { width: 100%; max-width: 38em; }
}
@media (max-width: 530px) {
  .shell { width: calc(100% - 36px); }
  .masthead-inner { min-height: 65px; gap: 8px; }
  .masthead .wordmark { gap: 8px; }
  /* Reserve space for the side margins, gaps, and language switch. */
  :root { --brand-width: clamp(84px, calc((100vw - 132px) / 1.6), 190px); }
  .masthead .brand-lockup { min-width: 0; }
  .masthead .brand-zh { letter-spacing: .025em; }

  .language a { padding: 2px 6px; font-size: 11px; }
  .cover-spread { padding-top: 28px; gap: 15px; }
  .cover h1 { font-size: min(10.2vw,53px); }
  .cover-label { margin-bottom: 12px; font-size: 11px; }
  .subline { font-size: 21px; }
  .cover .lede { font-size: 14px; }
  .primary-button { padding: 10px 16px; }
  .hero-art { width: 98%; }
  .art-frame { margin: 0; }
  .art-frame img { aspect-ratio: 1.62; }
  .chat-exchange p { font-size: 12px; padding: 7px 10px; }
  .chat-invite { left: -1%; }
  .chat-reply { right: 0; }
  .msg-lang { font-size: 9px; padding-right: 5px; }
  .stat-grid { grid-template-columns: minmax(0,.88fr) minmax(0,1.12fr); gap: 15px 10px; padding-block: 20px; }
  .stat-grid > div:nth-child(odd) { border: 0; padding-left: 0; }
  .stat-grid dd { font-size: clamp(20px, 4.65vw, 25px); }
  :root { --stat-figure-size: clamp(36px, 7.6vw, 42px); }
  .chapter { padding-block: 44px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*::before,*::after { animation-duration: .01ms!important; transition-duration: .01ms!important; } }
.hero-art { padding-bottom: 0; }
.hero-art::before { display: none; }
.hero-scene { position: relative; padding-bottom: clamp(17px,2.3vw,36px); }
.hero-scene::before { content: ""; position: absolute; z-index: -1; width: 62%; height: 46%; right: -3%; bottom: 1%; background: #bcefe6; border-radius: 54% 47% 35% 53%; transform: rotate(4deg); }
.chat-exchange p { display: block; padding: 9px 14px 10px; line-height: 1.42; }
.chat-exchange .msg-lang { display: block; padding: 0; border: 0; text-transform: uppercase; letter-spacing: .045em; font-size: 9px; }
.chat-invite { bottom: 12%; }
.chat-reply { right: -1%; bottom: -1%; }
.sender-trail { margin: 17px auto 0; display: flex; align-items: center; justify-content: center; gap: 13px; color: #2e5073; }
.sender-label { font-size: 11px; font-weight: 700; color: #416382; }
.sender-label > span { font: 17px var(--sans); margin-right: 4px; }
.sender-trail > div { border-left: 1px solid #aacad9; padding-left: 12px; display: grid; gap: 2px; }
.sender-trail code { color: #365b8b; font: 12px/1.3 var(--mono); }
.sender-trail strong { color: #213c5c; font-size: 14px; }
@media (max-width: 900px) { .chat-exchange p { font-size: 13px; } }
@media (max-width: 530px) {
  .hero-scene { padding-bottom: 25px; }
  .chat-exchange p { font-size: 11px; padding: 6px 8px; border-radius: 12px; }
  .chat-exchange .msg-lang { font-size: 8px; }
  .chat-invite { bottom: 18%; }
  .sender-trail { justify-content: flex-start; gap: 7px; margin-top: 8px; }
  .sender-label { font-size: 9px; flex-shrink: 0; }
  .sender-trail code { font-size: 9px; }
  .sender-trail strong { font-size: 12px; }
  .sender-trail > div { padding-left: 7px; }
}
@media (max-width: 360px) {
  .chat-invite { max-width: 55%; }
}

/* The live candidate example uses the arrangement of a draft above a phone keyboard. */
#demo .demo-library {
  background: #f4f9ff; border: 1px solid #e0eaf6; border-radius: 28px;
  padding: clamp(15px, 2.6vw, 38px); box-shadow: none;
}
#demo .demo-switch {
  display: inline-flex; align-items: stretch; gap: 3px; max-width: 100%;
  padding: 4px; border: 1px solid #dce5f0; border-radius: 32px; background: #fff;
}
#demo .demo-switch[hidden], #demo .demo-panel[hidden] { display: none; }
#demo .demo-switch button {
  appearance: none; border: 0; border-radius: 24px; background: transparent; color: #485f7e;
  font: inherit; font-size: clamp(12px, 1.1vw, 15px); line-height: 1.25; font-weight: 650;
  padding: 9px clamp(12px, 1.6vw, 23px); cursor: pointer;
}
#demo .demo-switch button[aria-selected="true"] { background: #183b74; color: #fff; }
#demo .demo-switch button:hover:not([aria-selected="true"]) { background: #e8f4ff; color: #113d74; }
#demo .demo-switch button:focus-visible, #demo .candidate:focus-visible { outline: 3px solid #1672c0; outline-offset: 2px; }
#demo .demo-panel {
  display: grid; grid-template-columns: minmax(0, .76fr) minmax(0, 1.14fr); align-items: center;
  gap: clamp(22px, 5vw, 76px); margin: 0; padding: clamp(20px, 2.5vw, 40px) 0 0; border: 0;
}
#demo .demo-panel + .demo-panel:not([hidden]) { margin-top: 18px; border-top: 1px solid #d6e3f3; }
#demo .enhanced .demo-panel + .demo-panel { margin-top: 0; border-top: 0; }
#demo .demo-copy h3 { margin: 0; color: #192e48; font-size: clamp(22px, 2.2vw, 35px); line-height: 1.22; letter-spacing: -.045em; }
#demo .demo-copy p { color: #485c76; font-size: 15px; line-height: 1.85; margin: 15px 0 0; }
#demo .demo-copy .demo-note {
  margin: 18px 0 0; border-left: 3px solid #72cbbf; padding-left: 12px; font-size: 13px; color: #496780;
}
#demo .sim-stage { min-width: 0; }
#demo .composer {
  overflow: hidden; margin-inline: auto; width: 100%; max-width: 520px; min-width: 0;
  background: #fff; border: 1px solid #c8d9ee; border-radius: 18px;
  box-shadow: 0 10px 27px -20px #6488bb;
}
#demo .composer-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 17px 1px; background: transparent; color: #4c6481; font-size: 12px; font-weight: 650;
}
#demo .composer-top span { display: inline-flex; align-items: center; gap: 6px; }
#demo .composer-top svg { height: 15px; width: 15px; color: #6282a5; }
#demo .composer-top i { font-style: normal; font-size: 12px; color: #8297b2; letter-spacing: 2px; }
#demo .result { display: flex; align-items: center; padding: 10px 17px 15px; min-height: 60px; background: transparent; border: 0; }
#demo .result output { font: 640 clamp(18px, 1.65vw, 24px)/1.45 system-ui, sans-serif; color: #233c63; overflow-wrap: anywhere; }
#demo .result output::after { content: ""; display: inline-block; width: 2px; height: 1.02em; margin-inline-start: 3px; vertical-align: -.12em; border-radius: 1px; background: #418cda; }
#demo .result output.changed { animation: draft-commit .25s ease-out; }
@keyframes draft-commit { from { opacity: .42; transform: translateY(2px); } }
#demo .sim-keyboard { display: grid; grid-template-columns: minmax(0, 1fr); background: #e4ebf5; border-top: 1px solid #d6dfed; padding: 10px 10px 12px; }
#demo .result [hidden] { display: none; }
#demo .preedit {
  min-width: 0; color: #28486a; font: 500 clamp(16px, 1.5vw, 21px)/1.45 var(--sans);
  overflow-wrap: anywhere;
}
#demo .preedit::after {
  content: ""; display: inline-block; width: 2px; height: 1em; margin-inline-start: 2px;
  vertical-align: -.12em; border-radius: 1px; background: #418cda;
}
#demo .candidate-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: start;
  min-width: 0; margin-bottom: 3px;
}
#demo .candidate-bar.is-expanded .candidates {
  display: grid; grid-template-columns: repeat(var(--expanded-columns, 1), max-content);
  grid-template-rows: repeat(2, 31px); justify-content: start; align-content: start; row-gap: 1px;
}
#demo .row-toggle {
  display: grid; place-items: center; width: 100%; height: 40px; padding: 0;
  border: 0; border-radius: 4px; color: #4b617b; background: transparent;
}
#demo .row-toggle:focus-visible { outline-offset: -2px; }
#demo .row-toggle svg { display: block; width: 17px; height: 17px; }
#demo .row-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
#demo .candidates {
  display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 40px;
  padding: 3px 4px 5px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #9aabc0 transparent;
}
#demo .candidate-pair { display: inline-flex; align-items: center; gap: 2px; flex: none; white-space: nowrap; }
#demo .candidate {
  appearance: none; flex: none; min-height: 31px; margin: 0; padding: 2px 3px; border: 0;
  border-radius: 4px; background: transparent; color: #233952; font: 500 20px/1.25 var(--sans);
  white-space: nowrap; text-align: start; cursor: pointer;
}
#demo .candidate-ja { color: #4b617b; font-size: 15px; font-weight: 450; }
@media (hover: hover) {
  #demo .candidate:hover { background: #d1e3f5; color: #174d80; }
}
#demo .candidate[aria-pressed="true"] { background: #ccdfef; color: #193f66; }
#demo .candidate:focus-visible { outline-offset: -2px; }
#demo .sense-toggle {
  flex: none; width: 30px; height: 31px; padding: 0; border: 0; border-radius: 4px;
  color: #405b7a; background: transparent; font: 500 23px/1 system-ui, sans-serif;
}
#demo .sense-toggle[aria-expanded="true"] { color: #174d80; background: #d1e3f5; }
#demo .sense-toggle:focus-visible { outline-offset: -2px; }
#demo .sense-menu, #demo .sim-keybed { grid-area: 2 / 1; align-self: start; }
#demo .sense-menu {
  z-index: 1; justify-self: start; max-width: 100%; padding: 4px;
  border: 1px solid #c9d5e3; border-radius: 5px; background: #fff;
  box-shadow: 0 3px 12px #20355526;
}
#demo .sense-menu[hidden] { display: none; }
#demo .sense-menu .sense-choice {
  display: flex; align-items: baseline; gap: 10px; width: 100%; min-height: 29px; padding: 3px 9px;
  white-space: normal; color: #233952; font-size: 15px;
}
#demo .sense-choice [lang="ja"] { color: #4b617b; font-size: 13px; }
#demo .sim-keybed { display: grid; gap: 4px; }
#demo .sim-keyrow { display: flex; justify-content: center; gap: 4px; }
#demo .sim-keyrow > i {
  display: grid; place-items: center; flex: 0 1 calc((100% - 37px) / 10); min-width: 0; height: clamp(19px, 2.05vw, 29px);
  border-radius: 4px; background: #fdfefe; box-shadow: 0 1px 0 #b4c2d4; color: #455a74;
  font: 500 clamp(9px, .82vw, 12px)/1 system-ui, sans-serif;
}
#demo .sim-keybottom { margin-top: 1px; }
#demo .sim-keybottom > i { flex-grow: 1; color: #465f7e; background: #c9d6e8; }
#demo .sim-keybottom > .sim-space { flex: 0 1 58%; color: #5d6e83; background: #fff; }
@media (max-width: 760px) {
  #demo .demo-library { border-radius: 22px; padding: 18px; }
  #demo .demo-panel { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  #demo .demo-copy p { margin-top: 8px; }
  #demo .demo-copy .demo-note { margin-top: 9px; }
  #demo .composer { max-width: none; }
  #demo .sim-keyrow > i { height: 26px; }
}
@media (max-width: 460px) {
  #demo .demo-library { padding: 13px 10px; border-radius: 17px; }
  #demo .demo-copy { padding-inline: 3px; }
  #demo .demo-switch { display: flex; gap: 1px; width: 100%; }
  #demo .demo-switch button { flex: 1 1 0; padding: 8px 3px; font-size: 11px; }
  #demo .demo-panel { padding-top: 16px; }
  #demo .sim-keyboard { padding: 8px 6px; }
  #demo .candidates { gap: 10px; padding-inline: 1px; }
  #demo .candidate { font-size: 17px; }
  #demo .candidate-ja { font-size: 13px; }
  #demo .sim-keyrow { gap: 3px; }
  #demo .sim-keyrow > i { height: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  #demo .result output.changed { animation: none; }
}

/* Learning, privacy and distribution */
.feature-block { background:#f6f9ff; color:var(--ink); }
.feature-grid,.story-grid,.download-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(22px,4vw,64px); }
.feature-card,.story-item,.download-card { min-width:0; }
.feature-card { padding:15px 0 0; }
.feature-card h3,.story-item h3,.open-source h3 { margin:0; color:var(--ink); font-size:clamp(1.2rem,1.8vw,1.48rem); line-height:1.38; letter-spacing:-.035em; }
.feature-card p,.story-item p,.lex-copy p,.open-source p { color:var(--muted); font-size:1rem; line-height:1.85; margin:12px 0 0; }
.feature-card .example { display:inline-block; margin:19px 0 0; padding:6px 12px; border-radius:12px 12px 12px 3px; color:#214d88; background:#e0ecff; font-size:.83rem; font-weight:620; line-height:1.6; }
.feature-card:nth-child(2) .example { color:#19604f; background:#dcf4e9; }
.feature-card:nth-child(3) .example { color:#58428c; background:#ede7fc; }
.lexicon { display:grid; grid-template-columns:minmax(215px,.78fr) minmax(0,1.22fr); align-items:center; gap:clamp(35px,7vw,100px); margin-top:clamp(40px,6.5vw,84px); padding:clamp(30px,5.5vw,74px) 0 0; border-top:1px solid #d6e3f3; }
.lex-count { display:flex; flex-direction:column; align-items:flex-start; color:#415e85; font-weight:600; letter-spacing:.025em; font-size:.87rem; }
.lex-count strong { margin:4px 0; color:#2059bd; }
.lex-copy h3 { margin:0; font-size:clamp(1.45rem,2.65vw,2.45rem); line-height:1.24; letter-spacing:-.04em; }
.lex-facts { display:flex; flex-wrap:wrap; align-items:baseline; gap:5px 11px; margin-top:17px; color:#37567d; font-size:.88rem; font-weight:650; }
.privacy { position:relative; isolation:isolate; overflow:hidden; background:#dcf4ec; color:#153e40; }
.privacy::after { content:""; position:absolute; z-index:-1; width:clamp(200px,24vw,390px); aspect-ratio:1; bottom:-55%; left:-7%; border:clamp(28px,4vw,55px) solid #c5ebdf; border-radius:50%; pointer-events:none; }
.privacy-inner { display:grid; grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr); gap:clamp(36px,8vw,115px); align-items:start; padding-block:clamp(46px,6.6vw,88px); }
.privacy-label { display:flex; gap:9px; align-items:center; color:#1f695c; font-size:.88rem; font-weight:700; }
.offline-mark { width:11px; height:11px; flex:0 0 auto; border:2px solid #20836d; border-radius:50%; background:#b3e7d6; }
.privacy h2 { color:#154c47; margin:14px 0 0; font-size:clamp(2.05rem,5.1vw,4.5rem); line-height:1.14; letter-spacing:-.06em; }
.privacy-details p { line-height:1.8; color:#355b56; margin:0 0 13px; }
.privacy-details .privacy-lead { color:#18443f; font-size:clamp(1.02rem,1.55vw,1.25rem); font-weight:600; line-height:1.68; }
.privacy-research { border-top:1px solid #abd3c5; margin-top:20px; padding-top:15px; }
.privacy-details .privacy-research a { display:inline-block; padding-block:6px; font-weight:700; }
.privacy-details .privacy-research p { margin:3px 0 0; font-size:.85rem; }
.download-card summary { cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center; gap:13px; min-height:44px; font-size:.91rem; font-weight:640; }
.download-card summary::-webkit-details-marker { display:none; }
.download-card summary span { font-size:1.2rem; line-height:1; }
.download-card details[open] summary span { transform:rotate(45deg); }
.privacy-details a { color:#145d4e; }
.privacy-details a:hover { color:#0d493e; }
.story-art { margin:0; overflow:hidden; border-radius:clamp(14px,1.9vw,28px); background:#e7f3fd; }
.story-art img { width:100%; height:auto; display:block; }
.story-grid { margin-top:clamp(24px,3.5vw,45px); }
.story-item { padding-left:15px; border-left:3px solid #a5c8ff; }
.story-item:nth-child(2) { border-color:#9fdcca; }
.story-item:nth-child(3) { border-color:#c8b5f0; }
.download-section { background:#edf4ff; color:var(--ink); }
.download-grid { gap:14px; align-items:start; }
.download-card { --platform:#2058c0; --platform-tint:#e6eeff; display:flex; flex-direction:column; align-items:flex-start; padding:clamp(20px,2.25vw,36px); border-radius:22px; background:#fff; border:1px solid #dce7f4; }
#download-android { --platform:#176654; --platform-tint:#def5eb; }
#download-ios { --platform:#6a4f98; --platform-tint:#f0eafb; }
.download-card h3 { display:flex; gap:11px; align-items:center; margin:0; color:var(--ink); line-height:1.1; font-size:clamp(1.55rem,2.1vw,2rem); letter-spacing:-.045em; }
.download-card h3 svg { width:38px; height:38px; padding:8px; border-radius:11px; color:var(--platform); background:var(--platform-tint); flex:none; }
.download-card .release { color:var(--platform); font-size:.76rem; font-weight:650; letter-spacing:.01em; margin:20px 0 5px; }
.download-card > p:not(.release) { min-height:2.9em; margin:0; color:var(--muted); font-size:.92rem; line-height:1.48; }
.card-action { display:flex; width:100%; margin-top:17px; }
.card-action .button,.card-action .coming { display:inline-flex; justify-content:center; align-items:center; box-sizing:border-box; width:100%; min-height:44px; padding:9px 12px; text-align:center; border:0; border-radius:12px; font-size:.88rem; font-weight:680; line-height:1.45; }
.card-action .button { gap:7px; color:white; background:var(--platform); }
.card-action .button:hover { filter:brightness(.92); }
.card-action .button svg { width:16px; height:16px; flex:none; }
.card-action .coming { color:var(--platform); background:var(--platform-tint); }
.download-card details { width:100%; margin-top:14px; padding-top:4px; border-top:1px solid var(--line); }
.download-card summary { color:#385677; }
.download-card ol { color:var(--muted); font-size:.9rem; line-height:1.72; padding-inline-start:1.3em; margin:4px 0 0; }
.download-card li + li { margin-top:7px; }
.download-card code { overflow-wrap:anywhere; }
.open-source { display:grid; grid-template-columns:minmax(0,.55fr) minmax(0,1.45fr); gap:16px 32px; margin-top:clamp(28px,4vw,55px); padding-top:24px; border-top:1px solid #d1e0f0; align-items:baseline; }
.open-source p { margin:0; font-size:.94rem; }
footer { border:0; background:#fff; color:#304d70; }
.footer-inner { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px 24px; padding-block:27px; }
.footer-inner > a:last-child,.license-links { font-size:.82rem; }
.open-source .license-links { display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:8px; }
.open-source .license-links a { color:#51545b; font-weight:650; }
.open-source .license-links a:hover { color:#34363b; }
.footer-inner > a:last-child { color:#415e82; }
.footer-inner > a:last-child:hover { color:var(--blue); }
@media(max-width:920px) {
  .feature-grid,.story-grid { gap:24px; }
  .download-card { padding:18px; }
}
@media(max-width:760px) {
  .feature-grid,.story-grid,.download-grid,.privacy-inner,.lexicon,.open-source { grid-template-columns:1fr; }
  .feature-grid { gap:5px; }
  .feature-card { padding:20px 0; border-bottom:1px solid #dae5f1; }
  .feature-card:last-child { padding-bottom:0; border:0; }
  .feature-card .example { margin-top:10px; }
  .lexicon { gap:20px; }
  .privacy-inner { gap:22px; }
  .privacy h2 br { display:none; }
  .story-grid { gap:23px; }
  .story-item { padding-left:12px; }
  .download-card { padding:23px; }
  .download-card > p:not(.release) { min-height:0; }
  .open-source { gap:8px; }
}
@media(max-width:420px) {
  .feature-card p,.story-item p,.lex-copy p,.open-source p,.privacy-details p { font-size:.95rem; }
  .privacy h2 br { display:initial; }
  .download-card { padding:19px; }
}

/* Next-release examples pair the actual keystrokes with the text they produce. */
.next-release h3 { margin: 0; font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.35; }
.next-release article p, .ranking-note p { color: var(--muted); margin: .55rem 0 0; line-height: 1.75; }
.typing-samples article { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(20px, 5vw, 75px); align-items: center; padding: 1.35rem 0; border-top: 1px solid var(--line); }
.sample-pair { min-width: 0; border-left: 3px solid #75cfc3; border-radius: 0 12px 12px 0; padding: .75rem 1rem; background: #eff8fa; }
.sample-pair > span { display: block; overflow-wrap: anywhere; }
.sample-pair b { color: #126a67; }
.sample-output { margin-top: .2rem; font-size: 1.13rem; font-weight: 650; color: #244b71; }
.sample-pair small { margin-inline-start: .5em; color: #455c73; font: 500 .8rem/1.4 var(--sans); }
.ranking-note { margin-top: 2rem; border-block: 1px solid var(--line); padding-block: .85rem; }
.ranking-note summary { color: #325479; font-weight: 650; cursor: pointer; }
.ranking-note p { max-width: 76ch; }
.lex-facts { column-gap: 1.5rem; }
@media (max-width: 760px) {
  .typing-samples article { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

.themes-section { background: #f6f6fb; }
.themes-section .chapter-intro h2 { max-width: 20em; }
.theme-reel {
  display: grid;
  --gap: clamp(10px, 1.4vw, 20px);
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * var(--gap)) / 4);
  gap: var(--gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.theme-reel { scroll-behavior: smooth; }
.theme-page { display: contents; }
.theme-arrows:not([hidden]) {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}
.theme-arrows button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 23px;
  cursor: pointer;
}
.theme-arrows button:first-child { text-align: left; }
.theme-arrows button:last-child { text-align: right; }
.theme-arrows button:disabled { opacity: .32; cursor: default; }
.theme-arrows button:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.theme-reel::-webkit-scrollbar { display: none; }
.theme-reel:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.theme-reel figure {
  --card-inset: clamp(6px, .7vw, 10px);
  min-width: 0;
  margin: 0;
  padding: 10px var(--card-inset);
  border: 1px solid #dce0e8;
  border-radius: 14px;
  background: #fff;
}
.theme-preview {
  position: relative;
  aspect-ratio: 960 / 984;
}
.theme-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.theme-preview img:last-child { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .theme-preview img { animation: theme-appearance 8s steps(1, end) infinite; }
  .theme-preview img:last-child { animation-delay: -4s; }
}
@keyframes theme-appearance {
  0%, 100% { visibility: visible; }
  50% { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) and (prefers-color-scheme: dark) {
  .theme-preview img:first-child { visibility: hidden; }
  .theme-preview img:last-child { visibility: visible; }
}
.theme-reel figcaption {
  padding-top: 8px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}
@media (max-width: 760px), (max-width: 950px) and (orientation: landscape) and (pointer: coarse) {
  .theme-reel {
    --gap: 10px;
    grid-auto-columns: 100%;
    scroll-snap-type: x mandatory;
  }
  .theme-page {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, 1fr);
    gap: var(--gap);
    scroll-snap-align: start;
  }
  .theme-reel figure { padding: 7px 5px; border-radius: 10px; }
  .theme-reel figcaption { padding-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-reel { scroll-behavior: auto; }
}
