/* ===================================================================
   Chinese Name Helper 鈥?visual system

   闈掔摲 路 鏈卞嵃 路 鏇歌

   Three decisions hold this page up, and every rule below follows from
   them rather than from a component library.

   1. The ground is celadon, not cream.
   The previous sheet was a warm off-white 鈥?pleasant, and the exact same
   temperature as the competing site's ground. Two sites opening on the
   same colour is the one similarity a visitor registers before reading a
   word. Celadon (姹濈獞 / 褰遍潚) is a cool, pale green-grey: it is the one
   pale colour that is specifically Chinese rather than generically warm,
   so it separates the page from every other "paper" template while
   staying light enough to read on.

   2. Nothing is a pill and nothing floats.
   Rounded corners of 14鈥?6px plus a soft drop shadow on every card is the
   house style of a thousand generated landing pages. The page is built
   like a printed book instead: near-square corners, hairline rules, and
   separation carried by the rule rather than by the shadow. A shadow is
   reserved for things that are actually above the page.

   3. The Chinese element is the mechanic, not a sticker.
   No dragons, no brush-stroke banners, no lanterns. The culture is in the
   structure: a 鏈辨枃鍗?is the literal form a Chinese name takes on an
   object, so the sample characters on the home page are printed as seals
   rather than shown as chips; section breaks are ruled like a book's
   鐗堝績; the practice grid behind a character is a real 绫冲瓧鏍?with its
   diagonals, because that is the grid calligraphy is actually practised
   on.

   An earlier revision removed a near-black band, a masked grid, three
   colour washes and a watermark glyph behind the headline, on the grounds
   that they read as synthetic. That judgement stands 鈥?everything here is
   flat colour, hairlines and type. Texture was considered for the celadon
   and rejected: a crackle that is not drawn by hand reads as scratches,
   which is a worse failure than having none.
   =================================================================== */

:root {
  /* ink 鈥?榛? A cool pine black rather than a warm one: warm black on a cool
     ground looks like dirt, so the text carries the page's temperature too. */
  --ink:        #1f1a15;
  --ink-soft:   #453a31;
  --ink-mute:   #6b5d51;

  /* paper 鈥?celadon */
  --paper:      #f6f1e6;
  --paper-2:    #efe8da;
  --paper-3:    #e6dcc9;
  --paper-glow: #fffdf7;
  --card:       #fffdf9;
  --line:       #ded2bf;
  --line-2:     #c9b9a2;

  /* accents */
  --cinnabar:   #b23a2a;
  --cinnabar-2: #c8543c;
  --gold:       #8f7433;
  --gold-2:     #b8964a;
  --jade:       #2f6d59;
  --indigo:     #454a6b;
  --ok:         #2f6d59;

  /* Near-square, for the book reason above. 5px on a 300px card is a
     deliberate softening of the corner, not a rounded rectangle. */
  --radius:     5px;
  --radius-sm:  3px;
  --shadow-sm:  0 1px 1px rgba(31,26,21,.04);
  --shadow-md:  0 1px 2px rgba(31,26,21,.05), 0 10px 22px -18px rgba(31,26,21,.28);
  --shadow-lg:  0 2px 6px rgba(31,26,21,.06), 0 20px 40px -28px rgba(31,26,21,.32);

  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* No grain overlay and no colour washes. A full-viewport noise texture under a
   radial tint is the single most recognisable "generated" flourish, and at the
   opacity that makes it visible it also dirties every photograph and card on
   the page. Paper is a colour here, not an effect. */

/* The 鐗堝績. A printed Chinese page is enclosed by a faint ruled frame with a
   wider outer margin at the top and bottom, and that frame 鈥?not a shadow,
   not a gradient 鈥?is what tells the eye "this is a page". It is drawn as a
   fixed pseudo-element rather than on .wrap so it holds still while the page
   scrolls, and it is dropped below 820px where the viewport itself is the
   page edge. */
/* 四周双边 — the frame of a Chinese woodblock page is drawn twice: a heavier
   outer rule and a thinner inner one set a few millimetres inside it. One rule
   alone reads as a browser outline; the pair reads as a printed border, which
   is the whole difference. Both are drawn from the same hairline colour, so the
   frame stays quiet and only the doubling registers. */
body::before {
  content: "";
  position: fixed; inset: 12px;
  border: 1px solid var(--line);
  pointer-events: none; z-index: 0;
}
body::after {
  content: "";
  position: fixed; inset: 17px;
  border: 1px solid var(--line);
  opacity: .55;
  pointer-events: none; z-index: 0;
}
@media (max-width: 820px) {
  body::before, body::after { inset: 0; border: 0; }
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.wrap-narrow { max-width: 780px; }

a { color: var(--cinnabar); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: rgba(178,58,42,.16); }

/* ---------------- header ---------------- */
/* The header is a book's running head: the same celadon as the page, a
   hairline below it, and the mark to the left. It used to be translucent black
   glass, which on a pale page read as a phone status bar sitting on top of a
   website. */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(224,234,226,.9);
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 14px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--cinnabar); }
/* The mark is an SVG of the character's own outlines, so its glyph is centred
   by construction 鈥?a text glyph here depended on whichever serif the OS fell
   back to and sat ~1px low.

   The filled cinnabar plate and its inset highlight are gone. The plate made a
   solid red square the heaviest thing in a 62px header, and it was the same
   shape and colour as another site's icon. The border and the glyph now carry
   the colour, and the box itself is only a sizing frame. */
.brand-mark {
  width: 30px; height: 30px;
  flex: none;
  display: grid; place-items: center;
}
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-name { font-size: 16px; }
.brand-name em { font-style: normal; color: var(--ink-mute); font-weight: 400; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 13.5px; }
.site-nav a { color: var(--ink-soft); transition: color .16s; }
.site-nav a:hover { color: var(--cinnabar); text-decoration: none; }
.site-nav a[aria-current="true"] { color: var(--cinnabar); font-weight: 600; }

/* Marks a nav entry whose target is still English on a translated page.
   The reader is told before the click rather than after, which is the whole
   point; the marker must not look like a button or a flag, so it is plain
   small text in the muted ink, at normal weight. */
.site-nav .nav-en {
  margin-left: 4px;
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 400;
  letter-spacing: .02em;
}
.site-nav a:hover .nav-en { color: var(--cinnabar); }

/* language switcher (built by _i18n) */
.lang-menu { position: relative; font-size: 13px; flex: none; }
.lang-menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 3px;
  border: 1px solid var(--line-2);
  color: var(--ink-soft);
  transition: border-color .16s, color .16s, background .16s;
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover { color: var(--cinnabar); border-color: rgba(178,58,42,.4); background: var(--card); }
.lang-menu[open] > summary { color: var(--cinnabar); border-color: rgba(178,58,42,.45); background: var(--card); }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  display: flex; flex-direction: column; min-width: 150px; padding: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 4px; box-shadow: var(--shadow-md);
}
.lang-menu .lang-list a {
  padding: 7px 11px; border-radius: var(--radius-sm); font-size: 13px;
  color: var(--ink-soft);
}
.lang-menu .lang-list a:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.lang-menu .lang-list a[aria-current="true"] { color: var(--cinnabar); background: rgba(178,58,42,.07); font-weight: 600; }

/* ---------------- hero + page heads ---------------- */
/* Both are paper now. The only thing that marks them off is a hairline at the
   bottom and generous type. */
