/* ==========================================================================
   Monō: "Six Vats"
   Layout concept: one pale studio wall (the photos' own backdrop colour) for
   the opening and closing, and between them six chapters, each a mirrored
   band of that piece's cloth, a wall-coloured disc carrying the bag across
   the seam, and a field in that piece's dye colour.
   ========================================================================== */

/* ---------- Tokens ------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Fixed colours */
  --wall: #d6d3c9;        /* exact backdrop of all 12 bag photos (sampled, std 0) */
  --ink: #23120f;         /* text on the wall */
  --ink-soft: #574a43;
  --oxblood: #5a1d22;     /* sampled from the logo file */
  --cream: #e8e5d5;       /* the logo file's own ground */

  /* World colours: defaults = wall. Each [data-world] overrides these four. */
  --bg: #d6d3c9;
  --fg: #23120f;
  --soft: #574a43;
  --accent: #5a1d22;

  /* Type */
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --text: "Figtree", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8125rem;                               /* 13px labels */
  --step-0: 1.0625rem;                                /* 17px body */
  --step-1: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);   /* lead */
  --step-2: clamp(1.75rem, 1.3rem + 1.9vw, 3rem);     /* small display */
  --step-3: clamp(2.75rem, 1.6rem + 5vw, 6rem);       /* section display */
  --step-name: clamp(3.75rem, 11.2vw, 11.5rem);       /* piece names */
  --step-hero: clamp(3.5rem, 16vw, 18rem);       /* hero sentence */

  /* Space */
  --gut: clamp(1rem, 4vw, 3.5rem);
  --section: clamp(2rem, 3.5vw, 3.5rem);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --world-time: 900ms;

  /* Film grain used over enlarged cloth photos (inline SVG, no request) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Animatable world colours (browsers without @property switch instantly) */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #d6d3c9; }
