/*
  Coil & Cabochon: Velvet Tray.

  The piece on a dark tray under one light. A high-contrast serif (Cormorant Garamond) for names
  and headlines, a quiet geometric sans (Jost) for everything read, hairline borders, generous
  space, and slow, eased motion. Colours come only from the palette variables the starter sets;
  the defaults below are palette A, for the moment before it runs.

  Written fresh for this demo: no markup or rule is copied from another demo (SKILL.md 5B.5).
  Media queries sit below the rules they override.
*/

:root {
  --bg: #1B1020; --surface: #251729; --text: #F4EDE4; --muted: #CDBDC4;
  --primary: #DDA67F; --accent: #DDA67F; --accent-text: #1B1020; --border: #3E2A42; --focus: #EBC3A2;
  --band-1: #21142A; --band-2: #2B1A30; --detail: #B8703F;
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: 16px;
  --wide: 1180px;
  --hair: 1px solid var(--border);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--masthead, 96px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 1rem/1.7 var(--sans);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .8s var(--ease), color .8s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--primary); color: var(--accent-text); }
:focus-visible { outline: 1px solid var(--focus); outline-offset: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The lamp and the dust, and a velvet grain over them. */
.ambient { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("../img/grain.svg");
}

/* ---------- type ---------- */

h1, h2, h3, .card-name, blockquote, .fact-big, .path-no, .figures dd {
  font-family: var(--serif); font-weight: 500; letter-spacing: -.005em;
}
h1 { font-size: clamp(3rem, 8.4vw, 6.4rem); line-height: .98; margin: .25em 0 .35em; }
h1 em { display: block; font-style: italic; font-weight: 400; color: var(--primary); }
h2 { font-size: clamp(2.2rem, 5.4vw, 3.8rem); line-height: 1.02; margin: .2em 0 .35em; }
h3 { font-size: 1.6rem; line-height: 1.1; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
.kicker {
  font: 500 .7rem/1.4 var(--sans); letter-spacing: .3em; text-transform: uppercase;
  color: var(--primary); margin: 0;
}
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 34em; }

/* ---------- buttons and chips ---------- */

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .9rem 1.7rem; overflow: hidden;
  font: 500 .72rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; text-decoration: none;
  border: 1px solid transparent; border-radius: 0; background: none; color: var(--text); cursor: pointer;
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), transform .5s var(--ease);
}
.btn-fill { background: var(--primary); color: var(--accent-text); border-color: var(--primary); }
.btn-fill::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transition: transform 1s var(--ease);
}
.btn-fill:hover::after { transform: translateX(120%); }
.btn-line { border-color: color-mix(in srgb, var(--text) 32%, transparent); }
.btn-line:hover { border-color: var(--primary); color: var(--primary); }
.btn.small { min-height: 40px; padding: .7rem 1.1rem; font-size: .64rem; }
.btn.wide { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  position: relative; display: inline-flex; align-items: baseline; gap: .5em;
  padding: .55rem .95rem; border: var(--hair); background: transparent; color: var(--text);
  font: 400 .82rem/1.2 var(--sans); letter-spacing: .04em; cursor: pointer;
  transition: border-color .4s var(--ease), background-color .4s var(--ease), color .4s var(--ease);
}
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--primary); border-color: var(--primary); color: var(--accent-text); }
.chip input, .swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:focus-visible), .swatch:has(input:focus-visible) { outline: 1px solid var(--focus); outline-offset: 3px; }
.chip-hint { font-size: .72rem; opacity: .72; }

/* ---------- frame ---------- */

