/* Hallmark · genre: editorial · design-system: design.md · designed-as-app
 * macrostructure: Catalogue (home) · Split Studio (product / brand) · Long Document (story)
 * theme: custom (tuned) · vibe: "gallery white, cool, ink-blue, quiet"
 * paper: oklch(98.5% 0.003 250) · accent: oklch(48% 0.16 260) · axes: light / roman-serif / cool
 * display: Newsreader + Noto Serif TC · body: Geist + Noto Sans TC · outlier: Geist Mono (numerals only)
 * nav: N6 masthead · footer: Ft1 mast-headed · F6 knobs: ratio=1/1, density=3-up, action=none
 * home hero: H2 split diptych knobs: ratio=1fr/22rem, right=proof column (contents
 *   index), divider=negative space · leaders: one list, home only · no global CTA
 * enrichment: none (typography only) · reveal: none · studied: no
 * surface: paper stock — --texture-paper on the sheet and its tints (2026-09-02)
 */
/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V5 · contrast: pass (40–41) · slop: pass (42–45)
 * honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30)
 * mobile: pass (34, 49, 50–57)
 *
 * 2026-09-02 · home opener · measured, not assumed:
 *   34 no horizontal scroll — scrollWidth == clientWidth at 320/375/414/768/1280/1440
 *   49 contents rows stay one line at all six widths; row pitch 54.6px (> 44px tap)
 *   40 ink/paper 17.7:1 · ink/paper-3 15.0:1 · muted/paper 7.1:1 · muted/paper-3 6.1:1
 *      focus/paper 6.5:1 · focus/paper-3 5.5:1 — every pair clears its threshold
 *   54 the 目錄 kicker labels the list directly beneath it in its own column; it is
 *      not an eyebrow for the h1, which is a sibling in the other column
 *   45 the leaders are motivated — they carry the eye from a section name to its
 *      count, which is the contents-page device, not an ornament
 *   28 the first 好物 card is now the page's first image and lands at y=749 in an
 *      800px fold, so it takes fetchpriority="high" instead of loading lazily
 *
 * 2026-09-02 · paper stock · measured, not assumed:
 *   40/41 the tile was rasterised to a canvas and its alpha read back — mean
 *      0.017, peak 0.114. Every text/background pair was then recomputed with
 *      the ink speckle composited at the tile's DARKEST pixel, not its mean:
 *      ink/paper 13.96 · ink-2/paper 8.88 · muted/paper 5.62 · muted/paper-2
 *      5.24 · muted/paper-3 4.80 · accent/paper 5.06 · accent-deep/paper 6.61 ·
 *      focus/paper 5.13 · focus/paper-3 4.38 — every pair clears its threshold.
 *      muted-on-paper-3 is the binding pair and sets the peak alpha ceiling.
 *   29 not an abstract background: no accent, no gradient, no animation, no
 *      mesh. Grain is anti-patterns.md's own prescribed fix for the aurora
 *      blob, and the layer runs at ~0.017 against its < 0.1 ceiling.
 *   45 not hero decoration: the stock is uniform across all 25 pages and never
 *      enters the opener, so design.md's no-hero-enrichment rule still holds.
 *   34 no horizontal scroll at 320/375/414/768/1280/1440/1920 on all six page
 *      types (home, product, brand, archive-route, article, 404)
 */
@import url("../tokens.css");

/* ─── base ─────────────────────────────────────────────────────────────── */

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-xl);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--color-ink);
  background-color: var(--color-paper);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  text-underline-offset: 0.18em;
}

