/* 複寫練習 / Trace & Write website.
   Colours follow the app (lib/app_theme.dart); the practice grids are the
   app's red lines (lib/widgets/paper.dart). Headings use LXGW WenKai TC, cut
   down to the characters on these pages (tool/build_site_font.py).
   Light only, like the app. */

/* font:begin  written by tool/build_site_font.py */
@font-face { font-family: "PP WenKai"; src: url("fonts/wenkai-1.woff2") format("woff2"); font-display: swap; unicode-range: U+20,U+21,U+22,U+23,U+24,U+25,U+26,U+27,U+28,U+29,U+2A,U+2B,U+2C,U+2D,U+2E,U+2F,U+30,U+31,U+32,U+33,U+34,U+35,U+36,U+37,U+38,U+39,U+3A,U+3B,U+3C,U+3D,U+3E,U+3F,U+40,U+41,U+42,U+43,U+44,U+45,U+46,U+47,U+48,U+49,U+4A,U+4B,U+4C,U+4D,U+4E,U+4F,U+50,U+51,U+52,U+53,U+54,U+55,U+56,U+57,U+58,U+59,U+5A,U+5B,U+5C,U+5D,U+5E,U+5F,U+60,U+61,U+62,U+63,U+64,U+65,U+66,U+67,U+68,U+69,U+6A,U+6B,U+6C,U+6D,U+6E,U+6F,U+70,U+71,U+72,U+73,U+74,U+75,U+76,U+77,U+78,U+79,U+7A,U+7B,U+7C,U+7D,U+7E,U+D7,U+2014,U+2026,U+3001,U+3002,U+300C,U+300D,U+300E,U+300F,U+30FB,U+4E00,U+4E09,U+4E0B,U+4E0D,U+4E4B,U+4E4E,U+4E5D,U+4E94,U+4E9B,U+4EA6,U+4ECA,U+4F60,U+500B,U+505A,U+5148,U+516B,U+5207,U+53EA,U+53EF,U+5510,U+554F,U+559C,U+5716,U+5728,U+591A,U+5929,U+5958,U+597D,U+5B57,U+5B78,U+5B8C,U+5BAE,U+5BEB,U+5C31,U+5DF1,U+5E16,U+5E2B,U+5E95,U+5EA6,U+5F35,U+5F71,U+5F97,U+5FC3,U+60F3,U+6210,U+6216,U+624B,U+6253,U+6284,U+628A,U+62CD,U+6307,U+6311,U+63CF,U+6536,U+653F,U+6642,U+6709,U+672C,U+683C,U+6A5F,U+6B0A,U+6B21,U+6B61,U+6B65,U+6BCF,U+6BDB,U+6C38,U+6CD5,U+6CE2,U+6DF1,U+6ED1,U+7167,U+7247,U+7384,U+7528,U+7530,U+7559,U+756B,U+7576,U+7684,U+7686,U+770B,U+786C,U+79C1,U+7A2E,U+7A7A,U+7B46,U+7B56,U+7C73,U+7D19,U+7D93,U+7DF4,U+7F85,U+7FD2,U+800C,U+80FD,U+81EA,U+822C,U+82E5,U+82E6,U+83E9,U+8457,U+85A9,U+85CF,U+860A,U+871C,U+884C,U+88E1,U+8907,U+898B,U+89C0,U+8AAA,U+8B6F,U+9019,U+9032,U+904E,U+9084,U+90E8,U+90FD,U+958B,U+96B1,U+9EDE,U+9F20,U+FF01,U+FF08,U+FF09,U+FF0C,U+FF1A,U+FF1B,U+FF1F,U+FF5E; }
/* font:end */

