/* =========================================================
   EDIT ME: design tokens. Everything below is derived from
   these values — colors, type, spacing — so updating this
   block re-skins every page.

   Three-color system: navy ink, warm stone base, brick-red accent.
   Navy is the one hue family none of the 16 shirt designs use (they
   span green/grey/tan/orange/black/purple/turquoise/yellow/red), so
   the site's own chrome reads as its own thing next to the product
   photography rather than competing with it. Navy + brick red is a
   varsity/nautical pairing — manly, a little brash, not the previous
   pass's workwear brown/brass.

   Contrast-checked against WCAG AA (4.5:1 body / 3:1 large):
     ink on paper             13.5:1
     ink on card              10.7:1
     ink-soft on paper          6.0:1
     ink-soft on card           4.7:1
     chip on card                4.7:1
     chip on paper                6.0:1
     white on chip               6.3:1
     white on ink                14.4:1
   ========================================================= */
:root {
  /* Page background is now the near-white tone; --card (object/surface
     fill — cards, form controls, the shirt-grid backdrop) carries the
     warm tan instead. Previously the reverse: --paper was the tan page
     background and --card the near-white surface color. */
  --paper: #FAF8F3;
  --card: #E2DED5;
  --ink: #1C2B3D;
  --ink-soft: #556070;
  --line: #D2CBB8;
  --chip: #B22F19;
  --chip-soft: #F5DFDA;
  --radius: 14px;

  --font-display: 'Archivo Black', 'Archivo', sans-serif;
  --font-body: 'Archivo', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --max-width: 1160px;
  color-scheme: light;
}

/* Native cross-page morph: the browser handles the crossfade/geometry
   animation between old and new document for any element sharing a
   view-transition-name (set per-product on the thumb/detail images). */
@view-transition {
  navigation: auto;
}

/* Tuned so only the shirt image reads as "animating". Left at browser
   defaults, the whole-page crossfade (grid <-> product panel) runs at the
   same speed as the image morph and the two compete, which reads as
   choppy. Cutting the page crossfade short and slowing/easing just the
   image group keeps a single smooth, deliberate motion instead. Normal
   blending replaces the default plus-lighter, which was washing color out
   of the shirt art for the duration both images overlapped. */
::view-transition-group(*) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
::view-transition-old(*),
::view-transition-new(*) {
  mix-blend-mode: normal;
}
::view-transition-group(root) {
  animation-duration: 130ms;
  animation-timing-function: ease;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Visually hidden but still readable by screen readers — used for the
   cart's live-region announcements (assets/cart.js), where sighted users
   already get the visible badge count so no on-screen text is needed. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus {
  left: 24px;
  top: 24px;
}

:focus-visible {
  outline: 2px solid var(--chip);
  outline-offset: 3px;
}

/* ---- Header / nav ----
   Transparent over the hero by default; once scrolled past the letterhead
   it shrinks slightly and picks up a muted, translucent card background so
   it stays legible over whatever content is underneath. */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 24px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
}
/* Scroll state is a hard snap at the SCROLL_THRESHOLD in transitions.js, not
   an eased blend — see transitions.js for why. */
header.site-header.is-scrolled {
  padding: 14px 0;
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 20px rgba(28, 43, 61, 0.10);
}
header.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.wordmark img {
  display: block;
  width: auto;
  height: 42px;
}
header.site-header.is-scrolled .wordmark img { height: 32px; }

header.site-header nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
header.site-header nav a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
header.site-header nav a:hover,
header.site-header nav a:focus-visible {
  color: var(--ink);
}
header.site-header nav a { touch-action: manipulation; }
header.site-header nav a.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--chip);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
}