/* ─── the stock ────────────────────────────────────────────────────────────
 * One sheet, one tooth. --texture-paper is a transparent ink speckle, so a
 * surface sets its own background-COLOR and inherits the grain from here.
 * That is why no paper tint anywhere in this file uses the `background`
 * shorthand: the shorthand resets background-image to none, which would punch
 * a flat rectangle out of the page the moment a row was hovered.
 *
 * The line: the sheet and its tints carry the tooth — the page, the plinth
 * frame, the footer band, the menu sheet, the dialog panel, and every hairline
 * row that retints on hover. Controls (.chip), form fields (.search-input) and
 * image wells (.story-row__thumb, .story__figure) do not; they are a different
 * material laid on the sheet, and an asset covers them anyway.
 *
 * The masthead is not listed because it is transparent: it is the same paper
 * as the page, so it shows the canvas tooth by not painting over it.
 *
 * No background-attachment: fixed. Each surface starts its own tile, but at
 * mean alpha 0.017 with 38% of the tile fully clear the seam is below the
 * threshold of vision — and fixed attachment janks on iOS for no gain. */
body,
.mobile-menu,
.mobile-menu a:hover,
.plinth,
.contents a:hover,
.index a:hover,
.story-row:hover,
.directory a:hover,
.foot-mast,
.site-dialog,
.search-result:hover {
  background-image: var(--texture-paper);
  background-size: var(--texture-paper-tile);
}

body:has(dialog[open]) {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: var(--rule-bold) solid var(--color-focus);
  outline-offset: var(--space-2xs);
}

::selection {
  color: var(--color-accent-ink);
  background: var(--color-accent-deep);
}

/* margin, not margin-block — blockquote and figure carry a 40px UA inline
 * margin that would indent the pull quote out of the grid. */
h1,
h2,
h3,
p,
figure,
blockquote,
dl,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3,
blockquote {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-title);
}

h1 {
  font-size: var(--text-2xl);
  line-height: var(--leading-display);
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-md);
}

/* ─── typographic primitives ───────────────────────────────────────────── */

.kicker,
.meta,
.masthead__line,
.colophon {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--color-muted);
}

.kicker {
  margin-block-end: var(--space-md);
}

.numeral {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.lede {
  max-width: var(--measure);
  color: var(--color-ink-2);
  font-size: var(--text-md);
}

.fineprint {
  max-width: var(--measure);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* ─── layout ───────────────────────────────────────────────────────────── */

.wrap {
  width: min(100% - (var(--page-gutter) * 2), var(--content));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-2xl);
}

.section--tight {
  padding-block: var(--space-xl);
}

.skip-link {
  position: fixed;
  z-index: calc(var(--z-modal) + 1);
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--color-paper);
  background: var(--color-ink);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Section head — single column, always. Heading first, count beneath. (gate 54) */
.head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  margin-block-end: var(--space-xl);
  padding-block-end: var(--space-md);
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.head h2 {
  max-width: 22ch;
}

.head__meta {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* ─── buttons ──────────────────────────────────────────────────────────── */

/* C1 outlined chip — the one primary action. 8 states. */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--tap);
  padding: var(--space-sm) var(--space-lg);
  color: var(--color-ink);
  background: transparent;
  border: var(--rule-hair) solid var(--color-ink);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.chip:hover {
  color: var(--color-paper);
  background: var(--color-ink);
}

.chip:active {
  transform: translateY(1px);
}

.chip[disabled],
.chip[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.chip.is-busy {
  color: var(--color-muted);
  background-color: var(--color-paper-2);
  border-color: var(--color-rule);
}

.chip.is-success {
  color: var(--color-paper);
  background: var(--color-success);
  border-color: var(--color-success);
}

.chip.is-error {
  color: var(--color-paper);
  background: var(--color-error);
  border-color: var(--color-error);
}

/* C3 typographic link — every secondary action. */
.link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap);
  color: var(--color-ink);
  border-block-end: var(--rule-hair) solid var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.link:hover {
  color: var(--color-accent-deep);
  border-block-end-color: var(--color-accent-deep);
}

.link:active {
  transform: translateY(1px);
}

/* Masthead + dialog utility buttons. */
.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap);
  padding-inline: var(--space-sm);
  background: transparent;
  border: 0;
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

.ghost-button:hover {
  color: var(--color-accent-deep);
}

.ghost-button:active {
  transform: translateY(1px);
}