@property --fg { syntax: "<color>"; inherits: true; initial-value: #23120f; }
@property --soft { syntax: "<color>"; inherits: true; initial-value: #574a43; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #5a1d22; }

/* ---------- Colour worlds -------------------------------------------------
   Sampled from each piece's photos (see DESIGN-NOTES.md for sources and the
   computed WCAG ratios). Without JS every section carries its own world.
   With JS (html.js-worlds) the body carries the current world and the
   sections go transparent, so the whole page changes colour between pieces. */
[data-world="wall"] {
  --bg: #d6d3c9; --fg: #23120f; --soft: #574a43; --accent: #5a1d22;
}
html:not(.js-worlds) [data-world="aokumo"], body[data-world="aokumo"] {
  --bg: #072f73; --fg: #f1ecdd; --soft: #c3d0e8; --accent: #a9c6f0;
}
html:not(.js-worlds) [data-world="misty-earth"], body[data-world="misty-earth"] {
  --bg: #c7b3a2; --fg: #2e1c16; --soft: #4d372e; --accent: #5b2f22;
}
html:not(.js-worlds) [data-world="terra-veil"], body[data-world="terra-veil"] {
  --bg: #5a372c; --fg: #f3e7da; --soft: #dcc5b6; --accent: #e8b48a;
}
html:not(.js-worlds) [data-world="warp-desen"], body[data-world="warp-desen"] {
  --bg: #9097ad; --fg: #1b2030; --soft: #262c40; --accent: #43271b;
}
html:not(.js-worlds) [data-world="kohaku"], body[data-world="kohaku"] {
  --bg: #b9a560; --fg: #071b30; --soft: #1b2a38; --accent: #071b30;
}
html:not(.js-worlds) [data-world="shadow-bloom"], body[data-world="shadow-bloom"] {
  --bg: #121d27; --fg: #e4e9ed; --soft: #b3c0cc; --accent: #9fb4c8;
}
html:not(.js-worlds) [data-world="oxblood"], body[data-world="oxblood"] {
  --bg: #5a1d22; --fg: #e8e5d5; --soft: #d3c5b4; --accent: #e8c9a0;
}

/* ---------- Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: --bg var(--world-time) var(--ease), --fg var(--world-time) var(--ease),
    --soft var(--world-time) var(--ease), --accent var(--world-time) var(--ease);
}
[data-world] { background: var(--bg); color: var(--fg); }
html.js-worlds .chapter, html.js-worlds .process { background: transparent; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
p, h1, h2, h3, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--wall); padding: 0.6rem 1rem; border-radius: 999px;
}
.skip:focus { top: 1rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Type roles --------------------------------------------------- */
.display {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.display em, .en {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.01em;
}
.label {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
}
.lead { font-size: var(--step-1); line-height: 1.4; max-width: 34ch; }
.soft { color: var(--soft); }
.measure { max-width: 58ch; }

/* Text link with a drawn underline */
.link {
  display: inline-block;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 0.2em;
  font-weight: 500;
  transition: background-size 260ms var(--ease);
}
.link:hover { background-size: 0% 1px; background-position: 100% 100%; }

/* The one filled button: inverse of the current world */
.btn {
  display: inline-flex; align-items: center; gap: 0.7em;
  min-height: 3.25rem; padding: 0.85rem 1.6rem;
  border: 0; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 220ms var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn .arr { transition: transform 220ms var(--ease); }
.btn:hover .arr { transform: translate(3px, -3px); }

/* ---------- Header ------------------------------------------------------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(1rem, 2vw, 1.75rem) var(--gut);
  position: relative; z-index: 5;
}
.logo { display: block; flex: none; border-radius: 50%; overflow: hidden; width: clamp(3.25rem, 5vw, 4.5rem); }
.logo img { width: 100%; }
.nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.2vw, 2.25rem); flex-wrap: wrap; justify-content: flex-end; }
.nav a { text-decoration: none; font-size: 0.9375rem; font-weight: 500; padding: 0.4rem 0; }
.nav a:hover { text-decoration: underline; }
.nav .count { font-family: var(--display); font-style: italic; font-size: 1.125rem; font-variation-settings: "SOFT" 100, "WONK" 1; }
@media (max-width: 620px) { .nav .opt { display: none; } }

/* ---------- Hero: six words, six cloths ---------------------------------- */
.hero { padding-bottom: clamp(1.5rem, 3vw, 3rem); overflow: clip; }
.hero__inner { padding-inline: var(--gut); }
.hero__h {
  font-family: "DM Serif Display", var(--display);
  font-weight: 400;
  font-size: clamp(3.5rem, 15vw, 17rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-top: clamp(0.5rem, 1vw, 1rem);
  margin-left: -0.04em;
}
.hero__h .line { display: block; white-space: nowrap; }
.hero__h .line:nth-child(2) { text-align: right; padding-right: 0.05em; }

/* A word cut out of one piece's cloth. Pale cloths are dimmed (brightness < 1) so their
   lightest threads never dissolve into the wall; factors chosen so that 95%
   of each cloth's pixels reach 3:1 against the wall (see the notes). */
.cw {
  display: inline-block;
  color: var(--fallback, var(--ink));
  padding: 0 0.07em 0.14em; margin: 0 -0.07em -0.14em;   /* room for descenders and overhangs */
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .cw {
    background-image: var(--cloth);
    background-size: var(--cs, 560px) auto;
    background-position: var(--cp, 50% 50%);
    filter: brightness(var(--dim, 1)) saturate(var(--sat, 1));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}
.cw--aokumo { --cloth: url("img/aokumo-3.webp"); --fallback: #073f80; --cp: 10% 60%; }
.cw--misty-earth { --cloth: url("img/misty-earth-3.webp"); --dim: 0.56; --sat: 1.15; --fallback: #64493e; }
.cw--terra-veil { --cloth: url("img/terra-veil-3.webp"); --dim: 0.6; --sat: 1.15; --fallback: #664337; --cs: 640px; --cp: 40% 20%; }
.cw--warp-desen { --cloth: url("img/warp-desen-3.webp"); --dim: 0.56; --sat: 1.3; --fallback: #5c5560; --cs: 360px; --cp: 46% 52%; }
.cw--kohaku { --cloth: url("img/kohaku-3.webp"); --dim: 0.82; --fallback: #1c3044; --cs: 760px; --cp: 30% 40%; }
.cw--shadow-bloom { --cloth: url("img/shadow-bloom-3.webp"); --fallback: #263340; --cs: 620px; }

.hero__meta {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1.5rem 3rem;
  margin-top: clamp(1.25rem, 2.5vw, 2.5rem);
}
.hero__tally { text-align: right; }
@media (max-width: 620px) {
  .hero__h { font-size: 14.5vw; }
  .hero__meta { grid-template-columns: 1fr; }
  .hero__tally { text-align: left; }
}
.hero__tally .num { font-family: var(--display); font-weight: 300; font-size: var(--step-3); line-height: 0.8; letter-spacing: -0.04em; font-variation-settings: "SOFT" 100; }
.hero__tally .num small { font-size: 0.42em; letter-spacing: 0; }

/* The six bags hung in a row on the wall: page colour = photo backdrop,
   so no frame, no card, no visible square. */
.rail {
  display: grid; grid-template-columns: repeat(6, 1fr);
  margin-top: clamp(1rem, 2vw, 2rem);
  padding-inline: calc(var(--gut) * 0.4);
}
.rail__item { position: relative; text-decoration: none; display: block; padding-bottom: 0.5rem; }
.rail__ph { display: block; position: relative; aspect-ratio: 1; }
.rail__cap > span { display: block; }
.rail__ph img { position: absolute; inset: 0; width: 100%; height: 100%; }
.rail__ph .back { opacity: 0; transition: opacity 320ms var(--ease); }
.rail__item:hover .back, .rail__item:focus-visible .back { opacity: 1; }
.rail__cap { display: grid; gap: 0.15rem; justify-items: center; text-align: center; margin-top: -0.25rem; }
.rail__no { font-family: var(--display); font-style: italic; font-size: 0.9375rem; color: var(--soft); font-variation-settings: "SOFT" 100, "WONK" 1; }
.rail__name { font-family: var(--display); font-size: clamp(1.25rem, 1.9vw, 1.875rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; font-variation-settings: "SOFT" 100; }
.rail__state { font-size: var(--step--1); color: var(--soft); }
.rail__item.is-sold .rail__name { text-decoration: line-through; text-decoration-thickness: 1px; }
.rail__item.is-sold .rail__ph img { opacity: 0.5; }   /* opacity only: a filter would tint the backdrop and reveal the square */
.rail__item.is-sold:hover .rail__ph img:not(.back) { opacity: 0.5; }
@media (max-width: 1000px) { .rail { grid-template-columns: repeat(3, 1fr); row-gap: 1.5rem; } }
@media (max-width: 560px) { .rail { grid-template-columns: repeat(2, 1fr); padding-inline: 0; } }

/* ---------- Chapter ------------------------------------------------------ */
.chapter { position: relative; overflow: clip; scroll-margin-top: 0; }

/* Cloth band. From 900px up the macro is shown twice, the second copy
   mirrored: every photo stays at or below its native 916px (no soft upscale)
   and the fold line reads like the fold that made the pattern. */
.band { position: relative; display: grid; grid-template-columns: 1fr; height: min(56vw, 40svh); overflow: hidden; background: var(--ink); }
.half { overflow: hidden; min-height: 0; }
.half--mirror { display: none; transform: scaleX(-1); }
.band img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--bz, 1.12)); transform-origin: var(--bo, 50% 50%); }
.band::after { content: ""; position: absolute; inset: 0; background: var(--grain); mix-blend-mode: overlay; opacity: 0.35; pointer-events: none; }
@media (min-width: 900px) {
  .band { grid-template-columns: 1fr 1fr; height: min(30vw, 46svh); }
  .half--mirror { display: block; }
}

.field {
  position: relative;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2vw, 1.5rem);
  padding: clamp(1rem, 2vw, 2rem) var(--gut) var(--section);
}

/* The wall-coloured disc: the bag's own backdrop, cut as a circle like the
   logo disc. The photo is clipped inside it, so no square edge ever shows.
   A second, smaller disc carries the back of the bag; for a sold piece it
   is an empty outline. */
.discs {
  position: relative; z-index: 2;
  grid-column: 7 / 13; grid-row: 1 / span 4; align-self: start;
  margin-top: calc(-1 * clamp(9rem, 21vw, 22rem));
  margin-right: calc(-1 * var(--gut) - 3vw);
}
.disc, .disc2 { position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--wall); }
.disc img, .disc2 img { position: absolute; left: 8.5%; top: 8.5%; width: 83%; height: 83%; max-width: none; }
.disc2 { width: 44%; margin: -15% 0 0 9%; box-shadow: 0 0 0 clamp(6px, 0.8vw, 12px) var(--bg); }
.disc2--empty {
  background: transparent; box-shadow: none; border: 1.5px solid var(--fg);
  display: grid; place-items: center; text-align: center; padding: 12%;
  font-size: clamp(1.5rem, 3vw, 3rem); line-height: 1;
}
.chapter--flip .discs { grid-column: 1 / 7; margin-right: 0; margin-left: calc(-1 * var(--gut) - 3vw); }
.chapter--flip .disc2 { margin-left: auto; margin-right: 9%; }

.chapter__head { grid-column: 1 / 7; grid-row: 1; padding-top: clamp(0.5rem, 1.5vw, 1.5rem); min-width: 0; }
.chapter--flip .chapter__head { grid-column: 7 / 13; }
.chapter__no { display: flex; align-items: baseline; gap: 0.75rem; color: var(--accent); }
.chapter__no .n { font-family: var(--display); font-style: italic; font-weight: 300; font-size: var(--step-2); line-height: 1; font-variation-settings: "SOFT" 100, "WONK" 1; }
.chapter__name { font-size: var(--step-name); margin-top: 0.12em; margin-left: -0.04em; }
.chapter__name .w { display: block; }
.chapter--solo .chapter__name { font-size: clamp(3.75rem, 13.4vw, 14rem); }

.chapter__body {
  grid-column: 1 / 7; grid-row: 2;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start; margin-top: clamp(1.25rem, 2.5vw, 2.5rem);
}
.chapter--flip .chapter__body { grid-column: 7 / 13; }

/* 1/1: solid while the piece is here, hollow once it has found a home */
.one {
  font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100, "WONK" 0;
  font-size: clamp(4.5rem, 9.5vw, 9.5rem); line-height: 0.78; letter-spacing: -0.06em;
  font-feature-settings: "lnum";
}
.one--hollow { color: transparent; -webkit-text-stroke: 1.5px var(--fg); }
@supports not (-webkit-text-stroke: 1px red) { .one--hollow { color: var(--soft); } }

.facts { display: grid; gap: 1.1rem; min-width: 0; }
.facts__state { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.25rem; }
.price { font-family: var(--display); font-size: var(--step-2); font-weight: 400; line-height: 1; letter-spacing: -0.02em; font-variation-settings: "SOFT" 100; white-space: nowrap; }
.price--gone { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--soft); }
.facts p { max-width: 34ch; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1.25rem; font-size: 0.9375rem; padding-top: 0.9rem; border-top: 1px solid color-mix(in srgb, var(--fg) 35%, transparent); max-width: 24rem; }
.spec dt { color: var(--soft); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 0.5rem; }
.fine { font-size: var(--step--1); color: var(--soft); max-width: 40ch; }
.home-line { font-family: var(--display); font-style: italic; font-weight: 300; font-size: var(--step-2); line-height: 1.05; letter-spacing: -0.02em; font-variation-settings: "SOFT" 100, "WONK" 1; }

@media (max-width: 899px) {
  .field { display: block; padding-top: 0; }
  .discs, .chapter--flip .discs { width: min(96vw, 34rem); margin: -34vw auto 0; }
  .chapter--solo .chapter__name { font-size: clamp(3.75rem, 19vw, 8rem); }
  .chapter__head { padding-top: 1.75rem; }
  .chapter__name { font-size: clamp(3.75rem, 19vw, 8rem); }
  .chapter__body { grid-template-columns: 1fr; }
}

/* ---------- Process (oxblood) -------------------------------------------- */
.process { padding: var(--section) var(--gut); overflow: clip; }
.process__top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1.5rem; row-gap: 2rem; align-items: end; }
.process__h { grid-column: 1 / 9; font-size: var(--step-name); }
.process__intro { grid-column: 9 / 13; display: grid; gap: 1rem; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); margin-top: clamp(1.5rem, 2.5vw, 2.5rem); counter-reset: step; }
.step { display: grid; gap: 1.1rem; align-content: start; counter-increment: step; }
.step__disc { width: 122%; margin-left: -11%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; position: relative; }
.step:nth-child(2) .step__disc { z-index: 1; box-shadow: 0 0 0 clamp(6px, 0.8vw, 12px) var(--bg); }
.step__disc img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--z, 1.3)); transform-origin: var(--o, 50% 50%); }
.step__t { font-family: var(--display); font-size: var(--step-2); font-weight: 400; line-height: 1; letter-spacing: -0.02em; font-variation-settings: "SOFT" 100; }
.step__t::before { content: counter(step) ". "; font-style: italic; color: var(--accent); font-variation-settings: "SOFT" 100, "WONK" 1; }
.process__quote { margin-top: clamp(1.5rem, 3vw, 3rem); font-size: var(--step-3); max-width: 18ch; }
@media (max-width: 899px) {
  .process__h, .process__intro { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; }
  .step { grid-template-columns: 6.5rem 1fr; align-items: center; column-gap: 1.25rem; }
  .step__disc, .step:nth-child(2) .step__disc { grid-row: span 2; width: 100%; margin-left: 0; box-shadow: none; }
  .step p { grid-column: 2; }
}

/* Six cloths side by side: the buffer between the dark and the pale worlds */
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); height: clamp(10rem, 30svh, 18rem); position: relative; }
.swatches img { width: 100%; height: 100%; object-fit: cover; min-width: 0; }
.swatches::after { content: ""; position: absolute; inset: 0; background: var(--grain); mix-blend-mode: overlay; opacity: 0.3; pointer-events: none; }
@media (max-width: 620px) { .swatches { grid-template-columns: repeat(3, 1fr); height: 50vw; } }

