/* GG designs
   Palette from the brief. Bodoni Moda (display) + Jost (interface). */

:root {
  --navy: #0F2350;
  --ink: #1A1A1C;
  --oat: #E7DFD0;
  --fog-light: #A9ADB4;
  --fog: #8E939B;
  --cloud: #F9F7F3;

  --text: var(--ink);
  --muted: #5B6068;            /* Fog darkened for body-size legibility on Cloud */
  --line: rgba(26, 26, 28, 0.12);
  --line-strong: rgba(26, 26, 28, 0.28);
  --cool-bg: #DCDDE0;          /* backdrop for light garments */

  --serif: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 3.4vw, 48px);
  --header-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

/* scroll-padding keeps anchor jumps, scrollIntoView and focus scrolling clear of the sticky header */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }
html.no-scroll { overflow: hidden; }

body {
  margin: 0;
  background: var(--cloud);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
figure { margin: 0; }

/* classes that set display (.btn etc.) must not override the hidden attribute */
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
/* the navy ring is invisible on the navy statement and the ink footer */
.statement :focus-visible, .site-footer :focus-visible { outline-color: var(--cloud); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--cloud);
  padding: 10px 16px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--muted); }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; min-height: 52px; padding: 0 28px;
  border: 1px solid var(--navy); border-radius: 0;
  background: var(--navy); color: var(--cloud);
  font-size: 15px; font-weight: 500; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-line:hover { background: var(--ink); color: var(--cloud); border-color: var(--ink); }
.btn-light { background: var(--cloud); color: var(--navy); border-color: var(--cloud); }
.btn-light:hover { background: var(--oat); border-color: var(--oat); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.text-link {
  font-size: 15px; text-decoration: underline;
  text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.text-link:hover { text-decoration-thickness: 2px; }

.text-btn, .link-btn {
  background: none; border: 0; padding: 4px 0;
  font-size: 15px; text-decoration: underline;
  text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.text-btn:hover, .link-btn:hover { text-decoration-thickness: 2px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  background: none; border: 0; border-radius: 50%;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: rgba(26, 26, 28, 0.06); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 18px; height: 18px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  background: rgba(249, 247, 243, 0.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.menu-btn { display: none; }
.nav-main { display: flex; gap: 30px; }
.nav-main a { font-size: 15px; text-decoration: none; }
.nav-main a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.wordmark {
  font-family: var(--serif); font-weight: 500; font-size: 28px;
  letter-spacing: -0.01em; line-height: 1; text-decoration: none;
  white-space: nowrap;
}
.nav-tools { display: flex; justify-content: flex-end; align-items: center; }
.bag-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 6px 0; font-size: 15px;
}
.bag-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.bag-count {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--navy); color: var(--cloud);
  font-size: 12.5px; font-weight: 500;
}

/* ---------- section heads ---------- */
.section-head {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px 48px; align-items: end;
  padding: 0 var(--gutter); margin-bottom: clamp(28px, 4vw, 52px);
}
.section-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 6.4vw, 6rem); line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.section-head p { color: var(--muted); max-width: 44ch; }

/* ---------- hero ---------- */
.hero {
  --g-size: min(36vw, 72svh);
  --g-gap: min(15vw, 28svh);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: calc(100svh - var(--header-h));
  padding: clamp(20px, 3.4vh, 40px) var(--gutter) clamp(24px, 4vh, 44px);
  overflow: hidden;
}
.hero-stage {
  grid-area: 1 / 1 / -1 / -1; position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  margin-bottom: calc(clamp(24px, 4vh, 44px) * -1);
}
.hero-stage::after {
  content: ""; position: absolute; left: 50%; bottom: 1.2%;
  width: min(22vw, 300px); height: 26px; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(26, 26, 28, 0.28), rgba(26, 26, 28, 0));
  z-index: 0;
}
.hero-letters {
  position: absolute; inset: 0 0 6% 0;
  display: flex; align-items: center; justify-content: center; gap: var(--g-gap);
  font-family: var(--serif); font-weight: 500;
  font-size: var(--g-size); line-height: 1;
  color: var(--navy);
  user-select: none; pointer-events: none;
}
.hero-letters .g { display: block; }
.hero-model {
  position: relative; z-index: 1;
  height: calc(100svh - var(--header-h) - 12px); max-height: 980px;
  width: auto; max-width: none;
}

.hero-copy { grid-area: 1 / 1 / 2 / 2; position: relative; z-index: 2; max-width: 24rem; }
.hero-copy h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.55rem, 2.1vw, 2.1rem); line-height: 1.12;
  letter-spacing: -0.01em; margin-bottom: 0.7rem; max-width: 16ch;
}
.hero-copy p { color: var(--muted); font-size: 15.5px; max-width: 34ch; }

