/* BTX Paperbag — main stylesheet
   Layout concept: a transparent header floats over a full-bleed video hero with the
   text laid on the video (desktop and phone); the header turns white once the page
   scrolls past the hero. Single light theme by choice (print/paper subject). */

@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-latin.woff2") format("woff2-variations"),
       url("/assets/fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color */
  --paper: #F6F1E7;        /* cream page ground */
  --white: #FFFFFF;        /* header bar, text on video */
  --ink: #2A2724;          /* soft charcoal text */
  --ink-muted: #5A554E;    /* secondary text on paper (7.0:1) */
  --magenta: #C4259C;      /* BTX logo magenta (logo only) */
  --mulberry: #8C1D6B;     /* site accent chosen by Willy, 8.4:1 with white */
  --mulberry-deep: #6F1655;/* hover / pressed, 10.9:1 with white */
  /* Accent roles (buttons, nav underline, focus ring). */
  --accent: var(--mulberry);
  --accent-hover: var(--mulberry-deep);
  --on-accent: var(--white);
  --rule: #E4DCCD;         /* hairlines on paper */
  --scrim: 22 19 16;       /* RGB of the video scrim */

  /* Type */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-hero: clamp(2.85rem, 1.6rem + 4.8vw, 5.4rem);

  /* Shape: buttons are rounded pills, never square boxes (Willy's rule) */
  --radius-pill: 999px;

  /* Space */
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --page-max: 80rem;
  --header-h: 72px;

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

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

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

a { color: inherit; }

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

main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: var(--gutter-l);
  top: 8px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.button:hover { background: var(--accent-hover); }
.button:active { background: var(--accent-hover); }

/* ---------- Header ----------
   Default (no JS, or page scrolled): white bar, charcoal text.
   .is-over-hero (set by header.js at the top of the page): transparent, white text. */
.site-header {
  --hdr-bg: var(--white);
  --hdr-fg: var(--ink);
  --hdr-rule: var(--rule);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--hdr-bg);
  color: var(--hdr-fg);
  border-bottom: 1px solid var(--hdr-rule);
  transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
.site-header.is-over-hero {
  --hdr-bg: transparent;
  --hdr-fg: var(--white);
  --hdr-rule: transparent;
}
.site-header.is-over-hero :focus-visible { outline-color: var(--white); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: var(--page-max);
  min-height: var(--header-h);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: 8px;
}
.site-header__brand { display: block; flex: none; line-height: 0; }
.site-header__brand img { width: 56px; height: 56px; }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding-block: 0.5rem;
  color: var(--hdr-fg);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat;
  transition: background-size 180ms ease;
}
.site-nav a:hover { background-size: 100% 2px; }

.button--header { flex: none; padding-inline: 1.3rem; font-size: 0.9375rem; }

/* ---------- Hero ----------
   Video fills the hero on every screen; text sits on it, bottom-left.
   Scrims are tuned against every 0.5 s frame of the loop (see README). */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
}

.hero__media { position: absolute; inset: 0; }
.hero__video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.hero__content :focus-visible { outline-color: var(--white); }

.hero__kicker {
  margin: 0;
  color: rgb(255 255 255 / 0.88);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hero__title {
  margin: 0;
  max-width: 13em;
  font-family: var(--font-display);
  font-size: var(--step-hero);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.nowrap { white-space: nowrap; }

.hero__lede {
  margin: 0;
  max-width: 34rem;
  color: rgb(255 255 255 / 0.92);
  font-size: var(--step-1);
  line-height: 1.6;
  text-wrap: pretty;
}

.button--hero { margin-top: 0.5rem; padding: 1rem 2rem; font-size: 1.0625rem; }


.hero__toggle {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 50%;
  background: rgb(var(--scrim) / 0.55);
  color: var(--white);
  cursor: pointer;
  transition: background-color 150ms ease;
}
.hero__toggle:hover { background: rgb(var(--scrim) / 0.8); }
.hero__toggle:focus-visible { outline-color: var(--white); }
.hero__toggle .icon--play { display: none; }
.hero__toggle[data-state="paused"] .icon--pause { display: none; }
.hero__toggle[data-state="paused"] .icon--play { display: block; }

/* Phones and small tablets: text over the video, stacked from the bottom. */
@media (max-width: 899.98px) {
  .site-nav { display: none; }
  .button--header { margin-left: auto; }

  .hero { min-height: max(600px, min(100svh, 780px)); }
  .hero__media::after {
    background:
      linear-gradient(180deg, rgb(var(--scrim) / 0.6) 0%, rgb(var(--scrim) / 0) 22%),
      linear-gradient(0deg, rgb(var(--scrim) / 0.9) 0%, rgb(var(--scrim) / 0.82) 52%, rgb(var(--scrim) / 0.35) 76%, rgb(var(--scrim) / 0) 100%);
  }
  .hero__content {
    gap: 1rem;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 2rem);
    padding-bottom: 5rem; /* clears the pause button below the text */
  }
  /* Pause/Play sits bottom-right on phones. */
  .hero__toggle {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: 20px;
  }
  .button--hero { margin-top: 0.25rem; }
  /* Sized so "No US anti-dumping duty." holds one line on common phones (360–430px). */
  .hero__title { font-size: clamp(2.25rem, 10vw, 2.85rem); }
}

@media (max-width: 420px) {
  :root { --header-h: 64px; }
  .site-header__inner { gap: 1rem; }
  .site-header__brand img { width: 48px; height: 48px; }
  .button--header { padding-inline: 1rem; font-size: 0.875rem; }
  .hero__lede { font-size: var(--step-0); }
}

/* Desktop: scrim on the left, text bottom-left. */
@media (min-width: 900px) {
  .hero { min-height: clamp(600px, 88svh, 920px); }
  .hero__media::after {
    background:
      linear-gradient(180deg, rgb(var(--scrim) / 0.78) 0%, rgb(var(--scrim) / 0.45) 14%, rgb(var(--scrim) / 0) 30%),
      linear-gradient(90deg, rgb(var(--scrim) / 0.88) 0%, rgb(var(--scrim) / 0.8) 50%, rgb(var(--scrim) / 0.35) 72%, rgb(var(--scrim) / 0) 100%),
      linear-gradient(0deg, rgb(var(--scrim) / 0.5) 0%, rgb(var(--scrim) / 0) 45%);
  }
  .hero__toggle { right: max(24px, env(safe-area-inset-right, 0px)); bottom: 24px; }
  .hero__content { padding-block: calc(var(--header-h) + 6rem) 4.5rem; }
}

@media (min-width: 1100px) {
  .site-nav ul { gap: 2.25rem; }
}