:root {
  --paper: #faf7eb;
  --desk: #e2edeb;
  --panel: #fffdf6;
  --panel-2: #f1f6f5;
  --line: #d9e3df;
  --line-soft: #e6ece8;
  --ink: #17363a;
  --ink-2: #4d6d70;
  --ink-3: #7b9497;
  --accent: #2e808a;
  --accent-strong: #236a73;
  --accent-ink: #1f646c;
  --accent-light: #79cbca;
  --accent-soft: #d5efee;
  --on-accent: #f4fbfa;
  --cinnabar: #c8372d;
  --grid: rgba(217, 83, 79, .6);
  --model: #c9d3d0;
  --hz-ink: #1e1e1e;
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 22px;
  --shadow-card: 0 1px 2px rgba(23, 54, 58, .05), 0 18px 40px -22px rgba(23, 70, 72, .38);
  --shadow-phone: 0 1px 2px rgba(23, 54, 58, .08), 0 32px 60px -26px rgba(23, 70, 72, .5);
  --header-h: 60px;
  --font-latin: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --font-sans: var(--font-latin), "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-kai: "PP WenKai", "LXGW WenKai TC", "BiauKai", "Kaiti TC", "DFKai-SB", "標楷體", serif;
  --font-display: var(--font-kai);
  --lh: 1.85;
  /* "only": browsers that darken pages on their own (Chrome's auto dark mode)
     would leave the ink dark on dark paper. */
  color-scheme: only light;
}
:lang(en) { --font-sans: var(--font-latin), sans-serif; --lh: 1.6; }

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 12px);
}
html, [lang] { font-family: var(--font-sans); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-size: 1rem;
  line-height: var(--lh);
  /* Rice paper: a faint wash of the app's desk colour at the top. */
  background:
    radial-gradient(1200px 520px at 85% -120px, rgba(121, 203, 202, .22), rgba(121, 203, 202, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, 0) 900px),
    var(--paper);
  overflow-x: hidden;
}
.i18n-pending body { visibility: hidden; }
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: env(safe-area-inset-top, 0px);
  background: var(--paper);
}

img { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2.5px solid var(--accent-strong); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(46, 128, 138, .2); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  max-width: 1152px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 12px; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: .03em;
  line-height: 1.35;
  text-wrap: balance;
}
:lang(en) .display, .display:lang(en) { letter-spacing: 0; line-height: 1.25; }
.wordmark { font-family: var(--font-kai); letter-spacing: .04em; white-space: nowrap; }
:lang(en) .wordmark { letter-spacing: 0; }

/* -- header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  height: var(--header-h);
  background: rgba(250, 247, 235, .78);
  -webkit-backdrop-filter: saturate(1.3) blur(16px);
  backdrop-filter: saturate(1.3) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background-color .25s;
}
.site-header.is-scrolled { background: rgba(250, 247, 235, .92); border-bottom-color: var(--line); }
/* The sticky bars sit inside html's scroll-padding: without this, Tab to a link
   in them would scroll the page up to "uncover" it, again at every press. */
.site-header *, .policy-tabs * { scroll-margin-top: calc(-1 * (var(--header-h) + env(safe-area-inset-top, 0px) + 72px)); }
.header-row { height: 100%; display: flex; align-items: center; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--accent-strong); }
.brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 1px 2px rgba(23, 54, 58, .16); }
.brand .wordmark { font-size: 1.125rem; }

.header-nav { display: none; gap: 2px; }
.header-nav a {
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .9375rem;
  text-decoration: none;
  white-space: nowrap;
}
.header-nav a:hover { color: var(--ink); background: rgba(46, 128, 138, .1); }
@media (min-width: 820px) { .header-nav { display: flex; } }

.header-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 246, .75);
}
.lang-tabs button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: .8125rem;
  line-height: 1.6;
  white-space: nowrap;
  cursor: pointer;
}
.lang-tabs button:hover { color: var(--ink); }
.lang-tabs button[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s;
}
.btn:hover { background: var(--ink); color: var(--on-accent); }
.btn-small { height: 36px; padding: 0 16px; font-size: .875rem; }
@media (max-width: 379px) { .btn-small { display: none; } }

/* -- shared bits: grids, sheets, written characters ---------------------- */