.masthead { position: sticky; top: 0; z-index: 30; }
.preview-ribbon {
  padding: .45rem var(--gutter); text-align: center;
  background: var(--surface); border-bottom: var(--hair);
  font: 400 .72rem/1.4 var(--sans); letter-spacing: .06em; color: var(--muted);
}
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
.brand-words { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font: 500 1.25rem/1 var(--serif); letter-spacing: .02em; white-space: nowrap; }
.brand-tag { display: none; white-space: nowrap; font: 400 .6rem/1.6 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.topnav { display: none; gap: 2rem; }
.topnav a {
  position: relative; white-space: nowrap; text-decoration: none; font: 400 .74rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  transition: color .4s var(--ease);
}
.topnav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 1px; background: var(--primary);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.topnav a:hover { color: var(--text); }
.topnav a:hover::after { transform: scaleX(1); }

main > section { position: relative; padding: clamp(4.5rem, 11vw, 8.5rem) var(--gutter); }
main > section > * { max-width: var(--wide); margin-left: auto; margin-right: auto; }
.section-head { text-align: center; max-width: 40rem; margin-bottom: clamp(2.2rem, 5vw, 3.6rem); }
.section-head::before {
  content: ""; display: block; width: 44px; height: 1px; margin: 0 auto 1.4rem; background: var(--primary);
}
.section-head .muted { margin: 0 auto; max-width: 34em; }

/* ---------- the tray every piece sits on ---------- */

.tray {
  position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.12; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, color-mix(in srgb, var(--primary) 16%, var(--surface)) 0%, transparent 70%),
    radial-gradient(ellipse at 50% 50%, var(--surface) 0%, color-mix(in srgb, var(--bg) 82%, #000) 100%);
  border: var(--hair);
}
.tray::after {
  content: ""; position: absolute; inset: 10px; border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); pointer-events: none;
}
.tray .piece-svg { width: 76%; height: auto; transition: transform 1.1s var(--ease); }
.tray .piece-photo, .tray .hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.maker-photo { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: var(--hair); }

/* ---------- hero ---------- */

.hero { display: grid; gap: 1.6rem; align-items: center; padding-top: 1.4rem; }
.hero-piece { order: -1; }
.hero-piece .tray { width: min(100%, 36vh); margin: 0 auto; }
.hero > * { margin: 0; max-width: none; }
.hero-words .kicker { margin-bottom: .4rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 1.6rem; }
.status { display: flex; align-items: center; gap: .6rem; font-size: .84rem; color: var(--muted); margin: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.status.is-open .dot { background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent); }
.hero-piece { margin: 0; }
.hero-piece .tray { border-radius: 50% 50% 0 0 / 34% 34% 0 0; aspect-ratio: 1 / 1.18; }
.hero-piece .tray::after { border-radius: inherit; }
.hero-piece .piece-svg { width: 70%; animation: float 9s ease-in-out infinite; }
.hero-piece figcaption { margin-top: .9rem; font: italic 400 1.02rem/1.4 var(--serif); color: var(--muted); text-align: center; }

.glint { animation: glint 7s cubic-bezier(.45, 0, .2, 1) infinite; }
@keyframes glint { 0%, 58% { transform: translateX(0); } 88%, 100% { transform: translateX(280px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- fresh and the Bench Book ---------- */

.fresh { background: linear-gradient(180deg, transparent, var(--band-1) 18%, var(--band-1) 82%, transparent); }
.fresh-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 74%; gap: 1rem; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: .6rem; list-style: none; scrollbar-width: thin;
}
.fresh-row > .card { scroll-snap-align: start; }

.filters { display: grid; gap: .9rem; margin-bottom: 2rem; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.filter-name { font: 500 .66rem/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); min-width: 4.5rem; }
.count { margin: 0; font-size: .8rem; color: var(--muted); letter-spacing: .06em; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 1rem; list-style: none; padding: 0; margin: 0 auto; }
.card { list-style: none; }
.card-btn {
  display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.card-btn:hover .tray { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); }
.card-btn:hover .piece-svg { transform: translateY(-5px) scale(1.035); }
.card-words { display: grid; gap: .15rem; padding-top: .9rem; }
.piece-no { font: 500 .62rem/1.4 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--primary); }
.card-name { font-size: 1.45rem; line-height: 1.1; }
.spec { font-size: .78rem; line-height: 1.5; color: var(--muted); }
.card-price { font: 400 .95rem/1.4 var(--sans); letter-spacing: .04em; margin-top: .25rem; }
.card-price.is-sold, .card-price.is-commission { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.card-price.is-sold::before, .card-price.is-commission::before { content: ""; display: inline-block; width: 18px; height: 1px; margin-right: .6em; vertical-align: middle; background: currentColor; }

/* ---------- the builder ---------- */

.design { background: linear-gradient(180deg, transparent, var(--band-2) 12%, var(--band-2) 88%, transparent); }
.builder { display: grid; gap: 1.8rem; }
.builder-view {
  position: sticky; top: var(--masthead, 96px); z-index: 5; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-items: center;
  padding: .6rem 0; background: color-mix(in srgb, var(--band-2) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.builder-view .tray-large { aspect-ratio: 1 / 1.05; }
.neckline { color: var(--muted); text-align: center; }
.neck-svg { width: 100%; max-width: 180px; margin: 0 auto; }
.neck-words { font-size: .74rem; line-height: 1.4; margin: .4rem 0 0; }

.builder-controls { display: grid; gap: 1.4rem; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .7rem; font: 500 .66rem/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem .4rem; }
.swatch { position: relative; display: grid; justify-items: center; gap: .35rem; cursor: pointer; text-align: center; }
.swatch-dot {
  width: 38px; height: 38px; border-radius: 50%;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .35), 0 0 0 1px var(--border);
  transition: box-shadow .4s var(--ease), transform .4s var(--ease);
}
.swatch .chip-name { font-size: .68rem; line-height: 1.25; color: var(--muted); }
.swatch:hover .swatch-dot { transform: translateY(-2px); }
.swatch:has(input:checked) .swatch-dot { box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .35), 0 0 0 2px var(--bg), 0 0 0 3px var(--primary); }
.swatch:has(input:checked) .chip-name { color: var(--text); }

.builder-summary { padding: 1.6rem; border: var(--hair); background: color-mix(in srgb, var(--surface) 86%, transparent); }
.summary-line { font: italic 400 1.35rem/1.35 var(--serif); margin: .6rem 0 1.2rem; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 1.4rem; padding: 1.1rem 0; border-top: var(--hair); border-bottom: var(--hair); }
.figures dt { font: 500 .62rem/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.figures dd { margin: .45rem 0 0; font-size: 1.55rem; line-height: 1.1; }
.notes h3 { font-size: 1.25rem; }
.notes-list { margin: 0 0 .8rem; display: grid; gap: .7rem; }
.notes-list dt { font: 500 .6rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--primary); }
.notes-list dd { margin: .3rem 0 0; font-size: .9rem; line-height: 1.6; }
.builder-summary .btn { margin-top: .6rem; }

/* ---------- paths, own stone, request ---------- */

.path-list { display: grid; gap: 1rem; list-style: none; padding: 0; margin: 0 auto 3.5rem; }
.path { padding: 1.6rem; border: var(--hair); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.path-no { display: block; font-style: italic; font-size: 2.4rem; line-height: 1; color: var(--primary); margin-bottom: .6rem; }
.path-time { font: 500 .68rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--primary); margin: 0 0 .8rem; }
.ownstone { margin-bottom: 3.5rem; }
.ownstone h3 { font-size: clamp(1.7rem, 4vw, 2.4rem); text-align: center; margin-bottom: 1.4rem; }
.steps { display: grid; gap: 1rem; counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: grid; gap: .25rem; padding: 1rem 0 1rem 3rem; border-top: var(--hair); position: relative; }
.steps li::before { content: counter(s, upper-roman); position: absolute; left: 0; top: .9rem; font: italic 500 1.3rem/1 var(--serif); color: var(--primary); }
.steps strong { font-weight: 500; }

.request { max-width: 40rem; padding: clamp(1.4rem, 4vw, 2.4rem); border: var(--hair); background: color-mix(in srgb, var(--surface) 86%, transparent); }
.request label { display: grid; gap: .35rem; margin-bottom: 1.1rem; }
.request label > span { font: 500 .62rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.request input:not([type="checkbox"]), .request textarea {
  width: 100%; padding: .7rem 0; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 30%, transparent);
  background: transparent; color: var(--text); font: 300 1rem/1.5 var(--sans); border-radius: 0;
  transition: border-color .4s var(--ease);
}
.request input:focus, .request textarea:focus { outline: none; border-bottom-color: var(--primary); }
.request textarea { resize: vertical; }
.request label.check { display: flex; align-items: center; gap: .7rem; }
.request label.check span { font: 300 .92rem/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: var(--text); }
.request input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.sample-out { margin-top: 1.6rem; padding-top: 1.4rem; border-top: var(--hair); }
.sample-out pre { white-space: pre-wrap; font: 300 .92rem/1.6 var(--sans); margin: .8rem 0; padding: 1rem; background: var(--band-1); border-left: 1px solid var(--primary); }

/* ---------- maker, care, visit, footer ---------- */

.maker { display: grid; gap: 2.5rem; align-items: center; }
.maker > * { margin: 0; max-width: none; }
.maker-art { width: 100%; color: var(--primary); max-width: 360px; margin: 0 auto; opacity: .9; }
.maker-svg { width: 100%; height: auto; }
.maker blockquote { margin: 1.6rem 0; padding-left: 1.2rem; border-left: 1px solid var(--primary); font-style: italic; font-size: 1.6rem; line-height: 1.3; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; list-style: none; padding: 1.4rem 0 0; margin: 0; border-top: var(--hair); }
.fact-big { display: block; font-size: 2.8rem; line-height: 1; color: var(--primary); }
.fact-small { display: block; font-size: .74rem; line-height: 1.4; color: var(--muted); margin-top: .4rem; }

.care-list { display: grid; gap: 0; margin: 0 auto; }
.care-item { padding: 1.5rem 0; border-top: var(--hair); }
.care-item dt { font: 500 1.5rem/1.1 var(--serif); margin-bottom: .4rem; }
.care-item dd { margin: 0; color: var(--muted); }

.visit { text-align: center; }
.visit > * { max-width: 36rem; }
.visit .kicker { margin-bottom: .2rem; }
.contact { margin-top: 1.6rem; font: 500 1.35rem/1.4 var(--serif); }
.contact a { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--primary) 50%, transparent); }

.footer { padding: 3rem var(--gutter) 7rem; border-top: var(--hair); text-align: center; font-size: .82rem; color: var(--muted); }
.footer > * { max-width: 44rem; margin-left: auto; margin-right: auto; }
.showing { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6rem; margin-bottom: 1.6rem; }
.showing-label { font: 500 .62rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; }
.palette-switch { display: inline-flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.palette-switch button {
  min-width: 40px; min-height: 36px; padding: .4rem .7rem; border: var(--hair); background: transparent; color: var(--text);
  font: 400 .72rem/1 var(--sans); letter-spacing: .08em; cursor: pointer;
}
.palette-switch button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--accent-text); }

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--bg) 86%, transparent); border-top: var(--hair);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  padding-bottom: env(safe-area-inset-bottom);
}
.action-bar a {
  display: grid; place-items: center; min-height: 54px; text-decoration: none;
  font: 500 .66rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
}
.action-bar a + a { border-left: var(--hair); }
.action-bar a.on { background: var(--primary); color: var(--accent-text); }

