/* ============================================================
   LINHORD — Canvas Atelier
   Design system v3: "Night Atelier / Blueprint"
   Deep pine ground · bone type · oxide thread · paper bands
   Type: Space Grotesk / IBM Plex Mono — no serif, no italic:
   emphasis is the red thread.
   NOTE: legacy var names are kept as aliases so page markup
   (inline styles) needs no changes: --ink=text, --gesso=ground.
   ============================================================ */

:root {
  /* ---- LIGHT (default) — bone / cream ground, pine ink ---- */
  /* Fixed brand surfaces do not flip with the selected page theme. */
  --brand-cream: #F1EEE1;
  --brand-ink:   #182A20;
  --brand-pine:  #16241C;
  --brand-thread:#AA3F23;
  --brand-thread-on-pine:#E07149;
  --ground:   #F1EEE1;   /* page — warm bone / cream */
  --ground-2: #E7E2D1;   /* lifted panels / blueprint plates */
  --bone:     #182A20;   /* primary type — deep pine, near black */
  --bone-2:   #4C5C4E;   /* secondary type */
  --bone-3:   #60654F;   /* muted / captions — AA on the light panels */
  --paper:    #16241C;   /* inverted bands — flip to dark pine */
  --paper-2:  #1E2E24;
  --thread:   #AA3F23;   /* oxide red — AA on light ground and lifted panels */
  --thread-inverted: #E07149; /* oxide highlight on dark inverted bands */
  --thread-action: #963B22; /* filled interactive state — AA with white */
  --on-thread: #FFFFFF;
  --line:     #D9D3BF;   /* hairlines on ground */
  --line-2:   #E4DFCD;

  /* ink that sits on the inverted (--paper) bands — opposite of page */
  --paper-ink:   #EDE8D8;
  --paper-ink-2: rgba(237, 232, 216, 0.72);
  --paper-ink-3: rgba(237, 232, 216, 0.60);
  --paper-line:  rgba(237, 232, 216, 0.20);
  /* frosted nav / rail — page ground at alpha */
  --scrim: rgba(241, 238, 225, 0.90);
  /* blueprint drawing ink (on --ground-2 plates) */
  --draw:      rgba(24, 42, 32, 0.82);
  --draw-2:    rgba(24, 42, 32, 0.40);
  --draw-soft: rgba(24, 42, 32, 0.07);

  /* legacy aliases — keep inline styles in pages working */
  --ink:        var(--bone);
  --ink-2:      var(--bone-2);
  --ink-3:      var(--bone-3);
  --gesso:      var(--ground);
  --gesso-2:    var(--ground-2);
  --pine:       var(--paper);
  --hairline:   var(--line);
  --hairline-2: var(--line-2);

  --serif: 'Space Grotesk', -apple-system, sans-serif;  /* alias: display face */
  --sans:  'Space Grotesk', -apple-system, sans-serif;
  --mono:  'IBM Plex Mono', 'SF Mono', monospace;

  --pad: clamp(20px, 4vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-entry: cubic-bezier(0.22, 0.65, 0.36, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
}

/* ---- DARK (opt-in) — the original "Night Atelier" deep-pine system ---- */
:root[data-theme="dark"] {
  --ground:   #14211A;
  --ground-2: #1B2B22;
  --bone:     #EAE6D7;
  --bone-2:   #A9AB98;
  --bone-3:   #9A9E8B;
  --paper:    #EAE6D7;   /* inverted bands read as light on the dark page */
  --paper-2:  #DFDACA;
  --thread:   #E07149;
  --thread-inverted: #AA3F23;
  --thread-action: #A23F24;
  --on-thread: #FFFFFF;
  --line:     #2A3A2F;
  --line-2:   #223129;

  --paper-ink:   #16241C;
  --paper-ink-2: rgba(20, 33, 26, 0.70);
  --paper-ink-3: rgba(20, 33, 26, 0.66);
  --paper-line:  rgba(20, 33, 26, 0.22);
  --scrim: rgba(20, 33, 26, 0.90);
  --draw:      rgba(234, 230, 215, 0.88);
  --draw-2:    rgba(234, 230, 215, 0.45);
  --draw-soft: rgba(234, 230, 215, 0.09);
}
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ground);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--thread-action); color: var(--on-thread); }
img { max-width: 100%; display: block; }
.brand-logo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1163 / 287;
  line-height: 0;
}
.brand-logo img {
  width: 100%;
  height: auto;
  max-width: 100%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 480ms var(--ease), filter 480ms var(--ease);
}
/* The supplied PNG is black with a transparent background. On dark/photo
   surfaces the fallback softens white toward the surrounding surface. Modern
   browsers use the PNG's real alpha channel as a mask below, which gives the
   exact #F1EEE1 brand cream instead of an approximate filter colour. */