.hero, .page-head {
  position: relative;
  color: var(--ink);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero > .wrap, .page-head > .wrap { position: relative; z-index: 1; }

/* ---------------- hero ---------------- */
/* The hero is set as a page, not as a slide.
   Every generator landing page opens the same way: one centred column, label
   over heading over subhead over chips, everything symmetric, everything the
   same weight. That symmetry is the tell — no printed page has ever been
   centred like that. A Chinese book page is asymmetric by construction: a
   block of text against the margin, and the colophon (title, author, seal)
   stacked down the right-hand edge.

   So the hero is two columns. The prose sits left against the margin, ragged
   right, the way body text sets. The five sample seals stand down the right
   edge as a vertical colophon, hung from a cinnabar rule, read top to bottom.
   The asymmetry is the design, and it is the same grammar the inner pages use
   with their 界格 rule — one hand drew both. */
.hero { padding: 62px 0 58px; text-align: left; }
.page-head { padding: 50px 0 46px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
  gap: 44px;
}
.hero-lede { min-width: 0; }

/* The colophon rule. A seal column in a book hangs from a hairline; without it
   five loose squares read as a chip row again, just rotated. */
.hero-show {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  gap: 9px;
  padding: 10px 0 0;
  border-left: 1px solid var(--line);
}
.hero-show::before {
  content: "";
  position: absolute; left: -1px; top: 0; width: 1px; height: 46px;
  background: var(--cinnabar); opacity: .7;
}

/* 界格 — the ruled column guide on a manuscript.
   Every inner page (characters, gifts, gift detail) opens on a page-head, and
   they all used to open with the same left-aligned eyebrow and the same
   40-character headline on the same flat ground. A vertical cinnabar rule hung
   down the right edge, ending in a small tick, gives those pages a fixed piece
   of furniture the home page does not have — so an inner page is recognisable
   as an inner page before a single word is read. It is purely ornament, so it
   is drawn on ::after and disappears on a phone where the edge is the viewport. */
.page-head > .wrap { position: relative; }
.page-head > .wrap::after {
  content: "";
  position: absolute; right: 20px; top: 6px; bottom: 6px;
  width: 1px; background: var(--cinnabar); opacity: .3;
  pointer-events: none;
}
.page-head > .wrap::before {
  content: "";
  position: absolute; right: 16px; bottom: 0; width: 9px; height: 1px;
  background: var(--cinnabar); opacity: .5;
  pointer-events: none;
}
@media (max-width: 820px) {
  .page-head > .wrap::after, .page-head > .wrap::before { display: none; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-mute); margin-bottom: 18px; font-weight: 600;
}
/* A short rule before the label, not a pill with a border and a backdrop blur.
   The pill made every page look like a product launch slide. */
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--cinnabar); opacity: .7;
}

h1.hero-title {
  font-family: var(--serif);
  font-size: clamp(31px, 5.2vw, 52px);
  line-height: 1.14; letter-spacing: -.026em;
  margin: 0 0 18px; font-weight: 600;
}
.page-head h1.hero-title { font-size: clamp(27px, 4.1vw, 41px); margin-bottom: 14px; }
.page-head .hero-sub { margin: 0; text-align: left; }

/* A gradient-filled headline is the single most generated-looking thing on a
   page. Cinnabar, flat, is what a seal actually prints. */
h1.hero-title .accent { color: var(--cinnabar); }

/* Hero prose sets ragged right against the left margin, like body copy. The
   600px measure is the readable column width, not a centre line. */
.hero-sub {
  font-size: clamp(15px, 1.8vw, 17px); color: var(--ink-soft);
  max-width: 600px; margin: 0 0 10px;
}
.page-head .hero-sub { color: var(--ink-soft); max-width: 660px; }
.hero-note { font-size: 13.5px; color: var(--ink-mute); margin: 0; max-width: 560px; }
.hero-note b { color: var(--ink-soft); font-weight: 600; }

/* ---- sample seals ----
   These five characters used to be rounded white chips with a soft shadow and a
   hover lift 鈥?a card deck, i.e. the same object as every feature grid on every
   marketing page. They are now 鏈辨枃鍗? bare cinnabar-on-celadon, a 2px frame, a
   seal-script cut of the character inside, and a tiny pinyin in the corner
   where a real seal carries its side inscription (杈规).

   The shadow is gone on purpose. A seal is pressed flat onto paper; a shadow
   under one says "floating UI element", which is the opposite of what the
   object means. The slight rotation is the only imperfection, and it is what
   keeps five identical boxes from reading as a diagram. */
/* ---- sample seals ----
   These five characters used to be rounded white chips with a soft shadow and a
   hover lift — a card deck, i.e. the same object as every feature grid on every
   marketing page. They are now 朱文印: bare cinnabar-on-celadon, a 2px frame, a
   seal-script cut of the character inside, and a tiny pinyin in the corner
   where a real seal carries its side inscription (邊款).

   The shadow is gone on purpose. A seal is pressed flat onto paper; a shadow
   under one says "floating UI element", which is the opposite of what the
   object means. The slight rotation is the only imperfection, and it is what
   keeps five identical boxes from reading as a diagram. */
.hero-show .hs {
  --r: 0deg;
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0;
  width: 50px; height: 50px;
  padding: 0;
  background: transparent;
  border: 2px solid var(--cinnabar);
  border-radius: 3px;
  color: var(--cinnabar);
  transform: rotate(var(--r));
  transition: background .2s, color .2s;
  /* The press. A seal is not a card that fades in — it is an object lowered onto
     paper and pushed. Each one comes down slightly oversized and a touch
     rotated, then settles: that reads as contact, where a fade-up reads as a
     tooltip appearing. Staggered by 90ms so five of them land in sequence
     rather than all at once, which is also how someone would stamp a sheet.
     `backwards` fill covers the delay; the rotation lives in --r so the
     animation and the resting transform cannot fight each other. */
  animation: pressIn .46s cubic-bezier(.2,.9,.25,1) backwards;
}
/* The inner cut. A 朱文印 is carved, not drawn: the frame is a thin wall with a
   shadow of itself inside it. One hairline at 28% turns the border from a CSS
   box into something pressed into paper. */
.hero-show .hs::before {
  content: ""; position: absolute; inset: 2px;
  border: 1px solid currentColor; opacity: .28; border-radius: 1px;
}
/* The 杈规: the pinyin sits in the top-left corner of the field, small and
   letter-spaced, the way a seal's side inscription is carved. */
.hero-show .hs i {
  position: absolute; top: 3px; left: 4px;
  font-style: normal; font-size: 6px; letter-spacing: .06em;
  opacity: .78; text-transform: lowercase; line-height: 1;
}
.hero-show .hs b {
  font-family: var(--serif); font-size: 21px; font-weight: 500;
  line-height: 1; color: inherit;
}
.hero-show .hs:hover { background: var(--cinnabar); color: var(--paper-glow); }
.hero-show .hs:hover::before { opacity: .45; }
.hero-show .hs:nth-child(1) { --r: -2.2deg; animation-delay: .28s; }
.hero-show .hs:nth-child(2) { --r: 1.4deg; animation-delay: .37s; }
.hero-show .hs:nth-child(3) { --r: -.8deg; animation-delay: .46s; }
.hero-show .hs:nth-child(4) { --r: 2.4deg; animation-delay: .55s; }
.hero-show .hs:nth-child(5) { --r: -1.6deg; animation-delay: .64s; }
@keyframes pressIn {
  from { opacity: 0; transform: rotate(var(--r)) scale(1.42); }
  55%  { opacity: 1; }
  to   { opacity: 1; transform: rotate(var(--r)) scale(1); }
}

/* A band whose content is a tool rather than a headline (character pages). */
.page-head-hz { padding: 26px 0 34px; }
.crumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-mute); margin-bottom: 20px;
}
.crumb a { color: var(--ink-soft); }
.crumb a:hover { color: var(--cinnabar); text-decoration: none; }
.hz-hint { font-size: 12.5px; color: var(--ink-mute); margin: 0; }

