/* braincultures — shared styles for the partner pages: home, shop, product, cart, account, visuals, about, terms, privacy.
   Each page keeps its own layout in its <style>; this file holds what they all share:
   the ticker, the menu button, the fullscreen menu (strike-through + drifting chromosomes; its foot: who is signed
   in, log out, terms, privacy), the masthead with the LED clock and the cart, and how one page gives way to the next.
   Served no-cache, so an edit shows on the next load; check with scripts/check-site.py. */

/* DSEG7 — the red LED clock. SIL Open Font License: /assets/fonts/OFL-DSEG.txt */
@font-face {
  font-family: "DSEG7";
  src: url("/assets/fonts/DSEG7Classic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #fff;
  color: #000;
  /* Aeonik is the intended face but isn't licensed/loaded yet, so most visitors get Helvetica Neue / Arial */
  font-family: "Aeonik", "Aeonik Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #000; text-decoration: none; }
img, video { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 60;
  padding: 10px 16px;
  background: #000;
  color: #fff;
  font-size: 13px;
  letter-spacing: .08em;
  outline: 1px solid #fff;
}
.skip-link:focus { top: 50px; }

/* ── ticker: black bar across the top; site.js cycles its three states ── */
.ticker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 12px;
  background: #050505;
  color: #fff;
}
.ticker-track { font-size: 12px; font-weight: 700; letter-spacing: .22em; white-space: nowrap; }
@media (max-width: 420px) { .ticker-track { font-size: 10.5px; letter-spacing: .14em; } }   /* the free-shipping line fits a small phone */
.ticker-track.wide { width: 100%; display: flex; justify-content: space-between; letter-spacing: 0; overflow: hidden; }
body.menu-open .ticker { opacity: 0; visibility: hidden; transition: opacity .3s ease; }

/* ── menu button: three black lines on the white pages, an X while the menu is open ── */
.menu-btn {
  position: fixed;
  top: 38px;                 /* the lines sit where the partner put them (46px / 40px); */
  right: 32px;               /* the 8px padding just makes the button easier to hit    */
  z-index: 40;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  width: 34px;
  height: 2px;
  background: #000;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .9));   /* stays visible over artwork */
  transition: transform .3s ease, opacity .2s ease;
}
body.menu-open .menu-btn span { background: #fff; filter: none; }
body.menu-open .menu-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.menu-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 560px) {
  .menu-btn { top: 44px; right: 16px; }   /* was top 28px, which hid two lines under the ticker */
}

/* ── the fullscreen menu: slides down, links stagger in, a marker strike on hover ── */
#site-menu {
  position: fixed;
  inset: 0;
  z-index: 25;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(12px, 3.5vh, 28px);      /* short screens (a phone on its side) close the gaps… */
  padding: 0 clamp(24px, 6vw, 96px);
  background: #050505;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 1s cubic-bezier(.16, 1, .3, 1), visibility 0s linear 1s;
}
body.menu-open #site-menu {
  transform: translateY(0);
  visibility: visible;
  transition: transform 1s cubic-bezier(.16, 1, .3, 1), visibility 0s;
}
#site-menu > a {
  position: relative;
  z-index: 1;
  width: max-content;
  color: #fff;
  text-transform: lowercase;
  font-size: clamp(30px, min(7vw, 10vh, calc((100vh - 120px) / 8)), 84px);   /* …and shrink the words, so all seven and the foot fit */
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
}
#site-menu > a:hover { color: #fff; opacity: 1; }
#site-menu a:focus-visible, #site-menu button:focus-visible { outline: 2px solid #fff; outline-offset: 8px; }
#site-menu > a::after {
  content: "";
  position: absolute;
  left: -2%;
  top: 58%;
  width: 104%;
  height: 22px;
  transform: translateY(-50%) rotate(-.7deg) scaleX(0);
  transform-origin: left center;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 24' preserveAspectRatio='none'%3E%3Cpath d='M3 15 C 60 8, 96 17, 150 11 S 250 16, 300 9 S 370 15, 397 10' fill='none' stroke='%23000' stroke-width='9' stroke-linecap='round'/%3E%3Cpath d='M12 17 C 70 12, 110 19, 168 13 S 262 18, 322 12 S 380 16, 392 13' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' opacity='0.85'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}
@keyframes brainStrikeIn {
  from { transform: translateY(-50%) rotate(-.7deg) scaleX(0); }
  to   { transform: translateY(-50%) rotate(-.7deg) scaleX(1); }
}
#site-menu > a:hover::after,
#site-menu > a:focus-visible::after { animation: brainStrikeIn .35s cubic-bezier(.22, 1, .36, 1) forwards; }
body.menu-open #site-menu > a, body.menu-open #site-menu .menu-foot { opacity: 1; transform: translateY(0); }
body.menu-open #site-menu > a:nth-child(1) { transition-delay: .35s; }
body.menu-open #site-menu > a:nth-child(2) { transition-delay: .44s; }
body.menu-open #site-menu > a:nth-child(3) { transition-delay: .53s; }
body.menu-open #site-menu > a:nth-child(4) { transition-delay: .62s; }
body.menu-open #site-menu > a:nth-child(5) { transition-delay: .71s; }
body.menu-open #site-menu > a:nth-child(6) { transition-delay: .80s; }
body.menu-open #site-menu > a:nth-child(7) { transition-delay: .89s; }
body.menu-open #site-menu .menu-foot { transition-delay: 1s; }