:root[data-theme="dark"] .brand-logo img {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
/* The homepage navigation sits directly on photography until it scrolls. */
body.home-hero .nav:not(.scrolled) .brand-logo img {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
/* The transition curtain also sits on a dark surface, so its mark follows the
   same cream fallback in browsers without CSS masking support. */
.veil .brand-logo img,
:root[data-theme="dark"] .veil .brand-logo img {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

@supports ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
  :root[data-theme="dark"] .brand-logo,
  body.home-hero .nav:not(.scrolled) .brand-logo,
  .veil .brand-logo {
    color: var(--brand-cream);
  }
  :root[data-theme="dark"] .brand-logo img,
  body.home-hero .nav:not(.scrolled) .brand-logo img,
  .veil .brand-logo img,
  :root[data-theme="dark"] .veil .brand-logo img {
    filter: none;
    opacity: 0;
  }
  :root[data-theme="dark"] .brand-logo::after,
  body.home-hero .nav:not(.scrolled) .brand-logo::after,
  .veil .brand-logo::after,
  :root[data-theme="dark"] .veil .brand-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-color: currentColor;
    -webkit-mask: url('/assets/brand/linhord-wordmark.png?v=50') center / 100% 100% no-repeat;
    mask: url('/assets/brand/linhord-wordmark.png?v=50') center / 100% 100% no-repeat;
  }
}
.sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* emphasis: no italics in this house — the red thread does the work */
em, .it { font-style: normal; color: var(--thread); }

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

.serif { font-family: var(--serif); font-weight: 500; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
}
.mono.dim { color: var(--bone-3); }
.mono .no { color: var(--thread); }

.display-1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(50px, 8.2vw, 118px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.display-2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.display-3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

/* ---------- links ---------- */

.lnk {
  position: relative;
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  padding-bottom: 5px;
}
.lnk::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--bone);
  transform-origin: left;
  transition: transform 450ms var(--ease), background 300ms;
}
.lnk:hover::after { background: var(--thread); transform: scaleX(0.4); }
.lnk:hover { color: var(--thread); transition: color 300ms; }

.lnk-quiet { color: var(--bone-2); text-decoration: none; transition: color 300ms; font-size: 13px; }
.lnk-quiet:hover { color: var(--thread); }

.arrow { display: inline-block; transition: transform 350ms var(--ease); }
a:hover .arrow { transform: translateX(5px); }

/* ---------- selvage divider: hairline w/ a red thread ---------- */

.selvage {
  position: relative; height: 1px; background: var(--line);
  transform-origin: left;
  transition: transform 1400ms var(--ease);
}
html.js .selvage { transform: scaleX(0); }
html.js body.ready .selvage.in { transform: scaleX(1); }
.selvage::after {
  content: '';
  position: absolute; left: 0; top: 0;
  width: 56px; height: 1px;
  background: var(--thread);
}

/* ---------- veil: fixed deep-pine transition curtain ---------- */

html:not(.js) .veil { display: none; }
.veil {
  position: fixed; inset: 0; z-index: 999;
  background: var(--brand-pine);
  color: var(--brand-cream);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px;
  opacity: 1;
  pointer-events: none;
  transition: opacity 260ms ease-out;
  will-change: opacity;
}
.veil.home-arrival {
  transition-duration: 700ms;
  transition-timing-function: ease-in-out;
}
.veil.quick { transition-duration: 180ms; }
.veil.snap { transition: none !important; }
.veil.nav-leaving {
  pointer-events: auto;
  transition-duration: 320ms;
  transition-timing-function: var(--ease);
}
.veil.below, .veil.lift { opacity: 0; }
.veil.gone { display: none; }
.veil-word {
  width: clamp(180px, 28vw, 360px);
  line-height: 0;
  opacity: 0;
  transform: translateY(16px);
}
.veil.type-in .veil-word { animation: veilWord 240ms var(--ease) 20ms forwards; }
.veil-line {
  width: clamp(72px, 9vw, 132px); height: 1px;
  background: var(--brand-thread-on-pine);
  transform: scaleX(0);
}
.veil.type-in .veil-line { animation: veilLine 220ms var(--ease) 40ms forwards; }
.veil-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(241, 238, 225, 0.72);
  opacity: 0;
}
.veil.type-in .veil-sub { animation: veilWord 220ms var(--ease) 60ms forwards; }
/* arriving via an internal link: the curtain is a continuation of the one that
   just rose on the previous page — show the mark already set, never re-animate */
