/* ===========================================================================
   Mr.Wang Chinese — Hanzi skill pages
   ---------------------------------------------------------------------------
   Shared styles for the four focused-practice courses that hang off
   hanzi.html: strokes.html, components.html, writing.html, origins.html.

   Same design family as assets/area-page.css (Lora display + Outfit UI, sand /
   white banding, 1200px measure), plus the three sections those pages do not
   need: the syllabus scope list, the worked lesson walkthrough, and a
   reference table for content that is closed enough to publish today.

   Accent comes from the body class:
     <body class="skill-page sk-strokes">

   Two accent tokens on purpose: --sk-accent is a MARK — the status dot, the
   scope bullets, the gallery hover edge — and --sk-accent-ink is TYPE, and so
   it is also what fills the solid button. Small white text never sits on a
   mark.

   COLOUR COMES FROM assets/theme.css. The --sk-* names below are unchanged;
   they are now aliases of --t-* tokens, so every rule further down still reads
   the name it always read. Two of them cross over: --sk-line is the LIGHTER
   hairline here and --sk-line-soft the darker, the opposite of what the theme's
   names suggest, so they are mapped by value rather than by name.

   The four courses used to be four unrelated hues — green, teal, slate, rose —
   a fifth categorical four-way system on a site that has four area hues, all
   of them already spoken for. These four courses all sit INSIDE the Characters
   area, so they are re-encoded as four steps of the Characters green, in the
   order hanzi.html lists them. Same information, and now the wayfinding is
   true: these four belong to Characters.

   Load after style.css and site-nav.css, and after assets/theme.css.
   =========================================================================== */

body.skill-page {
  --sk-ink:       var(--t-ink);
  --sk-muted:     var(--t-muted);
  /* DECORATION ONLY, 2.6:1. It is now used by exactly one rule — the
     aria-hidden arrow in .sk-path. Everything it used to colour that was
     actually text takes --t-muted instead; see .sk-eyebrow. */
  --sk-soft:      var(--t-faint);
  --sk-body:      var(--t-ink-2);
  --sk-line:      var(--t-line-soft);   /* the lighter hairline — see header */
  --sk-line-soft: var(--t-line);        /* the heavier one, despite the name  */
  --sk-sand:      var(--t-sand);
  /* Declared in the original and referenced by nothing, here or in any page or
     script. Left in place, aliased, rather than deleted. */
  --sk-green:     var(--t-green);

  --sk-ui:      var(--t-ui);
  --sk-display: var(--t-display);
  --sk-hanzi:   var(--t-chinese);

  margin: 0;
  color: var(--sk-ink);
  background: var(--t-white);
}

/* The four courses, as four steps of the Characters green: strokes →
   components → writing → origins, the order hanzi.html lists them in.

   The tint and the accent deepen monotonically down the four, so the ramp
   reads as a sequence rather than as four categories (the accent-ink has one
   documented exception, below):
     tint       #e9f6ee → #dcece2 → #d4eddd → #a9d3bd
     accent     #3d9163 → #2f7d52 → #256b43 → #215c3b
     accent-ink #256b43 → #215c3b → #2c4738 → #24503a

   Every accent-ink is now the on-colour the theme computed for the surface it
   actually sits on. The last two used to be crossed: writing wore
   --t-step-2-ink on a wash that is not step 2, origins wore --t-step-1-ink on
   a wash that IS step 2. Measured on their own tints, in course order:
   5.79 / 6.45 / 8.21 / 5.58. On white, where every accent-ink also sets small
   type and fills the solid button under white: 6.44 / 7.90 / 10.17 / 9.20.
   (Writing's wash, --t-area-char-tint2 #d4eddd, is 1.01:1 from --t-step-1
   #dcece2, so --t-step-1-ink is its computed on-colour within a rounding
   error: 8.21 here against 8.30 on step 1 itself. Components keeps
   --t-green-deep, §2's brand green rather than a step name, at 6.45.)

   The ink deepens over the first three and then lifts by 1.11:1 at origins,
   because the theme's own --t-step-1-ink (#2c4738) is darker than
   --t-step-2-ink (#24503a). Pairing every wash with its computed on-colour
   and deepening the ink monotonically cannot both hold here; the pairing
   wins. The 1.11:1 is invisible — it is 11-14px type on four separate pages,
   never side by side — and the ordinal signal a reader does see, the tint and
   the accent, is strictly monotonic in both.

   --sk-tint is not mapped straight onto --t-step-1..4: it is a full-bleed
   WASH that carries dark body copy in six places (the hero, the 综合测试
   card, the path pills, the lesson panel, the table head, the ask panel), and
   --t-step-3/--t-step-4 are a mid and a deep green meant to be chips with
   white on them. So the wash advances only as far as it can while staying
   readable, and the step is carried mainly by the depth of the accent. */
