/* =====================================================================
   Gutted Clothing Co. — storefront
   Built on design.md, cinematic (dark) track throughout. Transactional
   components (cart, product, forms) are ported onto the black canvas using
   canvas-night-elevated cards and white / white-stroked pills.
   Mobile-first; breakpoints at 768 / 1024 / 1440 per design.md.
   ===================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* colors */
  --canvas-night: #000000;
  --canvas-night-elevated: #0a0a0a;
  --surface-elevated-dark: #1e2c31;
  --hairline-dark: #1e2c31;
  --on-primary: #ffffff;
  --shade-30: #d4d4d8;
  --shade-40: #a1a1aa;
  --shade-50: #71717a;
  --shade-60: #52525b;
  --shade-70: #3f3f46;
  --link-cool-1: #9dabad;
  --link-cool-2: #9797a2;
  --link-cool-3: #bdbdca;
  --link-mint: #99b3ad;
  --warn: #f5b4a8;

  /* type */
  --font-display: "Neue Haas Grotesk Display", "Inter", Helvetica, Arial, sans-serif;
  --font-ui: "Inter", Helvetica, Arial, sans-serif;

  /* spacing */
  --s-xxs: 2px; --s-xs: 4px; --s-sm: 8px; --s-md: 12px; --s-lg: 16px;
  --s-xl: 24px; --s-xxl: 32px; --s-huge: 64px;
  --gutter: 16px;

  /* radius */
  --r-xs: 4px; --r-sm: 5px; --r-md: 8px; --r-lg: 12px; --r-xl: 20px; --r-pill: 9999px;

  --elev-1: 0 1px 2px rgba(255,255,255,0.05), inset 0 1px 0 rgba(255,255,255,0.04);
  --max: 1440px;

  color-scheme: dark;
}

@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1440px) { :root { --gutter: 48px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas-night);
  color: var(--on-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 420;
  line-height: 1.5;
  font-feature-settings: "ss03";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--on-primary); outline-offset: 3px; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 var(--s-lg); }
button, input, select, textarea { font: inherit; color: inherit; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--on-primary); color: var(--canvas-night); padding: var(--s-sm) var(--s-lg); }
.skip:focus { left: var(--s-lg); top: var(--s-lg); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 960px; }
.wrap--read { max-width: 840px; }

/* ---------- Typography ---------- */
.display-xxl, .display-xl, .display-lg, .display-md {
  font-family: var(--font-display);
  font-weight: 330;
  font-variation-settings: "opsz" 32;
}
/* Mobile sizes collapse per design.md stair: 96 → 70 → 55 → 48 → 36 */
.display-xxl { font-size: clamp(44px, 11vw, 96px); line-height: 1; letter-spacing: clamp(0.5px, 0.25vw, 2.4px); }
.display-xl  { font-size: clamp(40px, 8vw, 70px); line-height: 1; }
.display-lg  { font-size: clamp(36px, 6vw, 55px); line-height: 1.1; }
.display-md  { font-size: clamp(32px, 5vw, 48px); line-height: 1.14; }
.eyebrow { font-size: 12px; font-weight: 400; letter-spacing: 0.72px; text-transform: uppercase; color: var(--shade-40); margin-bottom: var(--s-lg); }
.lead { font-size: 18px; font-weight: 550; line-height: 1.56; }
.muted { color: var(--shade-40); }
.micro { font-size: 13px; font-weight: 500; letter-spacing: -0.13px; }
.warn { color: var(--warn); font-size: 14px; }
.prose { max-width: 720px; }
.prose p, .prose li { color: var(--shade-30); }
.prose h2 { font-size: 20px; font-weight: 500; letter-spacing: 0.3px; line-height: 1.4; margin: var(--s-xxl) 0 var(--s-md); color: var(--on-primary); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pills (the only button shape) ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-sm);
  min-height: 44px; padding: var(--s-md) var(--s-xl);
  border-radius: var(--r-pill); border: 2px solid transparent;
  font-size: 16px; font-weight: 420; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none !important;
  transition: background-color .15s, color .15s, border-color .15s;
}
.pill--outline-dark { background: transparent; border-color: var(--on-primary); color: var(--on-primary); }
.pill--outline-dark:hover { background: var(--on-primary); color: var(--canvas-night); }
.pill--white { background: var(--on-primary); color: var(--canvas-night); }
.pill--white:hover { background: var(--shade-30); }
.pill--white:active { background: var(--shade-40); }
.pill--block { width: 100%; }
.linkbtn { background: none; border: 0; padding: var(--s-xs) 0; color: var(--link-cool-1); text-decoration: underline; cursor: pointer; font-size: 14px; min-height: 32px; }