/* A practice square with the app's red lines: solid border, dashed guides. */
.grid-box {
  position: relative;
  aspect-ratio: 1;
  border: 1.5px solid var(--grid);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.grid-box.tian { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M50 0V100M0 50H100' fill='none' stroke='%23d9534f' stroke-opacity='.6' stroke-width='1' stroke-dasharray='2.5 2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
.grid-box.mi { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M50 0V100M0 50H100M0 0 100 100M100 0 0 100' fill='none' stroke='%23d9534f' stroke-opacity='.6' stroke-width='1' stroke-dasharray='2.5 2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
.grid-box.nine { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M33.3 0V100M66.7 0V100M0 33.3H100M0 66.7H100' fill='none' stroke='%23d9534f' stroke-opacity='.6' stroke-width='1' stroke-dasharray='2.5 2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
.on-dark .grid-box { border-color: rgba(255, 138, 128, .6); }
.on-dark .grid-box.nine { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M33.3 0V100M66.7 0V100M0 33.3H100M0 66.7H100' fill='none' stroke='%23ff8a80' stroke-opacity='.6' stroke-width='1' stroke-dasharray='2.5 2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }

/* A character written stroke by stroke (site.js builds the inside). */
.hz { position: absolute; inset: 5%; width: 90%; height: 90%; overflow: visible; pointer-events: none; }
.hz-model path { fill: var(--model); }
.hz-sweep { fill: none; stroke: var(--hz-ink); stroke-linecap: round; stroke-linejoin: round; }
.hz-nib { pointer-events: none; transition: opacity .3s; }
.hz.shaky .hz-sweep { stroke: #59696b; }
.hz.shaky .hz-model { display: none; }

/* A sheet of paper laid on the desk. */
.sheet {
  position: relative;
  background: var(--panel);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(23, 54, 58, .05), 0 1px 2px rgba(23, 54, 58, .06), 0 24px 48px -28px rgba(23, 70, 72, .5);
}

/* The numbers 01 to 05, drawn with a pen. */
.feature-no { position: relative; margin: 0 0 14px; color: var(--accent-ink); font-family: var(--font-kai); font-size: 2.6rem; line-height: 1; letter-spacing: .06em; }
.feature-no.is-drawn { width: 84px; height: 66px; }
.no-ink { position: absolute; left: -4px; top: 0; width: 84px; height: 66px; overflow: visible; }
.no-ink .stroke { fill: none; stroke: var(--accent); stroke-width: 7.5; stroke-linecap: round; stroke-linejoin: round; }
.no-ink .swash { fill: none; stroke: var(--accent-light); stroke-width: 4; stroke-linecap: round; opacity: .7; }

/* -- hero ----------------------------------------------------------------- */

.hero { padding: clamp(28px, 6vw, 72px) 0 clamp(36px, 6vw, 64px); }
.hero-grid { display: grid; gap: clamp(36px, 6vw, 56px); align-items: center; }
.kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--accent-ink); font-size: .9375rem; }
.kicker .wordmark { font-size: 1.0625rem; }
.kicker-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .55; }
.hero-title { margin: 0 0 22px; font-size: clamp(2.3rem, 1.6rem + 3.4vw, 3.9rem); line-height: 1.25; }
.hero-title:lang(en) { font-size: clamp(2.1rem, 1.5rem + 2.8vw, 3.4rem); }
.lead { max-width: 33rem; margin: 0 0 30px; color: var(--ink-2); font-size: 1.125rem; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
  height: 56px;
  padding: 0 18px 0 14px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.store-btn .icon { width: 26px; height: 26px; }
.store-text { display: flex; flex-direction: column; line-height: 1.2; }
.store-text small { font-size: .6875rem; opacity: .78; }
.store-name { font-size: 1.0625rem; font-weight: 600; }
.store-btn.is-soon { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); cursor: default; }
.hero-note { margin: 16px 0 0; color: var(--ink-3); font-size: .875rem; }

.hero-art { position: relative; display: flex; justify-content: center; padding: 8px 0 24px; }
.sheet-hero { width: min(100%, 400px); padding: clamp(20px, 5vw, 36px); transform: rotate(1.4deg); }
.sheet-hero .grid-box { width: 100%; background-color: #fffefa; }
.sheet-caption { margin: 16px 0 0; color: var(--ink-2); font-family: var(--font-kai); font-size: 1rem; text-align: center; }
.inks { position: absolute; left: 50%; bottom: -6px; display: flex; gap: 10px; margin: 0; padding: 10px 14px; list-style: none; border-radius: 999px; background: var(--panel); box-shadow: var(--shadow-card); transform: translateX(-50%) rotate(-2deg); }
.inks li { width: 20px; height: 20px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.inks li:first-child { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

/* -- try it ---------------------------------------------------------------- */

.section-head { max-width: 40rem; margin: 0 auto; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--accent-ink); font-size: .875rem; font-weight: 600; letter-spacing: .12em; }
.section-head h2, .privacy-card h2, .download h2 { margin: 0 0 14px; font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.6rem); }
.section-head p:last-child { margin: 0; color: var(--ink-2); font-size: 1.0625rem; }

.try { padding-top: clamp(40px, 6vw, 72px); }
.try-card {
  display: grid;
  gap: 22px;
  justify-items: center;
  max-width: 880px;
  margin: clamp(28px, 4vw, 44px) auto 0;
  padding: clamp(18px, 3.6vw, 36px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  background: rgba(255, 253, 246, .92);
  box-shadow: var(--shadow-card);
}
.try-pad { width: min(100%, 420px); background-color: #fffefa; touch-action: none; cursor: crosshair; }
.try-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.try-pad .hz-demo { z-index: 2; }
.try-pad .hz-demo .hz-model { display: none; }
.try-tools { display: grid; gap: 16px; justify-items: center; align-content: center; width: 100%; }
.seg { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); }
.seg button, .chip {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: .9375rem;
  cursor: pointer;
}
.seg button .icon, .chip .icon { width: 19px; height: 19px; }
.seg button[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-accent); }
.try-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.chip:hover { border-color: var(--accent-light); }
.chip:disabled { opacity: .5; cursor: default; }
.try-private { margin: 0; color: var(--ink-3); font-size: .8125rem; text-align: center; }
@media (min-width: 760px) {
  .try-card { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: center; }
  .try-tools { justify-items: start; }
  .try-private { text-align: left; }
}

/* -- features ---------------------------------------------------------------- */

.features { padding-top: clamp(56px, 8vw, 96px); overflow-x: clip; }
.feature {
  display: grid;
  gap: 36px;
  align-items: center;
  align-content: center;
  padding-block: clamp(48px, 8vw, 96px);
}
.feature-copy { max-width: 31rem; }
.feature h3 { margin: 0 0 18px; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); }
.feature h3:lang(en) { font-size: clamp(1.45rem, 1.1rem + 1.1vw, 1.95rem); }
/* As wide as its words, so the pen takes as long as the line is long. */
.feature h3 .ink-line { display: block; width: fit-content; max-width: 100%; }
.feature-copy > p:last-child { margin: 0; color: var(--ink-2); font-size: 1.0625rem; }
.feature-art { --w: clamp(210px, 58vw, 270px); display: flex; justify-content: center; }

@media (min-width: 880px) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); }
  .feature.is-flipped .feature-copy { order: 2; }
  .feature-copy { justify-self: center; }
}

