/* Reset and base. Tokens come from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--t-base);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; display: block; }
img, svg, canvas, video { max-width: 100%; }
img, svg { display: block; }
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.15;
  margin: 0 0 var(--s-4);
}
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); font-weight: 600; }
h4 { font-size: var(--t-base); font-weight: 600; }
p { margin: 0 0 var(--s-4); }
a { color: var(--c-signal); text-underline-offset: 3px; }
a:hover { color: var(--c-text); }
code, kbd, samp, pre { font-family: var(--f-mono); font-size: .95em; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-5) 0; }
::selection { background: var(--c-signal); color: var(--c-signal-ink); }

.container {
  width: 100%;
  max-width: var(--w-content);
  margin-inline: auto;
  padding-inline: var(--s-4);
}
@media (min-width: 640px) { .container { padding-inline: var(--s-5); } }

/* Focus ring */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--s-3);
  top: -100px;
  z-index: 1000;
  padding: var(--s-2) var(--s-4);
  background: var(--c-signal);
  color: var(--c-signal-ink);
  font-weight: 600;
  border-radius: var(--r-2);
  text-decoration: none;
}
.skip-link:focus { top: var(--s-3); }

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

/* Site header and footer (shared, identical on every page) */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 7, 13, .78);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--c-line);
  box-shadow: 0 1px 0 rgba(59, 227, 255, .08), 0 10px 30px rgba(0, 0, 0, .4);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--c-signal) 50%, transparent); opacity: .45;
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--s-5);
  padding-block: var(--s-1);
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--c-text);
  text-decoration: none;
}
.brand img { height: 30px; width: auto; }
.brand:hover img { filter: drop-shadow(0 0 8px rgba(59, 227, 255, .6)); }
.site-nav { flex: 1 1 100%; }
.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-1);
}
.site-nav a:not(.c-btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 2px;
  color: var(--c-text-muted);
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.site-nav a:not(.c-btn):hover { color: var(--c-text); border-bottom-color: var(--c-signal); }
.site-nav a.c-btn { min-height: 44px; padding: var(--s-1) var(--s-3); font-size: .75rem; white-space: nowrap; }
@media (min-width: 640px) {
  .brand img { height: 34px; }
  .site-nav { flex: 0 1 auto; }
  .site-nav ul { gap: var(--s-1) var(--s-5); }
  .site-nav a:not(.c-btn) { font-size: var(--t-sm); padding-inline: 0; }
  .site-nav a.c-btn { padding: var(--s-2) var(--s-5); font-size: var(--t-sm); }
}

.site-footer {
  margin-top: var(--s-8);
  border-top: 1px solid var(--c-line);
  background: var(--c-bg-2);
  color: var(--c-text-muted);
  font-size: var(--t-sm);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
  padding-block: var(--s-6);
}
.site-footer p { margin: 0 0 var(--s-2); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.site-footer a { color: var(--c-text); display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { color: var(--c-signal); }
.site-footer__credits a { min-height: 0; color: var(--c-signal); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print base */
@media print {
  body { background: #fff; color: #000; display: block; }
  .skip-link, .site-header, .site-footer { display: none !important; }
  a { color: inherit; }
}