.tag { display: inline-block; padding: var(--s-xs) var(--s-md); border-radius: var(--r-pill); font-size: 12px; letter-spacing: 0.72px; text-transform: uppercase; }
.tag--dark { background: var(--shade-70); color: var(--on-primary); }

/* ---------- Announcement + nav ---------- */
.announce { background: var(--canvas-night-elevated); border-bottom: 1px solid var(--hairline-dark); text-align: center; font-size: 14px; font-weight: 500; letter-spacing: 0.28px; padding: var(--s-sm) var(--gutter); }

.nav { position: sticky; top: 0; z-index: 50; background: rgba(0,0,0,0.92); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid rgba(255,255,255,0.06); }
.nav__inner { max-width: var(--max); margin: 0 auto; padding: var(--s-md) var(--gutter); display: flex; align-items: center; gap: var(--s-lg); }
.nav__brand { display: flex; align-items: center; gap: var(--s-md); font-family: var(--font-display); font-weight: 400; font-size: 18px; letter-spacing: 0.3px; text-decoration: none !important; margin-right: auto; }
.nav__brand img { height: 36px; width: auto; }
.nav__brand span { display: none; }
.nav__cart { order: 2; min-height: 40px; padding: var(--s-sm) var(--s-lg); }
.nav__count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--on-primary); color: var(--canvas-night); font-size: 12px; font-weight: 550; }
.nav__cart:hover .nav__count { background: var(--canvas-night); color: var(--on-primary); }