.hero-actions {
  grid-area: 3 / 1 / 4 / 2; align-self: end; position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
}
.hero-caption {
  grid-area: 3 / 2 / 4 / 3; justify-self: end; align-self: end; position: relative; z-index: 2;
  text-align: right; font-size: 14.5px; line-height: 1.5;
}

/* single orchestrated entrance */
.hero .g-l { animation: gg-in-left 1.15s var(--ease) both 0.05s; }
.hero .g-r { animation: gg-in-right 1.15s var(--ease) both 0.05s; }
.hero-model { animation: gg-rise 1.2s var(--ease) both 0.2s; }
.hero-copy, .hero-actions, .hero-caption { animation: gg-fade 0.8s ease both 0.75s; }
@keyframes gg-in-left { from { opacity: 0; translate: -10vw 0; } }
@keyframes gg-in-right { from { opacity: 0; translate: 10vw 0; } }
@keyframes gg-rise { from { opacity: 0; translate: 0 3%; } }
@keyframes gg-fade { from { opacity: 0; } }

/* ---------- garment rig (shared) ---------- */
.rig { position: relative; aspect-ratio: 1024 / 1536; perspective: 1600px; }
.rig .float, .rig .tilt, .rig .flip { width: 100%; height: 100%; transform-style: preserve-3d; }
.rig .float { animation: gg-float 7s ease-in-out infinite; will-change: transform; }
.rig .tilt { transition: transform 0.6s var(--ease); will-change: transform; }
.rig .garment-svg { width: 100%; height: 100%; overflow: visible; }
.rig .ground {
  position: absolute; left: 22%; right: 22%; bottom: 0; height: 4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(26, 26, 28, 0.32), rgba(26, 26, 28, 0));
  animation: gg-ground 7s ease-in-out infinite;
  pointer-events: none; z-index: -1;
}
.rig--still .ground { animation: none; opacity: 0.8; }

@keyframes gg-float {
  0%, 100% { transform: translateY(-1.4%) rotate(-0.4deg); }
  50% { transform: translateY(1%) rotate(0.4deg); }
}
@keyframes gg-ground {
  0%, 100% { transform: scale(0.84); opacity: 0.65; }
  50% { transform: scale(1); opacity: 1; }
}

.garment-svg * { pointer-events: none; }
.garment-svg .print { transition: opacity 0.36s ease; }

/* ---------- the range ---------- */
.range { padding: clamp(72px, 10vw, 140px) 0 clamp(56px, 8vw, 110px); }
.cards {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 4vw, 56px) clamp(14px, 1.8vw, 26px);
}
.card-media {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 4 / 5; background: var(--oat); overflow: hidden;
}
.card[data-product="french-sleeve-tee"] .card-media,
.card[data-product="tote"] .card-media { background: var(--cool-bg); }
.card-img {
  grid-area: 1 / 1; width: 82%; height: 92%; object-fit: contain;
  transition: opacity 0.35s ease;
}
.card-img:not([src]) { opacity: 0; }
.card-img--back { opacity: 0; }
.card-media:hover .card-img--back[src] { opacity: 1; }
.card-media:hover .card-img--back[src] ~ .gsm-pill { opacity: 1; }
.card-media:has(.card-img--back[src]):hover .card-img:not(.card-img--back) { opacity: 0; }
.gsm-pill {
  position: absolute; left: 14px; top: 14px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(249, 247, 243, 0.85); font-size: 13px; font-weight: 500;
}
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 16px; }
.card-title h3 { font-family: var(--serif); font-weight: 400; font-size: 1.55rem; line-height: 1.15; }
.card-price { font-size: 15px; white-space: nowrap; }
.card-fabric { font-size: 14.5px; margin-top: 2px; }
.card-meaning { color: var(--muted); font-size: 15px; margin-top: 4px; max-width: 38ch; }
.dots { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.dot {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(26, 26, 28, 0.55);
}
.dot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--cloud), 0 0 0 3.5px var(--ink); }
.card-cta { min-height: 44px; padding: 0 20px; }

