/* =====================================================================
   Seven Chapters storefront
   Layout: one calm column (max 1240px) with wide margins. The shop opens
   like the first page of a book, then the seven chapter cards; the home scroll scene is the only full-bleed
   moment, set on a sunlit plaster wall. Light theme only, by design:
   porcelain white, the logo's ink.
   ===================================================================== */
:root {
  /* Colour: taken from the pieces. Porcelain glaze, the logo's ink, cobalt underglaze. */
  --glaze: #F3F4F8;      /* page ground */
  --paper: #FCFCFE;      /* raised surfaces: bag, fields, order summary */
  --ink: #241C33;        /* text, buttons (the logo's colour) */
  --ink-2: #5E596C;      /* secondary text */
  --ink-3: #8F8B9C;      /* unwritten chapters, dotted leaders */
  --rule: #D8DAE3;       /* hairlines */
  --cobalt: #2B3B8E;     /* links, notes, focus */
  --wash: #E6E9F3;       /* selected choices, image placeholders */
  --error: #9A2B3B;
  --on-photo: #FFFFFF;   /* words written on chapter cards */

  /* Home wallpaper: colours sampled from the photo, and its blur and grain.
     How much it zooms while scrolling is WALL_ZOOM in js/hero.js. */
  --wall: #80644D;        /* the photo's average (mocha silk), shown while it loads */
  --wall-light: #8F7663;  /* its lit folds: behind cards while they load */
  --wall-blur: 0px;       /* 0px = sharp; try 1.5px for a softer wall */
  --wall-grain: 0;        /* 0 = none, 1 = strongest */
  --hero-ink: #2A1910;    /* dark walnut: the Shop now button */
  --hero-ink-2: #4A3628;  /* Shop now on hover */
  --hero-on-ink: #F1E7DA; /* the words on the brown Shop now button */
  --hero-halo: transparent;       /* a glow around the logo, e.g. rgba(238,227,212,.9) (none on the silk) */
  --hero-halo-soft: transparent;  /* its wider, fainter edge */
  --hero-on-wall: rgba(255, 255, 255, 0.86);   /* light words on the silk: the scroll hint */

  /* Type: Italiana for names and titles, Hanken Grotesk for reading and buying. */
  --f-display: 'Italiana', 'Didot', 'Bodoni 72', 'Bodoni MT', Georgia, serif;
  --f-text: 'Hanken Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --f-script: 'Pinyon Script', 'Snell Roundhand', 'Apple Chancery', cursive;   /* chapter names on the cards */

  --t-xs: 0.8125rem;   /* 13 */
  --t-s: 0.875rem;     /* 14 */
  --t-m: 1rem;         /* 16 */
  --t-l: 1.1875rem;    /* 19 */
  --d-m: clamp(1.625rem, 1.2rem + 1.4vw, 2.25rem);  /* 26–36 */
  --d-l: clamp(2.125rem, 1.4rem + 2.6vw, 3.5rem);   /* 34–56 */
  --d-xl: clamp(2.75rem, 1.5rem + 4.6vw, 6rem);     /* 44–96 */
  --d-xxl: clamp(3.25rem, 1.2rem + 7.6vw, 8.5rem);  /* 52–136 */

  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1240px;
  --bar: 64px;
  --top: env(safe-area-inset-top, 0px);
  --section: clamp(56px, 8vw, 112px);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + var(--top) + 24px); }
body {
  margin: 0;
  background: var(--glaze);
  color: var(--ink);
  font: 400 var(--t-m)/1.6 var(--f-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--glaze); border-radius: 999px; text-decoration: none;
}
.skip-link:focus { top: calc(var(--top) + 12px); }
.muted { color: var(--ink-2); }

.display-m, .display-l, .display-xl, .display-xxl {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0.005em;
  margin: 0;
  text-wrap: balance;
}
.display-m { font-size: var(--d-m); }
.display-l { font-size: var(--d-l); }
.display-xl { font-size: var(--d-xl); }
.display-xxl { font-size: var(--d-xxl); line-height: 0.95; }

