/* ==========================================================================
   oosh brand kit v2 — "signal"
   Neo-brutalist / Swiss transit-poster. Hard edges, flat colour, loud type.
   This file is the single source of truth for tokens + primitives.
   ========================================================================== */

:root {
  /* ---- Core palette (the only four brand colours) ---- */
  --oosh-ink:    #16232A;   /* near-black slate — text, borders, dark blocks */
  --oosh-orange: #FF5804;   /* primary accent — CTAs, live state, the dot     */
  --oosh-teal:   #075056;   /* secondary — depth, alt surfaces, calm states   */
  --oosh-ice:    #E4EEF0;   /* ground — page background, light surfaces      */

  /* ---- Derived tints (mixes only, never new hues) ---- */
  --ink-80:      #455056;
  --ink-60:      #73797d;
  --ice-deep:    #CFDDE1;
  --ice-white:   #F4F9FA;
  --orange-deep: #D64703;

  /* ---- Semantic ---- */
  --bg:          var(--oosh-ice);
  --bg-panel:    var(--ice-white);
  --bg-sunk:     var(--ice-deep);
  --bg-invert:   var(--oosh-ink);
  --fg:          var(--oosh-ink);
  --fg-muted:    var(--ink-80);
  --fg-invert:   var(--oosh-ice);
  --accent:      var(--oosh-orange);
  --accent-fg:   var(--oosh-ink);   /* ink on orange — 5.3:1, never white     */
  --line:        var(--oosh-ink);

  /* ---- Type ---- */
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Display = heavy + condensed + uppercase. That combination IS the brand. */
  --display-wght: 800;
  --display-wdth: 82;

  --fs-hero:  clamp(2.75rem, 10vw, 6.5rem);
  --fs-h1:    clamp(2rem, 6vw, 3.5rem);
  --fs-h2:    clamp(1.5rem, 4vw, 2.25rem);
  --fs-h3:    clamp(1.15rem, 2.5vw, 1.5rem);
  --fs-body:  1rem;
  --fs-small: 0.875rem;
  --fs-micro: 0.6875rem;

  /* ---- Structure ---- */
  --bw:        2px;     /* standard rule    */
  --bw-heavy:  3px;     /* section dividers */
  --radius:    0;       /* the brand is square. deliberately. */

  /* ---- Hard shadow — offset, never blurred ---- */
  --shadow:      4px 4px 0 var(--oosh-ink);
  --shadow-lift: 7px 7px 0 var(--oosh-ink);
  --shadow-sm:   3px 3px 0 var(--oosh-ink);

  /* ---- Motion ---- */
  --ease:   cubic-bezier(0.2, 0.8, 0.2, 1);
  --snap:   90ms;
  --settle: 220ms;

  /* ---- Layout ---- */
  --content-w: 1180px;
  --gutter:    clamp(1.15rem, 4vw, 2.5rem);

  /* ---- Safe area (iOS notch / gesture bar) ---- */
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ==========================================================================
   Patterns — the brand's texture vocabulary. Compose, don't invent new ones.
   ========================================================================== */
.p-dots {
  background-image: radial-gradient(currentColor 1.5px, transparent 1.5px);
  background-size: 12px 12px;
}
.p-hazard {
  background-image: repeating-linear-gradient(
    -45deg, currentColor 0 8px, transparent 8px 18px
  );
}
.p-grid {
  background-image:
    linear-gradient(currentColor 1px, transparent 1px),
    linear-gradient(90deg, currentColor 1px, transparent 1px);
  background-size: 26px 26px;
}
.p-check {
  background-image:
    conic-gradient(currentColor 90deg, transparent 90deg 180deg,
                   currentColor 180deg 270deg, transparent 270deg);
  background-size: 22px 22px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-variation-settings: 'wdth' 100, 'wght' 400;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
button, a { touch-action: manipulation; }

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' var(--display-wdth), 'wght' var(--display-wght);
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.92;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 1em; max-width: 62ch; }
p:last-child { margin-bottom: 0; }
strong { font-variation-settings: 'wdth' 100, 'wght' 700; }

/* Mono micro-label — metadata, slugs, breadcrumbs, kickers */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-muted);
}
.label--accent { color: var(--orange-deep); }