.veil.instant .veil-word { opacity: 1; transform: none; animation: none; }
.veil.instant .veil-line { transform: scaleX(1); animation: none; }
.veil.instant .veil-sub { opacity: 1; animation: none; }
/* Internal navigation gets one restrained, 320 ms brand beat while the
   curtain itself fades in. The complete lock-up then holds for the existing
   0.5 s before the destination loads. */
.veil.nav-leaving .veil-word {
  animation: navVeilLogo 300ms var(--ease-entry) 20ms both;
  will-change: opacity, transform;
}
.veil.nav-leaving .veil-line {
  animation: veilLine 240ms var(--ease) 60ms both;
}
.veil.nav-leaving .veil-sub {
  animation: navVeilSub 200ms ease-out 120ms both;
}
@keyframes veilWord { to { opacity: 1; transform: none; } }
@keyframes veilLine { to { transform: scaleX(1); } }
@keyframes navVeilLogo {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes navVeilSub {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* ---------- entrance rises (hero etc.) ---------- */

[data-rise] {
  transition: opacity 1350ms var(--ease-entry), transform 1350ms var(--ease-entry);
  transition-delay: var(--rd, 0ms);
}
html.js [data-rise] { opacity: 0; transform: translateY(28px); }
html.js body.ready [data-rise] { opacity: 1; transform: none; }

.hl { display: block; overflow: hidden; }
.hl-in {
  display: block;
  transition: transform 1450ms var(--ease-entry);
  transition-delay: var(--rd, 0ms);
}
html.js .hl-in { transform: translateY(112%); }
html.js body.ready .hl-in { transform: none; }

/* ---------- nav ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  height: 68px;
  border-bottom: 1px solid transparent;
  transition: background 400ms, border-color 400ms;
}
.nav.scrolled {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
/* Interior pages already render the navigation in its final solid state.
   Avoid a continuously re-sampled fixed backdrop over image-heavy pages. */
body:not(.home-hero) .nav.scrolled {
  background: var(--ground);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.nav-brand {
  display: block;
  width: 106px;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}
.nav-links { display: flex; gap: 36px; align-items: center; }
.nav-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
  text-decoration: none;
  transition: color 300ms;
}
.nav-links a:hover, .nav-links a.active { color: var(--thread); }
.nav-links a[aria-current="page"] { color: var(--thread); }
.nav-order-status { white-space: nowrap; }
.nav-cta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ground) !important;
  background: var(--paper);
  padding: 10px 20px;
  text-decoration: none;
  transition: background 300ms, color 300ms;
}
.nav-cta:hover { background: var(--thread-action); color: var(--on-thread) !important; }

.nav-cart {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--bone); background: transparent;
  transition: color 300ms, border-color 300ms, background 300ms, transform 300ms var(--ease);
}
.nav-cart:hover { color: var(--thread) !important; border-color: var(--thread); }
.nav-cart:active { transform: scale(0.9); }
.nav-cart svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.cart-count {
  position: absolute; top: -6px; right: -7px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ground); border-radius: 999px;
  background: var(--thread-action); color: var(--on-thread);
  font-family: var(--mono); font-size: 8px; line-height: 1; letter-spacing: 0;
}
.cart-count[data-empty="true"] { display: none; }

/* Keep the full desktop navigation at the established 861px breakpoint,
   while giving the tablet-width band enough room to remain on one line. */
@media (min-width: 861px) and (max-width: 1100px) {
  .nav { padding-inline: clamp(14px, 2vw, 24px); }
  .nav-brand { width: 92px; }
  .nav-links { gap: clamp(5px, 0.9vw, 10px); }
  .nav-links a {
    font-size: 9.5px;
    letter-spacing: 0.05em;
    white-space: nowrap;
  }
  .nav-cta { padding: 8px 9px; }
  .nav-links .lang-toggle { min-width: 30px; height: 30px; padding-inline: 7px; }
  .nav-links .theme-toggle,
  .nav-links .nav-cart { width: 30px; height: 30px; }
}

/* theme toggle — moon in light mode, sun in dark mode.
   both icons are stacked and cross-fade + rotate on switch */
