/* Grow — ink, paper and the trigram colours. Upright serif, never italic. */
:root {
  --bg: #0E0D0B; --card: #16140F; --card2: #1E1B15;
  --text: #EDE6D6; --dim: #8C8474; --line: #2B2721; --line2: #3A352C;
  --kun: #C99A3A; --tg: var(--kun);
  --serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --han: 'Noto Serif SC', 'Noto Serif CJK SC', 'Songti SC', 'STSong', 'SimSun', serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-style: normal; }
html, body { background: var(--bg); color: var(--text); font-family: var(--serif); -webkit-tap-highlight-color: transparent; }
body {
  background: radial-gradient(90% 40% at 50% -8%, rgba(201, 154, 58, 0.10) 0%, rgba(14, 13, 11, 0) 70%) no-repeat, var(--bg);
  min-height: 100vh;
}
#app { max-width: 520px; margin: 0 auto; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
button { font-family: var(--serif); background: var(--card2); color: var(--text); border: 1px solid var(--line2); border-radius: 3px; padding: 10px 14px; font-size: 0.95rem; min-height: 44px; cursor: pointer; }
button.primary { background: var(--tg); color: #0E0D0B; border-color: var(--tg); font-weight: 600; letter-spacing: 0.06em; }
button.ghost { background: transparent; }
.dim { color: var(--dim); font-size: 0.85rem; }
.small { font-size: 0.8rem; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; }
.head { display: flex; align-items: baseline; gap: 10px; }
.zh { font-family: var(--han); font-weight: 600; color: var(--tg); }
.head .zh { font-size: 2rem; line-height: 1; }
h1 { font-size: 1.15rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; }
h2 { font-size: 0.78rem; color: var(--dim); font-weight: 600; margin-bottom: 8px; letter-spacing: 0.16em; text-transform: uppercase; }
.lang { min-height: 38px; padding: 0 12px; font-size: 0.78rem; letter-spacing: 0.16em; color: var(--dim); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 14px; margin: 10px 0; }
.hex { display: flex; gap: 18px; align-items: center; }
.hex .glyph { font-size: 3.4rem; line-height: 1; color: var(--tg); }
.hex p { margin-top: 6px; line-height: 1.5; }
.intro { margin-top: 12px; line-height: 1.5; text-wrap: pretty; }

.row { border-left: 3px solid var(--tg); cursor: pointer; padding: 12px 14px; }
.row:focus-visible { outline: 1px solid var(--tg); outline-offset: 2px; }
.row .title { display: flex; align-items: center; font-size: 1.02rem; }
.row .title .zh { font-size: 1.15rem; margin-right: 10px; }
.row .sub { margin-top: 4px; line-height: 1.45; text-wrap: pretty; }
.row .tgc { color: var(--dim); }

.care { margin: 16px 2px 6px; line-height: 1.5; text-wrap: pretty; }
.free { margin: 10px 2px 0; text-align: center; letter-spacing: 0.04em; }

/* A tapped row opens like a window: it grows out of its row and fills the screen; Done shrinks it back. */
html.focus-open, html.focus-open body { overflow: hidden; }
.focus {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--bg); max-width: 520px; margin: 0 auto;
  animation: focus-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.focus.leaving { animation: focus-out 220ms cubic-bezier(0.22, 1, 0.36, 1) both; pointer-events: none; }
@keyframes focus-in { from { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 0)) scale(0.3); } }
@keyframes focus-out { to { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 0)) scale(0.3); } }
.focus-bar { display: flex; align-items: center; padding: 10px 12px 0; padding-top: max(10px, env(safe-area-inset-top)); }
.focus-back { min-height: 44px; border: none; color: var(--dim); letter-spacing: 0.12em; padding: 0 8px; background: transparent; }
.focus-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; }
.focus-foot { padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.focus-done { width: 100%; min-height: 48px; letter-spacing: 0.22em; text-transform: uppercase; }
.focus .head { margin-top: 6px; }
.core { margin: 12px 0 4px; line-height: 1.55; text-wrap: pretty; }
.points { border-left: 3px solid var(--tg); }
.point + .point { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.point .t { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tg); margin-bottom: 4px; }
.point .x { font-size: 0.95rem; line-height: 1.55; text-wrap: pretty; }

.stage { position: relative; height: 150px; display: grid; place-items: center; margin: 6px 0 10px; }
.ring {
  position: absolute; width: 132px; height: 132px; border-radius: 50%;
  border: 1.5px solid var(--tg); background: color-mix(in srgb, var(--tg) 14%, transparent);
  transform: scale(0.55); transition: transform var(--dur, 4s) ease-in-out;
}
.ring.in { transform: scale(1); }
.word { position: relative; text-align: center; letter-spacing: 0.16em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .focus, .focus.leaving { animation: none; } .ring { transition: none; } }