/* ---------- the viewer ---------- */

.viewer {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--text);
}
.viewer::backdrop { background: rgba(6, 3, 8, .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.viewer[open] { animation: arrive .6s var(--ease); }
@keyframes arrive { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.viewer-inner { position: relative; display: grid; gap: 1.2rem; padding: 3.6rem var(--gutter) 1.4rem; min-height: 100%; align-content: start; }
.viewer-inner .tray-large { width: min(100%, 420px); margin: 0 auto; }
.viewer-close {
  position: absolute; top: .6rem; right: .6rem; width: 48px; height: 48px; border: 0; background: none; color: var(--text);
  font: 300 2rem/1 var(--sans); cursor: pointer;
}
.viewer-words h2 { font-size: clamp(2rem, 6vw, 3rem); margin: .1em 0 .2em; }
.viewer-price { font: 400 1.3rem/1.4 var(--serif); color: var(--primary); }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: 1.4rem; color: var(--muted); font-size: .8rem; letter-spacing: .14em; }
.viewer-nav button {
  width: 48px; height: 48px; border: var(--hair); background: none; color: var(--text); font-size: 1.1rem; cursor: pointer;
  transition: border-color .4s var(--ease);
}
.viewer-nav button:hover { border-color: var(--primary); }
.viewer-nav button:disabled { opacity: .3; cursor: default; }
html.viewer-open { overflow: hidden; }

/* ---------- the mark: the founder's traced logo, split in two and coloured by the look ---------- */

.brand-mark { position: relative; display: inline-block; flex: none; width: 27px; height: 42px; }
.brand-mark > span { position: absolute; inset: 0; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.logo-stone {
  -webkit-mask-image: url("../img/logo-stone.svg"); mask-image: url("../img/logo-stone.svg");
  background: radial-gradient(ellipse 60% 55% at 40% 40%, color-mix(in srgb, var(--primary) 62%, var(--surface)) 0%, color-mix(in srgb, var(--primary) 16%, var(--bg)) 78%);
}
.logo-wire {
  -webkit-mask-image: url("../img/logo-wire.svg"); mask-image: url("../img/logo-wire.svg");
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 45%, #FFFFFF) 0%, var(--primary) 45%, var(--detail) 100%);
}
.footer-mark { display: block; width: 40px; height: 62px; margin: 0 auto 1.4rem; }
.ornament-mark { display: block; width: 58px; height: 90px; margin: 0 auto 1.6rem; }

/* ---------- the builder's closest real piece ---------- */

.closest { margin: 0 0 1.2rem; padding-top: 1.1rem; border-top: var(--hair); }
.closest-label { font: 500 .6rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--primary); margin: 0 0 .7rem; }
.closest-btn { display: grid; grid-template-columns: 88px 1fr; gap: 1rem; align-items: center; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.closest-photo { width: 88px; height: 88px; object-fit: cover; border: var(--hair); transition: border-color .4s var(--ease); }
.closest-btn:hover .closest-photo { border-color: var(--primary); }
.closest-words { display: grid; gap: .15rem; }
.closest-words .fine { margin: .2rem 0 0; }
.closest-name { font: 500 1.2rem/1.1 var(--serif); }

/* ---------- the maker, in photographs ---------- */

.maker-art:has(img) { max-width: 460px; opacity: 1; position: relative; padding: 0 16% 18% 0; }
.maker-art .maker-photo { aspect-ratio: 4 / 5; }
.maker-bench {
  position: absolute; right: 0; bottom: 0; width: 46%; aspect-ratio: 4 / 5; object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

/* ---------- photographs in the trays ---------- */

.card-btn:hover .piece-photo { transform: scale(1.035); }
.tray:has(.piece-photo)::after { border-color: color-mix(in srgb, var(--primary) 10%, transparent); }

/* ---------- the lookbook strip on the home page ---------- */

.teasers {
  display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 1rem; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: .6rem;
}
.teaser { display: block; scroll-snap-align: start; text-decoration: none; }
.teaser-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: var(--hair); transition: transform 1.1s var(--ease); }
.teaser { overflow: hidden; }
.teaser:hover .teaser-photo { transform: scale(1.03); }
.teaser-caption { display: block; padding-top: .7rem; font: italic 400 1.1rem/1.3 var(--serif); color: var(--muted); }
.center { text-align: center; margin-top: 2.4rem; }

/* ---------- the lookbook page ---------- */

.look-head { text-align: center; padding-bottom: 1rem; }
.look-head > * { max-width: 40rem; }
.look-head .lead { margin: 0 auto; }
.rule-diamond { position: relative; display: block; width: 140px; height: 1px; margin: 2.4rem auto 0; background: color-mix(in srgb, var(--primary) 60%, transparent); }
.rule-diamond::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg); border: 1px solid var(--primary);
}
.look-body { padding-top: 1.5rem; }
.masonry { display: flex; align-items: flex-start; gap: 12px; }
.mcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.look-item { margin: 0; }
.look-btn { display: block; width: 100%; padding: 0; border: var(--hair); background: none; overflow: hidden; cursor: zoom-in; }
.look-btn img { display: block; width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.look-btn:hover img { transform: scale(1.025); }
.look-item figcaption { display: flex; align-items: baseline; gap: .6rem; padding: .55rem 0 .2rem; }
.look-cap { font: italic 400 1.02rem/1.3 var(--serif); color: var(--muted); }
.look-end { text-align: center; }
.look-end .btn { margin-top: 2rem; }

.look-viewer-inner { position: relative; display: grid; place-items: center; gap: 1rem; min-height: 100%; padding: 3.6rem var(--gutter) 1.4rem; }
.look-figure { margin: 0; text-align: center; }
.look-figure img { display: block; width: auto; max-width: 100%; max-height: 74vh; margin: 0 auto; border: var(--hair); }
.look-figure figcaption { margin-top: .9rem; font: italic 400 1.2rem/1.3 var(--serif); }

@media (min-width: 640px) {
  .teasers { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .masonry, .mcol { gap: 24px; }
}
@media (min-width: 760px) {
  .viewer.look-viewer { width: min(900px, 94vw); }
  .look-viewer-inner { padding: 3rem; }
}

/* Photographs fade in as they arrive, instead of appearing in pieces. */
.js img.piece-photo, .js img.hero-photo, .js img.teaser-photo, .js img.closest-photo, .js img.maker-photo, .js img.maker-bench, .js .look-btn img {
  opacity: 0; transition: opacity .9s var(--ease), transform 1.1s var(--ease);
}
.js img.is-loaded { opacity: 1; }

/* ---------- Try the looks, floating in the corner ---------- */

.looks { position: fixed; left: var(--gutter); bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 26; }
.looks-toggle {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: .55rem 1rem .55rem .7rem;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent); color: var(--text);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font: 500 .62rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35); transition: border-color .4s var(--ease), transform .4s var(--ease);
}
.looks-toggle:hover { border-color: var(--primary); transform: translateY(-2px); }
.looks-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--primary), var(--detail), var(--bg), var(--text), var(--primary));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 25%, transparent);
}
.looks-panel {
  position: absolute; left: 0; bottom: calc(100% + 10px); width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  padding: .8rem; border: var(--hair); background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
  animation: rise .45s var(--ease);
}
.looks-panel .palette-switch { justify-content: flex-start; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- the mark in 3D ---------- */

.mark-btn { display: grid; justify-items: center; gap: .7rem; margin: 0 auto 1.6rem; padding: .4rem; border: 0; background: none; color: inherit; cursor: pointer; }
.mark-btn .brand-mark { margin: 0; }
.mark-hint { font: 500 .58rem/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); transition: color .4s var(--ease); }
.mark-btn:hover .mark-hint { color: var(--primary); }
.mark-btn:hover .brand-mark, .brand-mark.spin { animation: spin-y 1.3s var(--ease); }
@keyframes spin-y { from { transform: perspective(400px) rotateY(0); } to { transform: perspective(400px) rotateY(360deg); } }
.mark-inner { position: relative; display: grid; justify-items: center; gap: .4rem; min-height: 100%; padding: 3.6rem var(--gutter) 1.6rem; text-align: center; }
.mark-inner h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.mark-stage { width: 100%; }
.mark-stage model-viewer {
  display: block; width: 100%; height: min(62vh, 520px); background: transparent; --poster-color: transparent;
  border-top: var(--hair); border-bottom: var(--hair);
}