.ghost-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.tally {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding-inline: var(--space-2xs);
  color: var(--color-paper);
  background: var(--color-ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ─── masthead · N6 ────────────────────────────────────────────────────── */

/* Transparent, not paper: the masthead sits on the same stock as the page, and
 * an opaque fill of the identical colour would punch a flat rectangle out of
 * the tooth. It is not sticky, so nothing scrolls under it. */
.masthead {
  border-block-end: 3px double var(--color-rule);
  background: transparent;
}

.masthead__inner {
  display: grid;
  justify-items: center;
  gap: var(--space-sm);
  padding-block: var(--space-lg) var(--space-md);
  text-align: center;
}

.masthead__line {
  margin: 0;
}

.masthead__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-sm);
  min-width: 0;
  min-height: var(--tap);
  padding-block: var(--space-2xs);
  font-family: var(--font-display);
  font-size: var(--text-mast);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
}

.masthead__name span {
  font-size: var(--text-lg);
  color: var(--color-muted);
}

.masthead__name:hover span {
  color: var(--color-accent-deep);
}

.masthead__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs) var(--space-md);
}

.masthead__links {
  display: none;
  align-items: center;
  gap: var(--space-md);
}

.masthead__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  border-block-end: var(--rule-bold) solid transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.masthead__links a:hover {
  color: var(--color-accent-deep);
  border-block-end-color: var(--color-accent);
}

/* Wayfinding — the nav entry for the section this page belongs to stays marked.
 * Decorative only: the link points at a home anchor, not at the current page,
 * so it carries no aria-current. */
body[data-page-type="product"] :is(.masthead__links, .mobile-menu) a[href="/#products"],
body[data-page-type="article"] :is(.masthead__links, .mobile-menu) a[href="/#stories"],
body[data-page-type="brand"] :is(.masthead__links, .mobile-menu) a[href="/#worlds"],
body[data-page-type="category"] :is(.masthead__links, .mobile-menu) a[href="/#worlds"],
body[data-page-type="landing"] :is(.masthead__links, .mobile-menu) a[href="/#worlds"] {
  color: var(--color-accent-deep);
  border-block-end-color: var(--color-accent);
}

.masthead__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.mobile-menu {
  display: grid;
  border-block-start: var(--rule-hair) solid var(--color-rule);
  background-color: var(--color-paper-2);
}

/* A class selector out-specifies the UA's [hidden] { display: none }, so the
 * closed state has to be restated here or the menu renders always-open. */
.mobile-menu[hidden] {
  display: none;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: var(--space-sm) var(--page-gutter);
  border-block-end: var(--rule-hair) solid var(--color-rule-2);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.mobile-menu a:last-child {
  border-block-end: 0;
}

.mobile-menu a:hover {
  color: var(--color-accent-deep);
  background-color: var(--color-paper-3);
}

/* ─── plinths — every image sits on a contained surface ────────────────── */

/* A single minmax(0, 1fr) track with the default `stretch` — NOT place-items:
 * center. Centring makes the child content-sized, so `height: 100%` resolves
 * cyclically and a portrait image overflows the frame instead of fitting it. */
.plinth {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  margin: 0;
  padding: var(--space-md);
  aspect-ratio: 4 / 3;
  background-color: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  overflow: hidden;
  transition: background-color var(--dur-fast) var(--ease-out);
}

/* Routes with no asset keep the tinted surface, so an archive plinth still
 * reads as a different kind of thing from a product on white. */
.plinth:has(> .archive-plinth) {
  background-color: var(--color-paper-2);
}

/* The one large frame on a product / brand page. These are its narrow-viewport
 * values; the diptych rules override them at >=64rem. The home opener carries
 * no frame — it is typography plus a contents index.
 * width:100% is required — justify-self:end alone would shrink-to-fit. */
.plinth--display {
  justify-self: end;
  width: 100%;
  max-width: 30rem;
  padding: var(--space-lg);
  aspect-ratio: 1;
}

.plinth__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.archive-plinth {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-xs);
  width: 100%;
  height: 100%;
  padding: var(--space-md);
  text-align: center;
}

.archive-plinth__mark {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 600;
  line-height: 1;
  color: var(--color-rule);
}

.archive-plinth__label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ─── home · opener ────────────────────────────────────────────────────── */