/* ---- Quantity stepper (product detail + cart pages) ---- */
.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  width: fit-content;
}
.qty-stepper button {
  background: var(--card);
  border: none;
  width: 38px;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.qty-stepper button:hover { background: var(--paper); }
.qty-stepper input {
  width: 46px;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 9px;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s ease, transform 0.15s ease;
  touch-action: manipulation;
}
.btn:hover { background: var(--chip); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 8px 0;
}
.btn-ghost:hover { color: var(--ink); }

/* ---- Breadcrumb bar (product + cart pages) ---- */
.breadcrumb-bar { padding: 22px 0 0; }
.breadcrumb-bar .wrap { display: flex; }

/* ---- Footer ---- */
footer {
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
footer .brand-line {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink);
}

/* ---- Cart drawer (assets/cart-drawer.js) ----
   Not present on cart.html, which is the full, un-drawered view of the
   same cart data — no reason to overlay a mini version of itself. */
.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 43, 61, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--paper);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -12px 0 40px rgba(28, 43, 61, 0.25);
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-drawer:focus { outline: none; }
.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.cart-drawer-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0;
}
.cart-drawer-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px;
  touch-action: manipulation;
}
.cart-drawer-close:hover { color: var(--ink); }
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 24px;
}
.cart-drawer-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--ink-soft);
}
.cart-drawer-empty p { margin: 0 0 20px; }
.cart-drawer-list { display: flex; flex-direction: column; gap: 18px; }
.cart-drawer-line {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.cart-drawer-line:last-child { border-bottom: none; padding-bottom: 0; }
.cart-drawer-thumb {
  width: 88px;
  height: 88px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--card);
  border-radius: 6px;
}
.cart-drawer-meta { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cart-drawer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.cart-drawer-name {
  font-family: var(--font-display);
  font-size: 15.5px;
  line-height: 1.3;
  margin: 0;
}
.cart-drawer-remove {
  flex: none;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px;
  touch-action: manipulation;
}
.cart-drawer-remove:hover { color: var(--chip); }
.cart-drawer-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 0;
}
.cart-drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.cart-drawer-price {
  font-family: var(--font-mono);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cart-drawer-summary {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 20px;
}
.cart-drawer-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cart-drawer-subtotal s { color: var(--ink-soft); font-weight: 500; margin-right: 6px; }
.cart-drawer-bundle-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--chip);
  margin: 8px 0 0;
}
.cart-drawer-checkout {
  width: 100%;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  border-radius: 999px;
  padding: 17px 28px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #000;
}
.cart-drawer-checkout:hover { background: var(--chip); }
.cart-drawer-checkout svg { flex: none; }

/* ---- Payment badges ----
   Simple, generic stand-ins for the accepted card/wallet networks — not
   pixel-exact official marks, just enough to read as "these payment
   methods work here" beneath the checkout button. */
.cart-drawer-payments {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.cart-drawer-payment-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 28px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.01em;
  color: #fff;
}
.cart-drawer-payment-badge.pb-visa { background: #1a1f71; }
.cart-drawer-payment-badge.pb-amex { background: #006fcf; }
.cart-drawer-payment-badge.pb-paypal { background: #003087; }
.cart-drawer-payment-badge.pb-applepay { background: #000; font-style: normal; gap: 2px; }
.cart-drawer-payment-badge.pb-mastercard {
  background: var(--card);
  border: 1px solid var(--line);
  position: relative;
}
.cart-drawer-payment-badge.pb-mastercard .mc-circles {
  display: flex;
  align-items: center;
}
.cart-drawer-payment-badge.pb-mastercard .mc-circles span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
}
.cart-drawer-payment-badge.pb-mastercard .mc-circles span:first-child {
  background: #eb001b;
  margin-right: -6px;
}
.cart-drawer-payment-badge.pb-mastercard .mc-circles span:last-child {
  background: #f79e1b;
  mix-blend-mode: multiply;
}

.cart-drawer-view-all {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 14px;
}
.cart-drawer-view-all:hover { color: var(--ink); }

/* ---- Add-to-cart badge bump (assets/cart-drawer.js) ----
   A quick pulse on the cart badge itself when something's added — enough
   to catch the eye without a full drawer (or any cross-page motion)
   interrupting browsing. */
@keyframes cartBadgeBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  65% { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.cart-count.cart-bump {
  animation: cartBadgeBump 0.4s ease;
}