/* ==========================================================================
   Button — the split block. Label panel + arrow panel, hard-joined.
   ========================================================================== */
.btn {
  display: inline-grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border: var(--bw) solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg-panel);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  transition: transform var(--snap) var(--ease), box-shadow var(--snap) var(--ease);
}
.btn__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 90, 'wght' 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--accent-fg);
}
.btn__arrow {
  display: grid;
  place-items: center;
  width: 3.25rem;
  background: var(--oosh-ink);
  color: var(--oosh-ice);
  border-left: var(--bw) solid var(--line);
  font-size: 1.1rem;
}
.btn--primary .btn__label { background: var(--accent); }
.btn--ghost   .btn__label { background: var(--bg-panel); }
.btn--teal    .btn__label { background: var(--oosh-teal); color: var(--oosh-ice); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lift); }
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--oosh-ink); }

/* ==========================================================================
   Badge — sharp status chip
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border: var(--bw) solid var(--line);
  background: var(--bg-panel);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.badge--live { background: var(--accent);    color: var(--accent-fg); }
.badge--beta { background: var(--oosh-teal); color: var(--oosh-ice); }
.badge--wip  { background: var(--oosh-teal); color: var(--oosh-ice); }
.badge--soon { background: var(--bg-sunk);   color: var(--fg-muted); }

/* ==========================================================================
   Card — the generic surface. Tiles, panels, modals all descend from this.
   ========================================================================== */
.card {
  background: var(--bg-panel);
  border: var(--bw) solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.15rem;
}
.card--sunk   { background: var(--bg-sunk); box-shadow: none; }
.card--invert { background: var(--oosh-ink); color: var(--fg-invert); }

/* ==========================================================================
   Form controls
   ========================================================================== */
.field { display: block; margin-bottom: 1rem; }
.field > .label { display: block; margin-bottom: 0.4rem; }

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--fg);
  background: var(--bg-panel);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow var(--snap) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-60); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  box-shadow: var(--shadow-sm);
}
.select {
  appearance: none;
  /* Chevron drawn as a token-coloured SVG so it tracks the palette */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2316232A' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px;
  padding-right: 2.4rem;
}

/* Selectable option card — the "Card / Wallet / Cash" pattern */
.option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem;
  background: var(--bg-panel);
  border: var(--bw) solid var(--line);
  cursor: pointer;
}
.option[aria-checked="true"],
.option:has(input:checked) {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Stat block — big number, unit chip. For scores, totals, results.
   ========================================================================== */
.stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1.15rem;
  background: var(--accent);
  color: var(--accent-fg);
  border: var(--bw) solid var(--line);
}
.stat__value {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 80, 'wght' 700;
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
}
.stat__unit {
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;          /* the one deliberate circle in the system */
  background: var(--oosh-ink);
  color: var(--oosh-ice);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 700;
}

/* ==========================================================================
   Decorative square cluster — the recurring corner motif
   ========================================================================== */
.squares {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 42px;
  flex: none;
}
.squares i { aspect-ratio: 1; display: block; }
.squares i:nth-child(1) { background: var(--oosh-ink); }
.squares i:nth-child(2) { background: transparent; }
.squares i:nth-child(3) { background: transparent; }
.squares i:nth-child(4) { background: var(--accent); }

/* ==========================================================================
   Focus — thick, offset, unmissable
   ========================================================================== */
:focus-visible {
  outline: 3px solid var(--oosh-orange);
  outline-offset: 3px;
}

/* ==========================================================================
   Utility
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--content-w);
  margin-inline: auto;
  padding-left:  calc(var(--gutter) + var(--safe-l));
  padding-right: calc(var(--gutter) + var(--safe-r));
}
.rule { border: 0; border-top: var(--bw-heavy) solid var(--line); margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
