/* ==========================================================================
   BASE — reset, element defaults, typography primitives, utilities.
   Depends on tokens.css.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset anchor jumps so a sticky header never covers the target. */
  scroll-padding-top: 120px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--g1-bg);
  color: var(--g1-text);
  font-family: var(--g1-font-body);
  font-size: var(--g1-text-body);
  line-height: var(--g1-leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Locks scroll behind the mobile drawer and cart drawer. */
body.g1-no-scroll { overflow: hidden; }

img, svg, video, canvas, iframe {
  display: block;
  max-width: 100%;
}

img, video { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; padding: 0; cursor: pointer; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

ul, ol { padding: 0; list-style: none; }

/* Restore list markers inside editor content, where they carry meaning. */
.g1-prose ul { list-style: disc; padding-left: 1.25rem; }
.g1-prose ol { list-style: decimal; padding-left: 1.25rem; }

table { border-collapse: collapse; width: 100%; }

/* --------------------------------------------------------------------------
   Typography primitives
   ------------------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--g1-font-ui);
  font-weight: var(--g1-weight-bold);
  line-height: var(--g1-leading-tight);
  letter-spacing: var(--g1-tracking-tight);
  text-transform: uppercase;
}

/* display-xl is the hero's size and nothing else's. BPN spends 96px once per
   page, on the slogan; every other h1 — page titles, PDP titles, account
   screens — sits at display-l. Leaving xl on the bare `h1` selector put
   "CHECKOUT" across two 120px lines with an orphaned "UT". */
.g1-display-xl,
.g1-hero__title {
  font-family: var(--g1-font-display);
  font-size: var(--g1-text-display-xl);
  line-height: 0.83;              /* BPN: 96px type on an 80px line */
  letter-spacing: var(--g1-tracking-display);
  font-weight: 900;  /* BPN sets display type at 900; Archivo Black is 900. */
}

h1, h2, .g1-display-l {
  font-family: var(--g1-font-display);
  font-size: var(--g1-text-display-l);
  line-height: 0.83;              /* BPN: 48px type on a 40px line */
  letter-spacing: var(--g1-tracking-tight);
  font-weight: 900;
}

h3, .g1-display-m { font-size: var(--g1-text-display-m); }
h4 { font-size: var(--g1-text-h4); }

a { color: inherit; text-decoration: none; }

.g1-prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--g1-line-strong);
  transition: text-decoration-color var(--g1-duration-fast) var(--g1-ease-out);
}
.g1-prose a:hover { text-decoration-color: var(--g1-red-text); }

strong, b { font-weight: var(--g1-weight-semibold); }

/* The all-caps label. Wide tracking is what keeps uppercase legible at 13px. */
.g1-eyebrow {
  font-family: var(--g1-font-ui);
  font-size: var(--g1-text-label);
  font-weight: var(--g1-weight-bold);
  letter-spacing: var(--g1-tracking-wider);
  text-transform: uppercase;
  color: var(--g1-red-text);
  margin-bottom: var(--g1-space-3);
}

.g1-eyebrow--muted { color: var(--g1-text-subtle); }

.g1-lead {
  font-size: var(--g1-text-body-l);
  color: var(--g1-text-muted);
  max-width: 60ch;
}

/* Long-form editor content. */
.g1-prose { max-width: var(--g1-container-prose); }
.g1-prose > * + * { margin-top: var(--g1-space-4); }
.g1-prose h2 { margin-top: var(--g1-space-8); font-size: var(--g1-text-display-m); }
.g1-prose h3 { margin-top: var(--g1-space-6); font-size: var(--g1-text-h4); }
.g1-prose li + li { margin-top: var(--g1-space-2); }
.g1-prose blockquote {
  border-left: 3px solid var(--g1-red);
  padding-left: var(--g1-space-5);
  font-size: var(--g1-text-body-l);
  color: var(--g1-text);
}

/* --------------------------------------------------------------------------
   Focus
   A double ring — page-coloured inner, red outer — so it reads on white, on
   the tonal bands, and over photography.
   ------------------------------------------------------------------------ */
:focus { outline: none; }

:focus-visible {
  outline: none;
  box-shadow: var(--g1-focus-ring);
  border-radius: var(--g1-radius-sm);
}

/* --------------------------------------------------------------------------
   Selection
   ------------------------------------------------------------------------ */
::selection { background: var(--g1-red); color: var(--g1-text-invert); }

/* --------------------------------------------------------------------------
   Layout utilities
   ------------------------------------------------------------------------ */
.g1-container {
  width: 100%;
  max-width: var(--g1-container);
  margin-inline: auto;
  padding-inline: var(--g1-gutter);
}

.g1-container--narrow { max-width: var(--g1-container-inner); }
.g1-container--prose { max-width: 76ch; }

/* Cart, checkout and the account dashboard. Wider than a reading measure and
   without the prose list/typography rules, which are wrong for UI. */
.g1-container--app { max-width: var(--g1-container-inner); }

.g1-section { padding-block: var(--g1-section-y); }
.g1-section--tight { padding-block: var(--g1-section-y-tight); }
.g1-section--flush-top { padding-top: 0; }

.g1-section--surface { background: var(--g1-surface); }

/* Tonal band on the light page — BPN uses #EEEEEE for the category strip and
   #F0F0F0 for trust. Not an inversion any more: text stays dark. */
.g1-section--light,
.g1-section--band {
  background: var(--g1-band);
  color: var(--g1-text);
}
.g1-section--band-alt { background: var(--g1-band-alt); color: var(--g1-text); }