/* Typography only. The right column is a printed contents index, not a frame:
 * a logo plinth here was decoration unrelated to the headline, and design.md
 * already says product imagery is grid content rather than hero furniture. */
.opener {
  display: grid;
  gap: var(--space-ml);
  padding-block: var(--space-xl) var(--space-3xl);
}

.opener__copy {
  min-width: 0;
}

/* CJK line breaks are set with <br> in the markup — a `ch` cap mis-measures
 * full-width glyphs and breaks mid-phrase, so no max-width here. */
.opener h1 {
  margin-block-end: var(--space-lg);
  font-size: var(--text-display);
}

.opener h1 mark {
  color: var(--color-accent-deep);
  background: transparent;
}

.opener__contents {
  min-width: 0;
  max-width: 26rem;
}

/* Closed top and bottom so the index reads as one printed block. Rows carry no
 * rule of their own — the leaders already separate them, and a rule per row
 * would make this a second copy of .index rather than a contents page. */
.contents {
  margin: 0;
  padding: 0;
  list-style: none;
  border-block: var(--rule-hair) solid var(--color-rule);
}

.contents a {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  padding-block: var(--space-sm);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.contents a:hover {
  background-color: var(--color-paper-3);
}

/* Both ends of the row are clickable text, so neither may wrap. (gate 49) */
.contents__name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  white-space: nowrap;
}