/* Cards that used to break up out of the ink band. There is no dark band to
   break out of any more, so this is now plain spacing 鈥?kept as a class because
   five generators emit it and a negative margin would put the card on top of
   the breadcrumb. */
.pull-up { position: relative; z-index: 1; margin-top: 30px; }

/* ---------------- form ---------------- */
/* One sheet on celadon, held by a hairline. The card's top edge carries a
   2px cinnabar rule from the left corner to 38% of the width 鈥?a 涔﹀彛 marker,
   the small register mark a Chinese printed page carries at its opening. It is
   the one accent on the form and it is structural, not decorative: it tells
   the eye where the sheet begins. */
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px 26px 20px;
  margin: 0 auto;
  max-width: 700px;
  position: relative; z-index: 1; text-align: left;
}
.form-card::before {
  content: "";
  position: absolute; left: 26px; top: -1px; width: 38%; height: 2px;
  background: var(--cinnabar);
}
/* Two short fields side by side, sized to their content rather than to half
   the card. A surname dropdown stretched across 340px is mostly empty box 鈥?
   the same complaint the date inputs earned in the old three-column layout,
   just horizontal instead of vertical. The date row below it keeps the full
   width, which gives the form a reading order: short, short, wide. */
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 216px)); gap: 14px; }
.field-row.two { grid-template-columns: repeat(2, minmax(0, 216px)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  color: var(--ink);
}
/* "optional" is a quiet aside, not a shout. It used to be uppercase at the same
   weight as the label, which made it look like part of the field's name. */
.field small { font-size: 12px; color: var(--ink-mute); font-weight: 400; }
/* A suggestion under the box, not a requirement above it. The old label carried
   the hint inline at label weight, which read as part of the field's name 鈥?
   and the hint itself promised the description "drives the character choice",
   which sounded like a condition. */
.field-hint {
  font-size: 12px; color: var(--ink-mute); margin: 2px 0 0; line-height: 1.5;
}

input[type=text], input[type=number], select, textarea {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--paper-glow); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 13px; width: 100%;
  transition: border-color .16s, box-shadow .16s, background .16s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: #b7a894; }
input[type=text]:focus, input[type=number]:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(178,58,42,.55); background: var(--card);
  box-shadow: 0 0 0 3px rgba(178,58,42,.09);
}
textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237d7770' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 34px;
}
/* Year / month / day get a whole row now. They used to sit inside the third
   column of a three-column form, roughly 63px each after padding and gap, which
   clipped the month placeholder to "mo" and the day to "da". The fix is the row
   above, not a smaller font: at full card width each box holds its placeholder
   and a spinner. */
.date-row {
  display: grid;
  grid-template-columns: minmax(96px, 1.35fr) 1fr 1fr;
  gap: 8px;
}
.date-row input { padding-left: 10px; padding-right: 6px; text-align: center; }

.btn {
  font-family: var(--sans); font-size: 15.5px; font-weight: 600;
  border: 1px solid var(--cinnabar); border-radius: var(--radius-sm); cursor: pointer;
  padding: 14px 26px; width: 100%; margin-top: 18px;
  background: var(--cinnabar);
  color: var(--card);
  transition: background .16s, box-shadow .2s, transform .12s;
  box-shadow: 0 8px 18px -12px rgba(178,58,42,.7);
  letter-spacing: .01em;
}
.btn:hover {
  background: #8e2c1e; border-color: #8e2c1e;
  box-shadow: 0 12px 22px -12px rgba(178,58,42,.65);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 3px; box-shadow: none;
  font-size: 13.5px; padding: 9px 17px; width: auto; margin: 0;
  transition: border-color .16s, color .16s, background .16s;
}
.btn-ghost:hover {
  background: var(--card);
  color: var(--cinnabar); border-color: rgba(178,58,42,.4);
  text-decoration: none;
}
.btn-sm { font-size: 13px; padding: 8px 15px; width: auto; margin: 0; }

.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 15px; font-size: 12.5px; color: var(--ink-mute); }
.form-foot .dots { display: inline-flex; gap: 4px; }
.form-foot .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }
.privacy { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------- results ---------------- */
.results { margin: 40px auto 0; max-width: 900px; scroll-margin-top: 84px; }
.results-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.results-head h2 {
  font-family: var(--serif); font-size: 26px; margin: 0; font-weight: 600; letter-spacing: -.012em;
}
.results-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-mute); }
.results-actions { display: flex; gap: 9px; }

.chart-strip {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px; padding: 12px 15px; margin-bottom: 18px;
  font-size: 13px; color: var(--ink-soft);
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--line); border-radius: 3px;
  padding: 3px 11px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap;
  box-shadow: 0 1px 2px rgba(31,26,21,.05);
}
.chip b { font-weight: 600; color: var(--ink); }
/* Tinted chips are flat fills, not two-stop gradients. A white-to-warm gradient
   on a 26px pill is invisible except as a faint smudge, and it was one of four
   surfaces on the page doing the same thing. */
