/* Hallmark · pre-emit critique: P5 H4 E5 S4 R4 V5
 * Hallmark · macrostructure: Newsstand / broken grid · tone: neo-brutalist print shop
 * anchor hue: blaze orange · theme: custom (paper white, ink black, blaze #ff5722, signal #ffeb3b)
 */

/* ==========================================================================
   BAO! Arcade — core.css
   Tokens, reset, typography, accessibility primitives and the reusable
   brutalist utilities (borders, shadows, halftone, grid paper, marquee).
   Only four brand colours are defined. Every rule references a token.
   ========================================================================== */

:root {
  /* --- Brand palette (the only four colours) ---------------------------- */
  --paper: #ffffff;
  --ink: #0a0a0a;
  --blaze: #ff5722;
  --signal: #ffeb3b;

  /* Alpha tints of the same palette, used for scrims and patterns. */
  --ink-scrim: rgba(10, 10, 10, 0.66);
  --ink-ghost: rgba(10, 10, 10, 0.12);
  --paper-ghost: rgba(255, 255, 255, 0.28);

  /* --- Type ------------------------------------------------------------- */
  --font-display: "Syne", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Noto Sans SC", system-ui, sans-serif;

  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: clamp(1.2rem, 1.6vw, 1.45rem);
  --text-xl: clamp(1.5rem, 2.4vw, 2rem);
  --text-2xl: clamp(2rem, 4.5vw, 3.25rem);
  --display-s: clamp(2.5rem, 6vw, 4.25rem);
  --display: clamp(3.25rem, 9vw, 7rem);
  --display-l: clamp(3.5rem, 12vw, 9.5rem);

  /* --- Shape ------------------------------------------------------------ */
  --rule: 3px;
  --rule-thick: 5px;
  --rule-heavy: 7px;
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-lg: 10px 10px 0 var(--ink);
  --radius: 0px;

  /* --- Space (4pt scale) ------------------------------------------------ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* --- Layout ----------------------------------------------------------- */
  --shell: 1240px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: 64px;

  /* --- Motion ----------------------------------------------------------- */
  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 420ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* --- Pattern helpers -------------------------------------------------- */
  --dot-size: 8px;
  --grid-size: 24px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  /* The header scrolls away, so anchors only need a small breathing gap. */
  scroll-padding-top: 1.5rem;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--ink);
  color: var(--signal);
}

:focus-visible {
  outline: var(--rule) solid var(--blaze);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.bao-shell {
  width: min(var(--shell), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.bao-section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.bao-section--tight {
  padding-block: clamp(1.75rem, 4vw, 3rem);
}

.bao-visually-hidden {
  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;
}

.bao-skip {
  position: fixed;
  top: -120px;
  left: var(--gutter);
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--signal);
  color: var(--ink);
  border: var(--rule) solid var(--ink);
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  transition: top var(--dur-fast) var(--ease-out);
}

.bao-skip:focus {
  top: 0.75rem;
}

/* ==========================================================================
   Type utilities
   ========================================================================== */

.bao-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bao-kicker::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: none;
  background: var(--blaze);
  border: 2px solid var(--ink);
}

.bao-kicker--signal::before {
  background: var(--signal);
}

.bao-kicker--paper {
  color: var(--signal);
}

.bao-kicker--paper::before {
  border-color: var(--paper);
  background: var(--blaze);
}

.bao-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bao-mono-label {
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.text-outline {
  color: var(--ink);
}

@supports ((-webkit-text-stroke: 1px black)) {
  .text-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--ink);
    paint-order: stroke fill;
  }

  .text-outline--paper {
    -webkit-text-stroke-color: var(--paper);
  }

  .text-outline--blaze {
    -webkit-text-stroke-color: var(--blaze);
  }

  @media (min-width: 768px) {
    .text-outline {
      -webkit-text-stroke-width: 3px;
    }
  }
}