/* Small red text fails AA on #EEE, so bands use the darkened variant. */
.g1-section--light .g1-eyebrow,
.g1-section--band .g1-eyebrow { color: var(--g1-red-text); }

/* Dark band, for sections that deliberately invert (footer, hero). */
.g1-section--dark {
  background: var(--g1-dark);
  color: var(--g1-text-invert);
}
.g1-section--dark .g1-lead,
.g1-section--dark .g1-section-head__intro { color: #B8B5B2; }

/* Section header block. */
.g1-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--g1-space-4);
  margin-bottom: var(--g1-space-7);
}
.g1-section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.g1-section-head__text { max-width: 46ch; }
.g1-section-head--center .g1-section-head__text { max-width: 56ch; }
.g1-section-head__intro {
  margin-top: var(--g1-space-4);
  color: var(--g1-text-muted);
  font-size: var(--g1-text-body-l);
}
.g1-section-head__cta { flex-shrink: 0; }

@media (max-width: 640px) {
  .g1-section-head__cta { width: 100%; }
}

/* Grids. */
.g1-grid { display: grid; gap: var(--g1-grid-gap); }
.g1-grid--2 { grid-template-columns: repeat(2, 1fr); }
.g1-grid--3 { grid-template-columns: 1fr; }
.g1-grid--4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 768px) {
  .g1-grid--3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .g1-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.g1-stack { display: flex; flex-direction: column; gap: var(--g1-space-4); }
.g1-row { display: flex; flex-wrap: wrap; gap: var(--g1-space-3); align-items: center; }

/* Grid and flex children default to min-width:auto, so a wide table, a long
   URL or an oversized image can push a column past its track and scroll the
   whole page sideways. Every direct child of a theme grid opts out. */
.g1-grid > *,
.g1-cats > *,
.g1-science > *,
.g1-belief__grid > *,
.g1-quiz > *,
.g1-footer__main > * { min-width: 0; }

.g1-main { display: block; }

/* --------------------------------------------------------------------------
   Accessibility utilities
   ------------------------------------------------------------------------ */

/* Visually hidden, still announced. */
.screen-reader-text,
.g1-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link — hidden until focused, then pinned top-left. */
.g1-skip-link {
  position: absolute;
  top: -100px;
  left: var(--g1-space-4);
  z-index: var(--g1-z-toast);
  padding: var(--g1-space-3) var(--g1-space-5);
  background: var(--g1-red);
  color: var(--g1-text);
  font-family: var(--g1-font-ui);
  font-weight: var(--g1-weight-bold);
  letter-spacing: var(--g1-tracking-wide);
  text-transform: uppercase;
  transition: top var(--g1-duration-fast) var(--g1-ease-out);
}
.g1-skip-link:focus { top: var(--g1-space-4); }

/* --------------------------------------------------------------------------
   Scroll reveal
   Elements start slightly offset and fade in when observed. The `no-js` guard
   matters: without JS the initial state must be visible, or the whole page
   renders blank.
   ------------------------------------------------------------------------ */
.g1-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--g1-duration-slow) var(--g1-ease-out),
    transform var(--g1-duration-slow) var(--g1-ease-out);
}
.g1-reveal.is-visible { opacity: 1; transform: none; }

html.no-js .g1-reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .g1-reveal { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   Horizontal scroller
   Grid on desktop, scroll-snap carousel below. One component, no JS carousel
   library, and it stays keyboard- and touch-native.
   ------------------------------------------------------------------------ */
.g1-scroller {
  display: grid;
  gap: var(--g1-grid-gap);
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 78vw);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--g1-gutter);
  padding-bottom: var(--g1-space-4);
  margin-inline: calc(var(--g1-gutter) * -1);
  padding-inline: var(--g1-gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--g1-line-strong) transparent;
}
.g1-scroller > * { scroll-snap-align: start; }

.g1-scroller::-webkit-scrollbar { height: 4px; }
.g1-scroller::-webkit-scrollbar-track { background: var(--g1-line); }
.g1-scroller::-webkit-scrollbar-thumb { background: var(--g1-line-strong); }

@media (min-width: 640px) {
  .g1-scroller { grid-auto-columns: minmax(240px, 42vw); }
}

@media (min-width: 1024px) {
  .g1-scroller {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    padding-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   Placeholder
   Deliberately conspicuous. An unfilled asset slot should be impossible to
   miss in review; every one is tracked in TODO.md.
   ------------------------------------------------------------------------ */
.g1-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  background:
    repeating-linear-gradient(
      45deg,
      var(--g1-surface-3) 0 10px,
      var(--g1-surface-2) 10px 20px
    );
  border: 1px dashed var(--g1-line-strong);
  color: var(--g1-text-muted);
  font-family: var(--g1-font-ui);
  font-size: var(--g1-text-label);
  letter-spacing: var(--g1-tracking-wider);
  text-transform: uppercase;
  text-align: center;
  padding: var(--g1-space-4);
}

/* --------------------------------------------------------------------------
   Marquee slogan band
   ------------------------------------------------------------------------ */
.g1-marquee {
  background: var(--g1-red);
  overflow: hidden;
  padding-block: var(--g1-space-4);
  white-space: nowrap;
}
.g1-marquee__track {
  display: inline-flex;
  gap: var(--g1-space-7);
  animation: g1-marquee-scroll var(--g1-marquee-duration) linear infinite;
  will-change: transform;
}
.g1-marquee span {
  font-family: var(--g1-font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: var(--g1-tracking-tight);
  text-transform: uppercase;
  color: var(--g1-text-invert);
}

@keyframes g1-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Pause rather than hide: the slogan should still read. */
@media (prefers-reduced-motion: reduce) {
  .g1-marquee__track { animation: none; }
}