/* ---------- Closing sections (wall) -------------------------------------- */
.closing__inner { padding: var(--section) var(--gut) 0; display: grid; gap: var(--section); }
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1.5rem; row-gap: 2rem; }
.split__h { grid-column: 1 / 6; display: grid; gap: 1.5rem; align-content: start; }
.split__h h2 { font-size: var(--step-3); }
.split__b { grid-column: 7 / 13; display: grid; gap: 1.25rem; align-content: start; }
.care li { display: grid; grid-template-columns: 2.5rem 1fr; align-items: baseline; padding: 0.7rem 0; border-top: 1px solid color-mix(in srgb, var(--fg) 30%, transparent); }
.care li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--fg) 30%, transparent); }
.care .k { font-family: var(--display); font-style: italic; color: var(--accent); font-variation-settings: "SOFT" 100, "WONK" 1; }
.about__lead { font-family: var(--display); font-weight: 300; font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.02em; font-variation-settings: "SOFT" 100; }
.kv { display: grid; grid-template-columns: 9rem 1fr; gap: 0.5rem 1rem; }
.kv dt { color: var(--soft); }


@media (max-width: 899px) { .split__h, .split__b { grid-column: 1 / -1; } }

/* ---------- Footer ------------------------------------------------------- */
.site-footer { padding: var(--section) var(--gut) 6.5rem; }
.footer__line { font-family: var(--display); font-weight: 900; font-size: clamp(3rem, 10.4vw, 11rem); line-height: 0.86; letter-spacing: -0.045em; font-variation-settings: "SOFT" 100; margin-left: -0.04em; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 2rem 2rem; margin-top: clamp(1.5rem, 2.5vw, 2.5rem); padding-top: 2rem; border-top: 1px solid color-mix(in srgb, var(--fg) 30%, transparent); font-size: 0.9375rem; }
.footer__grid h3 { margin-bottom: 0.9rem; }
.footer__grid li { padding: 0.2rem 0; }
.footer__grid a { text-decoration: none; }
.footer__grid a:hover { text-decoration: underline; }
.footer__brand { display: grid; gap: 1rem; align-content: start; max-width: 22rem; }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; margin-top: 2rem; font-size: var(--step--1); color: var(--soft); }
@media (max-width: 899px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Floating piece bar (JS only) --------------------------------- */
.pill {
  position: fixed; z-index: 20; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 160%);
  display: flex; align-items: center; gap: 0.9rem;
  max-width: calc(100vw - 1.5rem);
  background: var(--cream); color: var(--ink);
  border-radius: 999px; padding: 0.4rem 0.4rem 0.4rem 1.1rem;
  box-shadow: 0 10px 30px -12px rgba(20, 10, 8, 0.55);
  font-size: 0.9375rem; white-space: nowrap;
  transition: transform 420ms var(--ease);
}
.pill.is-on { transform: translate(-50%, 0); }
.pill[hidden] { display: none; }
.pill__no { font-family: var(--display); font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1; }
.pill__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.pill__name:hover { text-decoration: underline; }
.pill__price { color: var(--ink-soft); }
.pill__go { background: var(--ink); color: var(--cream); border-radius: 999px; padding: 0.55rem 1rem; text-decoration: none; font-weight: 600; }
.pill__go[aria-disabled="true"] { background: transparent; color: var(--ink); font-weight: 500; font-style: italic; font-family: var(--display); padding-left: 0.2rem; }
@media (max-width: 480px) { .pill__price { display: none; } }

