/* ============ 2R Technology — Design System ============ */
:root {
  --bg: #0a0e17;
  --bg-1: #0f172a;
  --bg-2: #131b2e;
  --surface: #161f36;
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --fg: #e6edf7;
  --fg-dim: #8a96ad;
  --fg-mute: #5b677d;
  --accent: #60a5fa;
  --accent-2: #3b82f6;
  --accent-glow: rgba(96,165,250,0.35);
  --danger: #f87171;
  --ok: #4ade80;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --max: 1280px;
}

[data-theme="light"] {
  --bg: #f6f5f1;
  --bg-1: #efede7;
  --bg-2: #e7e4dc;
  --surface: #ffffff;
  --line: rgba(10,14,23,0.08);
  --line-2: rgba(10,14,23,0.16);
  --fg: #0a0e17;
  --fg-dim: #4a5468;
  --fg-mute: #8a96ad;
  --accent-glow: rgba(59,130,246,0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}
@media (max-width: 820px) { body { cursor: auto; } }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ============ Custom cursor ============ */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none;
  z-index: 9999; transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  transition: transform 0.08s linear, width 0.2s, height 0.2s;
}
.cursor-ring {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--accent);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1), width 0.25s, height 0.25s, border-color 0.2s;
}
.cursor-ring.hover {
  width: 68px; height: 68px; border-color: var(--accent);
  background: var(--accent-glow);
}
@media (max-width: 820px) { .cursor-dot, .cursor-ring { display: none; } }

/* ============ Nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 20px 0;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px 28px;
  flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em;
  text-decoration: none; color: inherit; flex-shrink: 0;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 50%, #a78bfa));
  display: grid; place-items: center;
  color: #0a0e17; font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  box-shadow: 0 0 32px var(--accent-glow);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px 28px;
  font-size: 14px;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}
.nav-links a {
  position: relative; color: var(--fg-dim); transition: color 0.2s;
  padding: 6px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
}
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent;
  color: var(--fg-dim); display: grid; place-items: center;
  transition: border-color 0.2s, color 0.2s, transform 0.3s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(20deg); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 820px) {
  .nav { padding: 14px 0; }
  .nav .container {
    row-gap: 10px;
    column-gap: 16px;
  }
  .brand { order: 1; }
  .theme-toggle { order: 2; margin-left: auto; }
  .nav-links {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    justify-content: center;
    gap: 14px 20px;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
    font-size: 13px;
  }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase; border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #0a0e17;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-glow);
}
.btn-ghost {
  background: transparent; border-color: var(--line-2); color: var(--fg);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn .arrow { transition: transform 0.25s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ============ Typography ============ */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(48px, 8vw, 112px); line-height: 0.95; }
h2 { font-size: clamp(36px, 5vw, 64px); line-height: 1.02; }
h3 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; }
p  { margin: 0; line-height: 1.6; color: var(--fg-dim); }

.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 24px; height: 1px; background: var(--accent);
}

/* ============ Sections ============ */
section { padding: 120px 0; position: relative; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 64px; }
.section-head > div { max-width: 640px; }
.section-head p { margin-top: 20px; font-size: 17px; }
@media (max-width: 820px) { .section-head { flex-direction: column; align-items: flex-start; } }

/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s cubic-bezier(.2,.8,.2,1), transform 0.8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

/* ============ Footer ============ */
footer {
  border-top: 1px solid var(--line);
  padding: 80px 0 40px;
  background: var(--bg-1);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 60px; margin-bottom: 60px; }
.footer-grid h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-mute); font-weight: 500; margin-bottom: 18px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.footer-grid a { color: var(--fg-dim); font-size: 14px; transition: color 0.2s; }
.footer-grid a:hover { color: var(--accent); }
.footer-bot { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--fg-mute); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; } }

/* ============ Tweaks panel ============ */
.tweaks-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 800;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 16px; padding: 18px; width: 260px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  font-family: var(--font-mono); font-size: 12px;
  display: none;
}
.tweaks-panel.on { display: block; }
.tweaks-panel h5 { margin: 0 0 14px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); font-weight: 500; display: flex; justify-content: space-between; }
.tweak-row { margin-bottom: 14px; }
.tweak-row > label { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 6px; }
.tweak-swatches { display: flex; gap: 8px; }
.tweak-swatches button {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent;
  background: var(--c); cursor: pointer; transition: transform 0.15s;
}
.tweak-swatches button:hover { transform: scale(1.1); }
.tweak-swatches button.active { border-color: var(--fg); }
.tweak-select, .tweak-row select {
  width: 100%; background: var(--bg-1); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px;
  font-family: var(--font-mono); font-size: 12px;
}
.tweak-toggle {
  display: flex; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.tweak-toggle button {
  flex: 1; background: transparent; color: var(--fg-dim); border: 0;
  padding: 8px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
}
.tweak-toggle button.active { background: var(--accent); color: #0a0e17; }

/* ============ Scroll bar (webkit) ============ */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============ Selection ============ */
::selection { background: var(--accent); color: #0a0e17; }
