/* Latin text (with Turkish and other European letters) uses Source Serif 4 and Be Vietnam Pro;
   the Japanese fonts draw kana and kanji, which they do far better. */
@font-face { font-family: 'Source Serif 4'; font-weight: 600; font-display: swap; src: url('/fonts/source-serif-4-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-weight: 600; font-display: swap; src: url('/fonts/source-serif-4-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 400; font-display: swap; src: url('/fonts/be-vietnam-pro-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 400; font-display: swap; src: url('/fonts/be-vietnam-pro-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 700; font-display: swap; src: url('/fonts/be-vietnam-pro-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 700; font-display: swap; src: url('/fonts/be-vietnam-pro-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Shippori Mincho'; font-weight: 700; font-display: swap; src: url('/fonts/ShipporiMincho-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 400; font-display: swap; src: url('/fonts/ZenKakuGothicNew-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 700; font-display: swap; src: url('/fonts/ZenKakuGothicNew-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Klee One'; font-weight: 600; font-display: swap; src: url('/fonts/KleeOne-SemiBold.woff2') format('woff2'); }

:root {
  --paper: #f4efe6;
  --sheet: #fbf8f2;
  --sunken: #e9e0d0;
  --ink: #22201c;
  --muted: #5c564c;
  --line: #ddd3c2;
  --grid: #d3c7b3;
  --guide: #e3d9c8;
  --seal: #b5432d;
  --indigo: #2e4868;
  --display: 'Source Serif 4', 'Shippori Mincho', 'Hiragino Mincho ProN', serif;
  --body: 'Be Vietnam Pro', 'Zen Kaku Gothic New', system-ui, sans-serif;
  --kana: 'Klee One', 'Hiragino Maru Gothic ProN', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--body);
}
a { color: var(--indigo); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; font-family: var(--display); font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding-block: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 21px var(--display); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--seal); color: #fbf8f2; display: grid; place-items: center; font: 600 21px var(--kana); }
.lang { position: relative; font-size: 15px; color: var(--muted); }
.lang summary { cursor: pointer; list-style: none; padding: 6px 2px; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ' ▾'; font-size: 12px; }
.lang nav { position: absolute; right: 0; top: 100%; z-index: 10; display: flex; flex-direction: column; min-width: 190px; padding: 6px; background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.lang nav a, .lang nav span { padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.lang a { color: var(--muted); text-decoration: none; }
.lang a:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.lang [aria-current] { color: var(--ink); font-weight: 700; }
:lang(ko) { word-break: keep-all; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding-block: 48px 88px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 58px); letter-spacing: -0.01em; }
.hero .lead { margin-top: 20px; font-size: 19px; color: var(--muted); max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; border-radius: 14px; background: var(--ink); color: var(--sheet); font-weight: 700; text-decoration: none; }
.btn:hover { background: #3a3630; }
.note { font-size: 15px; color: var(--muted); }

/* The practice cell */
.cell-wrap { justify-self: center; width: 100%; max-width: 380px; }
.cell { position: relative; aspect-ratio: 1; background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; }
.cell svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cross { stroke: var(--grid); stroke-width: 0.5; stroke-dasharray: 2 2; fill: none; }
.model { stroke: var(--guide); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ink { stroke: var(--ink); stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.start { fill: var(--seal); }
.start-n { fill: #fbf8f2; font: 700 4.2px var(--body); text-anchor: middle; dominant-baseline: central; }
.seal {
  position: absolute; right: -14px; bottom: -14px; width: 86px; height: 86px; border-radius: 50%;
  border: 3px solid var(--seal); color: var(--seal); background: var(--paper);
  display: grid; place-items: center; font: 700 31px 'Shippori Mincho', serif; transform: rotate(-8deg);
}
.cell-caption { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 15px; color: var(--muted); }
.replay { font: inherit; color: var(--indigo); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Drawing animation, played once on load and on "Watch again" */
.play .ink { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s cubic-bezier(.5,0,.3,1) forwards; }
.play .ink.s2 { animation-delay: 1.0s; }
.play .ink.s3 { animation-delay: 2.0s; animation-duration: 1.5s; }
.play .seal { opacity: 0; animation: stamp 0.35s ease-out 3.7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes stamp { from { opacity: 0; transform: rotate(-8deg) scale(1.5); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .play .ink, .play .seal { animation: none; stroke-dashoffset: 0; opacity: 1; }
}

/* Sections */
section { padding: 72px 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(28px, 3.6vw, 38px); max-width: 22em; }
section .intro { margin-top: 14px; color: var(--muted); max-width: 36em; }

.steps { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: step; }
.steps li { counter-increment: step; }
.mini { position: relative; aspect-ratio: 1; max-width: 200px; background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; }
.mini svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mini .seal { width: 56px; height: 56px; font-size: 20px; right: -10px; bottom: -10px; border-width: 2px; }
.steps h3 { margin-top: 22px; font-size: 21px; }
.steps h3::before { content: counter(step) '. '; color: var(--seal); }
.steps p { margin-top: 8px; color: var(--muted); max-width: 22em; }

.checks { margin: 40px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 48px; }
.checks div { border-left: 2px solid var(--seal); padding-left: 18px; }
.checks dt { font-weight: 700; }
.checks dd { margin: 6px 0 0; color: var(--muted); }

.chart { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.chart span { aspect-ratio: 1; display: grid; place-items: center; background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; font: 600 25px var(--kana); }
.chart-note { margin-top: 18px; font-size: 15px; color: var(--muted); }

.coming { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; align-items: center; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 15px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { color: var(--muted); }

/* Legal pages */
.doc { max-width: 768px; padding-block: 32px 80px; }
.doc h1 { font-size: clamp(32px, 4.4vw, 44px); }
.doc .updated { margin-top: 10px; color: var(--muted); font-size: 15px; }
.doc h2 { font-size: 24px; margin-top: 44px; }
.doc p, .doc ul { margin-top: 14px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-block: 24px 64px; }
  .cell-wrap { max-width: 320px; }
  .steps { grid-template-columns: 1fr; gap: 44px; }
  .mini { max-width: 180px; }
  .checks { grid-template-columns: 1fr; }
  .coming { grid-template-columns: 1fr; }
  section { padding: 56px 0; }
}