/* ---------- studio ---------- */
.studio { --studio-h: clamp(680px, 90svh, 920px); padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 8vw, 120px); }
.studio-grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(380px, 1fr);
  height: var(--studio-h);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

.stage {
  --stage-a: #F1EBE0; --stage-b: #E3DACA;
  position: relative; display: flex; flex-direction: column; min-height: 0;
  background: radial-gradient(70% 62% at 50% 44%, var(--stage-a), var(--stage-b));
  outline: none; overflow: hidden;
}
.stage.on-light { --stage-a: #E9EAEC; --stage-b: #D3D5D9; }
.stage:focus-visible { box-shadow: inset 0 0 0 2px var(--navy); }
.stage.is-loading .studio-rig { opacity: 0.4; transition: opacity 0.2s; }

.stage-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 0; position: relative; z-index: 2; pointer-events: none; }
/* only the controls catch taps; the label lets them through to prints and handles beneath */
.stage-top .seg, .stage-top button { pointer-events: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); background: rgba(249, 247, 243, 0.55); }
.seg[hidden] { display: none; }
.seg button { border: 0; background: none; height: 38px; padding: 0 18px; font-size: 14.5px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--cloud); }
.stage-label { margin-left: auto; text-align: right; }
.stage-product { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; }
.stage-gsm { font-size: 13.5px; color: var(--muted); }
.stage.on-light .stage-gsm { color: #50555C; }

.stage-garment { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 20px 6px; }
.studio-rig { width: min(100%, 480px, calc((var(--studio-h) - 190px) * 0.667)); }

/* 3D preview (js/view3d.js). The flat garment stays underneath, hidden, as the editor's source of truth. */
.stage-top .seg-mode { margin-right: auto; }
.stage-3d { position: absolute; inset: 0; z-index: 1; }
.stage-3d[hidden] { display: none; }
.stage-3d-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.stage.is-dragging .stage-3d-canvas { cursor: grabbing; }
.stage-3d.is-loading::after {
  content: "Loading 3D"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 14px; color: var(--muted);
}
.stage.is-3d .stage-garment { visibility: hidden; }
.stage.is-dragging .float, .stage.is-dragging .ground,
.stage.is-still .float, .stage.is-still .ground { animation-play-state: paused; }

/* editing UI drawn inside the garment SVG */
.stage .garment-svg .layer image,
.stage .garment-svg [data-handle] { pointer-events: auto; }
.stage .garment-svg .layer { cursor: grab; }
.stage.is-dragging .garment-svg .layer { cursor: grabbing; }
.ui-zone { stroke: var(--navy); stroke-width: 1; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity 0.25s; }
.stage:hover .ui-zone, .stage.is-dragging .ui-zone { opacity: 0.45; }
.ui-guide { stroke: #3E7BFA; stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; }
.ui-guide.on { opacity: 0.9; }
.ui-box, .ui-stem { stroke: var(--cloud); stroke-width: 1.2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1px rgba(0,0,0,.7)); }
.ui-box { stroke-dasharray: 4 3; }
.on-light .ui-box, .on-light .ui-stem { stroke: var(--navy); filter: none; }
.ui-hit { fill: transparent; }
.ui-rot, .ui-scale { fill: var(--cloud); stroke: var(--navy); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
[data-handle="rot"] { cursor: grab; }
[data-handle="scale"] { cursor: nwse-resize; }

.drop-cue {
  position: absolute; inset: 14px; z-index: 5;
  display: grid; place-items: center;
  border: 1.5px dashed var(--navy); background: rgba(249, 247, 243, 0.7);
  font-family: var(--serif); font-size: 1.6rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.stage.is-dropping .drop-cue { opacity: 1; }

.layer-bar {
  position: relative; z-index: 2;
  border-top: 1px solid var(--line);
  background: rgba(249, 247, 243, 0.82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 12px 20px; min-height: 72px;
  display: flex; align-items: center;
}
.lb-hint { color: var(--muted); font-size: 14.5px; }
.layer-bar:not(.is-empty) .lb-hint { display: none; }
.layer-bar.is-empty .lb-controls { display: none; }
.lb-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; width: 100%; }
.lb-name { font-family: var(--serif); font-size: 1.15rem; min-width: 7ch; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-field { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.lb-field span { display: flex; justify-content: space-between; gap: 8px; }
.lb-field output { color: var(--ink); }
.lb-field select { height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--muted); background: var(--cloud); font-size: 14px; border-radius: 0; }
.lb-range input { width: 130px; accent-color: var(--navy); }
.lb-actions { display: flex; gap: 16px; margin-left: auto; }
.lb-actions .text-btn { font-size: 14px; }

/* panel */
.panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--cloud); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); flex: none; }
.tabs [role="tab"] { position: relative; height: 56px; border: 0; background: none; font-size: 15px; color: var(--muted); }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--navy); }
.tabs .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 2px; border-radius: 10px; background: var(--oat); color: var(--ink); font-size: 12px; }

