/* ============================================
   InfraSync — Mono Edition
   Pure white + black with light/dark mode
   Plus Jakarta Sans throughout
   ============================================ */

:root {
  /* LIGHT MODE (default) */
  --bg: #ffffff;
  --bg-elev: #fafafa;
  --bg-card: #ffffff;
  --bg-muted: #f5f5f5;
  --text: #0a0a0a;
  --text-secondary: #4a4a4a;
  --text-muted: #8a8a8a;
  --text-dim: #b8b8b8;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --line-bold: rgba(0, 0, 0, 0.4);
  --hover: rgba(0, 0, 0, 0.04);
  --hover-strong: rgba(0, 0, 0, 0.08);
  --invert-bg: #0a0a0a;
  --invert-text: #fafafa;
  --grain-opacity: 0.04;
  --signal-color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elev: #131313;
  --bg-card: #0f0f0f;
  --bg-muted: #161616;
  --text: #fafafa;
  --text-secondary: #b8b8b8;
  --text-muted: #7a7a7a;
  --text-dim: #4a4a4a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-bold: rgba(255, 255, 255, 0.4);
  --hover: rgba(255, 255, 255, 0.04);
  --hover-strong: rgba(255, 255, 255, 0.08);
  --invert-bg: #ffffff;
  --invert-text: #0a0a0a;
  --grain-opacity: 0.06;
  --signal-color: rgba(255, 255, 255, 0.5);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background 0.5s ease, color 0.5s ease;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* Text selection */
::selection {
  background: var(--invert-bg);
  color: var(--invert-text);
}

/* Cursor */
h1, h2, h3, h4, h5, h6, p, span, li, .desc, .eyebrow { cursor: text; }
a, button, .btn, .nav-logo, .faq-q, [role="button"], input { cursor: pointer; }
a span, button span, .btn span, .nav-logo span, .faq-q span { cursor: inherit; }

/* ============================================
   FILM GRAIN OVERLAY (fixed, subtle)
   ============================================ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  transition: opacity 0.5s ease;
}
[data-theme="dark"] .grain { mix-blend-mode: screen; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
  font-family: inherit;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

.label-mono {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================
   LAYOUT
   ============================================ */
section {
  position: relative;
  padding: 140px 0;
}
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 18px 32px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s, padding 0.3s;
}
.nav.scrolled {
  border-bottom-color: var(--line);
  padding: 12px 32px;
}
@media (max-width: 900px) {
  .nav, .nav.scrolled { padding: 14px 20px !important; }
}
.nav-logo { justify-self: auto; }
.nav-links {
  display: flex;
  gap: 4px;
  font-size: 13px;
  margin-left: 24px;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  position: relative;
}
.nav-links a:hover { color: var(--text); background: var(--hover); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
  justify-self: start;
  line-height: 1;
}
.nav-logo .mark {
  width: 30px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.nav-logo .mark.mark-light { display: none; }
[data-theme="dark"] .nav-logo .mark.mark-dark { display: none; }
[data-theme="dark"] .nav-logo .mark.mark-light { display: block; }
.nav-logo .word {
  display: inline-flex;
  align-items: baseline;
}
.nav-logo .word .infra { font-weight: 800; color: var(--text); letter-spacing: -0.025em; }
.nav-logo .word .sync { font-weight: 300; color: var(--text); letter-spacing: -0.025em; }
.nav-logo .word .sep { display: none; }

.theme-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.3s;
  color: var(--text);
  padding: 0;
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover { border-color: var(--text); background: var(--hover); }
.theme-toggle svg {
  width: 14px;
  height: 14px;
  position: absolute;
  top: 50%;
  left: 50%;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.4s;
}
.theme-toggle .icon-moon {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 1;
}
.theme-toggle .icon-sun {
  transform: translate(-50%, -50%) rotate(-90deg);
  opacity: 0;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}
[data-theme="dark"] .theme-toggle .icon-sun {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn .arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:hover .arrow { transform: translateX(4px); }