/* ---------- Product page ------------------------------------------------- */
.p-hero { padding: 0 var(--gut) var(--section); overflow: clip; position: relative; }
.crumb { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
/* --pn / --pn-m: per-piece name size (set inline by build_pages.py) so every
   name spans the page on one line; two-word names stack on phones. */
.p-name { font-size: clamp(3.5rem, var(--pn, 25.5vw), 27rem); line-height: 0.8; letter-spacing: -0.055em; margin: clamp(1rem, 2vw, 2rem) 0 0 -0.05em; white-space: nowrap; }
.p-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1.5rem; align-items: start; }
.p-buy { grid-column: 1 / 5; position: sticky; top: 2rem; display: grid; gap: 1.25rem; padding-top: clamp(1.25rem, 3vw, 3rem); z-index: 3; }
.p-buy .one { font-size: clamp(5rem, 11vw, 11rem); }
.p-gallery { grid-column: 5 / 13; position: relative; margin-top: clamp(1.5rem, 3vw, 3rem); }
.p-disc { position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--wall); }
.p-disc img { position: absolute; left: 8.5%; top: 8.5%; width: 83%; height: 83%; max-width: none; }
.p-disc--front { width: 100%; margin-right: calc(-1 * var(--gut)); }
.p-disc--back { width: 62%; margin: -9% 0 0 -3%; }   /* stays clear of the buy column: its text is the world's fg and would vanish on the wall disc */
.p-cap { margin-top: 0.9rem; font-size: var(--step--1); color: var(--soft); }
.p-cap--right { text-align: right; }
.p-buy > p:not(.one), .p-buy .soft { max-width: 34ch; }
/* Sold state, below 900px only: the empty outline disc from the index
   chapters, set beside the back of the bag. It carries "Found a home." there
   because the gallery comes before the buy block; from 900px up the sticky buy
   column says it instead, so the line is never on screen twice. */