.tabpanel { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 26px; }
.tabpanel[hidden] { display: none; }
.tabpanel h3 { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; line-height: 1.1; margin-bottom: 14px; }
.tabpanel .lede { color: var(--muted); font-size: 15px; margin-bottom: 20px; max-width: 40ch; }
.tabpanel .sub { font-family: var(--sans); font-weight: 500; font-size: 15px; margin: 22px 0 10px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 500; font-size: 15px; margin-bottom: 10px; }
.inks, .fonts { margin-top: 22px; }

.prod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.prod-opt { display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 10px; border: 1px solid var(--line); cursor: pointer; transition: border-color 0.2s; }
.prod-opt:hover { border-color: var(--line-strong); }
.prod-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.prod-opt:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 2px; }
.prod-thumb { display: grid; place-items: center; aspect-ratio: 1 / 1.1; background: var(--oat); margin-bottom: 6px; overflow: hidden; }
.prod-thumb img { width: 86%; height: 96%; object-fit: contain; }
.prod-thumb img:not([src]) { visibility: hidden; }
.prod-name { font-size: 13.5px; font-weight: 500; line-height: 1.25; }
.prod-gsm { font-size: 12.5px; color: var(--muted); }

.swatches { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; cursor: pointer; text-align: center; }
.swatch .chip { width: 40px; height: 40px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(26, 26, 28, 0.16); }
.swatch:has(input:checked) .chip { box-shadow: 0 0 0 2px var(--cloud), 0 0 0 3.5px var(--ink); }
.swatch:has(input:focus-visible) .chip { outline: 2px solid var(--navy); outline-offset: 5px; }
.swatch-name { font-size: 12.5px; line-height: 1.25; }