/* 02 to 05: sheets of paper. */
.feature.feature-card {
  position: relative;
  isolation: isolate;
  padding-inline: clamp(20px, 4.5vw, 56px);
}
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffefa, #fcf9ef);
  box-shadow: inset 0 0 0 1px rgba(23, 54, 58, .05), 0 1px 2px rgba(23, 54, 58, .06), 0 24px 48px -28px rgba(23, 70, 72, .45);
  transform: rotate(.5deg);
}
.feature-card.is-flipped::before { transform: rotate(-.6deg); }

/* The deck. Its stage stays pinned under the header while the page scrolls
   on; at each step the card on top fades away and the next one is written in
   (site.js adds .deck-live, sets --stage-top, --stage-h, --card-h, --fit and
   --track, and runs the pen). Without it the cards follow one another. */
.feature-deck { position: relative; }
.deck-card { padding-block: clamp(28px, 4.5vw, 56px); }
.deck-card + .deck-card { margin-top: clamp(20px, 3vw, 32px); }
@media (max-width: 879px) {
  .deck-card { gap: 22px; padding-block: 24px; }
  .feature-deck .feature-art { --w: clamp(160px, 44vw, 210px); }
  .feature-deck .feature h3 { margin-bottom: 12px; }
  .feature-deck .feature-copy > p:last-child { font-size: 1rem; }
  .feature-no { font-size: 2.1rem; }
  .feature-no.is-drawn, .no-ink { width: 68px; height: 54px; }
}
.deck-dots { display: none; }

.deck-live { height: var(--track); }
.deck-live .deck-stage {
  position: sticky;
  top: var(--stage-top);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  height: var(--stage-h);
}
.deck-live .deck-pile {
  position: relative;
  height: var(--card-h);
  transform: scale(var(--fit, 1));
}
.deck-live .deck-pile > .deck-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--card-h);
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* Each frame of a fade only changes opacity and a small shift: on layers of
   their own the card and its picture are not painted again for it. */