.chip.hot { border-color: rgba(178,58,42,.32); background: #f7efe4; color: var(--cinnabar); }
.chip.hot b { color: var(--cinnabar); }
.chip.jade { border-color: rgba(47,109,89,.3); background: #f1ebde; color: var(--jade); }
.chip.jade b { color: var(--jade); }

/* --- name card --- */
.name-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px; overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
/* A 3px vertical gradient bar that faded in on hover. It sat directly against
   the glyph plate and read as a rendering artifact, so the card now signals
   hover with its border and nothing else. */
.name-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
.name-card.open { box-shadow: var(--shadow-md); border-color: var(--line-2); }

.nc-main {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 26px;
  align-items: center; padding: 18px 22px; cursor: pointer;
}
/* 绫冲瓧鏍?鈥?the practice grid, drawn properly.
   The old version was two hairlines dividing the plate into quarters, which is
   a 鐢板瓧鏍? and it was labelled as a 绫冲瓧鏍? Calligraphy practice uses the
   diagonals too: they are what you align a 鎽?or a 鐐?against. A grid that
   claims to be practice paper and omits them is decoration wearing the costume
   of a tool 鈥?so the diagonals are drawn here, as a crossed pair of hairlines
   between opposite corners, in the same faint tint as the quarter rules. */
/* The name is what the card is for, so it is set the way a name is printed on
   a rubbing: one character per practice square, in a single row. It used to be
   a 124px plate with the characters wrapped inside it, which split a
   three-character name across two lines and left the header half empty. */
.nc-glyph {
  --cell: 116px;
  position: relative; flex: none;
  display: flex; align-items: stretch;
  padding-top: 16px;                 /* room for the rank number above */
}
/* A longer name takes smaller squares rather than a second line, so the row
   stays one row at every length the engine can produce. */
.nc-glyph[data-n="2"] { --cell: 104px; }
.nc-glyph[data-n="3"] { --cell: 92px; }
.nc-glyph[data-n="4"] { --cell: 82px; }

.nc-glyph .hz { display: flex; align-items: stretch; }

/* One square per character, sharing a hairline with its neighbour so the row
   reads as a ruled strip rather than a row of separate tiles. The cross and
   the diagonals are the 米字格 the character pages use, drawn with gradients
   so no extra element is needed. */
.nc-glyph .hz-cell {
  width: var(--cell); height: var(--cell);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: calc(var(--cell) * .6); line-height: 1;
  color: var(--ink); text-decoration: none;
  background-color: var(--paper-glow);
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom right, transparent calc(50% - .5px), var(--line) calc(50% - .5px), var(--line) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to bottom left, transparent calc(50% - .5px), var(--line) calc(50% - .5px), var(--line) calc(50% + .5px), transparent calc(50% + .5px));
  background-size: 50% 100%, 100% 50%, 100% 100%, 100% 100%;
  background-position: center;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .16s, color .16s, box-shadow .16s;
}
.nc-glyph .hz-cell + .hz-cell { margin-left: -1px; }
.nc-glyph .hz-cell:hover, .nc-glyph .hz-cell:focus-visible {
  position: relative; z-index: 1; outline: none;
  background-color: var(--card); color: var(--cinnabar);
  box-shadow: inset 0 0 0 1px rgba(178,58,42,.5);
}

/* The rank sits above the strip, not inside a square: a number in a practice
   square is a number in the wrong place. */
.nc-glyph .rk {
  position: absolute; top: 0; left: 1px;
  font-size: 10px; color: var(--ink-mute);
  font-family: var(--mono); letter-spacing: .08em;
}

.nc-body { min-width: 0; }
.nc-pinyin { font-size: 13px; color: var(--cinnabar); letter-spacing: .07em; font-weight: 600; margin-bottom: 4px; text-transform: uppercase; }
.nc-why { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; max-width: 62ch; }
.nc-mean { font-size: 13px; color: var(--ink-mute); margin-top: 7px; }
.nc-elems { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.nc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.score-ring {
  --v: 0;
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(from -90deg, var(--jade) calc(var(--v) * 1%), var(--paper-3) 0);
  box-shadow: 0 6px 14px -10px rgba(47,109,89,.9);
}
.score-ring::before { content: ""; position: absolute; inset: 4px; background: var(--card); border-radius: 50%; }
.score-ring span { position: relative; font-size: 13.5px; font-weight: 700; color: var(--jade); font-family: var(--mono); }
.nc-expand {
  font-size: 12px; color: var(--ink-mute); display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 3px; border: 1px solid transparent; transition: .18s;
}
.name-card:hover .nc-expand { border-color: var(--line); background: var(--card); color: var(--cinnabar); }
.nc-expand .arw { transition: transform .24s; display: inline-block; }
.name-card.open .nc-expand .arw { transform: rotate(180deg); }

/* --- expanded detail --- */
.nc-detail { display: none; border-top: 1px solid var(--line); background: var(--paper); }
.name-card.open .nc-detail { display: block; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.detail-col { padding: 24px; }
.detail-col + .detail-col { border-left: 1px solid var(--line); }
.detail-col h4 {
  margin: 0 0 13px; font-size: 11.5px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--ink-mute); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.detail-col h4 .han { font-family: var(--serif); font-size: 18px; color: var(--ink); letter-spacing: 0; text-transform: none; }

.src-block { margin-bottom: 16px; }
.src-block:last-child { margin-bottom: 0; }
.src-quote {
  font-family: var(--serif); font-size: 16px; line-height: 1.8;
  color: var(--ink); margin: 0 0 7px; padding-left: 14px;
  border-left: 2px solid var(--gold-2);
}
.src-cite { font-size: 12px; color: var(--cinnabar); margin: 0 0 5px; letter-spacing: .02em; font-weight: 600; }
.src-en { font-size: 13px; color: var(--ink-mute); margin: 0; line-height: 1.55; font-style: italic; }
.src-west {
  font-size: 13.5px; color: var(--jade); margin: 11px 0 0;
  background: var(--paper-2);
  border: 1px solid rgba(47,109,89,.16);
  border-left: 2px solid var(--jade);
  border-radius: var(--radius-sm); padding: 9px 12px;
  line-height: 1.55;
}
.src-note {
  font-size: 12.5px; color: var(--ink-mute); margin: 11px 0 0;
  padding-top: 10px; border-top: 1px dashed var(--line-2); line-height: 1.55;
}

/* --- tool row inside detail --- */
.tool-row {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  padding: 16px 24px; border-top: 1px solid var(--line); background: var(--card);
}
.tool-row .sep { flex: 1; }

/* --- stroke order canvas --- */
.stroke-box {
  display: flex; gap: 16px; align-items: center; padding: 18px 24px 22px;
  border-top: 1px solid var(--line); background: var(--card);
}
.stroke-canvas-wrap { display: flex; gap: 10px; }
/* 米字格, again — the stroke cells were the third and last place the site drew a
   田字格 and called it practice paper. They get the diagonals too, and the warm
   cream fill gives way to the same celadon wash the glyph plates use. */
.stroke-cell {
  width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 2px;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom right, transparent calc(50% - .5px), var(--line) calc(50% - .5px), var(--line) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to bottom left, transparent calc(50% - .5px), var(--line) calc(50% - .5px), var(--line) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(180deg, var(--paper-glow), var(--paper));
  background-size: 50% 100%, 100% 50%, 100% 100%, 100% 100%, 100% 100%;
  position: relative; flex: none; overflow: hidden;
}
.stroke-cell .lbl {
  position: absolute; bottom: 3px; right: 6px; font-size: 10px;
  color: var(--ink-mute); font-family: var(--mono);
}
.stroke-meta { font-size: 12.5px; color: var(--ink-mute); line-height: 1.6; }
.stroke-meta b { color: var(--ink-soft); font-weight: 600; }

/* ---------------- signature ---------------- */
.signature-panel {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 22px;
}
.signature-panel h4 {
  margin: 0 0 4px; font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: -.01em;
}
.signature-panel .sub { font-size: 12.5px; color: var(--ink-mute); margin: 0 0 15px; }
.sig-styles { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sig-style {
  border: 1px solid var(--line); background: var(--card); border-radius: 3px;
  padding: 6px 16px; font-size: 13px; cursor: pointer; color: var(--ink-soft);
  font-family: var(--sans); transition: all .16s;
  box-shadow: 0 1px 2px rgba(31,26,21,.05);
}
.sig-style:hover { border-color: rgba(178,58,42,.38); color: var(--cinnabar); }
.sig-style[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.sig-stage {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  display: grid; place-items: center; padding: 10px; min-height: 150px;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 var(--paper-glow), 0 12px 26px -22px rgba(31,26,21,.28);
}
.sig-stage canvas { max-width: 100%; height: auto; display: block; }
.sig-stage .seal {
  position: absolute; right: 18px; bottom: 16px;
  width: 44px; height: 44px; border: 2px solid var(--cinnabar);
  border-radius: 4px; color: var(--cinnabar); font-family: var(--serif);
  font-size: 12px; line-height: 1.1; display: grid; place-items: center;
  text-align: center; opacity: .85; transform: rotate(-3deg);
  padding: 3px; letter-spacing: .02em;
}
.sig-actions { display: flex; gap: 9px; margin-top: 13px; flex-wrap: wrap; }

/* ---------------- empty / loading ---------------- */
.empty-state {
  text-align: center; padding: 50px 20px; color: var(--ink-mute);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  background: var(--paper-2);
}
.empty-state .big {
  font-family: var(--serif); font-size: 42px; margin-bottom: 12px; letter-spacing: .1em;
  /* Was #e3d4bb at 1.41:1 鈥?the first thing after the hero, and it read as a
     ghost. 42px counts as large text, so 3:1 is the floor to clear. */
  color: #6f7f6a;
}
.empty-state p { margin: 0; font-size: 14px; color: var(--ink-soft); }

.skeleton { background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 37%, var(--paper-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: var(--radius-sm); }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- sections below ---------------- */
/* 鱼尾. A Chinese thread-bound book puts a small fish-tail mark at the fold of
   every section opening, and it is the one ornament the format allows at this
   scale — two short rules that meet at a point, stacked above the heading.
   It is what separates one section from the next instead of another grey line
   and a 54px gap, which is what every other page on the web uses. */
.section {
  position: relative;
  padding: 54px 0; border-top: 1px solid var(--line); margin-top: 54px;
}
.section h2 {
  font-family: var(--serif); font-size: clamp(22px, 3.2vw, 30px); font-weight: 600;
  letter-spacing: -.02em; margin: 0 0 9px;
}
.section > .wrap > h2::before {
  content: "";
  display: block; width: 13px; height: 7px; margin-bottom: 13px;
  background:
    linear-gradient(to bottom right, transparent calc(50% - .5px), var(--cinnabar) calc(50% - .5px), var(--cinnabar) calc(50% + .5px), transparent calc(50% + .5px)) left top / 100% 100% no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - .5px), var(--cinnabar) calc(50% - .5px), var(--cinnabar) calc(50% + .5px), transparent calc(50% + .5px)) left bottom / 100% 50% no-repeat;
  opacity: .8;
}
.section h2 .accent, .accent-rule { color: var(--cinnabar); }
.section .lede { font-size: 15px; color: var(--ink-soft); max-width: 680px; margin: 0 0 26px; }

/* 四部 — the four-part argument, set as a ruled page rather than as cards.
   Four equal white boxes in a row, each with its own accent stripe and its own
   glyph tile, is the single most reproduced block on the web; it reads as a
   component library because it is one. A woodblock page has no cards — it has
   columns of text separated by hairlines (界行), and the eye follows the rules.
   So these are columns, not boxes: no fill, no border, no shadow, no radius,
   divided by one vertical rule, and deliberately unequal in width so the eye
   has a rhythm to walk instead of four beats of the same length. */
.feat-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.3fr .95fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
/* Two equal cards side by side, dropping to one on a phone. Set here rather
   than inline so the breakpoint actually applies. */
.feat-grid.two-col { grid-template-columns: 1fr 1fr; gap: 18px; border-top: 0; }
/* A two-column grid is a different use (side-by-side comparison), so it keeps
   card styling and drops the ordinal — it has no 一二三四 to count. */
.feat-grid.two-col .feat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 20px 21px;
}
.feat-grid.two-col .feat::before { content: none; }
@media (max-width: 700px) { .feat-grid.two-col { grid-template-columns: 1fr; } }
.feat {
  position: relative;
  background: transparent;
  border: 0; border-radius: 0;
  padding: 24px 22px 22px;
  box-shadow: none;
  border-left: 1px solid var(--line);
}
.feat:first-child { border-left: 0; padding-left: 0; }
.feat:last-child { padding-right: 0; }
/* The ordinal. A Chinese argument numbers its parts 一二三四, and the number
   sits in the margin beside the column, which is where a woodblock page puts
   the folio. Cinnabar, small, above the heading — it replaces both the colour
   stripe and the pictogram tile, and it costs one glyph. */
.feat::before {
  content: attr(data-n);
  display: block;
  font-family: var(--serif);
  font-size: 13px; line-height: 1;
  color: var(--cinnabar); opacity: .85;
  margin-bottom: 12px;
}
.feat:hover { box-shadow: none; border-color: var(--line); }
.feat:hover .ico { border-color: var(--cinnabar); }
/* The glyph plate is a 朱文印: cinnabar strokes on bare celadon, a hairline
   frame, no fill. The four tinted fills it used to carry — pink, cream, mint,
   lilac — were the last place the old warm palette survived, and they made the
   four columns read as four different components instead of one repeated unit
   whose colour only marks position. */
.feat .ico {
  font-family: var(--serif); font-size: 19px; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 2px; margin-bottom: 13px;
  background: transparent;
  color: var(--cinnabar); border: 1px solid var(--cinnabar);
}
.feat h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; letter-spacing: -.008em; }
.feat p { margin: 0; font-size: 13.6px; color: var(--ink-soft); line-height: 1.62; }
.feat a { font-size: 13.5px; display: inline-block; margin-top: 11px; }
/* Four columns cannot survive a narrow viewport. Below 860px the rules go and
   the parts stack, separated by hairlines instead of columns — the same
   division, turned ninety degrees. Placed after the base .feat rule so the
   border override actually wins. */
@media (max-width: 860px) {
  .feat-grid:not(.two-col) { grid-template-columns: 1fr; }
  .feat-grid:not(.two-col) .feat {
    border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 18px;
  }
  .feat-grid:not(.two-col) .feat:first-child { border-top: 0; padding-top: 22px; }
  .feat::before { margin-bottom: 10px; }
}

/* ---------------- faq ---------------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 18px 34px 18px 0; font-size: 15.5px; font-weight: 600;
  list-style: none; position: relative; color: var(--ink); letter-spacing: -.006em;
  transition: color .16s;
}
.faq summary:hover { color: var(--cinnabar); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 15px;
  font-size: 21px; color: var(--ink-mute); font-weight: 300; line-height: 1;
  transition: transform .22s, color .16s;
}
.faq details[open] summary { color: var(--cinnabar); }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--cinnabar); }
.faq details p { margin: 0 0 18px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.72; max-width: 720px; }
.faq details p + p { margin-top: -8px; }

/* ---------------- footer ---------------- */
/* Paper again, closed by a hairline instead of a second black band. Two dark
   bands on a pale page turn a short page into a stripe, and the footer is not
   important enough to be the darkest thing on screen. */
.site-foot {
  position: relative; padding: 40px 0 46px; margin-top: 20px;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
}
.site-foot .wrap { display: flex; gap: 34px; flex-wrap: wrap; align-items: flex-start; }
.foot-col { min-width: 150px; }
.foot-col h5 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-soft); margin: 0 0 10px; font-weight: 700;
}
.foot-col a { display: block; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 7px; transition: color .16s; }
.foot-col a:hover { color: var(--cinnabar); text-decoration: none; }
.foot-legal { flex: 1; min-width: 220px; font-size: 12.5px; color: var(--ink-mute); line-height: 1.65; }
.foot-legal .brand { margin-bottom: 9px; }
.foot-legal .brand-name { color: var(--ink); }
.foot-legal a { color: var(--cinnabar); }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--ink);
  border: 1px solid var(--ink);
  color: var(--paper); font-size: 13.5px;
  padding: 10px 20px; border-radius: 3px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 200; max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- entrance ---------------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to   { opacity: 1; transform: none; }
}
/* `backwards`, not `both`: a finished animation with fill-mode `both` keeps
   its last keyframe applied, and `transform: none` there would silently
   override the hover lift on every card. Backwards fill covers the delay, and
   once the animation is over the element returns to its own rules. */