/* ---------- buttons and links ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 30px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: 500 var(--t-s)/1 var(--f-text); letter-spacing: 0.04em;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.pill:hover { background: var(--ink); color: var(--glaze); }
.pill-solid { background: var(--ink); color: var(--glaze); }
.pill-solid:hover { background: var(--cobalt); border-color: var(--cobalt); }
.pill-wide { width: 100%; }
.pill:disabled { opacity: .45; cursor: not-allowed; }
.pill:disabled:hover { background: var(--ink); border-color: var(--ink); }

.text-link {
  color: var(--cobalt); background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.text-button {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  font-size: var(--t-s); color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.text-button:hover, .text-link:hover { color: var(--ink); }

/* ---------- top bar ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(var(--bar) + var(--top));
  padding: var(--top) var(--gutter) 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: color-mix(in srgb, var(--glaze) 76%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 36px); font-size: var(--t-s); letter-spacing: 0.02em; }
.nav-end { justify-content: flex-end; }
.nav a, .bag-button {
  padding: 10px 0; background: none; border: 0; cursor: pointer; text-decoration: none; letter-spacing: inherit;
}
.nav a:hover, .bag-button:hover { color: var(--cobalt); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 1px; }
.bag-count { font-variant-numeric: tabular-nums; }
.brand { display: block; padding: 6px; }
.brand img { height: 40px; width: auto; }
body[data-page="home"] { background: var(--wall); }
/* Home: the same top bar as the shop, but almost clear over the silk (10%),
   with white links and a white mark, and no line under it. */
body[data-page="home"] .site-header,
body[data-page="home"] .site-header.is-scrolled {
  background: color-mix(in srgb, var(--glaze) 10%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom-color: transparent;
  color: #FFFFFF;
}
body[data-page="home"] .brand img { filter: brightness(0) invert(1); }
body[data-page="home"] .nav a:hover,
body[data-page="home"] .bag-button:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
@media (max-width: 640px) { .wide-only { display: none; } }

/* ---------- page frame ---------- */
.page {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding: calc(var(--bar) + var(--top) + clamp(36px, 6vw, 80px)) var(--gutter) var(--section);
}

/* =====================================================================
   Home: the scroll scene
   ===================================================================== */
.hero { position: relative; }
.hero-stage { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--wall); }
.hero.is-moving .hero-stage { position: sticky; top: 0; }
.hero-photos { position: absolute; inset: 0; }

/* The wallpaper: her photo with fine grain over it. js/hero.js zooms it in a
   little as the visitor scrolls (it sets --wall-zoom). */