.contents__count {
  color: var(--color-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

/* A printed dot leader. The box is exactly one dot tall, so baseline alignment
 * seats the dots on the text baseline the way a row of periods would. Drawn
 * with a gradient rather than `border-style: dotted`, whose dot shape, size and
 * spacing are all left to the browser. */
.contents__leader {
  flex: 1 1 auto;
  min-width: var(--space-md);
  height: var(--rule-bold);
  background: radial-gradient(circle at 50% 50%, var(--color-rule) 1px, transparent 1.25px) repeat-x 0 0 / 0.45em var(--rule-bold);
}

/* The opener already ends on a full section's padding. */
.opener + .section {
  padding-block-start: 0;
}

/* ─── home · F6 product grid (Catalogue) ───────────────────────────────── */

.goods {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2xl) var(--space-lg);
}

.good {
  display: grid;
  align-content: start;
  gap: var(--space-xs);
  min-width: 0;
}

.good__plinth {
  margin-block-end: var(--space-md);
}

.good .plinth__image,
.good .archive-plinth {
  transition: transform var(--dur-base) var(--ease-out);
}

.good:hover .plinth__image,
.good:hover .archive-plinth {
  transform: scale(1.02);
}

.good:hover .plinth {
  background-color: var(--color-paper-2);
}

.good:hover .plinth:has(> .archive-plinth) {
  background-color: var(--color-paper-3);
}

.good__brand {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.good__name {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.5;
  text-decoration: underline solid transparent;
  text-decoration-thickness: var(--rule-hair);
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}

.good:hover .good__name {
  text-decoration-color: var(--color-accent);
}

.good__price {
  margin: 0;
  margin-block-start: var(--space-xs);
  color: var(--color-ink-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* ─── home · hairline index (brands) ───────────────────────────────────── */

.index {
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.index a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-xs) var(--space-md);
  min-height: var(--space-2xl);
  padding-block: var(--space-lg);
  border-block-end: var(--rule-hair) solid var(--color-rule-2);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.index a:hover {
  background-color: var(--color-paper-3);
}

/* DOM order is name · note · kind; placement is explicit at both widths. */
.index__name {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
}

.index__note {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.index__kind {
  grid-column: 2;
  grid-row: 1;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─── home · stories ───────────────────────────────────────────────────── */

.stories {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.story-row {
  display: grid;
  grid-template-columns: var(--space-3xl) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-md);
  padding-block: var(--space-ml);
  border-block-end: var(--rule-hair) solid var(--color-rule-2);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.story-row:hover {
  background-color: var(--color-paper-3);
}

.story-row > div {
  min-width: 0;
}

.story-row__thumb {
  margin: 0;
  aspect-ratio: 1;
  background-color: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  overflow: hidden;
}

.story-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-row__meta {
  margin-block-end: var(--space-xs);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.story-row__title {
  margin-block-end: var(--space-xs);
  font-size: var(--text-md);
}

.story-row__summary {
  margin: 0;
  color: var(--color-ink-2);
  font-size: var(--text-sm);
}

/* ─── home · complete directory ────────────────────────────────────────── */

.directory {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--space-2xl);
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.directory a {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-sm);
  min-height: var(--space-xl);
  padding-block: var(--space-md);
  border-block-end: var(--rule-hair) solid var(--color-rule-2);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.directory a:hover {
  background-color: var(--color-paper-3);
}

.directory__no {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.directory__title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
  font-weight: 500;
}

.directory__kind {
  color: var(--color-muted);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─── breadcrumbs ──────────────────────────────────────────────────────── */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding-block: var(--space-md);
  color: var(--color-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.breadcrumbs a {
  text-decoration: underline;
  text-decoration-color: var(--color-rule);
}

.breadcrumbs a:hover {
  color: var(--color-accent-deep);
  text-decoration-color: var(--color-accent);
}

.breadcrumbs [aria-current="page"] {
  min-width: 0;
  overflow: hidden;
  color: var(--color-ink);
  text-overflow: ellipsis;
}

/* ─── Split Studio · diptych ───────────────────────────────────────────── */

.diptych {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
  padding-block: var(--space-lg) var(--space-2xl);
}

.diptych__copy {
  min-width: 0;
  align-self: center;
}

/* The second row's narrow column reads as a note on the wide column beside it,
 * so it hangs from the top rather than floating in the middle. */
.diptych__aside {
  min-width: 0;
  align-self: start;
}

.diptych + .diptych {
  padding-block-start: 0;
}

/* The second diptych already carries a full section's worth of bottom padding;
 * without this the two paddings stack into ~190px of empty page. */
.diptych + .section,
.story + .section {
  padding-block-start: 0;
}

/* Mobile leads with the object. The figure is not interactive, so tab order is
 * untouched and a screen reader still meets the heading first. */
.diptych > .plinth--display {
  order: -1;
  margin-block-end: var(--space-xl);
}

.diptych h1 {
  margin-block-end: var(--space-lg);
}

.diptych .lede {
  margin-block-end: var(--space-ml);
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-md);
  margin-block-end: var(--space-ml);
  padding-block: var(--space-lg);
  border-block: var(--rule-hair) solid var(--color-rule);
}

.price-row__value {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1;
}

/* The accent marks an actual price. Routes with no price carry a status label
 * ("舊站選品"), which is a word — and design.md keeps mono to numerals. */
.price-row__value[data-price] {
  color: var(--color-accent-deep);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.price-row__note {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.diptych .chip {
  width: 100%;
}

.diptych .fineprint {
  margin-block-start: var(--space-ml);
}

/* F3-adjacent hairline spec list — no bullets, no invented keys. */
.spec {
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.spec li {
  padding-block: var(--space-lg);
  border-block-end: var(--rule-hair) solid var(--color-rule-2);
  font-size: var(--text-base);
}

.manifesto {
  font-size: var(--text-xl);
  line-height: var(--leading-title);
}

.manifesto__source {
  display: block;
  margin-block-start: var(--space-lg);
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* ─── Long Document · story ────────────────────────────────────────────── */

/* The article page is one centred column at 44rem — the previous full-wrap
 * container left the right half of a desktop viewport empty for the whole read.
 * Prose keeps the measure inside it; the figure is the one element that breaks. */
body[data-page-type="article"] main .wrap {
  width: min(100% - (var(--page-gutter) * 2), 44rem);
}

.story {
  padding-block: var(--space-lg) var(--space-2xl);
}

.story__head,
.prose,
.story__end {
  margin-inline: auto;
}

.story__head {
  max-width: var(--measure);
}

.story__meta {
  margin-block-end: var(--space-sm);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.story h1 {
  margin-block-end: var(--space-md);
}

.story__figure {
  margin: var(--space-xl) 0;
  aspect-ratio: 2 / 1;
  background-color: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  overflow: hidden;
}

.story__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prose {
  max-width: var(--measure);
}

.prose section + section {
  margin-block-start: var(--space-2xl);
}

.prose h2 {
  margin-block-end: var(--space-md);
  font-size: var(--text-lg);
}

.prose p {
  color: var(--color-ink-2);
}

.story__end {
  margin-block-start: var(--space-2xl);
  padding-block-start: var(--space-lg);
  max-width: none;
  border-block-start: var(--rule-hair) solid var(--color-rule);
  color: var(--color-accent-deep);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* ─── 404 ──────────────────────────────────────────────────────────────── */

.not-found {
  display: grid;
  align-content: center;
  gap: var(--space-lg);
  justify-items: start;
  min-height: 56vh;
  padding-block: var(--space-3xl) var(--space-4xl);
}

.not-found h1 {
  font-size: var(--text-display);
}

/* ─── footer · Ft1 mast-headed ─────────────────────────────────────────── */

.foot-mast {
  border-block-start: var(--rule-hair) solid var(--color-rule);
  background-color: var(--color-paper-2);
}

.foot-mast__inner {
  display: grid;
  gap: var(--space-lg);
  padding-block: var(--space-2xl);
}

.foot-mast__name {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: 1;
}

.foot-mast__tagline {
  margin-block-start: var(--space-sm);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
}

.foot-mast__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-lg);
}

.foot-mast__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  border-block-end: var(--rule-hair) solid transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.foot-mast__links a:hover {
  color: var(--color-accent-deep);
  border-block-end-color: var(--color-accent);
}

.colophon {
  margin: 0;
  padding-block-start: var(--space-lg);
  border-block-start: var(--rule-hair) solid var(--color-rule);
  line-height: 1.7;
}

/* ─── dialogs ──────────────────────────────────────────────────────────── */

.site-dialog {
  width: min(100% - var(--space-lg), 42rem);
  max-height: min(85vh, 44rem);
  margin: auto;
  padding: var(--space-lg);
  color: var(--color-ink);
  background-color: var(--color-paper);
  border: var(--rule-hair) solid var(--color-ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-dialog);
  opacity: 0;
  transform: translateY(var(--space-xs));
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), overlay var(--dur-base) allow-discrete, display var(--dur-base) allow-discrete;
}

.site-dialog[open] {
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  .site-dialog[open] {
    opacity: 0;
    transform: translateY(var(--space-xs));
  }
}

.site-dialog::backdrop {
  background: var(--color-overlay);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-block-end: var(--space-lg);
  padding-block-end: var(--space-md);
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.dialog-head h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.field-label {
  display: block;
  margin-block-end: var(--space-sm);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.search-input {
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-sm) var(--space-md);
  color: var(--color-ink);
  background-color: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-sm);
  outline: var(--rule-bold) solid transparent;
  outline-offset: 1px;
  font-size: var(--text-base);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.search-input::placeholder {
  color: var(--color-muted);
}

.search-input:hover {
  border-color: var(--color-ink-2);
}

.search-input:focus-visible {
  background-color: var(--color-paper);
  border-color: var(--color-ink-2);
  outline-color: var(--color-focus);
}

.search-input[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.search-results {
  display: grid;
  gap: 0;
  min-height: 1lh;
  max-height: 50vh;
  margin-block-start: var(--space-lg);
  overflow-y: auto;
}

.search-results > p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.search-result {
  display: grid;
  grid-template-columns: var(--space-xl) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  min-height: var(--space-3xl);
  padding-block: var(--space-md);
  border-block-end: var(--rule-hair) solid var(--color-rule-2);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.search-result:hover {
  background-color: var(--color-paper-3);
}

.search-result img,
.search-result__blank {
  width: var(--space-xl);
  height: var(--space-xl);
  object-fit: contain;
  background-color: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
}

.search-result div {
  min-width: 0;
}

.search-result strong {
  display: block;
  overflow: hidden;
  font-size: var(--text-sm);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result span {
  display: block;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.search-result b {
  color: var(--color-muted);
}

.bag-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  padding-block: var(--space-lg);
  border-block-end: var(--rule-hair) solid var(--color-rule-2);
}

.bag-item div {
  min-width: 0;
}

.bag-item a {
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--color-rule);
}

.bag-item a:hover {
  color: var(--color-accent-deep);
  text-decoration-color: var(--color-accent);
}

.bag-item small {
  display: block;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.bag-item button {
  min-width: var(--tap);
  min-height: var(--tap);
  background: transparent;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.bag-item button:hover {
  background-color: var(--color-paper-3);
  border-color: var(--color-ink-2);
}

.bag-item button:active {
  transform: translateY(1px);
}

.bag-note,
.empty-bag {
  margin-block-start: var(--space-lg);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* ─── 42rem ────────────────────────────────────────────────────────────── */

@media (min-width: 42rem) {
  .goods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-row {
    grid-template-columns: var(--space-4xl) minmax(0, 1fr);
    gap: var(--space-lg);
    padding-block: var(--space-lg);
  }

  .directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot-mast__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-lg) var(--space-2xl);
  }

  .colophon {
    grid-column: 1 / -1;
  }
}

/* ─── 48rem — masthead links surface ───────────────────────────────────── */

@media (min-width: 48rem) {
  .masthead__links {
    display: flex;
  }

  .masthead__actions {
    padding-inline-start: var(--space-md);
    border-inline-start: var(--rule-hair) solid var(--color-rule);
  }

  .masthead__menu {
    display: none;
  }

  /* Above the breakpoint the real links are visible, so the sheet never opens. */
  .mobile-menu {
    display: none;
  }
}

/* ─── 64rem ────────────────────────────────────────────────────────────── */

@media (min-width: 64rem) {
  .section {
    padding-block: var(--space-3xl);
  }

  /* A fixed-ish second track, not a fraction: the index is four short rows, and
   * a 5fr column would stretch the leaders across half the page. `start` hangs
   * the contents label from the top of the headline rather than centring it. */
  .opener {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    gap: var(--space-3xl);
    align-items: start;
    padding-block: var(--space-2xl) var(--space-3xl);
  }

  .goods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2xl) var(--space-xl);
  }

  .index a {
    grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) auto;
  }

  .index__note {
    grid-column: 2;
    grid-row: 1;
  }

  .index__kind {
    grid-column: 3;
  }

  .stories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-2xl);
  }

  .diptych {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-3xl);
    padding-block: var(--space-xl) var(--space-3xl);
  }

  .diptych--flip {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }

  /* The frame fills the 7fr column instead of sitting capped at its right edge,
   * which left ~230px of void between the copy and the image. Its height then
   * follows the asset rather than a fixed ratio: the archive mixes wide banners
   * with portrait posters, and any single ratio letterboxes one of them. The
   * max-height keeps the tallest asset inside the fold at 1280x800. */
  .diptych > .plinth--display {
    order: 0;
    max-width: none;
    margin-block-end: 0;
    aspect-ratio: auto;
  }

  .diptych > .plinth--display .plinth__image {
    height: auto;
    max-height: 26rem;
  }

  /* A route with no asset has only two lines of content, so an auto height
   * collapses the frame. The floor keeps it reading as the page's one frame. */
  .diptych > .plinth--display:has(> .archive-plinth) {
    min-height: 20rem;
  }

  /* The article page's related index is one column at the narrow measure. */
  body[data-page-type="article"] .stories {
    grid-template-columns: minmax(0, 1fr);
  }

  .diptych .chip {
    width: auto;
  }

  .story {
    padding-block: var(--space-xl) var(--space-3xl);
  }
}

/* ─── reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 150ms !important;
  }

  .good:hover .plinth__image,
  .good:hover .archive-plinth,
  .chip:active,
  .link:active,
  .ghost-button:active,
  .bag-item button:active {
    transform: none;
  }

  .site-dialog,
  .site-dialog[open] {
    transform: none;
  }
}