.nav__toggle { order: 3; display: none; width: 44px; height: 44px; border-radius: var(--r-pill); border: 2px solid var(--on-primary); background: transparent; cursor: pointer; position: relative; }
.nav__toggle-bars, .nav__toggle-bars::before, .nav__toggle-bars::after { position: absolute; left: 50%; width: 16px; height: 2px; margin-left: -8px; background: var(--on-primary); transition: transform .2s, opacity .2s; content: ""; }
.nav__toggle-bars { top: 50%; margin-top: -1px; }
.nav__toggle-bars::before { top: -5px; left: 0; margin-left: 0; }
.nav__toggle-bars::after { top: 5px; left: 0; margin-left: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

.nav__menu { display: flex; gap: var(--s-xl); }
.nav__menu a { font-size: 15px; font-weight: 500; letter-spacing: 0.3px; padding: var(--s-sm) 0; }

/* Mobile: hamburger, full-width dropdown that inherits the black canvas */
@media (max-width: 767px) {
  .js .nav__toggle { display: block; }
  .nav__inner { flex-wrap: wrap; }
  .nav__menu { order: 4; flex-basis: 100%; flex-direction: column; gap: 0; padding-top: var(--s-sm); }
  .nav__menu a { font-family: var(--font-display); font-weight: 330; font-size: 28px; padding: var(--s-md) 0; border-top: 1px solid rgba(255,255,255,0.08); }
  .js .nav__menu { display: none; }
  .js .nav.is-open .nav__menu { display: flex; }
  .js body.menu-open { overflow: hidden; }
}
@media (min-width: 768px) {
  .nav__brand span { display: inline; }
  .nav__menu { order: 1; }
  .nav__cart { order: 2; }
}

/* ---------- Flash messages ---------- */
.flashes { max-width: var(--max); margin: var(--s-lg) auto 0; padding-inline: var(--gutter); }
.flash { margin: 0 0 var(--s-sm); padding: var(--s-md) var(--s-lg); border-radius: var(--r-md); background: var(--canvas-night-elevated); border: 1px solid var(--hairline-dark); box-shadow: var(--elev-1); font-size: 15px; }
.flash--error { border-color: #5b2b2b; color: var(--warn); }
.flash--success { border-color: #24433a; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 10vw, 128px); }
.hero__text { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-xl); padding-bottom: clamp(40px, 8vw, 96px); }
.hero__text .eyebrow { margin: 0; }
.hero__photo { margin: 0; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
@media (min-width: 768px) { .hero__photo { aspect-ratio: 16 / 9; } }
@media (min-width: 1440px) { .hero__photo { aspect-ratio: 21 / 9; } }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid rgba(255,255,255,0.1); padding: var(--s-lg) 0; }
.marquee__track { display: flex; gap: var(--s-huge); width: max-content; animation: marquee 40s linear infinite; }
.marquee__track span { font-family: var(--font-display); font-weight: 330; font-size: clamp(24px, 4vw, 40px); white-space: nowrap; color: var(--shade-40); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* ---------- Bands / sections ---------- */
.band { padding-block: clamp(64px, 10vw, 160px); }
.band__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-xl); margin-bottom: clamp(32px, 5vw, 64px); }

/* ---------- Product grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-xxl) var(--s-lg); }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-huge) var(--s-xl); } }
@media (min-width: 1440px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.pcard { display: block; text-decoration: none !important; }
.pcard__media { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-lg); background: var(--canvas-night-elevated); box-shadow: var(--elev-1); }
.pcard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s, transform .6s; }
.pcard__img--alt { opacity: 0; }
@media (hover: hover) {
  .pcard:hover .pcard__img--alt { opacity: 1; }
  .pcard:hover .pcard__img { transform: scale(1.02); }
}
.pcard__tag { position: absolute; left: var(--s-md); top: var(--s-md); }
.pcard__body { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-xs) var(--s-md); padding-top: var(--s-md); }
.pcard__name { font-size: 16px; font-weight: 500; letter-spacing: 0.2px; line-height: 1.3; }
.pcard__price { margin: 0; color: var(--shade-40); font-size: 15px; }
@media (min-width: 768px) { .pcard__name { font-size: 18px; } }

/* ---------- About ---------- */
.about { display: grid; gap: clamp(32px, 6vw, 96px); padding-block: clamp(64px, 10vw, 160px); align-items: start; }
.about__photo { margin: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; overflow: hidden; }
.about__photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.about__text h2 { margin-bottom: var(--s-xxl); }
@media (min-width: 1024px) {
  .about { grid-template-columns: 5fr 6fr; }
  .about__photo { position: sticky; top: 100px; }
}

/* ---------- Support band (CCA) ---------- */
.support { padding-bottom: clamp(64px, 10vw, 128px); }
.support__card { display: grid; gap: var(--s-xxl); align-items: center; padding: clamp(24px, 5vw, 64px); background: var(--canvas-night-elevated); border-radius: var(--r-lg); box-shadow: var(--elev-1); }
.support__card .lead { color: var(--shade-30); margin: var(--s-xl) 0 0; }
.support__logo { background: var(--on-primary); border-radius: var(--r-lg); padding: var(--s-xl); display: block; max-width: 360px; }
@media (min-width: 1024px) { .support__card { grid-template-columns: 3fr 2fr; } .support__logo { justify-self: end; } }

/* ---------- Contact ---------- */
.contact { text-align: center; padding-block: clamp(64px, 10vw, 160px); border-top: 1px solid rgba(255,255,255,0.08); }
.contact .lead { color: var(--shade-30); margin: var(--s-xl) auto var(--s-xxl); max-width: 560px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: var(--s-md); justify-content: center; }
.contact__actions .pill { white-space: normal; text-align: center; }

/* ---------- Generic pages ---------- */
.page { padding-block: clamp(40px, 7vw, 96px) clamp(64px, 10vw, 128px); }
.page__head { margin-bottom: clamp(32px, 5vw, 64px); }
.page__head .lead { color: var(--shade-30); margin-top: var(--s-xl); }
.page__head .pill { margin-top: var(--s-lg); }
.card { background: var(--canvas-night-elevated); border-radius: var(--r-lg); padding: var(--s-xxl) var(--s-xl); box-shadow: var(--elev-1); }
@media (min-width: 768px) { .card { padding: var(--s-xxl); } }
.empty { text-align: center; }
.empty .pill { margin-top: var(--s-md); }
.plain { list-style: none; padding: 0; margin: 0 0 var(--s-lg); }
.plain li { padding: var(--s-xs) 0; color: var(--shade-30); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-sm); margin-top: var(--s-xl); }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: var(--s-sm) var(--s-lg); border-radius: var(--r-pill); border: 1px solid var(--shade-60); font-size: 14px; font-weight: 500; text-decoration: none !important; }
.chip:hover { border-color: var(--on-primary); }
.chip.is-active { background: var(--on-primary); color: var(--canvas-night); border-color: var(--on-primary); }