.theme-toggle {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; flex: none;
  background: transparent;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--bone); cursor: pointer;
  transition: color 300ms, border-color 300ms, background 300ms, transform 300ms var(--ease);
}
.theme-toggle:hover { color: var(--thread); border-color: var(--thread); }
.theme-toggle:active { transform: scale(0.88); }
.theme-toggle svg {
  position: absolute; top: 50%; left: 50%; width: 16px; height: 16px;
  transition: opacity 400ms var(--ease), transform 520ms var(--ease);
}
.theme-toggle .ic-moon { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); }
.theme-toggle .ic-sun  { opacity: 0; transform: translate(-50%, -50%) rotate(-110deg) scale(0.4); }
:root[data-theme="dark"] .theme-toggle .ic-moon { opacity: 0; transform: translate(-50%, -50%) rotate(110deg) scale(0.4); }
:root[data-theme="dark"] .theme-toggle .ic-sun  { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); }

/* ---------- i18n: bilingual text (English default, Chinese opt-in) ---------- */
/* wrap translatable text in inline pairs: <span class="i18n-en">…</span><span class="i18n-zh">…</span> */
.i18n-zh { display: none; }
html[data-lang="zh"] .i18n-en { display: none; }
html[data-lang="zh"] .i18n-zh { display: initial; }

/* language toggle — shows the language you can switch TO */
.lang-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px; flex: none;
  background: transparent; border: 1px solid var(--line); border-radius: 17px;
  color: var(--bone); cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  transition: color 300ms, border-color 300ms, background 300ms, transform 300ms var(--ease);
}
.lang-toggle:hover { color: var(--thread); border-color: var(--thread); }
.lang-toggle:active { transform: scale(0.9); }
.lang-toggle .ll-to-en { display: none; }
html[data-lang="zh"] .lang-toggle .ll-to-zh { display: none; }
html[data-lang="zh"] .lang-toggle .ll-to-en { display: inline; }

/* full-page theme transition — circular reveal from the toggle (View
   Transitions API, where supported) with a plain colour cross-fade fallback */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }
::view-transition-old(root) { z-index: 1; }

html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition: background-color 480ms var(--ease), color 480ms var(--ease),
              border-color 480ms var(--ease), fill 480ms var(--ease),
              stroke 480ms var(--ease) !important;
}
/* keep the toggle icons rotating/fading through the switch */
html.theme-anim .theme-toggle svg {
  transition: opacity 400ms var(--ease), transform 520ms var(--ease) !important;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
}

@media (max-width: 860px) {
  .nav-links a:not(.nav-cta):not(.nav-cart) { display: none; }
  .nav-links .nav-cta { display: none; }   /* the CTA moves into the mobile menu */
  .nav-links { gap: 14px; }
  .nav-links .nav-cart { display: inline-flex; }
  .nav-links .nav-burger { display: inline-flex; }  /* beats the base .nav-burger below */
}

/* ---------- mobile menu: burger button + full-screen overlay ---------- */
.nav-burger {
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  width: 34px; height: 34px; padding: 0; flex: none;
  background: transparent; border: 0; cursor: pointer; color: var(--bone);
}
.nav-burger .bar {
  display: block;
  width: 20px; height: 1.5px; flex: 0 0 1.5px;
  background: currentColor;
}

.mobile-menu {
  position: fixed; inset: 0; z-index: 150;
  background: var(--ground);
  display: flex; flex-direction: column; justify-content: center;
  padding: 96px var(--pad) 48px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0; transition: opacity 320ms var(--ease);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu.open { opacity: 1; }
@media (min-width: 861px) { .mobile-menu { display: none !important; } }
.mm-close {
  position: absolute; top: 16px; right: var(--pad);
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; color: var(--bone);
}
.mm-close svg { width: 24px; height: 24px; }
.mm-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mm-nav a {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 8.5vw, 46px); letter-spacing: -0.02em; line-height: 1.15;
  color: var(--bone); text-decoration: none; padding: 8px 0;
  transition: color 200ms var(--ease);
}
.mm-nav a:hover { color: var(--thread); }
.mm-nav a.mm-cart { display: inline-flex; align-items: center; gap: 12px; }
.mm-cart .cart-count {
  position: static; flex: none;
  border-color: var(--ground); transform: translateY(-8px);
}
.mm-nav a.btn {
  font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ground); background: var(--paper);
  border: 1px solid var(--paper); padding: 16px 30px; margin-top: 28px; line-height: 1;
}
.mm-nav a.btn:hover { background: var(--thread-action); border-color: var(--thread-action); color: var(--on-thread); }
html.menu-open, body.menu-open { overflow: hidden; }

