/* base.css — design tokens, reset, shared primitives (kbd, skip link, grain).
   Load first; every other css file may assume these. */

:root {
  --void: #08090c;
  --shell: #0b0d11;
  --panel-top: rgba(26, 30, 38, 0.92);
  --panel-bottom: rgba(15, 18, 23, 0.95);
  --panel-edge: rgba(160, 178, 210, 0.16);
  --line: rgba(160, 178, 210, 0.11);
  --line-2: rgba(160, 178, 210, 0.24);
  --text: #edeee9;
  --text-2: rgba(237, 238, 233, 0.66);
  --text-3: rgba(237, 238, 233, 0.42);
  --red: #e03a2c;
  --red-deep: #b1271c;
  --red-ink: #ff6a55;
  --red-soft: rgba(224, 58, 44, 0.16);
  --green: #46d17c;
  --glass-shadow: 0 30px 70px rgba(2, 3, 6, 0.55), 0 6px 20px rgba(2, 3, 6, 0.4);
  --glass-highlight: inset 0 1px 0 rgba(233, 240, 255, 0.07);
  --global-height: clamp(2.8rem, 5.4vh, 3.5rem);
  --section-height: clamp(2.8rem, 5.4vh, 3.5rem);
  --control-height: clamp(2.4rem, 4.6vh, 3rem);
  --edge: clamp(1.15rem, 3vw, 3.4rem);
  --display: "Barlow Condensed", "Arial Narrow", "Archivo", sans-serif;
  --body: "Archivo", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--void);
  color: var(--text);
  font-synthesis: none;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--red);
  color: #fff;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  background: none;
}

a {
  text-decoration: none;
}

button:not(:disabled),
a[href] {
  cursor: pointer;
  touch-action: manipulation;
}

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

kbd {
  display: inline-grid;
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0 0.25rem;
  place-items: center;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font: 500 0.72rem/1 var(--mono);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 178, 210, 0.25) transparent;
}

.skip-link {
  position: fixed;
  z-index: 300;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--text);
  color: var(--void);
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(-180%);
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

@media (max-width: 800px) {
  :root {
    --section-height: 3.5rem;
    --control-height: 3rem;
    --edge: 1.15rem;
  }
}

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