.deck-live .deck-pile > .deck-card,
.deck-live .deck-card .feature-art { will-change: opacity, transform; }
.deck-live .deck-pile > .deck-card.is-shown { opacity: 1; visibility: visible; }
.deck-live .deck-pile > .deck-card.is-top { pointer-events: auto; }
.deck-live .deck-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px));
}
.deck-dots button {
  appearance: none;
  -webkit-appearance: none;
  min-width: 40px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 246, .75);
  color: var(--ink-2);
  font: inherit;
  font-size: .75rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.deck-dots button:hover { color: var(--ink); border-color: var(--accent-light); }
.deck-dots button[aria-current="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
@media (max-width: 559px) {
  .deck-live .deck-dots { gap: 5px; padding-inline: 0 54px; }
  .deck-dots button { min-width: 34px; padding: 4px 6px; }
}

/* -- the app, drawn ------------------------------------------------------------ */

.phone {
  position: relative;
  width: var(--w);
  aspect-ratio: 9 / 17.6;
  margin: 0;
  padding: calc(var(--w) * .035);
  border-radius: calc(var(--w) * .14);
  background: #17363a;
  box-shadow: var(--shadow-phone);
  font-size: calc(var(--w) * .052);
  line-height: 1.4;
}
.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--w) * .11);
  background: var(--desk);
  font-family: var(--font-sans);
}
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.4em .9em .6em;
  color: var(--ink);
  font-weight: 600;
}
.app-bar .dots { width: 1em; height: .25em; background: radial-gradient(circle, var(--ink-2) 40%, transparent 45%) 0 0 / .34em .25em repeat-x; }
.app-bar .count { color: var(--ink-2); font-weight: 400; font-size: .85em; }

