/* CS Signal OS — shared theme: design tokens, base styles, nav, typography,
   buttons, reveal animation, and load-bearing iOS Safari mobile overrides.
   Page-specific styles stay inline in each HTML file. */

:root {
  --bg: #080a0f;
  --bg2: #0d1018;
  --bg3: #111520;
  --bg4: #161b28;
  --surface: rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text: #e8ecf2;
  --text2: #8a92a6;
  --text3: #5a6175;
  --accent: #3b6ef0;
  --accent2: #2952d4;
  --accent-glow: rgba(59,110,240,0.15);
  --teal: #0ea5a0;
  --teal-glow: rgba(14,165,160,0.12);
  --signal: #f0a030;
  --signal-glow: rgba(240,160,48,0.12);
  --danger: #e05050;
  --green: #22c55e;
  --mono: 'DM Mono', monospace;
  --serif: 'Instrument Serif', serif;
  --sans: 'Geist', system-ui, sans-serif;
  --nav-h: 64px;
  --max: 1200px;
  --r: 12px;
}

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

html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}
nav.scrolled {
  background: rgba(8,10,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--border);
}
.nav-inner {
  max-width: var(--max); width: 100%; margin: auto;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.logo-mark {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.nav-links {
  display: flex; align-items: center; gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
}
.nav-cta:hover { background: var(--accent2); transform: translateY(-1px); }

.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text2); border-radius: 2px;
  transition: 0.3s;
}

/* ── MOBILE NAV DRAWER ── */
.mobile-nav {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: rgba(8,10,15,0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 24px 32px;
  z-index: 99;
  flex-direction: column; gap: 20px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  color: var(--text2); text-decoration: none;
  font-size: 15px; padding: 4px 0;
}

/* ── LAYOUT ── */
section { padding: 100px 32px; }
.container { max-width: var(--max); margin: auto; }

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.label::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--accent);
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-weight: 500; }

h1 {
  font-size: clamp(38px, 5.5vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
h3 {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.serif-em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text2);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer; border: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(59,110,240,0.3); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.25); background: var(--surface); }

/* ── DECORATIVE GRID BG ── */
.grid-bg {
  position: relative;
  overflow: hidden;
}
.grid-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ── SCROLL REVEALS ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: transform, opacity;
}
.reveal.visible { will-change: auto; }
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── RESPONSIVE: shared nav behavior ── */
@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 600px) {
  section { padding: 72px 20px; }
  nav { padding: 0 20px; }
}

/* ══════════════════════════════════════
   iOS Safari mobile overrides (load-bearing).
   iOS Safari drops paint on long pages with many composited layers;
   the rules below disable the heaviest layer sources on mobile.
   Do not undo without testing on a real iPhone.
══════════════════════════════════════ */
@media (max-width: 900px) {
  .reveal, .reveal.visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }
  .grid-bg::before { display: none; }
  nav.scrolled {
    background: rgba(8,10,15,0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .mobile-nav {
    background: rgba(8,10,15,0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; will-change: auto; }
}

/* iOS leaves :hover applied after a tap; kill lift/shift on touch devices. */
@media (hover: none) {
  .nav-cta:hover,
  .btn-primary:hover { transform: none; box-shadow: none; }
}