.dropzone {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px; border: 1px dashed var(--line-strong); cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.dropzone:hover { border-color: var(--navy); background: rgba(231, 223, 208, 0.35); }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 2px; }
.dz-title { font-family: var(--serif); font-size: 1.3rem; }
.dz-note { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

.library { --tile: var(--navy); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lib-item { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; text-align: left; }
.lib-thumb { display: grid; place-items: center; aspect-ratio: 1; background: var(--tile); border: 1px solid var(--line); transition: border-color 0.2s; }
.lib-thumb img { width: 66%; height: 66%; object-fit: contain; }
.lib-thumb img:not([src]) { visibility: hidden; }
.lib-item:hover .lib-thumb { border-color: var(--ink); }
.lib-name { font-size: 13px; color: var(--muted); }

.ink-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ink { position: relative; cursor: pointer; }
.ink-chip { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(26, 26, 28, 0.55); }
.ink:has(input:checked) .ink-chip, .ink-custom.is-on .ink-chip { box-shadow: 0 0 0 2px var(--cloud), 0 0 0 3.5px var(--ink); }
.ink:has(input:focus-visible) .ink-chip { outline: 2px solid var(--navy); outline-offset: 4px; }
.ink-custom input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ink-chip--any { background: conic-gradient(#9C3D2E, #C9A227, #4E7A5A, #3C5FA8, #7A4E8C, #9C3D2E); }
.ink-custom.is-on .ink-chip--any { background: var(--c); }

.field-label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 8px; }
textarea {
  width: 100%; resize: vertical; min-height: 76px;
  padding: 12px 14px; border: 1px solid var(--muted); border-radius: 0;
  background: #fff; font-size: 17px; line-height: 1.4;
}
textarea:focus-visible { outline: 2px solid var(--navy); outline-offset: 0; }
.hint { font-size: 13.5px; color: var(--muted); margin-top: 8px; }

.font-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.font-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 8px; border: 1px solid var(--line); cursor: pointer; }
.font-chip:hover { border-color: var(--line-strong); }
.font-chip:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.font-chip:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 2px; }
.font-sample { font-size: 28px; line-height: 1.2; }
.font-name { font-size: 12.5px; color: var(--muted); }
.arc-field { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; font-weight: 500; font-size: 15px; }
.arc-field span { display: flex; justify-content: space-between; }
.arc-field output { font-weight: 400; color: var(--muted); }
.arc-field input { accent-color: var(--navy); }
#text-new { margin-top: 22px; }

.layer-list { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--line); }
.layer-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.layer-row.is-selected { background: rgba(231, 223, 208, 0.45); box-shadow: inset 3px 0 0 var(--navy); }
.layer-row.is-selected .layer-name { font-weight: 500; }
.layer-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 6px; border: 0; background: none; text-align: left; }
.layer-thumb { flex: none; display: grid; place-items: center; width: 44px; height: 44px; background: var(--tile); }
.layer-thumb img { width: 80%; height: 80%; object-fit: contain; }
.layer-text { display: flex; flex-direction: column; min-width: 0; }
.layer-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-side { font-size: 13px; color: var(--muted); }
.layer-actions { display: flex; flex: none; padding-right: 4px; }
.layer-actions .icon-btn svg { stroke-width: 1.6; }
.layer-empty { padding: 18px 0; color: var(--muted); font-size: 15px; }