.hero .eyebrow, .page-head .eyebrow,
.hero .hero-title, .page-head .hero-title,
.hero .hero-sub, .page-head .hero-sub,
.hero .hero-note { animation: riseIn .62s cubic-bezier(.2,.7,.3,1) backwards; }
.hero .hero-title, .page-head .hero-title { animation-delay: .06s; }
.hero .hero-sub, .page-head .hero-sub { animation-delay: .12s; }
.hero .hero-note { animation-delay: .18s; }
.results .name-card { animation: cardIn .42s cubic-bezier(.2,.7,.3,1) backwards; }
.results .name-card:nth-child(2) { animation-delay: .05s; }
.results .name-card:nth-child(3) { animation-delay: .10s; }
.results .name-card:nth-child(4) { animation-delay: .15s; }
.results .name-card:nth-child(5) { animation-delay: .20s; }

/* ---------------- responsive ---------------- */
@media (max-width: 820px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-col + .detail-col { border-left: none; border-top: 1px solid var(--line); }
  .nc-main { grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 18px; }
  .nc-glyph { --cell: 72px; }
  .nc-glyph[data-n="2"] { --cell: 66px; }
  .nc-glyph[data-n="3"] { --cell: 58px; }
  .nc-glyph[data-n="4"] { --cell: 52px; }
  .nc-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; margin-top: 4px; }
  .field-row { grid-template-columns: 1fr; }
  .field-row.two { grid-template-columns: 1fr; }
  /* Keep the year box wider than month and day even on a phone: three equal
     columns at 276px card width clipped "month" and "day" to single letters. */
  .date-row { grid-template-columns: minmax(78px, 1.4fr) 1fr 1fr; }
  .hero { padding: 42px 0 46px; }
  /* Below 820px there is no room for a colophon column, so the seals lie down
     along the foot of the hero in one row — the same objects, read left to
     right, which is how a seal strip sits under a title on a hanging scroll. */
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-lede { max-width: none; }
  .hero-show {
    flex-direction: row; flex-wrap: wrap;
    justify-content: center; gap: 10px;
    padding: 16px 0 0;
    border-left: 0; border-top: 1px solid var(--line);
  }
  .hero-show::before { display: none; }
  .hero-show .hs { width: 62px; height: 62px; }
  .hero-show .hs b { font-size: 26px; }
  .hero-show .hs i { font-size: 7px; top: 3px; left: 4px; }
  .page-head { padding: 36px 0 34px; }
  .pull-up { margin-top: 22px; }
  /* The nav used to be hidden outright below 820px, which left a phone visitor
     with no way to change page at all 鈥?the brand is the only other link, and
     it points at the page they are already on. It now drops to a second row and
     scrolls sideways, so every tool stays one tap away. */
  .site-head .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 0; }
  .site-nav {
    width: calc(100% + 40px); margin: 8px -20px 0; padding: 0 20px 9px;
    gap: 18px; font-size: 13.5px;
    overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
  .site-nav { margin-left: auto; }
  .lang-menu { margin-left: auto; }
  .stroke-box { flex-direction: column; align-items: flex-start; }
  .signature-panel { padding: 18px; }
  .tool-row { padding: 14px 18px; }
  .form-card { padding: 22px 18px 18px; }
  .section { padding: 42px 0; margin-top: 42px; }
}
@media (max-width: 480px) {
  .form-card { padding: 20px 15px 16px; border-radius: var(--radius); }
  .nc-main { padding: 15px 15px 15px 17px; gap: 13px; }
  .nc-glyph { --cell: 58px; }
  .nc-glyph[data-n="2"] { --cell: 54px; }
  .nc-glyph[data-n="3"] { --cell: 48px; }
  .nc-glyph[data-n="4"] { --cell: 44px; }
  .stroke-cell { width: 74px; height: 74px; }
  .detail-col { padding: 17px; }
  h1.hero-title { font-size: clamp(28px, 8.4vw, 38px); }
}

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

