/* ============================================================
   ALORIA — Candy Atelier design system
   White ground · ink text · gold interactions · 4 stone colors
   ============================================================ */
:root {
  --ink: #14120f;
  --ink-soft: #55504a;
  --white: #ffffff;
  --paper: #faf7f2;
  --line: #e9e4dc;
  --gold: #b08d3e;
  --gold-bright: #d4af5c;
  --crystal: #b9b4cf;
  --crystal-soft: #eceaf4;
  --emerald: #0f7a4d;
  --sapphire: #1e4fc2;
  --ruby: #c0143c;
  --pink: #e0619b;
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Space Grotesk", "Helvetica Neue", sans-serif;
  --mono: "Space Mono", "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }

/* ---------- type scale ---------- */
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; line-height: 1.08; }
.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.eyebrow { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }

/* ---------- stone dots ---------- */
.stone-dots { display: inline-flex; gap: 7px; align-items: center; }
.stone-dots i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-crystal { background: linear-gradient(135deg, #d8d4e8, #f4f2fa 60%, #c9c4de); }
.dot-emerald { background: var(--emerald); }
.dot-sapphire { background: var(--sapphire); }
.dot-ruby { background: var(--ruby); }

/* ============================================================
   GATE (dark) — polish reveal
   ============================================================ */
.gate {
  position: fixed; inset: 0; z-index: 100;
  background: #0d0c0a;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.5s ease 0.9s, visibility 0s linear 1.5s;
}
.gate.open { opacity: 0; visibility: hidden; pointer-events: none; }
.gate::after { /* light sweep */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 246, 224, 0.95) 50%, #fff 65%, #fff 100%);
  transform: translateX(-130%);
  pointer-events: none;
}
.gate.open::after { animation: sweep 1.1s cubic-bezier(0.7, 0, 0.2, 1) forwards; }
@keyframes sweep { to { transform: translateX(0); } }

.gate .wordmark {
  font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 4.6rem);
  letter-spacing: 0.34em; text-indent: 0.34em; color: #f5efe2; font-weight: 300;
}
.gate .gate-sub { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.32em; text-transform: uppercase; color: #8d8574; margin-top: 0.8rem; }
.gate form { margin-top: 3.2rem; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.gate input {
  background: transparent; border: none; border-bottom: 1px solid #4a4436;
  color: #f0e9d8; font-family: var(--mono); font-size: 1rem; letter-spacing: 0.5em;
  text-align: center; padding: 0.6rem 0.4rem; width: min(320px, 74vw); outline: none;
  transition: border-color 0.4s;
}
.gate input:focus { border-color: var(--gold-bright); }
.gate input::placeholder { color: #5b5445; letter-spacing: 0.28em; font-size: 0.72rem; }
.gate button {
  background: none; border: 1px solid #4a4436; color: #cfc6ad;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  padding: 0.75rem 2.4rem; cursor: pointer; transition: all 0.4s;
}
.gate button:hover { border-color: var(--gold-bright); color: var(--gold-bright); }
.gate .gate-error { font-family: var(--mono); font-size: 0.68rem; color: #b0632f; letter-spacing: 0.14em; min-height: 1.2em; opacity: 0; transition: opacity 0.3s; }
.gate.error .gate-error { opacity: 1; }
.gate.error .gate-box { animation: shake 0.45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.gate .gate-hint { position: absolute; bottom: 2rem; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em; color: #575043; text-transform: uppercase; }

/* ============================================================
   TEASER (below gate on index)
   ============================================================ */
.teaser { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6rem 1.5rem; }
.teaser h1 { font-size: clamp(3rem, 9vw, 6.5rem); letter-spacing: 0.3em; text-indent: 0.3em; font-weight: 300; }
.teaser .tagline { margin-top: 1.6rem; font-size: clamp(1rem, 2.4vw, 1.35rem); color: var(--ink-soft); font-family: var(--serif); font-style: italic; }
.teaser .stone-dots { margin-top: 2.2rem; } .teaser .stone-dots i { width: 12px; height: 12px; }
.waitlist { margin-top: 3.4rem; display: flex; gap: 0; max-width: 420px; width: 100%; }
.waitlist input { flex: 1; border: 1px solid var(--line); border-right: none; padding: 0.9rem 1.1rem; font-family: var(--sans); font-size: 0.9rem; outline: none; background: var(--paper); }
.waitlist button { background: var(--ink); color: var(--white); border: 1px solid var(--ink); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; padding: 0 1.6rem; cursor: pointer; transition: background 0.3s; }
.waitlist button:hover { background: var(--gold); border-color: var(--gold); }
.waitlist-msg { margin-top: 0.9rem; font-family: var(--mono); font-size: 0.7rem; color: var(--emerald); min-height: 1em; }

/* ============================================================
   HUB — layout & nav
   ============================================================ */
.hub-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hub-nav .brand { font-family: var(--serif); font-size: 1.15rem; letter-spacing: 0.3em; color: var(--ink); margin-right: 1.2rem; white-space: nowrap; }
.hub-nav .links { display: flex; gap: 1.6rem; align-items: center; }
.hub-nav .links a { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); transition: color 0.3s; }
.hub-nav .links a:hover { color: var(--gold); }
@media (max-width: 760px) { .hub-nav .links a.hide-m { display: none; } }

section.block { padding: 7rem 2rem; max-width: 1200px; margin: 0 auto; position: relative; }
.section-num {
  position: absolute; top: 2.5rem; right: 0.5rem; font-family: var(--serif);
  font-size: clamp(6rem, 16vw, 13rem); font-weight: 600; line-height: 1; pointer-events: none; z-index: 0;
}
.num-emerald { color: rgba(15, 122, 77, 0.07); }
.num-sapphire { color: rgba(30, 79, 194, 0.07); }
.num-ruby { color: rgba(192, 20, 60, 0.07); }
.num-crystal { color: rgba(120, 110, 160, 0.08); }
section.block h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 1.4rem; position: relative; z-index: 1; }
.lede { max-width: 620px; color: var(--ink-soft); font-size: 1.02rem; position: relative; z-index: 1; }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   HERO — ear stack assembly
   ============================================================ */
.hero { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 2rem; max-width: 1200px; margin: 0 auto; padding: 7rem 2rem 4rem; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-copy h1 { font-size: clamp(2.8rem, 6.5vw, 5rem); font-weight: 400; }
.hero-copy h1 em { font-style: italic; color: var(--gold); }
.hero-copy p { margin-top: 1.6rem; max-width: 480px; color: var(--ink-soft); }
.hero-copy .stone-dots { margin-top: 2rem; }
.hero-cta { display: inline-block; margin-top: 2.6rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; border: 1px solid var(--ink); color: var(--ink); padding: 0.9rem 2rem; transition: all 0.35s; }
.hero-cta:hover { background: var(--ink); color: var(--white); }

.stage { position: relative; height: min(78vh, 620px); }
.piece { position: absolute; opacity: 0; transform: translateY(-34px) scale(0.92); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.25, 0.8, 0.35, 1); }
.piece.landed { opacity: 1; transform: none; }
.piece img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 14px 34px rgba(20, 18, 15, 0.11); }
.piece .tag {
  position: absolute; left: 50%; bottom: -1.5rem; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em; color: var(--ink-soft);
  white-space: nowrap; opacity: 0; transition: opacity 0.4s ease 0.25s;
}
.piece.landed .tag { opacity: 1; }
/* positions sketching an ear-curve */
.p-e2 { width: 21%; top: 3%; left: 44%; }
.p-e1 { width: 24%; top: 26%; left: 58%; }
.p-e4 { width: 30%; top: 40%; left: 26%; }
.p-e3a { width: 15%; top: 66%; left: 52%; }
.p-e3b { width: 11%; top: 68%; left: 70%; }
.p-e5 { width: 15%; top: 12%; left: 20%; }

/* ============================================================
   DESIGN LANGUAGE
   ============================================================ */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2.5rem; margin-top: 3.4rem; }
.dl-card h3 { font-size: 1.15rem; margin-bottom: 1.2rem; }
.chips { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.chip { width: 52px; height: 52px; border-radius: 50% 50% 50% 4px; box-shadow: inset 0 -6px 12px rgba(0,0,0,0.18), 0 6px 14px rgba(20,18,15,0.14); position: relative; overflow: hidden; }
.chip::after { content: ""; position: absolute; top: 8px; left: 10px; width: 14px; height: 9px; background: rgba(255,255,255,0.65); border-radius: 50%; transform: rotate(-24deg); }
.chip-label { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; color: var(--ink-soft); margin-top: 0.5rem; text-align: center; }
.chip-crystal { background: linear-gradient(140deg, #efedf7, #cfcae2); }
.chip-emerald { background: linear-gradient(140deg, #16a267, #0a5c39); }
.chip-sapphire { background: linear-gradient(140deg, #3a6ce0, #14349c); }
.chip-ruby { background: linear-gradient(140deg, #e02a55, #98092c); }
.shapes { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: flex-end; }
.shape svg { width: 44px; height: 52px; stroke: var(--ink); fill: none; stroke-width: 1.4; }
.mat-list { list-style: none; }
.mat-list li { padding: 0.7rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; display: flex; justify-content: space-between; gap: 1rem; }
.mat-list .mono { color: var(--ink-soft); }

/* ============================================================
   CATEGORY SECTIONS
   ============================================================ */
.cat-worn { position: relative; height: 68vh; min-height: 420px; overflow: hidden; border-radius: 6px; margin: 3rem 0; }
.cat-worn img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.cat-worn figcaption { position: absolute; left: 1.4rem; bottom: 1.2rem; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; color: #fff; background: rgba(20,18,15,0.5); padding: 0.45rem 0.9rem; border-radius: 2px; }

.comp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin: 3rem 0; }
.comp-card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.4rem; transition: transform 0.35s ease, box-shadow 0.35s ease; position: relative; overflow: hidden; }
.comp-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(20, 18, 15, 0.09); }
.comp-card::before { /* glint */
  content: ""; position: absolute; top: 0; left: -80%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 252, 240, 0.85), transparent);
  transform: skewX(-18deg); transition: left 0.65s ease;
}
.comp-card:hover::before { left: 130%; }
.comp-card .code { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--gold); }
.comp-card h4 { font-family: var(--serif); font-size: 1.12rem; margin: 0.5rem 0 0.6rem; font-weight: 500; }
.comp-card p { font-size: 0.83rem; color: var(--ink-soft); line-height: 1.5; }
.comp-card .skus { margin-top: 0.9rem; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--ink-soft); }
.comp-card .skus b { color: var(--ink); }

/* ---------- swatch play ---------- */
.swatch-play { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 2.6rem; margin: 3rem 0; }
@media (max-width: 760px) { .swatch-play { grid-template-columns: 1fr; } }
.swatch-view { position: relative; min-height: 200px; }
.swatch-view img { width: 100%; border-radius: 6px; opacity: 0; transition: opacity 0.45s ease; position: absolute; inset: 0; }
.swatch-view img.active { opacity: 1; position: relative; }
.swatch-side h3 { font-size: 1.5rem; margin-bottom: 0.8rem; }
.swatch-side p { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 1.6rem; }
.swatch-row { display: flex; gap: 1rem; }
.swatch-btn { width: 46px; height: 46px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.25s, border-color 0.25s; box-shadow: inset 0 -5px 10px rgba(0,0,0,0.2); }
.swatch-btn:hover { transform: scale(1.12); }
.swatch-btn.active { border-color: var(--ink); transform: scale(1.12); }
.sw-ruby { background: radial-gradient(circle at 35% 30%, #ef5d82, #98092c); }
.sw-sapphire { background: radial-gradient(circle at 35% 30%, #6d92ef, #14349c); }
.sw-emerald { background: radial-gradient(circle at 35% 30%, #3fc98a, #0a5c39); }
.sw-pink { background: radial-gradient(circle at 35% 30%, #f49ac4, #cc3d7f); }
.sw-clear { background: radial-gradient(circle at 35% 30%, #ffffff, #cac4de); }
.swatch-name { margin-top: 1.1rem; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- variant wall ---------- */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; margin: 3rem 0; }
.wall img { border-radius: 4px; border: 1px solid var(--line); width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--paper); transition: transform 0.3s; }
.wall img:hover { transform: scale(1.04); }

/* ---------- atelier strip ---------- */
.atelier { background: linear-gradient(180deg, #f6f1e8, #efe8db); border-radius: 8px; padding: 3rem 2rem; margin: 3rem 0; position: relative; overflow: hidden; }
.atelier::before { content: ""; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image: radial-gradient(rgba(120, 100, 60, 0.05) 1px, transparent 1px); background-size: 5px 5px; }
.atelier .eyebrow { color: #8a6d2f; }
.atelier-row { display: flex; gap: 1.8rem; overflow-x: auto; padding: 1rem 0.4rem 1.4rem; scroll-snap-type: x mandatory; }
.atelier-row figure { flex: 0 0 min(420px, 82vw); scroll-snap-align: start; }
.atelier-row img { border-radius: 3px; box-shadow: 0 16px 36px rgba(60, 45, 20, 0.22); transform: rotate(-0.6deg); background: #fff; }
.atelier-row figure:nth-child(even) img { transform: rotate(0.7deg); }
.atelier-row figcaption { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; color: #6d5a35; margin-top: 0.9rem; text-transform: uppercase; }

/* ---------- spec drawer ---------- */
details.specs { border: 1px solid var(--line); border-radius: 6px; margin: 1.5rem 0 0; background: var(--white); }
details.specs summary { cursor: pointer; padding: 1.1rem 1.4rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); list-style: none; display: flex; justify-content: space-between; }
details.specs summary::after { content: "+"; font-size: 1rem; color: var(--gold); }
details.specs[open] summary::after { content: "−"; }
details.specs table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
details.specs th, details.specs td { text-align: left; padding: 0.75rem 1.4rem; border-top: 1px solid var(--line); vertical-align: top; }
details.specs th { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 400; }
details.specs td.code { font-family: var(--mono); color: var(--gold); font-size: 0.75rem; }

/* ============================================================
   GALLERY + SKU MASTER + FOOTER
   ============================================================ */
.filter-row { display: flex; gap: 0.7rem; margin: 2rem 0; flex-wrap: wrap; }
.filter-btn { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; padding: 0.55rem 1.3rem; border: 1px solid var(--line); background: var(--white); color: var(--ink-soft); cursor: pointer; border-radius: 100px; transition: all 0.3s; }
.filter-btn:hover, .filter-btn.active { border-color: var(--ink); color: var(--ink); }
.gallery { columns: 3 260px; column-gap: 0.9rem; }
.gallery figure { break-inside: avoid; margin-bottom: 0.9rem; position: relative; border-radius: 5px; overflow: hidden; }
.gallery img { border-radius: 5px; transition: transform 0.4s; width: 100%; }
.gallery figure:hover img { transform: scale(1.035); }
.gallery figcaption { position: absolute; left: 0.7rem; bottom: 0.6rem; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.12em; color: #fff; background: rgba(20,18,15,0.55); padding: 0.3rem 0.6rem; border-radius: 2px; text-transform: uppercase; }
.gallery figure.hidden { display: none; }

.sku-total { display: flex; align-items: baseline; gap: 1.2rem; margin: 2.4rem 0; }
.sku-total .big { font-family: var(--serif); font-size: clamp(3.4rem, 9vw, 6rem); color: var(--gold); line-height: 1; }
.sku-total .mono { color: var(--ink-soft); }

footer.hub-footer { border-top: 1px solid var(--line); margin-top: 5rem; padding: 3rem 2rem 4rem; text-align: center; }
footer.hub-footer .brand { font-family: var(--serif); letter-spacing: 0.32em; font-size: 1rem; }
footer.hub-footer p { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); margin-top: 0.9rem; }

/* section background blush */
.blush-emerald { background: linear-gradient(180deg, var(--white), rgba(15,122,77,0.035) 45%, var(--white)); }
.blush-sapphire { background: linear-gradient(180deg, var(--white), rgba(30,79,194,0.035) 45%, var(--white)); }
.blush-ruby { background: linear-gradient(180deg, var(--white), rgba(192,20,60,0.035) 45%, var(--white)); }
.blush-crystal { background: linear-gradient(180deg, var(--white), rgba(150,140,190,0.05) 45%, var(--white)); }
.full-bleed { max-width: none; padding-left: 0; padding-right: 0; }
.inner { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ============================================================
   MOBILE — additive layer, desktop untouched.
   Breakpoints: 900 (tablet/table scroll), 760 (phone), 420 (small phone).
   Measured before: /hub/ overflowed its viewport by 182px at 390px wide
   and 252px at 320px; / overflowed by 56px at 320px. Target is 0 at every
   width. The rules below are ordered by what actually caused that overflow.
   ============================================================ */

/* --- 1. Tables were the biggest offender: 540px wide inside a 375px viewport.
       hub.js now renders every variant matrix inside
         .table-wrap > .table-scroll[role=region][tabindex] > table
       .table-scroll is a plain block box, so its width is fixed by its containing
       block (details.specs) no matter how wide the table inside it gets; overflow-x
       absorbs the excess as internal scroll instead of propagating it to the document.
       The scroll container is the wrapper, NOT the table — the table keeps its
       display:table box and therefore its semantics for assistive tech. --- */
@media (max-width: 900px) {
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain; /* don't trigger back-swipe at the ends */
  }
  .table-wrap { position: relative; }

  /* right-edge fade: the affordance that says "there is more over here".
     It lives on .table-wrap, not .table-scroll — an abspos child of a scroll
     container scrolls with the content and would only appear at the far end. */
  .table-wrap::after {
    content: "";
    position: absolute; top: 0; right: 0; bottom: 0; width: 2.4rem;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--white) 82%);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  }
  .table-wrap.is-scrollable::after { opacity: 1; }
  .table-wrap.at-end::after { opacity: 0; }
  .table-wrap.is-scrollable + .table-hint { display: block; }
  .table-wrap.at-end + .table-hint { opacity: 0; }

  /* short columns stay on one line so rows scan cleanly; the long prose column
     wraps against a min-width, which keeps the scroll distance sane. */
  details.specs th, details.specs td { padding: 0.6rem 0.85rem; white-space: nowrap; }
  details.specs .c-fn { white-space: normal; min-width: 15rem; }
  details.specs .c-var { white-space: normal; min-width: 9rem; }
  details.specs .c-name { min-width: 7.5rem; }

  /* safety net for any table that is NOT wrapped by hub.js (direct child only,
     so it can never double up with .table-scroll). */
  details.specs > table,
  section.block > table,
  .inner > table {
    display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
}

/* the fade's companion hint; hidden until JS proves the table really scrolls */
.table-hint {
  display: none;
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 0.45rem 0.85rem 0.9rem; text-align: right;
  transition: opacity 0.25s ease;
}
/* keyboard users can scroll the region; inset the ring so it cannot overflow */
.table-scroll:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

@media (max-width: 420px) {
  details.specs table { font-size: 0.78rem; }
  details.specs th, details.specs td { padding: 0.55rem 0.7rem; }
  details.specs .c-fn { min-width: 13rem; }
}

/* --- 2. Long SKU codes must not force the page sideways. --- */
.comp-card .code, .comp-card .skus, td.code, .mono { overflow-wrap: anywhere; }

/* --- 3. Mobile browser chrome makes 100vh taller than the visible viewport. --- */
@supports (height: 100dvh) {
  .teaser { min-height: 100dvh; }
  .hero { min-height: 100dvh; }
}

@media (max-width: 760px) {
  /* --- 4. Nav: a non-wrapping flex row clipped its links off-screen.
         Let the links scroll within the bar instead of widening the page. --- */
  .hub-nav { padding: 0.7rem 1rem; gap: 0.6rem; }
  .hub-nav .brand { font-size: 1rem; letter-spacing: 0.2em; margin-right: 0; }
  .hub-nav .links {
    min-width: 0; flex: 1; gap: 1.1rem; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    justify-content: flex-end;
  }
  .hub-nav .links::-webkit-scrollbar { display: none; }
  .hub-nav .links a { white-space: nowrap; padding: 0.55rem 0; }

  /* --- 5. Reclaim space: desktop-sized gutters waste a phone screen. --- */
  section.block { padding: 3.5rem 1.15rem; }
  .inner { padding: 0 1.15rem; }
  .hero { padding: 5.5rem 1.15rem 2.5rem; gap: 1.5rem; min-height: 0; }
  .stage { height: min(62vh, 420px); }
  .section-num { top: 1rem; right: 0.25rem; }
  .atelier { padding: 2rem 1.15rem; }
  .swatch-play { padding: 1.5rem; gap: 1.75rem; }
  footer.hub-footer { padding: 2.5rem 1.15rem 3rem; }

  /* --- 6. Touch targets: 44px minimum. --- */
  .filter-btn { padding: 0.7rem 1.2rem; min-height: 44px; }
  .swatch-btn { width: 48px; height: 48px; }
  .hero-cta { padding: 1rem 2rem; }
  .gate button { padding: 0.9rem 2.4rem; min-height: 44px; }

  /* --- 7. Gallery: 3 columns is unreadable on a phone. --- */
  .gallery { columns: 2 140px; column-gap: 0.6rem; }
  .cat-worn { height: 52vh; min-height: 300px; }
}

/* --- 8. Waitlist was a non-wrapping row: the 56px overflow at 320px. --- */
@media (max-width: 460px) {
  .waitlist { flex-direction: column; gap: 0.55rem; }
  .waitlist input { border-right: 1px solid var(--line); }
  .waitlist button { padding: 0.95rem 1.6rem; min-height: 44px; }
  .gallery { columns: 1; }
}

/* --- 9. Inputs below 16px make iOS zoom in on focus. --- */
@media (max-width: 760px) {
  .waitlist input, .gate input { font-size: 16px; }
  .gate input { letter-spacing: 0.3em; }
}

/* --- 10. Keyboard focus was invisible everywhere (outline:none on both inputs). --- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.gate input:focus-visible, .gate button:focus-visible { outline-color: var(--gold-bright); }

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