.hero-wall { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hero-wall picture, .hero-wall img { display: block; width: 100%; height: 100%; }
.hero-wall img {
  object-fit: cover; object-position: 62% 50%;
  filter: blur(var(--wall-blur));
  transform: scale(calc(var(--wall-zoom, 1) * 1.01));   /* 1.01 hides any soft edge if blur is turned on */
  will-change: transform;
}
.hero-wall::after {
  content: ''; position: absolute; inset: 0;
  background: url("../assets/img/home/grain.png") 0 0 / 128px repeat;
  opacity: var(--wall-grain);
}

.float {
  position: absolute; left: 50%; top: 50%;
  aspect-ratio: 4 / 5; max-width: none;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
.float {
  opacity: 0; visibility: hidden;   /* hidden until the visitor scrolls */
}
.float img { width: 100%; height: 100%; object-fit: cover; background: var(--wall-light); }
/* The chapter card inside each floating link (styled with the shop's cards),
   with a warmer shadow that matches the sunlit wall. */
.float .chapter-card {
  width: 100%; height: 100%; aspect-ratio: auto;
  box-shadow: 0 1px 2px rgba(48, 40, 24, 0.16), 0 22px 44px -16px rgba(48, 40, 24, 0.45);
}

/* The logo, set a little above the middle */
.hero-center {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(16px, 2.6vh, 24px);
  padding: 0 var(--gutter) 10vh;
  text-align: center; pointer-events: none;
}
.hero-name { margin: 0; }
.hero-name img {
  width: clamp(190px, 22vmin + 110px, 360px); height: auto;
  /* A soft halo of sunlit plaster around the strokes, so the logo reads over the driftwood */
  filter: drop-shadow(0 0 1px var(--hero-halo)) drop-shadow(0 0 2px var(--hero-halo)) drop-shadow(0 0 8px var(--hero-halo-soft)) drop-shadow(0 0 20px var(--hero-halo-soft));
}
.hero-swap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hero.is-moving .hero-swap { display: contents; }   /* the button is placed on its own below */
.hero-cta {   /* solid walnut brown, a shade lighter on hover */
  pointer-events: auto; min-width: 168px;
  background: var(--hero-ink); border-color: var(--hero-ink); color: var(--hero-on-ink);
}
.hero-cta:hover { background: var(--hero-ink-2); border-color: var(--hero-ink-2); color: var(--hero-on-ink); }
.hero.is-moving .hero-cta {
  position: absolute; left: 0; right: 0; margin-inline: auto; width: max-content;
  bottom: calc(clamp(110px, 25vh, 240px) + env(safe-area-inset-bottom, 0px));
}
.hero-hint {
  display: none; position: absolute; left: 0; right: 0; z-index: 5;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  margin: 0; text-align: center; font-size: 1.0625rem; letter-spacing: 0.06em; color: var(--hero-on-wall);
}
.hero.is-moving .hero-hint { display: block; }

/* Reduced motion: a still page */
.hero.is-still .hero-stage {
  height: auto; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: 40px;
  padding: calc(var(--bar) + var(--top) + 24px) var(--gutter) 48px;
}
.hero.is-still .hero-center { position: relative; z-index: 1; padding: 0; }
.hero.is-still .hero-photos {
  position: relative; z-index: 1; order: 2; margin-inline: auto;
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 2vw, 20px);
}
.still-photo { width: min(220px, 56vw); box-shadow: 0 22px 44px -16px rgba(48, 40, 24, 0.45); }
.still-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* =====================================================================
   Shop: intro, the seven chapters, every piece, care, letter
   ===================================================================== */
.wrap { max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.shop-main { padding-top: calc(var(--bar) + var(--top) + clamp(36px, 6vw, 80px)); }

/* A note in the margin, then the title, like the first page of a book */
.shop-intro {
  display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 3.2fr);
  gap: 20px clamp(24px, 5vw, 80px); align-items: start;
  padding-bottom: clamp(40px, 6vw, 72px);
}
.margin-note {
  margin: 0; padding-top: 14px; border-top: 1px solid var(--rule);
  font-family: var(--f-display); font-size: clamp(1.25rem, 1rem + 0.6vw, 1.625rem); line-height: 1.35;
  color: var(--ink-2); max-width: 15em;
}
.shop-lede {
  margin: 0.45em 0 0; max-width: 30ch;
  font-family: var(--f-display); font-size: var(--d-m); line-height: 1.3; text-wrap: pretty;
}

/* The seven chapters */
.shop-chapters { padding-bottom: var(--section); }
.chapter-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 48px) clamp(16px, 2.4vw, 32px);
}
.chapter-tile { display: grid; gap: 12px; min-width: 0; }
.chapter-card {
  position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 3px; color: var(--on-photo); text-decoration: none;
  container-type: inline-size; background: var(--wash);
  box-shadow: 0 26px 50px -26px rgba(36, 28, 51, 0.5), 0 6px 14px rgba(36, 28, 51, 0.12);
}
.chapter-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.chapter-card:not(.is-titled)::after {   /* a quiet shade behind the words */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 45% at 50% 38%, rgba(20, 12, 28, 0.3), transparent 75%);
}
.card-words {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 5cqw;
  padding: 20cqw 8cqw 0; text-align: center;
  text-shadow: 0 1px 14px rgba(20, 12, 28, 0.45);
}
.card-kicker { font-family: var(--f-display); font-size: 7.4cqw; letter-spacing: 0.04em; }
.card-title { font-family: var(--f-script); font-size: 19cqw; line-height: 1.02; }
.chapter-card.is-closed .card-title { font-size: 15cqw; }
.card-cta {
  position: absolute; z-index: 2; left: 50%; bottom: 7cqw; transform: translate(-50%, 8px);
  padding: 0.55em 1.2em; border-radius: 999px; white-space: nowrap;
  font-size: max(11px, 4.6cqw); letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .4s ease, transform .4s ease;
}
@media (hover: hover) {
  .chapter-card:hover img { transform: scale(1.05); }
  .chapter-card:hover .card-cta { opacity: 1; transform: translate(-50%, 0); }
}
.chapter-card:focus-visible { outline-offset: 5px; }
.chapter-card:focus-visible .card-cta { opacity: 1; transform: translate(-50%, 0); }
.chapter-tile-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0;
  font-size: var(--t-s); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.chapter-tile-meta span:first-child { font-family: var(--f-display); font-size: 1.375rem; color: var(--ink); }