@media print {
  .site-head, .site-nav, .form-card, .results-actions, .tool-row, .signature-panel,
  .site-foot, .section, .toast, .hero, .page-head { display: none !important; }
  body { background: var(--card); }
  body::before { display: none; }
  .name-card { break-inside: avoid; box-shadow: none; border-color: #ccc; transform: none; }
  .nc-detail { display: block !important; }
}

/* ================= carrier / gift pages ================= */
/* These reuse the page shell (ink band, cards, breadcrumb) but nothing here is
   generated after a click 鈥?every block is baked into the static file 鈥?so the
   rules stay small and there is no runtime state to style. */
.gift-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(252px,1fr)); gap:16px; }
/* The card is a column so the "read the guide" line lands on the same baseline
   across a row. Without it a two-line blurb and a three-line blurb put the
   links at different heights, which reads as a broken grid. */
.gift-card {
  display:flex; flex-direction:column; overflow:hidden; text-decoration:none; color:var(--ink);
  background:var(--card);
  border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:none; transition:.18s;
}
.gift-card:hover { border-color:rgba(178,58,42,.34);
  box-shadow:var(--shadow-md); text-decoration:none; }
.gift-thumb { aspect-ratio:4/3; overflow:hidden; background:var(--paper-2); flex:none; }
/* The drawn illustrations are authored at 400x300, so `cover` fills the 4:3
   frame exactly. The product photographs are square, and a 4:3 centre crop of
   a square throws away the top and bottom sixth of the picture. Measured on
   seal.jpg that discarded band is 92% busy at the top and 68% at the bottom —
   it is the braided cord and the impressions on the paper, i.e. the whole
   point of the shot. Photographs are therefore shown whole and the frame
   takes the letterbox: a slightly shorter picture beats a decapitated one. */
.gift-thumb img.gift-photo { object-fit:contain; }
.gift-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
/* The icon sits on the title row rather than floated. A floated 36px box beside
   a four-line paragraph left a ragged notch down the right side of the text. */
.gift-card-body { padding:15px 17px 17px; flex:1; display:flex; flex-direction:column; }
.gift-card-head { display:flex; align-items:center; gap:10px; margin-bottom:7px; }
.gift-ico {
  flex:none; float:none; width:36px; height:36px; display:grid; place-items:center;
  border-radius:2px; font-family:var(--serif); font-size:18px;
  background:var(--paper-2);
  color:var(--cinnabar); border:1px solid var(--line);
}
.gift-card-body h3 { margin:0; font-size:16px; font-weight:600; letter-spacing:-.01em; }
.gift-card-body p { margin:0; flex:1; font-size:13px; line-height:1.6; color:var(--ink-soft); }
.gift-more { display:block; margin-top:11px; font-size:13px; color:var(--cinnabar); font-weight:600; }

.gift-fig { margin:0 0 24px; }
.gift-fig img { width:100%; max-width:520px; height:auto; display:block; margin:0 auto;
  border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); }
.gift-fig figcaption { text-align:center; font-size:12.5px; color:var(--ink-soft); margin-top:9px; }

.gift-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(132px,1fr)); gap:10px; }
.gift-stat { background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius-sm); padding:12px 14px; text-align:center; }
.gift-stat span { display:block; font-size:10.5px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--ink-soft); margin-bottom:4px; }
.gift-stat b { font-size:17px; font-family:var(--serif); color:var(--cinnabar); }

.char-chips { display:flex; flex-wrap:wrap; gap:9px; margin:0 0 16px; }
.char-chip {
  display:grid; place-items:center; width:72px; min-height:78px; text-decoration:none;
  background:var(--card); border:1px solid var(--line);
  border-radius:3px; transition:.16s;
}
.char-chip:hover { border-color:rgba(178,58,42,.38); text-decoration:none; }
.char-chip b { font-family:var(--serif); font-size:29px; line-height:1; color:var(--ink); }
.char-chip i { font-size:11px; font-style:normal; color:var(--ink-soft); }
.char-chip span { font-size:10px; color:var(--cinnabar); font-weight:700; }
.char-chip-deep { opacity:.62; border-style:dashed; }
.gift-dense-note { margin-top:6px; }

