/* ==========================================================================
   KADE — Design tokens, reset, base typography, shared primitives
   Industrial / athletic direction: condensed display type, monospace spec
   labels, safety-orange accent. LIGHT (bone paper) is the default.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Theming
   `--paper` = page surface   ·  `--ink` = page foreground
   `--flip-*`= the inverted block (.access), which stays a contrast flip
               in BOTH themes.
   -------------------------------------------------------------------------- */

:root {
  /* LIGHT (default) — bone paper, near-black type, safety orange */
  color-scheme: light;

  --paper:      #EDE9E1;
  --paper-2:    #E4DFD5;
  --paper-3:    #D9D3C7;

  --ink:        #0B0B0C;
  --ink-70:     rgba(11, 11, 12, 0.68);
  --ink-45:     rgba(11, 11, 12, 0.48);
  --ink-25:     rgba(11, 11, 12, 0.24);
  --ink-12:     rgba(11, 11, 12, 0.12);

  --signal:     #FF3B00;
  --signal-soft: rgba(255, 59, 0, 0.12);
  --line:       rgba(11, 11, 12, 0.14);

  --paper-blur: rgba(237, 233, 225, 0.88);
  --on-signal:  #FFFFFF;
  --glow:       rgba(255, 59, 0, 0.10);

  --plate-a:    #E0DACE;
  --plate-b:    #CFC7B8;

  /* Monochrome product photography.
     Pulls mixed-source, mixed-lighting shots into one coherent look until the
     final shoot lands. Set to `none` to show the photos in full colour —
     that single change is the whole switch. */
  --photo-filter: grayscale(1) contrast(1.08) brightness(1.02);

  /* Inverted block — ink surface, paper type */
  --flip-fg-70: rgba(237, 233, 225, 0.70);
  --flip-fg-50: rgba(237, 233, 225, 0.50);
  --flip-fg-45: rgba(237, 233, 225, 0.45);
  --flip-fg-30: rgba(237, 233, 225, 0.30);
  --flip-line:        rgba(237, 233, 225, 0.18);
  --flip-line-strong: rgba(237, 233, 225, 0.30);

  /* Type */
  --display: "Big Shoulders Display", "Arial Narrow", Haettenschweiler, sans-serif;
  --body:    "Archivo", "Helvetica Neue", Helvetica, sans-serif;
  --mono:    "IBM Plex Mono", SFMono-Regular, Menlo, monospace;

  /* Space */
  --gutter:  clamp(1.25rem, 4vw, 4rem);
  --section: clamp(5.5rem, 13vh, 11rem);
  --maxw:    1600px;

  /* Motion */
  --ease:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Layout */
  --announce-h: 38px;
  --header-h:   66px;
}

/* DARK — the original near-black surface. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --paper:      #0B0B0C;
  --paper-2:    #121214;
  --paper-3:    #1A1A1C;

  --ink:        #EDE9E1;
  --ink-70:     rgba(237, 233, 225, 0.70);
  --ink-45:     rgba(237, 233, 225, 0.46);
  --ink-25:     rgba(237, 233, 225, 0.24);
  --ink-12:     rgba(237, 233, 225, 0.12);

  --signal:     #FF4A14;
  --signal-soft: rgba(255, 74, 20, 0.16);
  --line:       rgba(237, 233, 225, 0.13);

  --paper-blur: rgba(11, 11, 12, 0.86);
  --on-signal:  #FFFFFF;
  --glow:       rgba(255, 74, 20, 0.14);

  --plate-a:    #24211E;
  --plate-b:    #16130F;

  /* Grayscale reads muddy on a dark surface — lift it slightly. */
  --photo-filter: grayscale(1) contrast(1.04) brightness(1.12);

  /* Inverted block — paper surface, ink type */
  --flip-fg-70: rgba(11, 11, 12, 0.70);
  --flip-fg-50: rgba(11, 11, 12, 0.50);
  --flip-fg-45: rgba(11, 11, 12, 0.45);
  --flip-fg-30: rgba(11, 11, 12, 0.30);
  --flip-line:        rgba(11, 11, 12, 0.14);
  --flip-line-strong: rgba(11, 11, 12, 0.25);
}

/* --------------------------------------------------------------- Reset -- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--announce-h) + var(--header-h));
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease);
}

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }

::selection { background: var(--signal); color: var(--on-signal); }

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

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--signal);
  color: var(--on-signal);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(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;
}

/* ----------------------------------------------------------- Typography -- */

.h-display {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.5rem, 7vw, 7rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.h-display em { font-style: normal; color: var(--signal); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-45);
  white-space: nowrap;
}
.tag--signal { color: var(--signal); }
.tag--live i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s var(--ease-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.7); }
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.section-head--flip { border-bottom-color: var(--flip-line); }
.section-head--flip .tag { color: var(--flip-fg-50); }

/* -------------------------------------------------------------- Buttons -- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  padding: 1.05em 2em;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn svg { width: 1em; height: 1em; transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease);
}
.btn:hover::before { transform: scaleX(1); }

.btn--solid { background: var(--signal); color: var(--on-signal); }
.btn--solid::before { background: var(--ink); }
.btn--solid:hover { color: var(--paper); }

.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink::before { background: var(--signal); }
.btn--ink:hover { color: var(--on-signal); }

.btn--line { border-color: var(--ink-25); color: var(--ink); }
.btn--line::before { background: var(--ink); }
.btn--line:hover { color: var(--paper); border-color: var(--ink); }

.btn--sm { padding: 0.7em 1.2em; font-size: 0.68rem; }
.btn--block { width: 100%; }

/* ------------------------------------------------------------- Overlays -- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Blueprint hairlines */
.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--gutter);
  pointer-events: none;
}
.grid-lines i { border-right: 1px solid var(--ink-12); opacity: 0.6; }
.grid-lines i:last-child { border-right: 0; }

/* Scroll progress */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 130;
  pointer-events: none;
}
.progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--signal);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

/* -------------------------------------------------------------- Reveals -- */

html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s var(--ease) var(--d, 0ms),
    transform 0.9s var(--ease) var(--d, 0ms);
  will-change: opacity, transform;
}
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------- Reduced motion -- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}