/* Centred menu content can become unreachable when it is taller than a
   landscape phone viewport. Start at the top in short viewports and let the
   overlay itself scroll so every link and the CTA remain reachable. */
@media (max-width: 860px) and (max-height: 640px) {
  .mobile-menu {
    justify-content: flex-start;
    padding-top: 72px;
    padding-bottom: 32px;
  }
  .mm-nav a {
    font-size: clamp(28px, 7vh, 38px);
    padding-block: 5px;
  }
  .mm-nav a.btn { margin-top: 18px; }
}

/* ---------- skip link (first focusable, visible only on focus) ---------- */
.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 1200;
  transform: translateY(-160%);
  background: var(--paper); color: var(--ground);
  padding: 12px 18px; border-radius: 0;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; transition: transform 200ms var(--ease);
}
.skip-link:focus { transform: translateY(0); }
.skip-link:focus-visible {
  outline: 3px solid var(--thread);
  outline-offset: 3px;
}

/* ---------- cart feedback ---------- */
.cart-toast {
  position: fixed; z-index: 1100;
  right: var(--pad); bottom: clamp(18px, 4vw, 38px);
  width: min(360px, calc(100vw - (2 * var(--pad))));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line); border-left: 2px solid var(--thread);
  background: var(--ground-2); color: var(--bone);
  box-shadow: 0 18px 55px rgba(7, 14, 10, 0.24);
  transform: translateY(18px); opacity: 0; pointer-events: none;
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}
.cart-toast.is-visible { transform: none; opacity: 1; pointer-events: auto; }
.cart-toast-icon { color: var(--thread); font-size: 17px; }
.cart-toast-copy { min-width: 0; font-size: 13px; line-height: 1.45; }
.cart-toast a {
  color: var(--bone); font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.1em; text-transform: uppercase; text-underline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .cart-toast { transition: none; }
}

/* Responsive structures shared by the factory, process and legacy collection
   pages. These classes replace brittle inline grids so narrow screens can
   collapse without forcing the document wider than the viewport. */
.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
}
.process-step-grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.strip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: center;
  padding-top: clamp(52px, 6vw, 88px);
  padding-bottom: clamp(52px, 6vw, 88px);
}
@media (max-width: 760px) {
  .page-hero-grid,
  .process-step-grid,
  .strip-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-hero-grid { align-items: start; }
  .process-step-grid { gap: 24px; }
  .strip-row { justify-items: start; gap: 26px; }
}

/* section-head titles are real <h2>/<h3> but keep the eyebrow look
   (only neutralise the UA margin + bold; .mono controls size/spacing) */
.sec-head h2, .sec-head h3 { margin: 0; font-weight: inherit; }

/* ---------- shell / sections ---------- */

.shell { padding-left: var(--pad); padding-right: var(--pad); max-width: 1560px; margin: 0 auto; }

.sec { padding-top: clamp(72px, 10vw, 144px); padding-bottom: clamp(72px, 10vw, 144px); }

.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  margin-bottom: clamp(36px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.sec-head::before {
  content: '+';
  position: absolute; right: 0; bottom: -9px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bone-3);
  line-height: 1;
}
.sec-head::after {
  content: ''; position: absolute; left: 0; bottom: -1px;
  width: 56px; height: 1px; background: var(--thread);
  transform-origin: left;
  transition: transform 1000ms var(--ease) 250ms;
}
html.js .sec-head::after { transform: scaleX(0); }
html.js body.ready .sec-head.reveal.in::after { transform: scaleX(1); }

/* ---------- instrument card (image + caption bar) ---------- */

.placard { }
.placard-img {
  position: relative;
  overflow: hidden;
  background: var(--ground-2);
  border: 1px solid var(--line);
}
.placard-img .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 1200ms var(--ease);
}
.placard:hover .placard-img .bg { transform: scale(1.035); }
.placard-cap {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-top: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-3);
  background: var(--ground);
}
.placard-cap .fig { color: var(--thread); }

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  animation: marquee 42s linear infinite;
}
.marquee-track span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-2);
  padding-right: 12px;
}
.marquee-track .sep { color: var(--thread); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- collection index list ---------- */

.idx { border-top: 1px solid var(--line); }
.idx-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: clamp(22px, 3vw, 38px) 12px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--bone);
  position: relative;
  transition: background 400ms var(--ease);
}
.idx-row:hover { background: var(--ground-2); }
.idx-row .idx-no {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--bone-3);
  transition: color 300ms;
}
.idx-row .idx-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 4.2vw, 62px);
  line-height: 1;
  letter-spacing: -0.03em;
  transition: transform 500ms var(--ease), color 300ms;
}
.idx-row .idx-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-3);
  text-align: right;
  transition: color 300ms;
}
.idx-row:hover .idx-no { color: var(--thread); }
.idx-row:hover .idx-name { transform: translateX(16px); color: var(--thread); }
.idx-row:hover .idx-meta { color: var(--bone); }
.idx-thumb { display: none; }
@media (max-width: 720px) {
  .idx-row { grid-template-columns: 44px 1fr 72px; align-items: center; }
  .idx-thumb {
    display: block; width: 72px; height: 90px;
    background-size: cover; background-position: center;
    border: 1px solid var(--line);
  }
  .idx-row .idx-meta { display: none; }
}