.bao-lede {
  max-width: 60ch;
  font-size: var(--text-md);
  line-height: 1.7;
}

.bao-small {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.bao-caption {
  font-size: var(--text-xs);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.bao-underline {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.bao-underline:hover {
  background: var(--signal);
}

/* ==========================================================================
   Brutalist utilities
   ========================================================================== */

.brutal,
.brutal-sm,
.brutal-lg {
  border: var(--rule) solid var(--ink);
  background: var(--paper);
}

.brutal {
  box-shadow: var(--shadow);
}

.brutal-sm {
  border-width: 2px;
  box-shadow: var(--shadow-sm);
}

.brutal-lg {
  border-width: var(--rule-thick);
  box-shadow: var(--shadow-lg);
}

.press {
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.press:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.press:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}

.halftone {
  background-image: radial-gradient(var(--ink) 1.15px, transparent 1.3px);
  background-size: var(--dot-size) var(--dot-size);
}

.halftone--soft {
  background-image: radial-gradient(var(--ink-ghost) 1.1px, transparent 1.25px);
  background-size: var(--dot-size) var(--dot-size);
}

.halftone--paper {
  background-image: radial-gradient(var(--paper-ghost) 1.1px, transparent 1.3px);
  background-size: var(--dot-size) var(--dot-size);
}

.grid-paper {
  background-image: linear-gradient(var(--ink-ghost) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-ghost) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

.stripes {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--ink) 0,
    var(--ink) 7px,
    transparent 7px,
    transparent 18px
  );
}

.stripes--paper {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--paper) 0,
    var(--paper) 7px,
    transparent 7px,
    transparent 18px
  );
}

.bao-tape {
  position: absolute;
  z-index: 3;
  width: 88px;
  height: 24px;
  background: var(--signal);
  border: 2px solid var(--ink);
  transform: rotate(-8deg);
  pointer-events: none;
}

.bao-tape--paper {
  background: var(--paper);
}

.bao-sticker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  background: var(--signal);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bao-sticker--blaze {
  background: var(--blaze);
}

.bao-sticker--ink {
  background: var(--ink);
  color: var(--signal);
  border-color: var(--paper);
}

.bao-sticker--tilt {
  transform: rotate(-4deg);
}

/* Tilt helpers. Cards use --tilt / --offset custom properties so hover can
   reset the rotation without fighting a second transform declaration. */
.tilt-a {
  --tilt: -1.4deg;
}

.tilt-b {
  --tilt: 1deg;
}

.tilt-c {
  --tilt: -0.6deg;
}

/* ==========================================================================
   Marquee
   ========================================================================== */

.marquee {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-block: var(--rule) solid var(--ink);
  background: var(--ink);
  color: var(--signal);
}

.marquee--signal {
  background: var(--signal);
  color: var(--ink);
}

.marquee--blaze {
  background: var(--blaze);
  color: var(--ink);
}

.marquee--paper {
  background: var(--paper);
  color: var(--ink);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: bao-marquee var(--marquee-duration, 26s) linear infinite;
}

.marquee--reverse .marquee__track {
  animation-direction: reverse;
}

.marquee__group {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1.25rem;
  padding: 0.55rem 1.25rem 0.55rem 0;
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 1.5vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.marquee__dot {
  width: 10px;
  height: 10px;
  flex: none;
  background: currentColor;
  transform: rotate(45deg);
}

@keyframes bao-marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ==========================================================================
   Micro-animation
   ========================================================================== */

.wobble {
  animation: bao-wobble 4.5s var(--ease-in-out) infinite;
}

.spin-slow {
  animation: bao-spin 22s linear infinite;
}

@keyframes bao-wobble {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

@keyframes bao-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Scroll reveal is additive: without JS the content is visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .marquee__track {
    animation: none;
    width: auto;
    flex-wrap: wrap;
  }

  .marquee__group[data-clone="true"] {
    display: none;
  }
}