/* ---------- Product page ---------- */
.product { display: grid; gap: var(--s-xxl); padding-block: var(--s-xl) clamp(64px, 10vw, 128px); }
@media (min-width: 900px) { .product { grid-template-columns: 11fr 9fr; gap: clamp(32px, 5vw, 96px); padding-top: var(--s-huge); } }
.product__gallery { min-width: 0; }
.product__main { border-radius: var(--r-lg); overflow: hidden; background: var(--canvas-night-elevated); aspect-ratio: 1; }
.product__main img { width: 100%; height: 100%; object-fit: cover; }
.product__thumbs { display: flex; gap: var(--s-sm); margin-top: var(--s-md); overflow-x: auto; padding-bottom: var(--s-xs); }
.product__thumb { flex: 0 0 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--r-md); overflow: hidden; background: none; cursor: pointer; }
.product__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product__thumb.is-active { border-color: var(--on-primary); }
@media (min-width: 900px) { .product__info { position: sticky; top: 100px; align-self: start; } }
.crumbs { font-size: 14px; color: var(--shade-40); margin-bottom: var(--s-lg); }
.crumbs a { color: var(--link-cool-1); }
.product__price { font-size: 20px; font-weight: 500; margin: var(--s-md) 0 var(--s-xl); }
.product__desc { margin-top: var(--s-xxl); }

.buy { display: grid; gap: var(--s-xl); }
.sizes { border: 0; padding: 0; margin: 0; }
.sizes legend { font-size: 12px; letter-spacing: 0.72px; text-transform: uppercase; color: var(--shade-40); margin-bottom: var(--s-md); }
.sizes__opts { display: flex; flex-wrap: wrap; gap: var(--s-sm); }
.size { position: relative; }
.size input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.size span { display: inline-flex; align-items: center; justify-content: center; min-width: 56px; min-height: 44px; padding: var(--s-sm) var(--s-lg); border-radius: var(--r-pill); border: 1px solid var(--shade-60); font-size: 15px; font-weight: 500; }
.size input:checked + span { background: var(--on-primary); color: var(--canvas-night); border-color: var(--on-primary); }
.size input:focus-visible + span { outline: 2px solid var(--on-primary); outline-offset: 3px; }
.size.is-out span { color: var(--shade-60); border-style: dashed; text-decoration: line-through; }
.size.is-out input { cursor: not-allowed; }
.buy__low { font-size: 13px; color: var(--shade-40); margin: var(--s-md) 0 0; }
.buy__row { display: flex; gap: var(--s-md); }
.qty input, .cart__qty input {
  width: 76px; min-height: 44px; padding: 10px 12px; text-align: center;
  background: var(--canvas-night); border: 1px solid var(--shade-60); border-radius: var(--r-pill);
}
.buy__row .pill { flex: 1; }