.gift-minis { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.gift-mini { display:inline-flex; align-items:center; gap:8px; text-decoration:none; color:var(--ink);
  background:var(--card); border:1px solid var(--line); border-radius:3px; padding:6px 14px 6px 6px; font-size:13.5px; }
.gift-mini .gift-ico { float:none; width:28px; height:28px; font-size:15px; }
.gift-mini:hover { text-decoration:none; border-color:rgba(178,58,42,.38); color:var(--cinnabar); }

.gift-form { max-width:560px; margin-top:18px; }
.gift-form .form-row { display:flex; flex-direction:column; gap:5px; margin-bottom:13px; }
.gift-form label, .gift-form .form-static { font-size:13px; font-weight:600; color:var(--ink); }
.gift-form input, .gift-form textarea {
  font-family:inherit; font-size:15px; color:var(--ink);
  background:var(--card); border:1px solid var(--line); border-radius:3px;
  padding:10px 13px; width:100%; box-sizing:border-box;
}
.gift-form input:focus, .gift-form textarea:focus { outline:none; border-color:var(--cinnabar);
  box-shadow:0 0 0 3px rgba(178,58,42,.10); }
.gift-form .form-value { font-size:15px; color:var(--cinnabar); }
.gift-form-note { font-size:12.5px; color:var(--ink-soft); margin:11px 0 0; }
.gift-form-fallback { font-size:12.5px; color:var(--ink-soft); margin:6px 0 0; }

@media (max-width:620px) {
  .gift-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .gift-card-body { padding:11px 12px 13px; }
  .gift-card-body h3 { font-size:14px; }
  .gift-ico { width:30px; height:30px; font-size:16px; }
  .char-chip { width:64px; min-height:70px; }
}

/* Language suggestion bar.
 *
 * In normal flow, not fixed: it pushes the header down by its own height
 * instead of covering the first screen. On the home page that first screen is
 * the name input, and a bar floating over it would cost more than the hint
 * earns. Height is held at 40px so the pushed-down layout shift stays small.
 *
 * Sits above the ink header, so it needs its own colours rather than the
 * shared band palette. */
.lang-hint {
  display:flex; align-items:center; gap:10px;
  min-height:40px; padding:0 16px;
  background: var(--paper-2);
  border-bottom:1px solid var(--line);
  font-size:13.5px; color:var(--ink-soft);
}
.lang-hint .lh-text { flex:1 1 auto; min-width:0; }
.lang-hint .lh-cta {
  flex:none; font-weight:600; color:var(--cinnabar); white-space:nowrap;
}
.lang-hint .lh-cta:hover { text-decoration:underline; text-underline-offset:3px; }
.lang-hint .lh-close {
  flex:none; width:26px; height:26px; display:grid; place-items:center;
  background:none; border:0; cursor:pointer; border-radius: var(--radius-sm);
  font-size:18px; line-height:1; color:var(--ink-soft); padding:0;
}
.lang-hint .lh-close:hover { background:rgba(31,26,21,.07); color:var(--ink); }

@media (max-width:520px) {
  /* On a phone the sentence and the call to action cannot share a row without
     truncating one of them, so the bar tightens instead of wrapping. */
  .lang-hint { padding:7px 13px; min-height:0; font-size:12.5px; gap:8px; }
}

/* ---------------- workshop (customiser) ---------------- */
/* The section head follows the same rule as every other section: a fish-tail
   mark, then the eyebrow, then the h2. */
.cw-head { max-width: 720px; }
.cw-head .lede { margin-top: 8px; }

/* Two columns, unequal on purpose: the controls are a narrow bench, the proof
   is the work. Equal columns would make the proof — the thing being judged —
   the smaller half of the panel. */
.cw {
  display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 28px; align-items: start; margin-top: 26px;
}

/* ---- controls ---- */
.cw-controls { min-width: 0; }

/* The mode switch is a row of ruled tabs, not a pill switcher: a rounded
   segmented control is the single most generic element a page can carry.
   Here the tabs share a hairline and the active one is marked by a cinnabar
   underline, the way a chapter is marked in a book. */
.cw-modes {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.cw-mode {
  position: relative; appearance: none; cursor: pointer;
  background: none; border: 0; border-radius: 0;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink-mute); padding: 11px 6px 13px;
  transition: color .16s;
}
.cw-mode + .cw-mode { border-left: 1px solid var(--line); }
.cw-mode::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: -1px; height: 2px;
  background: var(--cinnabar); transition: left .2s, right .2s;
}
.cw-mode:hover { color: var(--ink); }
.cw-mode.is-on { color: var(--ink); }
.cw-mode.is-on::after { left: 12%; right: 12%; }

.cw-pane { min-height: 96px; }
.cw-label {
  display: block; font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute);
  margin-bottom: 7px;
}

.cw-input-row { position: relative; }
.cw-input-row input {
  width: 100%; box-sizing: border-box;
  font-family: var(--serif); font-size: 24px; letter-spacing: .08em;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 12px 52px 12px 14px;
}
.cw-input-row input::placeholder { font-size: 14px; letter-spacing: 0; color: var(--ink-mute); font-family: var(--sans); }
.cw-input-row input:focus {
  outline: none; border-color: var(--cinnabar);
  box-shadow: 0 0 0 3px rgba(178,58,42,.10);
}
/* The counter sits inside the field, aligned to its baseline: a number that
   jumps around outside the box draws the eye to the limit rather than the
   name. */
.cw-count {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--ink-mute);
  pointer-events: none;
}

.cw-hint { font-size: 12.5px; line-height: 1.7; color: var(--ink-soft); margin: 10px 0 0; }

/* ---- upload ---- */
.cw-drop {
  position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px dashed var(--line-2); border-radius: 3px;
  padding: 14px; margin-top: 13px; transition: .16s;
}
.cw-drop.is-over { border-color: var(--cinnabar); background: rgba(178,58,42,.04); }
.cw-pick {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--cinnabar); cursor: pointer;
}
.cw-pick:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The native control is hidden but focusable through its label, so the panel
   keeps a keyboard path without a second custom button to maintain. */
.cw-drop input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.cw-or { font-size: 12.5px; color: var(--ink-mute); }

.cw-thumb {
  display: flex; align-items: center; gap: 11px; margin-top: 13px;
  font-size: 12px; color: var(--ink-mute);
}
.cw-thumb canvas {
  width: 56px; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--paper-glow); padding: 3px;
}

/* The error sits in the flow, not as a floating toast: a rejected upload is
   about the file just chosen, and it belongs next to that file. */
.cw-err {
  font-size: 12.5px; color: var(--cinnabar); margin: 11px 0 0;
  padding-left: 11px; border-left: 2px solid var(--cinnabar);
}

/* ---- the proof ---- */
/* The proof is a plate on a workbench: a paper frame, the object on it, and a
   hairline caption below. The backing is the practice grid, faint, because it
   is the same grid the sample is cut on. */
.cw-proof {
  position: relative; min-width: 0;
  border: 1px solid var(--line); border-radius: 3px;
  background: var(--card); padding: 0 0 14px;
  box-shadow: var(--shadow-sm);
}
.cw-proof-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-mute);
}
/* Double rule under the caption, the same 版心 framing the page uses. */
.cw-proof-head::after {
  content: ""; position: absolute; left: 0; right: 0; top: 37px; height: 1px;
  background: var(--line); opacity: .5; margin: 0 9px;
}
.cw-proof canvas {
  display: block; width: 100%; height: auto; padding: 14px 14px 0;
  box-sizing: border-box;
}
.cw-tip {
  font-size: 11.5px; line-height: 1.6; color: var(--ink-mute);
  margin: 9px 16px 0; padding-top: 9px; border-top: 1px solid var(--line);
}
.cw-actions {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  margin: 13px 16px 0;
}
.cw-send { width: auto; margin: 0; padding: 9px 18px; font-size: 13.5px; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  /* Proof first on a narrow screen: the thing being judged is the object, not
     the tab you used to change it. Order is a flex/grid property here, so the
     tab order still starts at the controls, which are above in the DOM. */
  .cw { grid-template-columns: 1fr; gap: 20px; }
  .cw-proof { order: -1; }
}

@media (max-width: 480px) {
  .cw-mode { font-size: 12px; padding: 10px 4px 12px; }
  .cw-input-row input { font-size: 21px; }
  .cw-actions { gap: 8px; }
  .cw-send { flex: 1 1 auto; }
}