/* floating hover image (desktop only) */
.float-img {
  position: fixed; top: 0; left: 0;
  width: 280px; height: 350px;
  background-size: cover; background-position: center;
  pointer-events: none;
  opacity: 0;
  z-index: 60;
  border: 1px solid var(--bone-3);
  transition: opacity 350ms var(--ease);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.float-img.on { opacity: 1; }
@media (hover: none), (max-width: 720px) { .float-img { display: none; } }

/* ---------- paper band (inverted strip) ---------- */

.strip {
  --thread: var(--thread-inverted);
  background: var(--paper);
  color: var(--ground);
  position: relative;
}
.strip::before {
  content: ''; position: absolute; top: 0; left: var(--pad);
  width: 56px; height: 1px; background: var(--thread);
}
.strip .mono { color: var(--paper-ink-2); }
.strip .mono .no { color: var(--thread); }
.strip .lnk { color: var(--paper-ink); }
.strip .lnk::after { background: var(--paper-ink); }
.strip .lnk:hover { color: var(--thread); }
.strip .lnk:hover::after { background: var(--thread); }
.strip .lnk-quiet { color: var(--paper-ink-2); }
.strip .lnk-quiet:hover { color: var(--thread); }
.strip .sec-head { border-bottom-color: var(--paper-line); }
.strip .sec-head::before { color: var(--paper-ink-3); }
.strip .display-3, .strip .display-2 { color: var(--ground); }

/* ---------- spec table ---------- */

.spec { border-top: 1px solid var(--line); }
.spec-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
}
.spec-row dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-3);
  padding-top: 3px;
}
.spec-row dd { font-size: 14.5px; color: var(--bone-2); }
.strip .spec { border-top-color: var(--paper-line); }
.strip .spec-row { border-bottom-color: var(--paper-line); }
.strip .spec-row dt { color: var(--paper-ink-3); }
.strip .spec-row dd { color: var(--paper-ink); }
@media (max-width: 600px) { .spec-row { grid-template-columns: 130px 1fr; } }

/* ---------- pinned scroll section: image holds, text scrolls ---------- */

.pin {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: clamp(32px, 5vw, 88px);
  padding: clamp(72px, 10vw, 144px) var(--pad);
  max-width: 1560px;
  margin: 0 auto;
}
.pin-media { position: sticky; top: 96px; align-self: start; }
.pin-img {
  position: relative; overflow: hidden;
  background: var(--ground-2);
  border: 1px solid var(--line);
  height: calc(100svh - 200px);
  min-height: 420px;
}
.pin-img .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.pin-block {
  min-height: 72svh;
  display: flex; flex-direction: column; justify-content: center;
}
.pin-block .mono { margin-bottom: 20px; }
.pin-block p.body { max-width: 46ch; color: var(--bone-2); margin-top: 22px; font-size: 15.5px; }
.pin-block.quote { min-height: 60svh; }
@media (max-width: 860px) {
  .pin { display: block; }
  .pin-media { position: sticky; top: 68px; z-index: 0; }
  .pin-img { height: 44svh; min-height: 300px; }
  .pin-blocks { position: relative; z-index: 1; background: var(--ground); margin-top: 28px; }
  .pin-block { min-height: 0; padding: 48px 0; }
}

/* ---------- journal list ---------- */