/* the menu's foot: who is signed in and log out (site.js), the terms, the privacy policy, your privacy choices (privacy.js opens them;
   with a Global Privacy Control signal it adds OPT-OUT REQUEST HONORED) — small, under the words */
#site-menu .menu-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 26px;
  margin: clamp(2px, 1.5vh, 14px) 0 0;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8c8c8c;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
}
#site-menu .menu-foot a, #site-menu .menu-foot button { padding: 0; border: 0; background: none; color: #8c8c8c; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
#site-menu .menu-foot a:hover, #site-menu .menu-foot button:hover { color: #fff; }
#site-menu .menu-foot .who { color: #c9c9c9; letter-spacing: .1em; text-transform: none; }
#site-menu .menu-foot .pc-icon { display: inline-block; width: 30px; height: 14px; margin-left: 9px; vertical-align: -2px; }   /* California's opt-out icon, beside YOUR PRIVACY CHOICES */

/* chromosomes drifting behind the links (site.js scatters them clear of the links on every open).
   The images are white on transparent: the partner's grayscale/brighten/screen look is baked in,
   so no black box shows around them. */
#chromo { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#chromo .chromo { position: absolute; animation: chromo-drift linear infinite alternate; }
#chromo img {
  display: block;
  opacity: 0;
  transition: opacity .5s ease .3s;
  animation: chromo-wobble ease-in-out infinite alternate;
}
body.menu-open #chromo img { opacity: 1; }
@keyframes chromo-drift {
  0%   { transform: translate(-50%, -50%) translate(0, 0); }
  25%  { transform: translate(-50%, -50%) translate(6px, -5px); }
  50%  { transform: translate(-50%, -50%) translate(-4px, 7px); }
  75%  { transform: translate(-50%, -50%) translate(-7px, -3px); }
  100% { transform: translate(-50%, -50%) translate(5px, 4px); }
}
@keyframes chromo-wobble {
  from { rotate: var(--rot); }
  to   { rotate: calc(var(--rot) + var(--spin)); }
}
html.menu-lock { overflow: hidden; }

/* ── masthead of the white pages: black wordmark, LED clock, cart / field button ── */
header.masthead {
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 102px 40px 0;
}
.brand { width: 190px; }
.brand img { display: block; width: 100%; height: auto; filter: invert(1); }
.stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px 5px;
  border: 1px solid #1e1e1e;
  border-radius: 3px;
  background: #0a0a0a;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .9);
}
.stamp .led { position: relative; font-family: "DSEG7", "Courier New", monospace; font-size: 20px; line-height: 1; letter-spacing: .02em; }
.stamp .led .ghost { color: #a81d0e; opacity: .07; }
.stamp .led .live { position: absolute; left: 0; top: 0; color: #b8210f; text-shadow: 0 0 6px rgba(184, 33, 15, .4); }
.cart { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #000; }
a.cart:hover { color: #666; }
a.cart:focus-visible { outline: 1px solid #000; outline-offset: 6px; }
.cart b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-weight: 400;
  font-size: 12px;
}

/* ── from page to page: the ticker, the menu button and the masthead stay where they are; the page under them rises in, as the
   menu's words do (cross-document view transitions — where the browser has them; elsewhere pages simply load) ── */
@view-transition { navigation: auto; }
.ticker { view-transition-name: brain-ticker; }
.menu-btn { view-transition-name: brain-menu-btn; }
header.masthead { view-transition-name: brain-masthead; }
::view-transition-old(root) { animation: brain-page-out .22s ease both; }
::view-transition-new(root) { animation: brain-page-in .6s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes brain-page-out { to { opacity: 0; } }
@keyframes brain-page-in { from { opacity: 0; transform: translateY(18px); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .01s; }
  #site-menu { transform: none; opacity: 0; transition: opacity .2s ease, visibility 0s linear .2s; }
  body.menu-open #site-menu { transform: none; opacity: 1; transition: opacity .2s ease, visibility 0s; }
  #site-menu > a, #site-menu .menu-foot { transform: none; transition: opacity .2s ease; }
  body.menu-open #site-menu > a, body.menu-open #site-menu .menu-foot { transform: none; transition-delay: 0s !important; }
  #chromo .chromo, #chromo img { animation: none; }
  .menu-btn span { transition: none; }
}
