/* Chirami website. Washi paper by day, sumi ink by night. No external requests. */
@font-face { font-family: "Shippori Mincho"; src: url("/assets/fonts/shippori-mincho-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F5F0E6; --bg2: #EFE8DA; --card: #FBF8F2; --line: #DDD3C2; --paper: #EFE8DA;
  --ink: #1C1B1A; --soft: #5B554C; --faint: #8A8275; --accent: #B8432B; --accent-ink: #FBF8F2; --wash: #F3E3DC;
  --night: #1D1C22; --night-ink: #F3EDE2; --night-soft: #B8AFA1;
  --grid: rgba(184, 67, 43, .22);
  --sys: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", Georgia, serif;
  --jp-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", "Source Han Serif JP", serif;
  --jp-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --r: 18px;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1C1B1A; --bg2: #232120; --card: #26241F; --line: #3B372F; --paper: #2B2924;
    --ink: #F3EDE2; --soft: #B8AFA1; --faint: #8F877B; --accent: #E0735A; --accent-ink: #1C1B1A; --wash: #3A2620;
    --night: #121115; --grid: rgba(224, 115, 90, .25); color-scheme: dark; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sys); }
img, video, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 6.4vw, 58px); }
h2 { font-size: clamp(26px, 4.2vw, 36px); }
h3 { font-size: 21px; }
p { margin: 0; }
[lang="ja"] { font-family: var(--jp-sans); }
h1 [lang="ja"], h2 [lang="ja"], h3 [lang="ja"], .lc-title [lang="ja"], .cta-title [lang="ja"] { font-family: var(--jp-serif); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1080px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
section { padding-block: 72px; }
section.alt { background: var(--bg2); }
.eyebrow { font: 700 13px/1.4 var(--sys); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.eyebrow a { color: inherit; text-decoration: none; }
.lead { font-size: 20px; color: var(--soft); max-width: 38ch; }
.sec-head { display: grid; gap: 10px; margin-bottom: 36px; max-width: 46rem; }
.sec-head p { color: var(--soft); font-size: 18px; }
.muted { color: var(--soft); font-size: 15px; }
.mail { font-weight: 700; overflow-wrap: anywhere; user-select: all; }

/* ---------- Header ---------- */
.lp-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.lp-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 22px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.lp-nav { display: flex; gap: 20px; margin-left: auto; font-size: 15px; font-weight: 600; }
.lp-nav a { color: var(--soft); text-decoration: none; }
.lp-nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .lp-nav { gap: 14px; } .lp-nav a:nth-child(n+3) { display: none; } }
@media (max-width: 520px) { .lp-nav a:nth-child(n+2) { display: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 16px/1.2 var(--sys); text-decoration: none; border: 0; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 14px; margin-left: 4px; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--wash); color: var(--ink); font: 700 14px/1.3 var(--sys); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Home ---------- */
.hero { padding-block: 56px 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero-text { display: grid; gap: 20px; min-width: 0; }
.hero-art { display: flex; justify-content: center; min-width: 0; }
.hero.nf .wrap { grid-template-columns: 1fr; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; gap: 40px; } .hero-text { text-align: center; justify-items: center; } .lead { margin-inline: auto; } .hero-actions { justify-content: center; } }
.shot { width: min(320px, 80vw); border-radius: 26px; box-shadow: 0 30px 60px -28px rgba(0,0,0,.45), 0 0 0 1px var(--line); display: block; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: grid; gap: 10px; align-content: start; counter-increment: step; }
.steps li::before { content: counter(step); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--wash); color: var(--accent); font: 800 17px/1 var(--sys); }
.steps p { color: var(--soft); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.gallery { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 4px 24px; margin: 0; list-style: none; }
.gallery li { flex: 0 0 auto; scroll-snap-align: center; display: grid; gap: 14px; justify-items: center; align-content: start; text-align: center; width: 250px; }
.gallery .shot { width: 250px; border-radius: 22px; }
.gallery span { color: var(--soft); font-size: 15px; line-height: 1.45; }
.gallery-hint { color: var(--soft); font-size: 14px; text-align: center; margin-top: 4px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: grid; gap: 8px; align-content: start; }
.feature .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--wash); display: grid; place-items: center; font: 700 22px/1 var(--jp-serif); color: var(--accent); }
.feature p { color: var(--soft); }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split > * { min-width: 0; }
.split .copy { display: grid; gap: 16px; }
.split .copy p { color: var(--soft); font-size: 18px; }
.split .art { display: flex; justify-content: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: grid; gap: 14px; align-content: start; }
.plan.pro { box-shadow: inset 0 0 0 2px var(--accent); }
.plan .tag { justify-self: start; }
.plan ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.band { background: var(--night); color: var(--night-ink); }
.band h2, .band h3 { color: var(--night-ink); }
.band .eyebrow { color: var(--night-soft); }
.band .sec-head p, .band p { color: var(--night-soft); }
.band .feature { background: color-mix(in srgb, var(--night) 80%, #ffffff 8%); border-color: color-mix(in srgb, var(--night) 70%, #ffffff 18%); }
.band .feature .ico { background: color-mix(in srgb, var(--night) 60%, #ffffff 14%); color: var(--night-ink); }
.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--line); padding-block: 18px; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details > *:not(summary) { margin-top: 10px; color: var(--soft); }
.faq ul { padding-left: 1.2em; }
.cta { text-align: center; display: grid; gap: 18px; justify-items: center; }
.cta img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 16px 30px -16px rgba(0,0,0,.4); }
.more-link { margin-top: 28px; text-align: center; }

/* ---------- Lesson cards ---------- */
.lgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.lgrid li { min-width: 0; }
.lcard { display: flex; gap: 16px; align-items: center; height: 100%; padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.lcard:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(0,0,0,.35); }
.lc-glyph { flex: none; width: 76px; height: 76px; border-radius: 14px; background: var(--paper); display: grid; place-items: center; }
.lc-glyph svg { width: 60px; height: 60px; }
.lc-glyph .glyph-text { font: 700 44px/1 var(--jp-serif); }
.lc-body { display: grid; gap: 4px; min-width: 0; }
.lc-cat { font: 700 12px/1.3 var(--sys); letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.lc-title { font: 700 17px/1.35 var(--head); margin: 0; letter-spacing: 0; }
svg.glyph .s path, svg.strokes .s path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
svg.glyph .s path { stroke-width: 5; }

/* ---------- Index pages ---------- */
.index-head { padding-block: 40px 24px; }
.index-head .wrap { display: grid; gap: 16px; }
.index-head .lead { max-width: 60ch; }
.index-list { padding-block: 8px 80px; }
.chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font: 600 15px/1.2 var(--sys); }
.chip:hover { border-color: var(--accent); }
.search { max-width: 520px; }
.search input { width: 100%; font: 17px/1.4 var(--sys); padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.search-empty { margin-top: 10px; color: var(--soft); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; font-size: 14px; color: var(--soft); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--faint); }
.crumbs a { color: var(--soft); }
.crumbs [aria-current] { display: none; }

/* ---------- Lesson page ---------- */
.lesson-head { padding-block: 36px 8px; }
.lesson-head .wrap { display: grid; gap: 14px; max-width: 1080px; }
.lesson-head h1 { font-size: clamp(32px, 5.6vw, 52px); max-width: 22ch; }
.lesson-meta { color: var(--soft); font-size: 15px; }
.prose { padding-block: 20px 64px; font-size: 18px; line-height: 1.72; }
.prose > * { max-width: 680px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 16px 20px; border-left: 4px solid var(--accent); background: var(--wash); border-radius: 0 12px 12px 0; }
.prose blockquote > * + * { margin-top: .6em; }
.prose strong { font-weight: 700; }
.prose ruby rt { font-size: 0.55em; color: var(--soft); }
.prose span[lang="ja"]:not([class]) { font-size: 1.04em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 700 13px/1.3 var(--sys); text-transform: uppercase; letter-spacing: .06em; color: var(--soft); background: var(--bg2); }
.prose tr:last-child td { border-bottom: 0; }
.prose td span[lang="ja"]:not([class]) { font-size: 1.15em; }
.examples { list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.examples li { margin: 0 !important; padding: 14px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.ex-ja { font-size: 21px; line-height: 1.6; }
.ex-ro { color: var(--soft); font-style: italic; font-size: 16px; }
.ex-en { font-size: 16px; }
.byline { color: var(--soft); font-size: 15px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 2.4em !important; }
.sources ul { font-size: 15px; color: var(--soft); }

.lesson-video { margin: 0; display: grid; gap: 10px; justify-items: center; }
.lesson-video video { width: min(340px, 100%); aspect-ratio: 9 / 16; height: auto; border-radius: 24px; background: var(--paper); box-shadow: 0 30px 60px -30px rgba(0,0,0,.5), 0 0 0 1px var(--line); display: block; }
.lesson-video figcaption { color: var(--soft); font-size: 14px; text-align: center; max-width: 34ch; }
.prose > .lesson-video { margin-top: 1.6em; margin-bottom: .6em; max-width: 680px; }
@media (min-width: 1000px) {
  .prose.has-video { display: grid; grid-template-columns: minmax(0, 680px) 340px; column-gap: 56px; justify-content: space-between; }
  .prose.has-video > * { grid-column: 1; }
  .prose.has-video > .lesson-video { grid-column: 2; grid-row: 1 / span 80; align-self: start; position: sticky; top: 92px; margin: 0; }
}

/* ---------- Kanji cards ---------- */
.kanji-section > * + * { margin-top: 14px; }
.kgrid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.kcard { margin: 0; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 20px; padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); align-items: start; }
.kc-art { display: grid; gap: 10px; justify-items: center; }
.kc-art svg, .kc-art .glyph-text { width: 128px; height: 128px; border-radius: 12px; background-color: var(--paper);
  background-image: linear-gradient(var(--grid), var(--grid)), linear-gradient(var(--grid), var(--grid));
  background-size: 100% 1px, 1px 100%; background-position: center; background-repeat: no-repeat; display: grid; place-items: center; }
.kc-art .glyph-text { font: 700 84px/1 var(--jp-serif); }
svg.strokes .s path { stroke-width: 3.6; }
svg.strokes .n text { font: 600 7px/1 var(--sys); fill: var(--accent); paint-order: stroke; stroke: var(--paper); stroke-width: 2px; }
svg.strokes.play .s path { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; animation: draw .55s ease both; }
svg.strokes.play .n { opacity: 0; }
@keyframes draw { 0% { stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { svg.strokes.play .s path { animation-duration: .01s; } }
.kc-play { font: 700 13px/1 var(--sys); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.kc-play:hover { border-color: var(--accent); }
.kc-info { display: grid; gap: 10px; min-width: 0; font-size: 15px; line-height: 1.5; }
.kc-mean { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-weight: 700; font-size: 17px; }
.kc-char { font: 700 30px/1 var(--jp-serif); }
.kc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 0; }
.kc-facts div { display: grid; gap: 0; }
.kc-facts dt { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.kc-facts dd { margin: 0; overflow-wrap: anywhere; }
.kc-facts a { color: inherit; text-decoration-color: var(--line); }
.kc-word { color: var(--soft); }
.kc-label { display: block; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.kana { color: var(--soft); }
@media (max-width: 520px) {
  .kcard { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .kc-art svg, .kc-art .glyph-text { width: 92px; height: 92px; }
  .kc-art .glyph-text { font-size: 60px; }
  .kc-facts { grid-template-columns: 1fr; }
}

/* ---------- Widget call to action ---------- */
.cta-widget { margin-top: 2.6em !important; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: center; padding: 26px; border-radius: 26px; background: var(--night); color: var(--night-ink); max-width: 680px; }
.cta-widget .muted, .cta-widget p { color: var(--night-soft); font-size: 15px; }
.cta-widget .cta-copy { display: grid; gap: 12px; min-width: 0; }
.cta-title { font: 700 24px/1.25 var(--head); color: var(--night-ink) !important; }
.cta-widget .pill { background: rgba(255,255,255,.12); color: var(--night-ink); }
.w-medium { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 12px; border-radius: 22px; background: #F5F0E6; color: #1C1B1A; box-shadow: 0 18px 40px -20px rgba(0,0,0,.6); font-family: var(--sys); }
.w-tile { position: relative; border-radius: 14px; background: #EAE3D3; display: grid; place-items: center; aspect-ratio: 1; }
.w-level { position: absolute; top: 8px; left: 9px; font: 700 10px/1 var(--sys); color: #B8432B; }
.w-glyph { font: 400 62px/1 var(--jp-serif); color: #1C1B1A; }
.w-text { display: grid; gap: 2px; align-content: start; min-width: 0; }
.w-label { font-size: 11px; color: #5B554C; }
.w-text b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-read { font-size: 12px; color: #5B554C; }
.w-btns { display: flex; gap: 6px; margin-top: 10px; }
.w-btns span { flex: 1; text-align: center; padding: 7px 4px; border-radius: 10px; font: 600 11px/1.2 var(--sys); box-shadow: inset 0 0 0 1.5px #1C1B1A; white-space: nowrap; }
.w-btns .dark { background: #1C1B1A; color: #F5F0E6; }
@media (max-width: 640px) { .cta-widget { grid-template-columns: 1fr; padding: 20px; } .w-medium { max-width: 320px; } }

.more { padding-block: 56px 72px; }
.more h2 { margin-bottom: 22px; }

/* ---------- Footer ---------- */
.lp-footer { border-top: 1px solid var(--line); color: var(--soft); font-size: 14px; }
.lp-footer .wrap { padding-block: 28px 44px; display: grid; gap: 8px; }
.lp-footer a { color: inherit; }
.foot-links a { font-weight: 600; }

/* ---------- Guides ---------- */
.gc-desc { color: var(--soft); font: 400 15px/1.45 var(--sys); }
.ggrid .lc-body { gap: 6px; }
.toc { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 16px 20px; }
.toc-title { font: 700 12px/1.3 var(--sys); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.toc ol { margin: 8px 0 0; padding-left: 1.3em; font-size: 16px; line-height: 1.5; }
.toc li + li { margin-top: .3em; }
.strokes-row { display: flex; flex-wrap: wrap; gap: 16px 14px; }
.sfig { margin: 0; display: grid; gap: 8px; justify-items: center; align-content: start; width: 128px; }
.sfig figcaption { font-size: 14px; line-height: 1.35; color: var(--soft); text-align: center; }
.sf-char { display: block; font: 700 22px/1.1 var(--jp-serif); color: var(--ink); margin-bottom: 2px; }
.ktable td { font-size: 15px; line-height: 1.45; }
.ktable td.kt-k { white-space: nowrap; }
.ktable .kt-char { font: 700 30px/1 var(--jp-serif); color: var(--ink); }
.ktable td.kt-k a { text-decoration: none; display: inline-grid; justify-items: center; gap: 4px; }
.kt-lesson { font: 700 10px/1 var(--sys); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ktable .kt-en { display: block; color: var(--soft); font-size: 14px; }
.ktable .kt-w { min-width: 11em; }
.more-sub { font-size: clamp(22px, 3.2vw, 28px); margin: 40px 0 18px; }
.start-here { margin-top: 18px; text-align: center; color: var(--soft); font-size: 15px; }
.start-guides { margin-top: 64px; }
@media (max-width: 520px) {
  .sfig { width: 100px; }
  .sfig .kc-art svg { width: 100px; height: 100px; }
  .ktable .kt-char { font-size: 26px; }
}
.ktable .r { display: block; }
@media (max-width: 560px) {
  .prose .ktable thead { display: none; }
  .prose .ktable, .prose .ktable tbody { display: block; }
  .prose .ktable tr { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .prose .ktable tr:last-child { border-bottom: 0; }
  .prose .ktable td { display: block; border: 0; padding: 2px 0; grid-column: 2; min-width: 0; }
  .prose .ktable td.kt-k { grid-column: 1; grid-row: 1 / span 4; padding-top: 4px; }
  .prose .ktable td.kt-m { font-weight: 700; }
  .prose .ktable td[data-label]::before { content: attr(data-label); display: block; font: 700 11px/1.4 var(--sys); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }
  .ktable .r { display: inline; }
  .ktable .r + .r::before { content: " · "; color: var(--faint); }
  .ktable .kt-w { min-width: 0; }
}
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--soft); font-size: 17px; }
.ticks li { position: relative; padding-left: 26px; }
.ticks li::before { content: ""; position: absolute; left: 3px; top: .6em; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }

/* ---------- Kanji pages: /kanji/, /kanji/<kanji>/, /kanji/parts/, /kanji-test/ ---------- */
/* Klee One, the app's textbook hand, in two subsets made by tools/make_klee_subset.py. */
@font-face { font-family: "Klee One"; src: url("/assets/fonts/klee-one-kanji.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Klee One Test"; src: url("/assets/fonts/klee-one-test.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
:root { --sq: #FFFFFF; --sq-line: #E2B9AE; --ghost: #DDD3C2; --ok: #1C1B1A; --ok-ink: #F5F0E6; }
@media (prefers-color-scheme: dark) { :root { --sq: #26241F; --sq-line: #6A4135; --ghost: #4A453C; --ok: #F3EDE2; --ok-ink: #1C1B1A; } }
.kl, .kl[lang="ja"] { font-family: "Klee One", var(--jp-sans); font-weight: 400; font-style: normal; font-synthesis: none; letter-spacing: 0; }
.kl.kl-test, .kl.kl-test[lang="ja"] { font-family: "Klee One Test", "Klee One", var(--jp-sans); }

/* the kanji page */
.kp-head { padding-block: 32px 4px; }
.kp-head h1 { font-size: clamp(34px, 6vw, 54px); max-width: none; }
.kp-head h1 .h-k { font-size: 1.1em; margin-right: .08em; }
.kp-top { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 28px 56px; align-items: start; padding-top: 22px; }
@media (max-width: 860px) { .kp-top { grid-template-columns: minmax(0, 1fr); } }
.kp-story, .kp-info, .kt-about { padding-block: 0; }
.kp-story { display: grid; justify-items: center; gap: 16px; text-align: center; min-width: 0; }
.ksq { --size: min(300px, 74vw); position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 10px; background-color: var(--sq); box-shadow: inset 0 0 0 1.5px var(--sq-line), 0 18px 40px -30px rgba(0,0,0,.35);
  background-image: repeating-linear-gradient(90deg, var(--sq-line) 0 5px, transparent 5px 10px), repeating-linear-gradient(180deg, var(--sq-line) 0 5px, transparent 5px 10px);
  background-size: 100% 1px, 1px 100%; background-position: center; background-repeat: no-repeat; display: grid; place-items: center; }
.ksq-c { font-size: calc(var(--size) * .8); line-height: 1; color: var(--ink); }
.ksq-svg { position: absolute; left: 4%; top: 4%; width: 92%; height: 92%; overflow: visible; visibility: hidden; }
.ksq.drawn .ksq-svg { visibility: visible; }
.ksq.drawn .ksq-c { visibility: hidden; }
.ksq-svg path { fill: none; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.ksq-ghost path { stroke: var(--ghost); }
.ksq-ink path { stroke: var(--ink); stroke-dasharray: 1 1; stroke-dashoffset: 1; visibility: hidden; }
.ksq-ink path.seal { stroke: var(--accent); }
.ksq-num text { font: 700 7px/1 var(--sys); fill: var(--accent); visibility: hidden; paint-order: stroke; stroke: var(--sq); stroke-width: 2px; }
.kplay { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.kplay[hidden] { display: none; }
.kbtn { min-height: 48px; padding: 10px 20px; border-radius: 999px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 700 16px/1.2 var(--sys); cursor: pointer; }
.kbtn:hover { background: var(--card); }
.kstory { position: relative; display: grid; gap: 6px; justify-items: center; width: 100%; max-width: 30rem; }
.ks-now { position: absolute; top: 0; left: 0; right: 0; margin: 0; font-size: 19px; font-weight: 700; line-height: 1.4; visibility: hidden; }
.ks-now .kl { font-size: 30px; line-height: 1.1; color: var(--accent); }
.kstory.telling .ks-now { visibility: visible; }
.kstory.telling .ks-end { visibility: hidden; }
.ks-end { display: grid; gap: 6px; justify-items: center; }
.ks-parts { font-size: 16px; line-height: 1.5; color: var(--soft); }
.ks-part { white-space: nowrap; }
.ks-parts .kl { font-size: 22px; color: var(--accent); }
.ks-head { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; justify-content: center; }
.ks-k { font-size: 32px; line-height: 1.2; }
.ks-label { font: 700 13px/1 var(--sys); padding: 6px 9px; border-radius: 8px; color: var(--accent); box-shadow: inset 0 0 0 1.5px currentColor; }
.ks-label.trick { color: var(--soft); }
.ks-line { font-size: 18px; line-height: 1.5; text-wrap: balance; }
.ks-line .kl { font-size: 1.1em; }
.ks-note { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--soft); max-width: 26rem; }
.kstory.told .ks-head, .kstory.told .ks-line { animation: ks-in .45s ease-out both; }
@keyframes ks-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kstory.told .ks-head, .kstory.told .ks-line { animation: none; } }
.kp-info { display: grid; gap: 16px; align-content: start; min-width: 0; }
.kp-info h2 { font-size: clamp(24px, 3.4vw, 30px); }
.kfacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.kfacts div { display: grid; gap: 2px; min-width: 0; }
.kfacts .wide { grid-column: 1 / -1; }
.kfacts dt { font: 700 12px/1.3 var(--sys); letter-spacing: .07em; text-transform: uppercase; color: var(--soft); }
.kfacts dd { margin: 0; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.kfacts a { color: inherit; text-decoration-color: var(--line); }
.kreads { display: grid; gap: 8px; }
.kread { border-radius: 14px; background: var(--sq); border: 1.5px solid var(--line); }
.kread summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 16px; min-height: 48px; border-radius: 14px; }
.kread summary::-webkit-details-marker { display: none; }
.kread summary:hover { background: var(--card); }
.kr-name { color: var(--soft); font-size: 15px; }
.kr-term { font-size: 13px; }
.kr-kana { font-size: 24px; line-height: 1.25; }
.kr-ro { font-weight: 700; }
.kread .chev { margin-left: auto; align-self: center; color: var(--soft); font-weight: 700; transition: transform .15s ease; }
.kread[open] .chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .kread .chev { transition: none; } }
.kread > p { padding: 0 16px 14px; font-size: 16px; line-height: 1.55; color: var(--soft); }
.kread > p .kl { font-size: 1.15em; color: var(--ink); }
.kr-hint { font-size: 14px; color: var(--soft); }
.kword { padding: 14px 18px; border-radius: 16px; background: var(--sq); border: 1.5px solid var(--line); display: grid; gap: 2px; }
.kw-label { font: 700 12px/1.3 var(--sys); letter-spacing: .07em; text-transform: uppercase; color: var(--soft); }
.kw-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.kw-w { font-size: 32px; line-height: 1.3; white-space: nowrap; }
.kw-read { color: var(--soft); font-size: 15px; }
.kw-read .kl { font-size: 18px; }
.kw-en { font-size: 16px; }
.kp-more { display: grid; gap: 32px; padding-block: 40px 64px; }
.kp-more > * { max-width: 820px; width: 100%; }
.kp-more .cta-widget { margin-top: 0 !important; max-width: 820px; }
.kp-more .cta-widget .cta-title { font-size: 22px; }
.kp-more .byline { margin-top: 0 !important; }
.kparts, .kquiz { padding: 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 14px; }
.kparts h2, .kquiz h2 { font-size: clamp(22px, 3vw, 26px); }
.kchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kchip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 5px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--sq); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; line-height: 1.3; }
.kchip .kl { font-size: 22px; line-height: 1.2; color: var(--accent); }
a.kchip:hover { border-color: var(--accent); }
.kchip.plain { border-color: transparent; background: none; font-weight: 400; padding-inline: 4px; }
.kchip .chev { color: var(--soft); }
.kp-hint { font-size: 14px; color: var(--soft); }
.kused { display: grid; gap: 8px; margin-top: 6px; }
.ku-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; justify-content: space-between; }
.kparts .ku-head h2, .kparts .ku-head h3 { font: 700 15px/1.4 var(--sys); color: var(--soft); letter-spacing: 0; }
.ku-head .kl { font-size: 22px; color: var(--accent); margin-right: 4px; }
.ku-all { font-weight: 700; font-size: 15px; }
.ktiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.ktiles li { min-width: 0; }
.ktile { display: grid; justify-items: center; align-content: center; gap: 2px; height: 100%; min-height: 80px; padding: 8px 4px; border-radius: 12px; background: var(--sq); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; text-align: center; }
.ktile:hover { border-color: var(--accent); }
.ktile.here { border-color: var(--accent); }
.kti-c { font-size: 30px; line-height: 1.15; }
.kti-m { font-size: 12px; line-height: 1.25; color: var(--soft); hyphens: auto; overflow-wrap: anywhere; }
.ktiles.big { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.ktiles.big .ktile { min-height: 96px; }
.ktiles.big .kti-c { font-size: 36px; }
.ktiles.big .kti-m { font-size: 13px; }
@media (max-width: 400px) { .ktiles.big { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; } }
.kq { display: grid; gap: 10px; }
.kq + .kq { border-top: 1px solid var(--line); padding-top: 18px; }
.kq-p { font-weight: 700; font-size: 18px; line-height: 1.45; }
.kq-p .kl { font-size: 1.35em; font-weight: 400; }
.kq-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .kq-opts { grid-template-columns: minmax(0, 1fr); } }
.kq-o { min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--sq); color: var(--ink); font: 600 16px/1.35 var(--sys); text-align: left; cursor: pointer; }
.kq-o .kl { font-size: 20px; font-weight: 400; }
.kq-o .kq-ro { font-weight: 700; }
.kq-o .kq-t { color: var(--soft); font-weight: 400; font-size: 14px; }
.kq-o:hover { border-color: var(--ink); }
.kq-o[aria-disabled="true"] { cursor: default; }
.kq-o[aria-disabled="true"]:hover { border-color: var(--line); }
.kq-o.is-right, .kq-o.is-right:hover { background: var(--ok); color: var(--ok-ink); border-color: var(--ok); }
.kq-o.is-right .kq-t { color: inherit; }
.kq-o.is-wrong, .kq-o.is-wrong:hover { border-color: var(--accent); color: var(--accent); }
.kq-fb { min-height: 1.5em; font-size: 16px; line-height: 1.5; }
.kq.is-no .kq-fb { color: var(--soft); }
.kq-fb .kl { font-size: 1.15em; }
.kquiz[hidden] { display: none; }
.kpager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.kpg { display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; min-width: 0; }
.kpg:hover { border-color: var(--accent); }
.kpg .kl { font-size: 30px; line-height: 1; }
.kpg span:not(.kl) { display: grid; font-size: 15px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.kpg small { color: var(--soft); font: 700 11px/1.3 var(--sys); letter-spacing: .07em; text-transform: uppercase; }
.kp-prev { justify-self: start; }
.kp-next { justify-self: end; text-align: right; flex-direction: row-reverse; }
.kp-all { font-weight: 700; font-size: 15px; text-align: center; padding: 8px; }
@media (max-width: 560px) { .kpager { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .kp-all { grid-column: 1 / -1; grid-row: 2; } }
.cta-widget .w-glyph.kl { font-size: 62px; line-height: 1; color: #1C1B1A; }

/* the index, the parts and the part families */
.kx { display: grid; gap: 12px; padding-block: 8px 72px; }
.kx-test { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; padding: 22px 24px; border-radius: 22px; background: var(--night); color: var(--night-ink); }
.kx-test h2 { font-size: clamp(22px, 3vw, 26px); color: var(--night-ink); }
.kx-test p { color: var(--night-soft); margin-top: 4px; }
.kx-sec { padding-block: 28px 8px; display: grid; gap: 10px; }
.kx-n { font: 700 15px/1 var(--sys); color: var(--soft); vertical-align: middle; margin-left: 6px; }
.kx-intro { color: var(--soft); max-width: 46rem; }
.kx-note { margin-top: 28px; }
.ptiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.ptile { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 12px; min-height: 72px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ptile:hover { border-color: var(--accent); }
.pt-c { grid-row: 1 / span 2; font-size: 40px; line-height: 1.2; color: var(--accent); text-align: center; }
.pt-m { font-weight: 700; font-size: 15px; line-height: 1.3; align-self: end; overflow-wrap: anywhere; }
.pt-n { font-size: 13px; color: var(--soft); align-self: start; }
.kf-head .wrap { gap: 14px; }
.kf-hero { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: center; }
.kf-part { display: grid; place-items: center; flex: none; width: 128px; height: 128px; border-radius: 22px; background: var(--sq); box-shadow: inset 0 0 0 1.5px var(--sq-line); font-size: 92px; line-height: 1; color: var(--accent); }
.kf-text { display: grid; gap: 10px; flex: 1 1 280px; min-width: 0; }
.kf-text h1 { font-size: clamp(30px, 5vw, 46px); }
.kf-text .lead { max-width: 46ch; font-size: 19px; }
.kf-note { color: var(--soft); max-width: 46rem; }
.kf-note .kl, .kx-intro .kl { font-size: 1.2em; color: var(--ink); }
.kf { display: grid; gap: 8px; padding-block: 8px 72px; }
.kf-sec { padding-block: 22px 6px; display: grid; gap: 12px; }
.kf-sec h2 { font-size: clamp(22px, 3.2vw, 28px); }
.kf-sec h2 .kl { color: var(--accent); }
.kf-cta { margin-top: 36px; display: grid; gap: 14px; justify-items: start; padding: 22px 24px; border-radius: 22px; background: var(--night); color: var(--night-soft); }
.kf-cta p { max-width: 46rem; }

/* the kanji test */
.kt { display: grid; gap: 40px; padding-block: 8px 72px; }
.ktest { max-width: 640px; width: 100%; padding: 24px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); scroll-margin-top: 84px; }
.kt-view { display: grid; gap: 16px; }
.kt-view[hidden] { display: none; }
.kt-start .btn[disabled] { opacity: .55; cursor: wait; }
.kt-levels { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.kt-levels li { padding: 4px 10px; border-radius: 999px; font: 700 13px/1.4 var(--sys); color: var(--soft); box-shadow: inset 0 0 0 1.5px var(--line); }
.kt-levels li.done { color: var(--ok-ink); background: var(--ok); box-shadow: none; }
.kt-levels li.now { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.kt-count { font-size: 15px; color: var(--soft); }
.kt-sq { justify-self: center; width: 168px; height: 168px; border-radius: 10px; display: grid; place-items: center; background-color: var(--sq); box-shadow: inset 0 0 0 1.5px var(--sq-line);
  background-image: repeating-linear-gradient(90deg, var(--sq-line) 0 5px, transparent 5px 10px), repeating-linear-gradient(180deg, var(--sq-line) 0 5px, transparent 5px 10px);
  background-size: 100% 1px, 1px 100%; background-position: center; background-repeat: no-repeat; }
.kt-sq .kl { font-size: 128px; line-height: 1; }
.kt-ask { font-size: clamp(22px, 3.4vw, 26px); text-align: center; }
.kt-ask:focus { outline: none; }
.kt-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .kt-opts { grid-template-columns: minmax(0, 1fr); } }
.kt-o, .kt-idk { min-height: 52px; padding: 10px 14px; border-radius: 14px; font: 600 17px/1.3 var(--sys); cursor: pointer; }
.kt-o { border: 1.5px solid var(--line); background: var(--sq); color: var(--ink); text-align: left; }
.kt-o:hover { border-color: var(--ink); }
.kt-idk { justify-self: center; border: 0; background: none; color: var(--soft); text-decoration: underline; text-underline-offset: 3px; min-width: 160px; }
.kt-o[aria-disabled="true"], .kt-idk[aria-disabled="true"] { cursor: default; }
.kt-o.is-right, .kt-o.is-right:hover { background: var(--ok); color: var(--ok-ink); border-color: var(--ok); }
.kt-o.is-wrong, .kt-o.is-wrong:hover { border-color: var(--accent); color: var(--accent); }
.kt-fb { min-height: 1.6em; text-align: center; font-weight: 700; }
.kt-fb.is-no { color: var(--soft); }
.kt-big { font-size: clamp(30px, 5.4vw, 44px); }
.kt-big:focus { outline: none; }
.kt-of { color: var(--soft); }
.kt-level { font-weight: 700; font-size: 18px; }
.kt-table { border-collapse: collapse; width: 100%; font-size: 16px; }
.kt-table th, .kt-table td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.kt-table thead th { font: 700 12px/1.3 var(--sys); text-transform: uppercase; letter-spacing: .06em; color: var(--soft); background: var(--bg2); }
.kt-table tr:last-child th, .kt-table tr:last-child td { border-bottom: 0; }
.kt-how { color: var(--soft); font-size: 16px; }
.kt-shared { font-size: 15px; color: var(--soft); overflow-wrap: anywhere; }
.kt-about { display: grid; gap: 14px; max-width: 720px; }
.kt-about h2 { font-size: clamp(24px, 3.6vw, 30px); }

/* the home page box */
.home-kanji { padding-block: 0 72px; }
.hk-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px 40px; align-items: center; padding: 28px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); }
.hk-card .copy { display: grid; gap: 12px; }
.hk-card .copy p { color: var(--soft); font-size: 17px; }
@media (max-width: 860px) { .hk-card { grid-template-columns: minmax(0, 1fr); padding: 22px; } }
.hk-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hk-tile { display: grid; justify-items: center; gap: 8px; padding: 12px 6px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; text-align: center; }
.hk-tile:hover { border-color: var(--accent); }
.hk-tile .lc-glyph { width: 64px; height: 64px; }
.hk-tile .lc-glyph svg { width: 50px; height: 50px; }
.hk-m { font-size: 14px; color: var(--soft); }

/* guide tables: each kanji links to its page, its lesson under it */
.ktable td.kt-k .kt-stack { display: inline-grid; justify-items: center; gap: 2px; }
.ktable td.kt-k a.kt-page { display: inline-block; padding: 2px 4px; }
.ktable td.kt-k a.kt-lesson { display: inline-block; padding: 6px 4px; text-decoration: none; }
.ktable td.kt-k a.kt-lesson:hover, .ktable td.kt-k a.kt-page:hover .kt-char { color: var(--accent); }