.p-seal {
  display: none;
  position: absolute; aspect-ratio: 1; border-radius: 50%;
  border: 1.5px solid var(--fg); place-items: center; text-align: center; padding: 3%;
  font-size: clamp(1.25rem, 3.1vw, 3.25rem); line-height: 1; transform: rotate(-7deg);
}
.only-sold { display: none; }
html[data-state="sold"] .only-sold { display: revert; }
html[data-state="sold"] .only-avail { display: none; }
html[data-state="sold"] .one { color: transparent; -webkit-text-stroke: 1.5px var(--fg); }
html[data-state="sold"] .price { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--soft); }

.statement { padding: var(--section) var(--gut); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1.5rem; row-gap: 2.5rem; }
.statement__q { grid-column: 1 / 9; font-size: var(--step-3); }
.statement__specs { grid-column: 9 / 13; grid-row: 1 / span 2; display: grid; gap: 1.5rem; align-content: start; }
.statement .spec { max-width: none; }
.p-care { grid-column: 1 / 7; display: grid; gap: 1rem; }

.next { display: grid; grid-template-columns: 1fr 1fr; }
.next a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; padding: clamp(1.5rem, 3.5vw, 3.5rem) var(--gut); text-decoration: none; background: var(--bg); color: var(--fg); overflow: hidden; }
.next .display { font-size: var(--step-3); }
.next__disc { width: clamp(7rem, 16vw, 15rem); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--wall); position: relative; transition: transform 500ms var(--ease); }
.next__disc img { position: absolute; left: 8.5%; top: 8.5%; width: 83%; height: 83%; max-width: none; }
.next a:hover .next__disc { transform: rotate(-6deg) scale(1.04); }