.chapter-tile.is-closed .chapter-tile-meta span:first-child { color: var(--ink-2); }

/* Every piece, as framed plates */
.shop-pieces { padding-bottom: var(--section); }
.collection-head {
  display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap;
  gap: 12px 24px; margin-bottom: clamp(28px, 4vw, 48px);
}
.collection-head p { margin: 0; color: var(--ink-2); font-size: var(--t-s); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 clamp(28px, 4vw, 48px); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--rule); border-radius: 999px; background: transparent; cursor: pointer;
  font-size: var(--t-s); transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--glaze); }
.chip-num { font-family: var(--f-display); opacity: 0.7; }

.plates {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 64px) clamp(16px, 3vw, 48px); align-items: start;
}
.plate { display: grid; gap: 16px; min-width: 0; }
.plate-frame { position: relative; display: block; padding: 10px; border: 1px solid var(--rule); background: var(--paper); }
.plate-media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--wash); }
.plate-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity .6s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1);
}
.plate-alt { opacity: 0; }
@media (hover: hover) {
  .plate-frame:hover .plate-alt { opacity: 1; }
  .plate-frame:hover .plate-media img { transform: scale(1.03); }
}
.plate-badge {
  position: absolute; top: 22px; left: 22px; padding: 2px 10px;
  border: 1px solid currentColor; border-radius: 999px; background: var(--paper);
  color: var(--cobalt); font-size: var(--t-xs); line-height: 1.5;
}
.plate-caption { display: grid; gap: 4px; }
.plate-no { margin: 0; font-family: var(--f-display); color: var(--ink-2); }
.plate-name { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(1.75rem, 1.3rem + 1vw, 2.25rem); line-height: 1.1; }
.plate-name a { text-decoration: none; }
.plate-name a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.plate-finish { font-family: var(--f-text); font-size: var(--t-m); color: var(--ink-2); }
.plate-line { margin: 0; color: var(--ink-2); }
.plate-buy { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.plate-price { margin: 0; font-variant-numeric: tabular-nums; }
.plate-add { min-height: 42px; padding: 0 22px; }

@media (max-width: 1000px) { .chapter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .shop-intro { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .chapter-tile-meta span:first-child { font-size: 1.125rem; }
  .plates { grid-template-columns: minmax(0, 1fr); gap: 56px; }
}

/* ---------- product cards ---------- */
.pieces {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 3vw, 48px) clamp(16px, 2.4vw, 36px);
}
.pieces-1 { grid-template-columns: minmax(0, 24rem); }
.pieces-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 52rem; }
.piece-link { display: grid; gap: 14px; text-decoration: none; }
.piece-media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--wash); }
.piece-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity .6s ease;
}
.piece-alt { opacity: 0; }
@media (hover: hover) { .piece-link:hover .piece-alt { opacity: 1; } }
.piece-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.piece-name { font-family: var(--f-display); font-size: clamp(1.625rem, 1.2rem + 0.9vw, 2.125rem); line-height: 1.05; }
.piece-price { font-size: var(--t-s); font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-was { color: var(--ink-2); margin-left: 0.35em; }
.piece-sub { font-size: var(--t-s); color: var(--ink-2); margin-top: -8px; }
.piece-badge { color: var(--cobalt); }

@media (max-width: 640px) {
  .pieces { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .pieces-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .pieces-2 .piece-name { font-size: 1.375rem; }
  .pieces-2 .piece-row { flex-wrap: wrap; gap: 2px 8px; }
}

/* ---------- care and questions ---------- */
.care-band { background: var(--wash); padding-block: var(--section); }
.care-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 40px clamp(40px, 7vw, 112px); align-items: start;
}
.care-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 18px; color: var(--ink-2); max-width: 46ch; }
.care-list li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 14px; }
.care-list li::before { content: ''; width: 7px; height: 7px; margin-top: 0.62em; border: 1px solid var(--cobalt); border-radius: 50%; }
.faq { margin-top: 20px; border-top: 1px solid var(--rule); }
.faq .fold summary { font-family: var(--f-display); font-size: 1.5rem; line-height: 1.25; padding-block: 20px; }
.fold { border-bottom: 1px solid var(--rule); }
.fold summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; font-size: var(--t-l);
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: ''; flex: none; width: 11px; height: 11px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
  transition: transform .25s ease;
}
.fold[open] summary::after { transform: rotate(45deg); }
.fold summary:hover { color: var(--cobalt); }
.fold p { margin: 0 0 22px; color: var(--ink-2); max-width: 62ch; }