.jr { border-top: 1px solid var(--line); }
.jr-row {
  display: grid;
  grid-template-columns: 130px 1fr 110px 24px;
  gap: 28px;
  align-items: baseline;
  padding: 26px 12px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--bone);
  transition: background 400ms var(--ease);
}
.jr-row:hover { background: var(--ground-2); }
.jr-row .jr-date { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-3); }
.jr-row .jr-title { font-family: var(--serif); font-weight: 500; font-size: clamp(21px, 2.4vw, 30px); letter-spacing: -0.015em; line-height: 1.15; transition: color 300ms; }
.jr-row .jr-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-3); text-align: right; }
.jr-row .jr-arr { color: var(--bone-3); transition: transform 350ms var(--ease), color 300ms; }
.jr-row:hover .jr-title { color: var(--thread); }
.jr-row:hover .jr-arr { transform: translateX(5px); color: var(--thread); }
@media (max-width: 720px) {
  .jr-row { grid-template-columns: 1fr 24px; }
  .jr-row .jr-date { grid-column: 1 / -1; }
  .jr-row .jr-tag { display: none; }
}

/* ---------- product cards (category pages) ---------- */

.prod-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(20px, 3vw, 48px);
  row-gap: clamp(48px, 6vw, 88px);
}
.prod { text-decoration: none; color: var(--bone); }
.prod .ph {
  position: relative; overflow: hidden;
  background: var(--ground-2);
  border: 1px solid var(--line);
}
.prod .ph .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 1100ms var(--ease);
}
.prod:hover .ph .bg { transform: scale(1.04); }
.prod:hover .ph { border-color: var(--bone-3); }
.prod .sku {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--thread);
  margin: 16px 0 4px;
}
.prod .nm { font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -0.015em; line-height: 1.1; }
.prod .ds { font-size: 13px; color: var(--bone-2); margin-top: 6px; }
.prod .wt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--bone-3); margin-top: 10px; text-transform: uppercase; }

/* blueprint plates — bone linework on lifted pine */
.plate {
  display: flex; align-items: center; justify-content: center;
  background: var(--ground-2);
}
.plate::before, .plate::after {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  color: var(--bone-3);
  position: absolute;
  z-index: 2;
}
.plate::before { content: '+'; top: 8px; left: 10px; }
.plate::after { content: '+'; bottom: 8px; right: 10px; }
.plate svg { width: 64%; height: 64%; color: var(--draw); }
.plate svg text {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  fill: var(--bone-3);
  text-transform: uppercase;
}
.plate svg .thread { stroke: var(--thread); }
.plate svg .dim { stroke: var(--bone-3); stroke-width: 0.75; }
.plate svg .dash { stroke-dasharray: 3 4; }

.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.r-34 .ph { aspect-ratio: 3 / 4; }
.r-45 .ph { aspect-ratio: 4 / 5; }
.r-11 .ph { aspect-ratio: 1 / 1; }
.r-32 .ph { aspect-ratio: 3 / 2; }
.r-169 .ph { aspect-ratio: 16 / 9; }
@media (max-width: 900px) {
  .prod-grid > * { grid-column: span 6; }
}
@media (max-width: 560px) {
  .prod-grid > * { grid-column: span 12; }
}

/* ---------- category header ---------- */

.cat-head {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 88px);
  align-items: end;
  padding-top: 148px;
  padding-bottom: clamp(48px, 6vw, 88px);
}
@media (max-width: 860px) { .cat-head { grid-template-columns: 1fr; } }

/* ---------- prose (journal posts, legal) ---------- */

.prose { max-width: 660px; }
.prose > * + * { margin-top: 1.4em; }
.prose p { font-size: 16px; line-height: 1.85; color: var(--bone-2); }
.prose h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: 28px; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--bone);
  margin-top: 2.2em;
}
.prose h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; color: var(--bone); margin-top: 2em; }
.prose ul, .prose ol { padding-left: 1.3em; color: var(--bone-2); font-size: 15px; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote {
  font-family: var(--serif); font-weight: 500;
  font-size: 22px; line-height: 1.45; letter-spacing: -0.01em;
  color: var(--bone);
  border-left: 1px solid var(--thread);
  padding-left: 28px;
  margin-top: 2em; margin-bottom: 2em;
}
.prose a { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--thread); }
.prose .lede {
  font-family: var(--serif); font-weight: 500;
  font-size: 21px; line-height: 1.5; letter-spacing: -0.01em;
  color: var(--bone);
}

/* ---------- forms ---------- */

.field { display: block; margin-bottom: 28px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 12px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--bone);
  border-radius: 0;
  transition: border-color 300ms;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-bottom-color: var(--thread);
}
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ground);
  background: var(--paper);
  border: 1px solid var(--paper);
  padding: 16px 36px;
  cursor: pointer;
  text-decoration: none;
  transition: background 300ms, border-color 300ms, color 300ms;
}
.btn:hover { background: var(--thread-action); border-color: var(--thread-action); color: var(--on-thread); }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--bone-3); }
.btn.ghost:hover { background: var(--thread-action); color: var(--on-thread); border-color: var(--thread-action); }
.strip .btn.ghost { color: var(--paper-ink); border-color: var(--paper-ink-3); }
.strip .btn.ghost:hover { background: var(--ground); color: var(--paper); border-color: var(--ground); }
.strip .field input, .strip .field textarea {
  color: var(--paper-ink);
  border-bottom-color: var(--paper-ink-3);
}
.strip .field input:focus, .strip .field textarea:focus { border-bottom-color: var(--thread); }