/* 01: free practice over a photo of a copybook. */
.canvas-area { position: relative; flex: 1; margin: 0 .5em; border-radius: .6em; overflow: hidden; background: var(--paper); }
.photo-copybook {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(122, 74, 42, .06) 1px, transparent 1px) 0 0 / 25% 100%,
    linear-gradient(160deg, #efe3c6, #e6d6b0);
}
.canvas-area .grid-box { position: absolute; left: 12%; top: 18%; width: 76%; border-color: rgba(217, 83, 79, .55); }
/* The copybook's own character, printed on the photo: the ink traces right over it. */
.canvas-area .hz-model path { fill: rgba(70, 45, 20, .5); }
.player {
  position: absolute;
  left: .6em;
  right: .6em;
  bottom: .6em;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .35em .6em;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  font-size: .8em;
}
.player .icon { width: 1.4em; height: 1.4em; }
.player .bar { flex: 1; height: .3em; border-radius: 1em; background: var(--line); }
.player .bar b { display: block; width: 38%; height: 100%; border-radius: inherit; background: var(--accent); }
.toolbar { display: flex; align-items: center; gap: .6em; padding: .7em .9em 1.4em; }
.toolbar .tool { width: 1.6em; height: 1.6em; border-radius: .45em; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.toolbar .tool.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.swatches { display: flex; gap: .35em; margin-left: auto; }
.swatches b { width: 1.1em; height: 1.1em; border-radius: 50%; background: var(--c); }

/* 02: framing a character on a worksheet, and the page it makes. */
.worksheet {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 .6em;
  padding: .4em;
  border-radius: .5em;
  background: linear-gradient(170deg, #f4f0e4, #e9e2cf);
  color: rgba(23, 54, 58, .7);
  font-family: var(--font-kai);
  font-size: 1.5em;
  line-height: 1.5;
  text-align: center;
}
.worksheet .frame { position: absolute; left: .27em; top: .27em; width: calc((100% - .54em) / 3); height: 1.5em; overflow: visible; }
.worksheet .frame path { fill: none; stroke: var(--accent); stroke-width: 2.5px; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
.maker-row { display: flex; align-items: center; justify-content: space-between; padding: .6em .7em; }
.pages { display: flex; gap: .3em; }
.pages i { width: 1.5em; height: 1.5em; border-radius: .25em; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.make-btn { padding: .3em 1em; border-radius: 999px; background: var(--accent); color: #fff; font-size: .85em; }
.page-view { flex: 1; display: grid; justify-items: center; align-content: center; gap: .3em; margin: 0 .6em 1em; border-radius: .6em; background: var(--paper); }
.page-view .grid-box { width: 70%; }
.page-no { margin: 0; color: var(--ink-3); font-size: .75em; }

/* 03: the Heart Sutra, one character at a time. */
.verse { margin: 0 .9em .5em; color: var(--ink-3); font-family: var(--font-kai); font-size: 1.05em; letter-spacing: .08em; }
.verse b { color: var(--cinnabar); font-weight: 400; }
.big-cell { width: calc(100% - 1.6em); margin: 0 .8em; background-color: var(--paper); }
.sutra-foot { display: flex; align-items: center; justify-content: space-between; gap: .6em; margin: auto .8em 1.3em; }
/* A little preview of the whole sheet: vertical columns, right to left. */
.sutra-mini {
  display: flex;
  flex-direction: row-reverse;
  gap: .25em;
  padding: .35em .4em;
  border-radius: .3em;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(217, 83, 79, .35);
  color: rgba(23, 54, 58, .32);
  font-family: var(--font-kai);
  font-size: .62em;
  line-height: 1.12;
}
.sutra-mini span { writing-mode: vertical-rl; }
.sutra-mini b { color: var(--ink); font-weight: 400; }
.next-btn { display: flex; align-items: center; gap: .5em; padding: .35em 1em; border-radius: 999px; background: var(--accent); color: #fff; font-size: .85em; }
.next-btn .ring { width: 1.1em; height: 1.1em; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-right-color: #fff; }

/* 04: three papers, three grids. */
.feature-art.papers { --w: clamp(240px, 70vw, 400px); position: relative; width: var(--w); height: calc(var(--w) * .92); margin-inline: auto; }
.papers .sheet { position: absolute; width: 50%; padding: 5% 5% 3%; color: var(--ink-2); font-size: calc(var(--w) * .036); text-align: center; }
.papers .sheet > span { display: block; margin-top: .5em; font-family: var(--font-kai); }
.papers .grid-box { width: 100%; }
.paper-white { left: 0; top: 0; transform: rotate(-4deg); }
.paper-xuan { left: 25%; top: 22%; z-index: 1; transform: rotate(2deg); background: #f1e6cc; }
.paper-ink { right: 0; top: 46%; z-index: 2; transform: rotate(-1.5deg); background: #2a2a2a; color: #d9d2c5; }
.paper-ink { --hz-ink: #fff; --model: #4a4a4a; }
.paper-ink .grid-box { border-color: rgba(255, 138, 128, .6); }
.paper-xuan { --model: #e2d3ae; }

/* 05: my practice. */
.streak { display: flex; align-items: center; gap: .7em; margin: 0 .8em; padding: .7em; border-radius: .7em; background: #fff; }
.goal { position: relative; width: 2.8em; height: 2.8em; flex: none; }
.goal svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal circle { fill: none; stroke: var(--accent-soft); stroke-width: 5; }
.goal circle.done { stroke: #e8833a; stroke-linecap: round; stroke-dasharray: .8 1; }
.goal b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .95em; }
.streak-big { margin: 0; font-weight: 600; font-size: .95em; }
.streak-sub { margin: 0; color: var(--ink-3); font-size: .72em; }
.heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: .18em; margin: .7em .8em 0; padding: .6em; border-radius: .7em; background: #fff; }
.heat i { aspect-ratio: 1; border-radius: .15em; background: #eef3f2; }
.heat i[data-l="1"] { background: #c3e6e4; }
.heat i[data-l="2"] { background: #79cbca; }
.heat i[data-l="3"] { background: #4fa3a6; }
.heat i[data-l="4"] { background: #2e808a; }
.growth-title { margin: .8em .9em .3em; font-weight: 600; font-size: .85em; }
.growth { display: grid; grid-template-columns: 1fr 1fr; gap: .5em; margin: 0 .8em; }
.growth > div { padding: .45em .45em .2em; border-radius: .6em; background: #fff; color: var(--ink-3); font-size: .7em; text-align: center; }
.growth .grid-box { width: 100%; background-color: var(--paper); }

/* -- more ------------------------------------------------------------------------ */

.more-title { margin: clamp(48px, 7vw, 80px) 0 22px; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem); text-align: center; }
.more { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.more li { padding: 22px; border: 1px solid var(--line-soft); border-radius: var(--radius-m); background: rgba(255, 253, 246, .9); }
.more .icon { color: var(--accent); }
.more h4 { margin: 10px 0 4px; font-size: 1.0625rem; }
.more p { margin: 0; color: var(--ink-2); font-size: .9375rem; }

/* -- privacy -------------------------------------------------------------------- */

.privacy { padding-top: clamp(64px, 9vw, 112px); }
.privacy-card {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--radius-l);
  background: var(--accent-soft);
  background: linear-gradient(160deg, #e1f3f2, #d2ecea);
  text-align: center;
}
.privacy-text { max-width: 36rem; margin: 0 auto 24px; color: var(--ink-2); font-size: 1.0625rem; }
.promises { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.promises li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .75); font-size: .9375rem; }
.promises .icon { width: 18px; height: 18px; color: var(--accent-strong); stroke-width: 2.2; }
.privacy-small { max-width: 34rem; margin: 0 auto 18px; color: var(--ink-2); font-size: .875rem; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.text-link .icon { width: 18px; height: 18px; transition: transform .2s; }
.text-link:hover .icon { transform: translateX(3px); }

/* -- faq ------------------------------------------------------------------------- */

.faq { padding-top: clamp(64px, 9vw, 112px); }
.faq-list { max-width: 760px; margin: clamp(24px, 4vw, 40px) auto 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 18px 36px 18px 2px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border: solid var(--ink-2);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { margin: 0 0 20px; padding-right: 36px; color: var(--ink-2); }

/* -- download ------------------------------------------------------------------- */

.download { padding: clamp(72px, 10vw, 128px) 0; text-align: center; }
.download .stores { justify-content: center; }
.download p { margin: 0 0 26px; color: var(--ink-2); }
.badge-icon { margin: 0 auto 22px; width: 140px; transform: rotate(-3deg); }
.badge-icon img { display: block; width: 140px; height: 140px; border-radius: 32px; box-shadow: var(--shadow-phone); }

/* -- footer ---------------------------------------------------------------------- */

.site-footer { padding: 28px 0 calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); color: var(--ink-2); font-size: .875rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.footer-brand img { border-radius: 6px; }
.footer-copy { color: var(--ink-3); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--ink-2); }
.footer-note { flex-basis: 100%; margin: 0; color: var(--ink-3); font-size: .8125rem; }

.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 246, .92);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top .icon { width: 20px; height: 20px; }

/* -- privacy policy page ------------------------------------------------------- */

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--ink-2); font-size: .9375rem; text-decoration: none; }
.back-link .icon { width: 18px; height: 18px; transform: rotate(180deg); }
.back-link:hover { color: var(--ink); }
.policy-tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h)); z-index: 40; padding: 10px 0; background: rgba(250, 247, 235, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tabs-row { display: flex; gap: 6px; max-width: 720px; margin-inline: auto; }
.tabs-row a { padding: 5px 14px; border-radius: 999px; color: var(--ink-2); font-size: .9375rem; text-decoration: none; }
.tabs-row a:hover { color: var(--ink); background: rgba(46, 128, 138, .08); }
.tabs-row a[aria-selected="true"] { background: var(--accent-strong); color: var(--on-accent); }
.policy-body { padding-block: clamp(32px, 6vw, 60px) clamp(64px, 9vw, 112px); }
.policy-body section { max-width: 720px; margin-inline: auto; scroll-margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 56px); }
.policy-body section:focus-visible { outline: none; }
.policy-body h1 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem); line-height: 1.3; }
.policy-body .date { margin: 0 0 28px; color: var(--ink-2); font-size: .875rem; }
.policy-body h2 { margin: 38px 0 8px; font-size: 1.125rem; line-height: 1.5; }
.policy-body p, .policy-body li { margin: 8px 0; }
.policy-body ul { padding-left: 1.3em; }
.policy-body li::marker { color: var(--accent); }
.policy-body strong { font-weight: 600; background: linear-gradient(transparent 58%, rgba(121, 203, 202, .45) 58%); }
.js .policy-body section { display: none; }
.js[data-lang="zh"] #policy-zh,
.js[data-lang="en"] #policy-en { display: block; }
html:not(.js) .policy-body section + section { margin-top: 56px; padding-top: 44px; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