@media (max-width: 899px) {
  .p-grid { display: flex; flex-direction: column; }
  .p-gallery { order: -1; margin-top: 1rem; width: 100%; }
  .p-disc--front { width: min(100%, 34rem); margin: 0 auto; }
  .p-disc--back { width: 58%; margin: -8% 0 0 0; }
  .p-seal { right: 0; bottom: 13%; width: 37%; font-size: clamp(1.25rem, 5.4vw, 2.75rem); }
  html[data-state="sold"] .p-seal { display: grid; }
  .p-buy .home-line { display: none; }
  .p-buy .home-line + .label { margin-top: 0 !important; }
  .p-buy { position: static; padding-top: 2rem; }
  .statement__q, .statement__specs, .p-care { grid-column: 1 / -1; grid-row: auto; }
  .next { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .p-name { font-size: clamp(3.5rem, var(--pn-m, 25.5vw), 27rem); line-height: 0.9; }
  .p-name .w { display: block; }
}

/* ---------- Motion (progressive, never required to read the page) -------- */
@media (prefers-reduced-motion: no-preference) {
  /* Cloth drifts slowly inside the hero letters */
  .cw { animation: cloth-drift 46s ease-in-out infinite alternate; }
  @keyframes cloth-drift { to { background-position: calc(50% + 180px) calc(50% - 120px); } }

  @supports (animation-timeline: view()) {
    /* Bands: the cloth slides behind its window as the chapter passes */
    .band img { animation: band-slide linear both; animation-timeline: view(); }
    @keyframes band-slide { from { translate: 0 -4%; } to { translate: 0 4%; } }
    /* Discs settle into place as they enter. Resting state is fully visible. */
    .disc, .disc2, .p-disc--back { animation: disc-in linear both; animation-timeline: view(); animation-range: entry 0% cover 34%; }
    @keyframes disc-in { from { transform: translateY(9%) scale(0.9) rotate(-5deg); } to { transform: none; } }
    .chapter__name .w { animation: name-in linear both; animation-timeline: view(); animation-range: entry 10% cover 30%; }
    .chapter__name .w + .w { animation-range: entry 40% cover 36%; }
    @keyframes name-in { from { transform: translateX(-0.12em); opacity: 0.35; } to { transform: none; opacity: 1; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* Cross-document transition between the chapter and its product page */
@view-transition { navigation: auto; }
.stack { display: grid; gap: 1rem; }