@media (min-width: 760px) {
  .looks { bottom: var(--gutter); }
  .viewer.mark-viewer { width: min(720px, 92vw); }
  .mark-inner { padding: 3rem 3rem 2rem; }
}

/* ---------- the reveal ---------- */

.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- wider screens ---------- */

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .brand-tag { display: block; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem 1.6rem; }
  .fresh-row { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .path-list { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
  .care-list { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .swatches { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
  .action-bar { display: none; }
  .footer { padding-bottom: 3rem; }
  .viewer { width: min(1000px, 92vw); height: auto; max-height: 92vh; margin: auto; border: var(--hair); }
  .viewer-inner { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 2.4rem; padding: 3rem; }
  .viewer-nav { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .topnav { display: flex; }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.1fr .9fr; gap: 4rem; min-height: calc(100vh - 100px); padding-top: clamp(2.5rem, 6vw, 4rem); }
  .hero-piece { order: 0; }
  .hero-piece .tray { width: 100%; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .builder { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 3rem; align-items: start; }
  .builder-view { grid-row: span 2; top: calc(var(--masthead, 96px) + 16px); grid-template-columns: 1fr; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .builder-view .tray-large { aspect-ratio: 1 / 1.1; }
  .neckline { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 1rem; text-align: left; }
  .maker { grid-template-columns: .8fr 1.2fr; gap: 5rem; }
  .swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