.summary { flex: none; border-top: 1px solid var(--line); padding: 16px 24px 20px; }
.sum-lines { list-style: none; margin: 0 0 12px; padding: 0; font-size: 14.5px; }
.sum-lines li { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); padding: 1px 0; }
.sum-lines li:first-child { color: var(--ink); }
.sum-lines li[hidden] { display: none; }
.sum-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sizes legend { font-size: 13px; color: var(--muted); font-weight: 400; margin-bottom: 6px; }
.size-row { display: flex; flex-wrap: wrap; gap: 4px; }
.size-chip span { display: grid; place-items: center; min-width: 40px; height: 34px; padding: 0 8px; border: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.size-chip:hover span { border-color: var(--line-strong); }
.size-chip:has(input:checked) span { background: var(--ink); border-color: var(--ink); color: var(--cloud); }
.size-chip:has(input:focus-visible) span { outline: 2px solid var(--navy); outline-offset: 2px; }
.sum-total strong { font-family: var(--serif); font-weight: 500; font-size: 2.1rem; line-height: 1; }
.sum-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.sum-actions .btn { padding: 0 20px; }

/* ---------- university merch ---------- */
.uni { padding: clamp(40px, 6vw, 80px) 0 clamp(72px, 10vw, 140px); }
.uni-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; padding: 0 var(--gutter); margin-bottom: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  min-height: 42px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: none; font-size: 15px;
}
.chip-btn:hover { border-color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--cloud); }
.uni-current { font-family: var(--serif); font-size: 1.3rem; }
.uni-grid {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 4vw, 52px) clamp(14px, 1.8vw, 26px);
}
.uni-media { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; background: var(--oat); overflow: hidden; }
.uni-tile:nth-child(3n + 2) .uni-media { background: var(--cool-bg); }
.uni-media .rig { height: 94%; }
.tile-side { position: absolute; left: 14px; bottom: 12px; font-size: 13px; color: var(--muted); }
.uni-info { margin-top: 14px; }
.uni-info h3 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.15; }
.uni-meta { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.uni-price { font-size: 15px; margin-top: 4px; }
.uni-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.uni-size select { height: 44px; padding: 0 30px 0 12px; border: 1px solid var(--muted); background: var(--cloud); border-radius: 0; font-size: 15px; }
.uni-add { min-height: 44px; padding: 0 20px; }

/* ---------- fabric guide ---------- */
.fabric {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  background: var(--oat);
}
.fabric-photo { position: relative; background: var(--cool-bg); }
.fabric-photo img {
  position: sticky; top: var(--header-h);
  width: 100%; height: calc(100svh - var(--header-h)); max-height: 1000px;
  object-fit: contain; object-position: center bottom;
}
.fabric-body { padding: clamp(56px, 7vw, 110px) var(--gutter); }
.fabric-body .section-title { font-size: clamp(2.4rem, 4.6vw, 4.4rem); max-width: 14ch; }
.fabric-lede { color: var(--muted); max-width: 52ch; margin: 18px 0 30px; }
.gsm-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.gsm-table th, .gsm-table td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid rgba(26, 26, 28, 0.14); }
.gsm-table thead th { font-weight: 500; font-size: 13.5px; color: var(--muted); padding-top: 0; }
.gsm-table tbody th { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; width: 34%; }
.gsm-fabric { display: block; font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.gsm-weight { white-space: nowrap; font-weight: 500; }
.gsm-feel { color: var(--muted); }
.sensory { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.sensory svg { width: 30px; height: 30px; fill: none; stroke: var(--navy); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
.sensory h3 { font-family: var(--sans); font-weight: 500; font-size: 16.5px; margin-bottom: 4px; }
.sensory p { color: var(--muted); font-size: 15px; }
.fabric-note { margin-top: 30px; font-size: 14.5px; color: var(--muted); }

/* ---------- how it works ---------- */
.how { padding: clamp(72px, 10vw, 140px) var(--gutter); }
.steps { list-style: none; margin: clamp(40px, 6vw, 80px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 72px); }
.step-n { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(5rem, 10vw, 9rem); line-height: 0.8; color: var(--navy); margin-bottom: 24px; }
.steps h3 { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; line-height: 1.1; margin-bottom: 10px; }
.steps p { color: var(--muted); max-width: 34ch; }

/* ---------- statement ---------- */
.statement {
  background: var(--navy); color: var(--cloud);
  padding: clamp(88px, 13vw, 200px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 40px 64px; align-items: end;
}
.statement-big { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(4.5rem, 14vw, 14rem); line-height: 0.86; letter-spacing: -0.03em; }
.statement-side p { color: rgba(249, 247, 243, 0.78); max-width: 34ch; margin-bottom: 26px; font-size: 18px; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--cloud); padding: clamp(56px, 7vw, 100px) var(--gutter) 28px; overflow: hidden; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 48px; }
.newsletter { position: relative; }
.newsletter label { display: block; font-family: var(--serif); font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1.15; max-width: 16ch; margin-bottom: 22px; }
.nl-field { display: flex; max-width: 440px; border-bottom: 1px solid rgba(249, 247, 243, 0.45); }
.nl-field input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--cloud); font-size: 16px; padding: 0; }
.nl-field input::placeholder { color: rgba(249, 247, 243, 0.55); }
.nl-field input:focus-visible { outline: none; }
.nl-field:focus-within { border-bottom-color: var(--cloud); }
.nl-field button { border: 0; background: none; color: var(--cloud); font-size: 15px; font-weight: 500; padding: 0 0 0 16px; }
.nl-field button[disabled] { opacity: 0.6; cursor: progress; }
.nl-help { max-width: 440px; margin-top: 12px; font-size: 13.5px; color: var(--fog-light); }
.nl-note { min-height: 1.5em; margin-top: 6px; font-size: 14px; color: var(--cloud); }
/* spam trap: kept in the form for bots, clipped out of sight for people */
.nl-trap {
  position: absolute; top: 0; left: 0;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* three short columns of real links; on phones they size to their words and spread edge to edge */
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-cols h3 { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--fog-light); margin-bottom: 12px; }
.footer-cols a { display: block; text-decoration: none; font-size: 15px; padding: 3px 0; opacity: 0.88; }
.footer-cols a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
.footer-mark {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(3.6rem, 17.4vw, 22rem); line-height: 0.82; letter-spacing: -0.035em;
  color: var(--oat); white-space: nowrap;
  margin: clamp(56px, 8vw, 110px) 0 24px -0.04em;
}
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--fog-light); border-top: 1px solid rgba(249, 247, 243, 0.14); padding-top: 18px; }