/* ---------- newsletter ---------- */
.letter-section { padding-block: var(--section); }
.letter {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 64px; align-items: end;
}
.letter-copy p { margin: 0.7em 0 0; color: var(--ink-2); }
.letter-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.letter-form input { flex: 1 1 220px; min-width: 0; }
.form-msg { flex-basis: 100%; margin: 0; font-size: var(--t-s); min-height: 1.5em; }
.has-error .form-msg { color: var(--error); }
.is-done .form-msg { color: var(--cobalt); }
@media (max-width: 760px) {
  .care-grid, .letter { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- form fields ---------- */
input[type="email"], input[type="text"], input[type="tel"], input[type="password"], input[type="number"], input[type="url"], textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 16px;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 0; border-color: var(--cobalt); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }

/* =====================================================================
   Chapter page
   ===================================================================== */
.chapter-open {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(36px, 6vw, 96px); align-items: center; padding-bottom: var(--section);
}
.chapter-text { max-width: 36rem; }
.chapter-num { margin: 0 0 0.6em; font-size: var(--t-s); color: var(--ink-2); letter-spacing: 0.02em; }
.chapter-lede { font-family: var(--f-display); font-size: var(--d-m); line-height: 1.25; margin: 0.8em 0 1em; text-wrap: pretty; }
.chapter-story { color: var(--ink-2); font-size: var(--t-l); line-height: 1.65; max-width: 58ch; }
.chapter-cover { margin: 0; }
.chapter-cover img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.chapter-pieces, .chapter-materials, .chapter-next {
  display: grid; gap: clamp(28px, 4vw, 48px);
  padding-block: var(--section); border-top: 1px solid var(--rule);
}
.chapter-next { padding-bottom: 0; justify-items: start; gap: 0; }
.chapter-next .display-l { margin-bottom: 0.4em; }
.chapter-next > p:not(.chapter-num) { color: var(--ink-2); }
.chapter-next .letter-form { width: min(100%, 34rem); margin-top: 12px; }
.next-link { text-decoration: none; }
.next-link:hover { color: var(--cobalt); }

.materials-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  gap: 16px 48px; align-items: end;
}
.materials-head p { margin: 0; color: var(--ink-2); }
.materials {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px clamp(16px, 2.4vw, 36px);
}
.material img { width: min(100%, 152px); aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin-bottom: 18px; }
.material h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.625rem; line-height: 1.1; margin: 0 0 8px; }
.material p { margin: 0; color: var(--ink-2); font-size: var(--t-s); max-width: 30ch; }

.notice { display: grid; gap: 20px; justify-items: start; max-width: 40rem; padding-block: 24px 64px; }
.notice p { margin: 0; color: var(--ink-2); }

@media (max-width: 900px) { .materials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .chapter-open, .materials-head { grid-template-columns: minmax(0, 1fr); }
  .chapter-cover { max-width: 30rem; }
}

/* =====================================================================
   Product page
   ===================================================================== */
.pdp {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px); align-items: start;
}
.gallery { min-width: 0; }
.gallery-track { display: grid; gap: 12px; }
.gallery-slide { margin: 0; }
.gallery-slide img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--wash); }
.gallery-count { display: none; }