/* ---------- RFQ fieldsets: group semantics, no default chrome ---------- */
.rfq-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.rfq-fs > legend { display: block; width: 100%; padding: 0; }
.rfq-message {
  min-height: 148px;
  resize: vertical;
}
.rfq-message[data-autogrow] {
  overflow-x: hidden;
  overflow-y: hidden;
  overflow-wrap: anywhere;
  resize: none;
}

.rfq-submit-status {
  min-height: 22px; margin: 20px 0 12px;
  color: var(--bone-2); font-size: 12.5px; line-height: 1.6;
}
.rfq-submit-status[data-state="error"] { color: var(--thread); }
.rfq-submit-status:focus { outline: none; }
.inquiry-reference {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 24px;
  margin: 30px 0 0; padding: 18px 20px;
  border: 1px solid var(--line); border-left: 2px solid var(--thread);
  background: var(--ground-2);
}
.inquiry-reference dt {
  color: var(--bone-3); font: 9px/1.5 var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.inquiry-reference dd {
  margin: 0; color: var(--bone); font: 12px/1.5 var(--mono); overflow-wrap: anywhere;
}
@media (max-width: 520px) { .inquiry-reference { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- keyboard focus: one clear ring everywhere (keyboard only) ---------- */
:focus-visible { outline: 2px solid var(--thread); outline-offset: 2px; border-radius: 2px; }
/* beat the form fields' outline:none (they only changed a border, too weak for keyboard) */
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible,
.pdp-thumb:focus-visible, .cfg-opt:focus-visible, .cfg-sw:focus-visible, .banner-dot:focus-visible {
  outline: 2px solid var(--thread); outline-offset: 2px;
}
/* the colour swatch is round — match the ring to it */
.cfg-sw:focus-visible { border-radius: 50%; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding-top: clamp(48px, 6vw, 88px);
  position: relative;
}
footer::before {
  content: ''; position: absolute; top: -1px; left: var(--pad);
  width: 56px; height: 1px; background: var(--thread);
}
.foot-word {
  width: clamp(250px, 48vw, 780px);
  line-height: 0;
  user-select: none;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding: clamp(40px, 5vw, 72px) 0;
}
.foot-grid h4, .foot-heading {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 18px;
}
.foot-grid a { display: block; font-size: 13.5px; color: var(--bone-2); text-decoration: none; padding: 4px 0; transition: color 300ms; }
.foot-grid a:hover { color: var(--thread); }
.foot-fine {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line-2);
  padding: 20px 0 28px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-3);
}
@media (max-width: 780px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- reveal on scroll (staggered via --rvd, set by JS) ---------- */

.reveal {
  transition: opacity 1300ms var(--ease-entry), transform 1300ms var(--ease-entry);
  transition-delay: var(--rvd, 0ms);
}
html.js .reveal { opacity: 0; transform: translateY(32px); }
html.js body.ready .reveal.in { opacity: 1; transform: none; }

/* image curtain-wipe inside reveals */
.reveal .ph .bg,
.reveal .placard-img .bg,
.reveal.pin-media .pin-img .bg {
  transition: clip-path 1500ms var(--ease-entry), transform 1450ms var(--ease-entry);
  transition-delay: var(--rvd, 0ms);
}
html.js .reveal .ph .bg,
html.js .reveal .placard-img .bg,
html.js .reveal.pin-media .pin-img .bg {
  clip-path: inset(0 0 100% 0);
}
html.js body.ready .reveal.in .ph .bg,
html.js body.ready .reveal.in .placard-img .bg,
html.js body.ready .reveal.in.pin-media .pin-img .bg {
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .selvage, [data-rise], .hl-in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .reveal .ph .bg, .reveal .placard-img .bg, .reveal.pin-media .pin-img .bg { clip-path: none !important; transition: none !important; }
  .sec-head::after { transform: scaleX(1) !important; transition: none !important; }
  .marquee-track { animation: none; }
  .veil { display: none; }
  html { scroll-behavior: auto; }
}