body.sk-strokes    { --sk-accent: var(--t-area-char-mark); --sk-accent-ink: var(--t-area-char-ink); --sk-tint: var(--t-area-char-tint); }
body.sk-components { --sk-accent: var(--t-green);          --sk-accent-ink: var(--t-green-deep);    --sk-tint: var(--t-step-1); }
body.sk-writing    { --sk-accent: var(--t-area-char-ink);  --sk-accent-ink: var(--t-step-1-ink);    --sk-tint: var(--t-area-char-tint2); }
body.sk-origins    { --sk-accent: var(--t-green-deep);     --sk-accent-ink: var(--t-step-2-ink);    --sk-tint: var(--t-step-2); }

.sk-main { font-family: var(--sk-ui); }
.sk-main *, .sk-main *::before, .sk-main *::after { box-sizing: border-box; }
/* :where() carries zero specificity: this reset still beats the browser
   default link colour, but loses to every class rule. As a plain descendant
   selector it was (0,1,1) and silently ate the text colour of every filled
   button — a dark pill rendered ink-on-ink, with the label invisible. */
:where(.sk-main) a { color: inherit; text-decoration: none; }
.sk-main button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ── Banding ──────────────────────────────────────────────────────────────── */
.sk-section { padding: 5rem 1.5rem; }
.sk-wrap    { max-width: 1200px; margin: 0 auto; }
@media (min-width: 768px)  { .sk-section { padding-left: 3rem; padding-right: 3rem; } }
@media (min-width: 1024px) { .sk-section { padding-left: 5rem; padding-right: 5rem; } }
.sk-sand { background: var(--sk-sand); }

/* Was --sk-soft (#9ca3af) — 2.5:1, on 12px uppercase type that names the
   section. --t-muted is the token for a label: 5.2:1 on white, 4.7:1 on sand,
   and inside the hero this is overridden to --sk-accent-ink anyway. */
.sk-eyebrow {
  margin: 0 0 1.25rem;
  color: var(--t-muted);
  font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
}
.sk-h2 {
  margin: 0;
  font-family: var(--sk-display);
  font-size: 2rem; font-weight: 700; line-height: 1.25;
  color: var(--sk-ink);
}
@media (min-width: 768px) { .sk-h2 { font-size: 2.5rem; } }
.sk-lede {
  max-width: 46rem; margin: 1.25rem 0 0;
  color: var(--sk-muted); font-size: 1.0625rem; font-weight: 300; line-height: 1.7;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.sk-hero { background: var(--sk-tint); border-bottom: 1px solid var(--sk-line); }
.sk-hero .sk-eyebrow { color: var(--sk-accent-ink); }
.sk-hero h1 {
  margin: 0;
  font-family: var(--sk-display);
  font-size: 2.75rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em;
  color: var(--sk-ink);
}
@media (min-width: 768px) { .sk-hero h1 { font-size: 3.75rem; } }
.sk-hero h1 span {
  display: block; margin-top: .375rem;
  font-family: var(--sk-hanzi); font-size: .4em; font-weight: 400;
  color: var(--sk-accent-ink); letter-spacing: .06em;
}
.sk-hero .sk-lede { color: var(--sk-body); font-size: 1.125rem; }

.sk-status {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.75rem; padding: .5rem 1rem; border-radius: var(--t-r-pill);
  /* Both literals kept: the theme has no translucent-white surface and no
     hairline this faint, and either one made opaque would stop the pill
     reading as frosted glass over the hero tint. */
  background: rgba(255, 255, 255, .82); border: 1px solid rgba(15, 23, 42, .07);
  font-size: .8125rem; font-weight: 500; color: var(--sk-body);
}
.sk-status i { flex-shrink: 0; width: .4375rem; height: .4375rem; border-radius: var(--t-r-pill); background: var(--sk-accent); }

.sk-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.75rem; }
.sk-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .875rem 1.75rem; border-radius: var(--t-r-pill);
  font-size: .875rem; font-weight: 500;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