.acc { border-top: 1px solid rgba(255,255,255,0.1); padding: var(--s-lg) 0; }
.acc:last-child { border-bottom: 1px solid rgba(255,255,255,0.1); }
.acc summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; min-height: 28px; align-items: center; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 22px; font-weight: 300; }
.acc[open] summary::after { content: "–"; }
.acc p { color: var(--shade-30); margin: var(--s-md) 0 0; font-size: 15px; }
.acc a { text-decoration: underline; }

/* ---------- Cart ---------- */
.cart__lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255,255,255,0.1); }
.cart__line { display: grid; grid-template-columns: 80px 1fr auto; grid-template-areas: "img info total" "img qty qty"; gap: var(--s-sm) var(--s-lg); padding: var(--s-xl) 0; border-bottom: 1px solid rgba(255,255,255,0.1); align-items: start; }
.cart__img { grid-area: img; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 1; background: var(--canvas-night-elevated); }
.cart__img img { width: 100%; height: 100%; object-fit: cover; }
.cart__info { grid-area: info; min-width: 0; }
.cart__info p { margin: var(--s-xs) 0 0; font-size: 14px; }
.cart__name { font-weight: 550; }
.cart__qty { grid-area: qty; display: flex; align-items: center; gap: var(--s-lg); }
.cart__total { grid-area: total; margin: 0; font-weight: 500; }
@media (min-width: 768px) {
  .cart__line { grid-template-columns: 96px 1fr auto 100px; grid-template-areas: "img info qty total"; align-items: center; }
  .cart__total { text-align: right; }
}
.cart__update { display: flex; justify-content: flex-end; margin: var(--s-xl) 0 var(--s-xxl); }
.summary dl { margin: 0 0 var(--s-xl); }
.summary dl div { display: flex; justify-content: space-between; padding: var(--s-sm) 0; color: var(--shade-30); }
.summary dd { margin: 0; }
.summary__total { border-top: 1px solid rgba(255,255,255,0.1); margin-top: var(--s-sm); padding-top: var(--s-md) !important; color: var(--on-primary) !important; font-size: 20px; font-weight: 500; }
.summary .micro { margin: var(--s-md) 0 0; text-align: center; }
.notice { margin: 0; padding: var(--s-lg); border: 1px solid var(--shade-70); border-radius: var(--r-md); color: var(--shade-30); }
.notice a { text-decoration: underline; color: var(--on-primary); }

/* ---------- Footer ---------- */
.footer { background: var(--canvas-night); border-top: 1px solid rgba(255,255,255,0.08); padding: var(--s-huge) var(--gutter) var(--s-xl); font-size: 14px; font-weight: 500; letter-spacing: 0.28px; }
.footer__inner { max-width: var(--max); margin: 0 auto; display: grid; gap: var(--s-xxl); grid-template-columns: 1fr 1fr; }
.footer__brand { grid-column: 1 / -1; }
.footer__brand img { height: 44px; width: auto; margin-bottom: var(--s-lg); }
.footer__tag { color: var(--shade-40); max-width: 320px; }
.footer__col { display: flex; flex-direction: column; gap: var(--s-sm); }
.footer__col h2 { font-size: 12px; font-weight: 400; letter-spacing: 0.72px; text-transform: uppercase; color: var(--shade-50); margin-bottom: var(--s-xs); }
.footer__col a { color: var(--link-cool-1); padding: var(--s-xxs) 0; word-break: break-word; }
.footer__col a:hover { color: var(--on-primary); }
.footer__legal { max-width: var(--max); margin: var(--s-huge) auto 0; padding-top: var(--s-xl); border-top: 1px solid var(--shade-70); color: var(--shade-50); font-size: 13px; }
@media (min-width: 768px) {
  .footer__inner { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer__brand { grid-column: auto; }
}