.buy { position: sticky; top: calc(var(--bar) + var(--top) + 32px); display: grid; max-width: 30rem; }
.back-link { justify-self: start; font-size: var(--t-s); color: var(--ink-2); text-decoration: none; }
.back-link:hover { color: var(--cobalt); text-decoration: underline; text-underline-offset: 4px; }
.product-name { font-size: var(--d-xl); margin: 16px 0 14px; }
.finish-switch {
  justify-self: start; display: inline-flex; gap: 2px; margin-bottom: 22px;
  padding: 3px; border: 1px solid var(--rule); border-radius: 999px;
}
.finish-switch a { padding: 6px 18px; border-radius: 999px; text-decoration: none; font-size: var(--t-s); }
.finish-switch a:hover { color: var(--cobalt); }
.finish-switch a[aria-current] { background: var(--ink); color: var(--glaze); }
.product-finish { margin: 0 0 22px; color: var(--ink-2); }
.product-price { margin: 0 0 22px; font-size: var(--t-l); font-variant-numeric: tabular-nums; }
.product-badge { margin-left: 0.6em; font-size: var(--t-s); color: var(--cobalt); }
.product-tagline { font-family: var(--f-display); font-size: var(--d-m); line-height: 1.2; margin: 0 0 12px; text-wrap: balance; }
.product-desc { color: var(--ink-2); line-height: 1.65; margin: 0 0 28px; }
.add-form { display: flex; gap: 12px; align-items: center; }
.add-button { flex: 1; }
.added-note { min-height: 1.6em; margin: 12px 0 18px; font-size: var(--t-s); color: var(--ink-2); }
.specs { margin: 0 0 8px; border-top: 1px solid var(--rule); }
.specs div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-s); }
.specs dt { color: var(--ink-2); }
.specs dd { margin: 0; }
.buy .fold summary { font-size: var(--t-m); padding: 14px 0; }
.buy .fold p { font-size: var(--t-s); }
.also { display: grid; gap: 32px; margin-top: var(--section); padding-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--rule); }