/* The fill is --sk-accent-ink, not --sk-accent: this pill carries small white
   text, and a mark-weight green under white text is 3.5:1. */
.sk-btn-solid { background: var(--sk-accent-ink); color: var(--t-white); }
.sk-btn-solid:hover { background: var(--sk-ink); color: var(--t-white); }
.sk-btn-outline { border: 1px solid var(--t-action-edge); color: var(--sk-body); }
.sk-btn-outline:hover { border-color: var(--sk-ink); color: var(--sk-ink); }

/* ── "Not the same thing as…" callout ─────────────────────────────────────── */
.sk-distinction {
  display: flex; gap: 1rem; align-items: flex-start;
  max-width: 46rem; margin-top: 2.5rem;
  padding: 1.25rem 1.5rem; border-radius: 1rem;
  background: var(--t-white); border: 1px solid var(--sk-line-soft);
}
.sk-distinction b {
  flex-shrink: 0;
  font-size: .625rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sk-accent-ink); padding-top: .1875rem;
}
.sk-distinction p { margin: 0; color: var(--sk-body); font-size: .9375rem; font-weight: 300; line-height: 1.65; }

/* ── Scope: what the course covers ────────────────────────────────────────── */
.sk-scope { display: grid; gap: .625rem; margin-top: 2.5rem; }
@media (min-width: 640px)  { .sk-scope { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .sk-scope { grid-template-columns: repeat(3, 1fr); } }
.sk-scope li {
  display: flex; gap: .625rem; align-items: baseline;
  padding: .75rem 1rem; border-radius: .75rem;
  background: var(--t-white); border: 1px solid var(--sk-line-soft);
  list-style: none;
}
.sk-scope li::before {
  content: ""; flex-shrink: 0;
  width: .375rem; height: .375rem; border-radius: var(--t-r-pill);
  background: var(--sk-accent); transform: translateY(-.15rem);
}
.sk-scope b     { font-size: .875rem; font-weight: 500; color: var(--sk-ink); }
.sk-scope small { display: block; margin-top: .125rem; font-family: var(--sk-hanzi); font-size: .8125rem; color: var(--sk-muted); }
.sk-sand .sk-scope li { background: var(--t-white); }

/* ── Modules: the course categories ───────────────────────────────────────── */
.sk-modules { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 640px)  { .sk-modules { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .sk-modules { grid-template-columns: repeat(3, 1fr); } }

.sk-module {
  display: flex; flex-direction: column;
  padding: 1.5rem; border-radius: var(--t-r-md);
  background: var(--t-white); border: 1px solid var(--sk-line-soft);
}
.sk-module-n {
  margin-bottom: .875rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em;
  color: var(--sk-accent-ink);
}
.sk-module h3 {
  margin: 0 0 .25rem;
  font-family: var(--sk-display); font-size: 1.0625rem; font-weight: 700; line-height: 1.3;
  color: var(--sk-ink);
}
.sk-module .zh {
  display: block; margin-bottom: .625rem;
  font-family: var(--sk-hanzi); font-size: .875rem; color: var(--sk-accent-ink);
}
.sk-module p { margin: 0; color: var(--sk-muted); font-size: .875rem; font-weight: 300; line-height: 1.65; }
/* The final module on each page is the综合测试 — mark it, do not hide it. */
.sk-module.is-test { background: var(--sk-tint); border-color: transparent; }
/* On white, --sk-muted at .875rem/300 is 5.42:1. On the four washes it is
   4.88 / 4.43 / 4.38 / 3.29 — three of the four courses fail, origins badly.
   Body ink instead: 9.29 / 8.43 / 8.34 / 6.27. */
.sk-module.is-test p { color: var(--t-ink-2); }

/* ── Learning path arrows ─────────────────────────────────────────────────── */
.sk-path {
  display: flex; flex-wrap: wrap; align-items: center; gap: .625rem;
  margin-top: 2.5rem; padding: 0; list-style: none;
}
.sk-path li {
  padding: .5rem 1rem; border-radius: var(--t-r-pill);
  background: var(--sk-tint); color: var(--sk-accent-ink);
  font-size: .875rem; font-weight: 500;
}
.sk-path li.sep {
  padding: 0; background: none; color: var(--sk-soft); font-weight: 400;
}

/* ── Worked lesson walkthrough ────────────────────────────────────────────── */
.sk-lesson { display: grid; gap: 2.5rem; margin-top: 2.5rem; align-items: start; }
@media (min-width: 900px) { .sk-lesson { grid-template-columns: 15rem 1fr; } }

.sk-lesson-subject {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem;
  padding: 2rem 1rem; border-radius: var(--t-r-md);
  background: var(--sk-tint);
}
/* A 田字格 behind the glyph — the grid the site's worksheets already use. */
.sk-lesson-glyph {
  position: relative;
  width: 8.5rem; height: 8.5rem;
  display: flex; align-items: center; justify-content: center;
  /* A real 田字格, so it takes the paper tokens the worksheets print with —
     and keeps their promise that the cell frame reads stronger than the inner
     guide (2.05:1 vs 1.45:1 on paper). The two slate rgba()s it replaces were
     .12 and .1, i.e. all but identical, which let the guide read as the box. */
  border: 1px solid var(--t-grid-border); border-radius: .5rem;
  background: var(--t-paper);
}
.sk-lesson-glyph::before,
.sk-lesson-glyph::after {
  content: ""; position: absolute; background: var(--t-grid-guide);
}
.sk-lesson-glyph::before { left: 0; right: 0; top: 50%; height: 1px; }
.sk-lesson-glyph::after  { top: 0; bottom: 0; left: 50%; width: 1px; }
.sk-lesson-glyph span {
  position: relative;
  font-family: var(--sk-hanzi); font-size: 4.5rem; line-height: 1; color: var(--sk-ink);
}
.sk-lesson-label { font-size: .875rem; color: var(--sk-accent-ink); font-weight: 500; text-align: center; }

.sk-steps { margin: 0; padding: 0; list-style: none; counter-reset: sk-step; }
.sk-steps li {
  position: relative;
  padding: 0 0 1.25rem 2.75rem;
  counter-increment: sk-step;
}
.sk-steps li::before {
  content: counter(sk-step, decimal-leading-zero);
  position: absolute; left: 0; top: .0625rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em;
  color: var(--sk-accent-ink);
}
/* The connecting rail — stops before the last step. */
.sk-steps li::after {
  content: ""; position: absolute; left: .5625rem; top: 1.375rem; bottom: .1875rem;
  width: 1px; background: var(--sk-line-soft);
}
.sk-steps li:last-child { padding-bottom: 0; }
.sk-steps li:last-child::after { display: none; }
.sk-steps b     { display: block; font-size: .9375rem; font-weight: 600; color: var(--sk-ink); }
.sk-steps small { display: block; margin-top: .1875rem; font-size: .875rem; font-weight: 300; line-height: 1.6; color: var(--sk-muted); }

/* ── Reference table (real content, publishable today) ────────────────────── */
.sk-table-note { max-width: 46rem; margin: 1rem 0 0; color: var(--sk-muted); font-size: .9375rem; font-weight: 300; line-height: 1.65; }
/* Wide tables scroll in their own box — the page body must never scroll sideways. */
.sk-table-scroll { margin-top: 2rem; overflow-x: auto; border: 1px solid var(--sk-line-soft); border-radius: var(--t-r-md); background: var(--t-white); }
.sk-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.sk-table th {
  padding: .875rem 1.25rem; text-align: left; white-space: nowrap;
  background: var(--sk-tint);
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sk-accent-ink);
}
.sk-table td { padding: .875rem 1.25rem; border-top: 1px solid var(--sk-line-soft); color: var(--sk-body); vertical-align: middle; }
.sk-table tr td:first-child {
  font-family: var(--sk-hanzi); font-size: 1.75rem; line-height: 1; color: var(--sk-ink);
  width: 1%; white-space: nowrap;
}
.sk-table td.zh { font-family: var(--sk-hanzi); color: var(--sk-ink); }

/* ── Stroke gallery ───────────────────────────────────────────────────────── */
.sk-gallery-group { margin-top: 2.5rem; }
.sk-gallery-group h3 {
  display: flex; align-items: baseline; gap: .5rem;
  margin: 0 0 1rem; padding-bottom: .625rem;
  border-bottom: 1px solid var(--sk-line-soft);
  font-family: var(--sk-display); font-size: 1rem; font-weight: 700; color: var(--sk-ink);
}
.sk-gallery-group h3 span { font-family: var(--sk-hanzi); font-size: .9375rem; font-weight: 400; color: var(--sk-accent-ink); }
.sk-gallery-group h3 em {
  margin-left: auto;
  /* The stroke count — information, not decoration, so --t-muted not
     --t-faint. It was 2.6:1. */
  font-style: normal; font-size: .75rem; font-weight: 500; color: var(--t-muted);
}

.sk-gallery {
  display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
}
.sk-gallery li {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1rem .625rem; border-radius: 1rem;
  background: var(--t-white); border: 1px solid var(--sk-line-soft);
  transition: border-color .15s ease, transform .15s ease;
}
.sk-gallery li:hover { border-color: var(--sk-accent); transform: translateY(-2px); }
.sk-gallery img {
  width: 4rem; height: 4rem; display: block; margin-bottom: .625rem;
  object-fit: contain;
}
.sk-gallery b     { font-family: var(--sk-hanzi); font-size: 1rem; font-weight: 600; color: var(--sk-ink); line-height: 1.2; }
.sk-gallery small { margin-top: .1875rem; font-size: .8125rem; color: var(--sk-accent-ink); }
.sk-gallery span  { margin-top: .25rem; font-size: .75rem; font-weight: 300; line-height: 1.35; color: var(--sk-muted); }

/* ── Tools that exist today ───────────────────────────────────────────────── */
.sk-tools { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 768px) { .sk-tools { grid-template-columns: repeat(3, 1fr); } }
.sk-tool {
  display: flex; flex-direction: column;
  padding: 1.5rem; border-radius: var(--t-r-md);
  background: var(--t-white); border: 1px solid var(--sk-line);
  transition: transform .2s ease, box-shadow .2s ease;
}
.sk-tool:hover {
  transform: translateY(-2px);
  box-shadow: var(--t-sh-2);
}
.sk-tool h3 { margin: 0 0 .375rem; font-family: var(--sk-display); font-size: 1.0625rem; font-weight: 700; color: var(--sk-ink); }
.sk-tool p  { flex: 1; margin: 0 0 1rem; color: var(--sk-muted); font-size: .875rem; font-weight: 300; line-height: 1.6; }
.sk-tool span {
  display: inline-flex; align-items: center; gap: .375rem;
  font-size: .875rem; font-weight: 500; color: var(--sk-accent-ink);
  transition: gap .2s ease;
}
.sk-tool:hover span { gap: .625rem; }

/* ── Ask ──────────────────────────────────────────────────────────────────── */
.sk-ask { padding: 3.5rem 2.5rem; border-radius: 1.5rem; background: var(--sk-tint); text-align: center; }
@media (min-width: 768px) { .sk-ask { padding-left: 5rem; padding-right: 5rem; } }
.sk-ask .sk-h2 { font-size: 1.75rem; }
.sk-ask p { max-width: 34rem; margin: .875rem auto 1.75rem; color: var(--sk-body); font-weight: 300; line-height: 1.7; }

/* ── Sibling skills ───────────────────────────────────────────────────────── */
.sk-siblings { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 768px) { .sk-siblings { grid-template-columns: repeat(4, 1fr); } }
.sk-siblings a {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 1rem 1.25rem; border-radius: 1rem;
  background: var(--sk-sand);
  font-size: .9375rem; font-weight: 500; color: var(--sk-ink);
  transition: background .15s ease;
}
.sk-siblings a:hover { background: var(--t-sunk); }
/* The Chinese name of the sibling course — text, so --t-muted. It was 2.6:1. */
.sk-siblings a em { font-style: normal; color: var(--t-muted); font-weight: 400; font-size: .8125rem; }

@media print {
  .sk-actions, .sk-ask, .sk-siblings, .sk-status { display: none !important; }
  .sk-table-scroll { overflow: visible; }
}