/* ---------- bag drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(26, 26, 28, 0.4); opacity: 0; transition: opacity 0.3s; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  display: flex; flex-direction: column; background: var(--cloud);
  transform: translateX(100%); transition: transform 0.32s var(--ease); outline: none;
  /* safety net: if the footer outgrows the screen (e.g. PayPal's card form), the panel scrolls */
  overflow-y: auto; overscroll-behavior: contain;
}
.drawer.is-open .drawer-scrim { opacity: 1; }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; }
.drawer-body { flex: 1; min-height: 96px; overflow-y: auto; padding: 8px 24px; }
.bag-items { list-style: none; margin: 0; padding: 0; }
.bag-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.bag-thumb { width: 72px; aspect-ratio: 2 / 3; background: var(--oat); display: grid; place-items: center; overflow: hidden; }
.bag-thumb img { width: 100%; height: 100%; object-fit: contain; }
.bag-name { font-family: var(--serif); font-size: 1.1rem; line-height: 1.2; }
.bag-meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.bag-qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; border: 1px solid var(--line-strong); }
.bag-qty span { min-width: 24px; text-align: center; font-size: 14px; }
.qty-btn { width: 32px; height: 32px; border: 0; background: none; font-size: 18px; line-height: 1; }
.qty-btn:hover { background: rgba(26, 26, 28, 0.06); }
.bag-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.bag-price { font-weight: 500; }
.bag-side .text-btn { font-size: 13.5px; }
.bag-empty, .bag-done { display: none; padding: 32px 0; }
.bag-empty { color: var(--muted); }
.drawer.is-empty .bag-empty { display: block; }
.drawer.is-empty:not(.is-done) .drawer-foot { display: none; }
.drawer.is-done .bag-done { display: block; }
.drawer.is-done .bag-empty, .drawer.is-done .drawer-foot { display: none; }
.bag-done h3 { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin-bottom: 8px; }
.bag-done p { color: var(--muted); margin-bottom: 10px; }
.bag-ref { font-size: 13.5px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 24px 20px; }
.bag-row { display: flex; justify-content: space-between; align-items: baseline; }
.bag-row strong { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; }
.bag-note { font-size: 13.5px; color: var(--muted); margin: 4px 0 14px; }
.bag-status { font-size: 14px; margin-top: 8px; min-height: 1.2em; }
.bag-test { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* short screens: items and checkout stack and scroll together instead of squeezing the list */
@media (max-height: 560px) {
  .drawer-body { flex: none; min-height: 0; overflow: visible; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  width: max-content; max-width: min(520px, calc(100vw - 32px));
  transform: translate(-50%, 16px);
  background: var(--ink); color: var(--cloud);
  padding: 14px 20px; font-size: 15px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .studio-grid { grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr); }
  .lb-range input { width: 110px; }
  .cards, .uni-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sensory { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  /* equal side columns keep the wordmark centred on the page: menu on the left, bag on the right */
  .site-header { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .menu-btn { display: inline-grid; justify-self: start; margin-left: -8px; }
  .wordmark { justify-self: center; font-size: 24px; }
  .nav-main {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--cloud); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .menu-open .nav-main { display: flex; }
  .nav-main a { font-family: var(--serif); font-size: 1.6rem; padding: 10px 0; }

  .section-head { grid-template-columns: 1fr; }

  .studio-grid { grid-template-columns: 1fr; height: auto; }
  .stage { height: min(80svh, 760px); min-height: 540px; }
  /* size the garment from the space left between .stage-top and .layer-bar, however much they wrap;
     the first width is the fallback for browsers without container query units */
  .stage-garment { container-type: size; }
  .studio-rig {
    width: min(100%, 420px, calc((clamp(540px, 80svh, 760px) - 210px) * 0.667));
    width: min(100%, 420px, calc(100cqh / 1.5));
  }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .tabpanel { overflow: visible; }

  .fabric { grid-template-columns: 1fr; }
  .fabric-photo { max-height: 70svh; }
  .fabric-photo img { position: static; height: 70svh; }
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .statement { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
}

/* stacked hero: phones, and portrait tablets where the overlay puts the CTAs on the model */
@media (max-width: 720px), (max-width: 920px) and (orientation: portrait) {
  .hero {
    --g-size: 52vw;
    --g-gap: 22vw;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    min-height: 0;
    padding-top: 24px;
  }
  .hero-stage { grid-area: auto; grid-row: 2; margin: 12px calc(var(--gutter) * -1) 0; }
  .hero-model { height: min(118vw, 70svh); }
  .hero-copy { grid-area: auto; grid-row: 1; }
  .hero-actions { grid-area: auto; grid-row: 3; margin-top: 16px; }
  .hero-caption { grid-area: auto; grid-row: 4; justify-self: start; text-align: left; margin-top: 20px; }
}

/* short landscape screens (phones on their side, small laptops): the full-width overlay has no
   room between the Gs, the model and the text, so the model and the Gs take the right-hand column
   and all the text stacks in the left one, with the caption last, under the buttons. Nothing in
   the hero can then sit on top of anything else. */
@media (min-width: 721px) and (max-height: 640px) {
  .hero {
    --g-size: min(18vw, 60svh);
    grid-template-rows: auto 1fr auto auto;
  }
  .hero-stage { grid-column: 2 / -1; }
  .hero-caption { grid-area: 4 / 1 / 5 / 2; justify-self: start; text-align: left; margin-top: 16px; }
}

@media (max-width: 720px) {
  .hero-actions .btn { flex: 1 1 100%; }

  .stage-top { padding: 14px 14px 0; flex-wrap: wrap; gap: 8px 10px; }
  .stage-top .seg button { padding: 0 14px; }
  /* the piece name gets its own line under the switches, so it is never squeezed off the edge */
  .stage-label { flex: 1 1 100%; margin-left: 0; text-align: left; }
  .layer-bar { padding: 10px 14px; }
  .lb-controls { gap: 10px 16px; }
  .lb-name { width: 100%; max-width: none; }
  .lb-range { flex: 1 1 40%; }
  .lb-range input { width: 100%; }
  .lb-actions { margin-left: 0; }

  .tabpanel { padding: 20px 16px 24px; }
  .summary { padding: 16px; }
  .sum-row { flex-direction: column; align-items: flex-start; }
  .sum-actions { grid-template-columns: 1fr; }
  .library { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .cards, .uni-grid { grid-template-columns: 1fr; }
  .gsm-table thead { display: none; }
  .gsm-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid rgba(26, 26, 28, 0.14); }
  .gsm-table th, .gsm-table td { border: 0; padding: 0; width: auto; }
  .gsm-table tbody th { width: auto; }
  .gsm-table td:last-child { grid-column: 1 / -1; }
  .footer-cols { grid-template-columns: repeat(3, auto); justify-content: space-between; column-gap: 16px; }
}

/* keep the wordmark on one line on the narrowest phones */
@media (max-width: 360px) {
  .wordmark { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rig .float { animation: none; }
}