.stepper { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); }
.stepper button { width: 36px; height: 100%; padding: 0; background: none; border: 0; border-radius: 999px; cursor: pointer; font-size: 1rem; }
.stepper button:hover:not(:disabled) { color: var(--cobalt); }
.stepper button:disabled { color: var(--ink-3); cursor: default; }
.stepper output { min-width: 2ch; text-align: center; font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.stepper-lg { height: 48px; }
.stepper-lg button { width: 44px; }

@media (max-width: 860px) {
  .pdp { grid-template-columns: minmax(0, 1fr); }
  .buy { position: static; max-width: none; }
  .gallery { margin-inline: calc(var(--gutter) * -1); }
  .gallery-track {
    grid-auto-flow: column; grid-auto-columns: 84%;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .gallery-track::-webkit-scrollbar { display: none; }
  .gallery-slide { scroll-snap-align: start; }
  .gallery-count { display: block; margin: 12px 0 0; text-align: center; font-size: var(--t-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
}

/* =====================================================================
   Checkout
   ===================================================================== */
.checkout-title { margin-bottom: clamp(28px, 4vw, 48px); }
.checkout-grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px); align-items: start;
}
.checkout-form { display: grid; gap: 44px; max-width: 40rem; min-width: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 16px; }
legend { font-family: var(--f-display); font-size: var(--d-m); line-height: 1.1; padding: 0 0 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: var(--t-s); font-weight: 500; }
.optional { font-weight: 400; color: var(--ink-2); }
.field-help { margin: 0; font-size: var(--t-xs); color: var(--ink-2); }
.field-error { margin: 0; font-size: var(--t-xs); color: var(--error); }
.field-error:empty { display: none; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.address { display: grid; gap: 16px; }
.check { display: flex; gap: 12px; align-items: center; font-size: var(--t-s); cursor: pointer; justify-self: start; }
.check input, .choice input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--ink); }
.choices { display: grid; gap: 10px; }
.choice {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper);
  cursor: pointer; transition: border-color .2s, background-color .2s;
}
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--wash); }
.choice-text { display: grid; gap: 2px; }
.choice-title { font-weight: 500; }
.choice-note { font-size: var(--t-xs); color: var(--ink-2); }
.choice-fee { font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.form-error { margin: 12px 0 0; color: var(--error); font-size: var(--t-s); }
.form-error:empty { display: none; }
.form-error:focus { outline: none; }
.checkout-form .fine { margin: 12px 0 0; }

.summary {
  position: sticky; top: calc(var(--bar) + var(--top) + 32px);
  display: grid; gap: 18px; padding: clamp(20px, 2.4vw, 28px);
  background: var(--paper); border: 1px solid var(--rule);
}
.summary-title { font-family: var(--f-display); font-weight: 400; font-size: var(--d-m); margin: 0; line-height: 1.1; }
.sum-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sum-line { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.sum-line img { width: 56px; aspect-ratio: 4 / 5; object-fit: cover; }
.sum-name { display: grid; font-size: var(--t-s); }
.sum-qty { font-size: var(--t-xs); color: var(--ink-2); }
.sum-price { font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.sum-totals { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); display: grid; gap: 6px; }
.sum-totals div { display: flex; justify-content: space-between; gap: 16px; font-size: var(--t-s); }
.sum-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.sum-totals .sum-total { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: var(--t-l); }
.summary .text-link { justify-self: start; font-size: var(--t-s); }

.checkout-done { display: grid; gap: 20px; justify-items: start; max-width: 40rem; }
.checkout-done h2:focus { outline: none; }
.checkout-done p { margin: 0; }
.preview-note { color: var(--ink-2); font-size: var(--t-s); padding: 14px 16px; background: var(--wash); border-radius: 8px; }

@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; order: -1; }
}
@media (max-width: 560px) { .field-pair { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Bag drawer
   ===================================================================== */
.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(420px, 100%); max-width: 100%; height: 100%; max-height: none;
  padding: 0; border: 0; border-left: 1px solid var(--rule);
  background: var(--paper); color: var(--ink);
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.2, .7, .2, 1);
}
.drawer[open] { display: flex; }
.drawer.is-in { transform: none; }
.drawer::backdrop { background: rgba(36, 28, 51, 0.3); }
html.bag-open { overflow: hidden; }
.drawer-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: calc(18px + var(--top)) 24px 14px; border-bottom: 1px solid var(--rule);
}
.drawer-title { font-family: var(--f-display); font-weight: 400; font-size: var(--d-m); line-height: 1.1; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 24px; }
.bag-lines { list-style: none; margin: 0; padding: 0; }
.bag-line {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 16px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--rule);
}
.bag-thumb img { width: 76px; aspect-ratio: 4 / 5; object-fit: cover; }
.bag-name { font-family: var(--f-display); font-size: 1.375rem; line-height: 1.1; text-decoration: none; }
.bag-name:hover { color: var(--cobalt); }
.bag-price { margin: 4px 0 10px; font-size: var(--t-s); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bag-remove { padding-top: 2px; }
.bag-empty { display: grid; gap: 16px; justify-items: start; padding: 32px 0; }
.bag-empty p { margin: 0; color: var(--ink-2); }
.drawer-foot {
  display: grid; gap: 6px;
  padding: 18px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
}
.bag-total { display: flex; justify-content: space-between; margin: 0; font-size: var(--t-l); font-variant-numeric: tabular-nums; }
.fine { margin: 0 0 10px; font-size: var(--t-xs); color: var(--ink-2); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: clamp(48px, 7vw, 88px) var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
}
.footer-inner {
  max-width: var(--max); margin-inline: auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px 56px; align-items: start;
}
.footer-logo img { width: 104px; }
.footer-line { margin: 0; color: var(--ink-2); font-size: var(--t-s); max-width: 36ch; }
.footer-nav { display: grid; gap: 8px; justify-items: start; font-size: var(--t-s); }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--cobalt); text-decoration: underline; text-underline-offset: 4px; }
.footer-nav .footer-admin { margin-top: 8px; color: var(--ink-2); }
.footer-small { grid-column: 1 / -1; margin: 16px 0 0; font-size: var(--t-xs); color: var(--ink-2); }
@media (max-width: 640px) { .footer-inner { grid-template-columns: minmax(0, 1fr); } }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