@media print {
  .cw-controls, .cw-actions { display: none !important; }
  .cw { grid-template-columns: 1fr; }
}

/* =========================================================================
   HOME REDESIGN
   -------------------------------------------------------------------------
   The landing page opens on a painted scene instead of a flat field: a
   watercolour landscape behind the whole opening block, the form as a white
   sheet overlapping its lower edge, a pale green plate under that, and four
   feature columns headed by a pink roundel carrying the ordinal over the
   glyph.

   The painting is a real illustration (assets/img/hero-painting.webp, 1672x941,
   97KB after re-encoding from a 2MB PNG), not something assembled from SVG
   primitives. Hand-placed ellipses and rectangles read as cut paper no matter
   how carefully they are shaded; only a painted image carries the bleeding
   edges and the brush texture that make the composition read as 山水.

   Three things matter for it to sit under the text rather than behind it:

   1. It spans the full width and fades out at its own bottom edge, so there
      is no horizontal seam where the picture stops.
   2. The left third is veiled in the painting's own paper colour, because the
      reference puts the headline over blank sky and the sky is not blank in
      this crop.
   3. The form card sits ON the bottom edge, not below it. A card that clears
      the picture reads as two stacked sections; one that overlaps it reads as
      a single composition.

   Every selector below is scoped to something only the home pages render,
   except .feat-grid-home, added to the home grid in _gen_home.cjs precisely
   so the shared .feat component on other pages is untouched.
   ========================================================================= */

/* ---- ground ------------------------------------------------------------ */
/* The header sat on celadon at 90% opacity and would read as a green bar over
   a cream page. */
.site-head { background: rgba(248,243,232,.93); }

/* ---- the opening block ------------------------------------------------ */
/* `cover` on a 16:9 picture inside a wider, shorter block crops top and
   bottom. The reference keeps the waterline and the eaves, both of which sit
   in the lower half, so the crop is anchored to the bottom edge. */
.hero {
  background-color: #f8f3e8;
  background-image: url("/assets/img/hero-painting.webp");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  padding: 56px 0 150px;
  min-height: 470px;
}
/* The veil that gives the headline clean paper to sit on. It is the painting's
   own sky colour, not white, so the left side reads as an unpainted area of
   the same sheet rather than as a panel laid over the artwork. */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    linear-gradient(90deg, rgba(248,243,232,.97) 0%, rgba(248,243,232,.94) 24%, rgba(248,243,232,.72) 44%, rgba(248,243,232,.28) 62%, rgba(248,243,232,0) 78%),
    linear-gradient(180deg, rgba(248,243,232,.5) 0%, rgba(248,243,232,0) 30%);
}
/* And the fade along the bottom edge, so the water dissolves into the paper
   instead of ending on a ruled line. */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 170px;
  pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, rgba(248,243,232,0) 0%, rgba(248,243,232,.66) 54%, rgba(248,243,232,.97) 100%);
}
/* The seal column stands in front of the trees on the right. */
.hero-show { border-left-color: rgba(255,253,246,.5); z-index: 1; }

/* ---- form: the sheet overlapping the painting ------------------------ */
/* 104px up against 150px of hero padding leaves ~46px of painting visible
   beneath the card, which reads as overlap without burying the water. */
.form-card {
  margin-top: -104px;
  border-radius: 10px;
  padding: 34px 34px 24px;
  box-shadow: 0 26px 64px -36px rgba(40,32,24,.42), 0 2px 4px rgba(40,32,24,.04);
}
/* The cinnabar rule on the card top edge is retired: in the reference the
   sheet has no accent stripe, and a red bar would cut across the waterline
   it is now straddling. */
.form-card::before { content: none; }

/* ---- the pale plate under the form ----------------------------------- */
.empty-state {
  border-radius: 10px;
  border-color: #cfdfd4;
  padding: 54px 20px 48px;
  background-color: #deeae1;
  background-image:
    radial-gradient(circle at 0% 100%, transparent 74px, rgba(255,255,255,.55) 75px, rgba(255,255,255,.55) 76px, transparent 77px),
    radial-gradient(circle at 0% 100%, transparent 122px, rgba(255,255,255,.38) 123px, rgba(255,255,255,.38) 124px, transparent 125px),
    radial-gradient(circle at 0% 100%, transparent 170px, rgba(255,255,255,.24) 171px, rgba(255,255,255,.24) 172px, transparent 173px),
    radial-gradient(circle at 100% 100%, transparent 74px, rgba(255,255,255,.55) 75px, rgba(255,255,255,.55) 76px, transparent 77px),
    radial-gradient(circle at 100% 100%, transparent 122px, rgba(255,255,255,.38) 123px, rgba(255,255,255,.38) 124px, transparent 125px),
    radial-gradient(circle at 100% 100%, transparent 170px, rgba(255,255,255,.24) 171px, rgba(255,255,255,.24) 172px, transparent 173px),
    linear-gradient(180deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,0) 72%);
}
.empty-state .big {
  font-size: 40px; font-weight: 600;
  letter-spacing: .16em; text-indent: .16em;
  color: var(--ink); margin: 0 auto 16px; line-height: 1.25;
}
.empty-state .big::before,
.empty-state .big::after {
  content: ""; display: inline-block; vertical-align: middle;
  width: 92px; height: 1px; background: #7d9184; opacity: .5;
  margin: 0 26px; text-indent: 0;
}
.empty-state p { color: #4d5b52; font-size: 14.5px; }

/* ---- features: four columns, roundel heads --------------------------- */
.feat-grid-home {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px;
  border-top: 0;
  padding-top: 4px;
}
.feat-grid-home > .feat { border-left: 0; padding: 0; }
.feat-grid-home > .feat::before { content: none; }
.feat-grid-home .ico[data-n] {
  width: 62px; height: 62px;
  border: 0; border-radius: 50%;
  background: #f6dcd7;
  color: var(--cinnabar);
  font-size: 20px;
  margin: 0 0 18px;
  display: grid; place-items: center;
  padding-top: 13px;
  position: relative;
}
.feat-grid-home .ico[data-n]::before {
  content: attr(data-n);
  position: absolute; top: 11px; left: 0; right: 0;
  text-align: center;
  font-family: var(--serif); font-size: 10.5px; line-height: 1;
  opacity: .85;
}
.feat-grid-home > .feat:hover .ico[data-n] { background: #f1d0c9; }

/* ---- narrow screens -------------------------------------------------- */
@media (max-width: 1000px) {
  .hero { padding-bottom: 130px; min-height: 420px; background-position: 62% bottom; }
  .form-card { margin-top: -92px; }
}
@media (max-width: 860px) {
  .feat-grid-home { grid-template-columns: 1fr; gap: 0; }
  .feat-grid-home > .feat {
    border-top: 1px solid var(--line);
    padding: 22px 0 4px;
  }
  .feat-grid-home > .feat:first-child { border-top: 0; padding-top: 0; }
}
/* Below 820px the picture is cropped to a strip and there is no room for the
   card to overlap anything, so the paper stands alone. */
@media (max-width: 820px) {
  .hero {
    background-image: none;
    padding-bottom: 84px;
    min-height: 0;
  }
  .hero::before, .hero::after { content: none; }
  .form-card { margin-top: -52px; }
}
@media (max-width: 520px) {
  .empty-state { padding: 38px 16px 34px; }
  .empty-state .big { font-size: 32px; letter-spacing: .1em; text-indent: .1em; }
  .empty-state .big::before, .empty-state .big::after { width: 40px; margin: 0 14px; }
  .form-card { padding: 24px 18px 18px; margin-top: -40px; }
}
