/* ===== BASE STYLES — GlacierPhonk™ ===== */
/* Shared across all pages: reset, tokens, background, nav, footer */

:root {
  --black: #0A0E17;
  --black-light: #0f1420;
  --cyan: #00D4FF;
  --purple: #7B2FBE;
  --frost: #E0F7FA;
  --frost-muted: #E0F7FAaa;
  --frost-subtle: #E0F7FA88;
  --frost-dim: #E0F7FA44;
  --gradient: linear-gradient(135deg, var(--cyan), var(--purple));
  --border-subtle: rgba(224,247,250,0.06);
  --border-faint: rgba(224,247,250,0.04);
  --nav-height: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 44px); }

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  padding: 8px 16px;
  background: var(--cyan);
  color: var(--black);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
}
.skip-link:focus { top: 0; }

/* ===== FOCUS STYLES ===== */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.nav-mark:focus-visible { outline-offset: 4px; }

body {
  background: var(--black);
  color: var(--frost);
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--cyan);
  color: var(--black);
}

/* ===== NOISE OVERLAY ===== */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 150;
}

/* ===== GRID BACKGROUND ===== */
.grid-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(var(--frost-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--frost-dim) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

/* ===== GLOW ===== */
.glow-cyan {
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,212,255,0.15) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.glow-purple {
  position: fixed;
  bottom: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(123,47,190,0.12) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10,14,23,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-faint);
}
.nav-mark {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: var(--frost-muted);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease-out;
}
.nav-links a:hover { color: var(--cyan); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--cyan); }

/* ===== SECTION COMMON ===== */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 24px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
  border: none;
}
.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--frost);
  border: 1px solid var(--frost-dim);
}
.btn-ghost:hover {
  border-color: var(--purple);
  color: var(--purple);
  box-shadow: 0 0 20px rgba(123, 47, 190, 0.2);
}

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-faint);
}
footer pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--frost-subtle);
  letter-spacing: 1px;
  margin-bottom: 16px;
  line-height: 1.4;
}
footer p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--frost-subtle);
  letter-spacing: 1px;
}
footer .tm { color: var(--frost-muted); }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 1px;
}
.footer-links a {
  padding: 4px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
footer a {
  color: var(--frost-subtle);
  text-decoration: none;
  transition: color 0.2s;
}
footer a:hover { color: var(--cyan); }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== RESPONSIVE BASE ===== */
@media (max-width: 768px) {
  .nav-links { gap: 16px; }
}
@media (max-width: 640px) {
  nav { padding: 12px 16px; }
  .nav-links { gap: 8px; }
  .nav-links a {
    font-size: 0.6rem;
    padding: 8px 6px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
@media (max-width: 360px) {
  .nav-links { gap: 4px; }
  .nav-links a { font-size: 0.55rem; padding: 8px 4px; }
  .nav-mark { font-size: 0.75rem; }
}
