/* ===========================================================
   lo programamos — design tokens + base
   =========================================================== */

:root {
  /* Palette — dark developer */
  --bg: #0a0a0c;
  --bg-elevated: #111114;
  --bg-subtle: #16161a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --fg: #ededef;
  --fg-muted: #a1a1aa;
  --fg-dim: #6b6b75;

  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --accent-glow: rgba(167, 139, 250, 0.35);
  --accent-2: #f0abfc;

  --success: #4ade80;

  /* Type */
  --font-display: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-serif: 'Instrument Serif', ui-serif, Georgia, serif;

  /* Spacing */
  --pad-section: clamp(80px, 9vw, 160px);
  --pad-x: clamp(20px, 4vw, 64px);
  --container: 1320px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--bg); }

/* Custom cursor */
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  mix-blend-mode: difference;
}
#cursor.hover {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-color: var(--accent);
}
@media (hover: none), (max-width: 900px) {
  #cursor { display: none; }
}

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  position: relative;
  z-index: 2;
}

section {
  padding-top: var(--pad-section);
  padding-bottom: var(--pad-section);
  position: relative;
}

/* Section labels — small mono */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Section heading */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 72px;
  max-width: 900px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}
.section-head h2 em {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
}
.section-head p {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--fg-muted);
  max-width: 620px;
  margin: 0;
  text-wrap: pretty;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Utility */
.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-muted); }
.dim { color: var(--fg-dim); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* Divider */
.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Density variants */
body[data-density="compact"] { --pad-section: clamp(60px, 7vw, 110px); }
body[data-density="roomy"] { --pad-section: clamp(110px, 12vw, 220px); }

/* Theme variants */
body[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-elevated: #ffffff;
  --bg-subtle: #ebe8e1;
  --line: rgba(10, 10, 10, 0.08);
  --line-strong: rgba(10, 10, 10, 0.16);
  --fg: #1a1a1a;
  --fg-muted: #5b5b5f;
  --fg-dim: #8a8a8f;
}
body[data-theme="light"] body::before { opacity: 0.3; }

/* Accent variants */
body[data-accent="violet"] { --accent: #a78bfa; --accent-soft: rgba(167,139,250,0.14); --accent-glow: rgba(167,139,250,0.35); --accent-2: #f0abfc; }
body[data-accent="green"]  { --accent: #4ade80; --accent-soft: rgba(74,222,128,0.14); --accent-glow: rgba(74,222,128,0.35); --accent-2: #a7f3d0; }
body[data-accent="orange"] { --accent: #fb923c; --accent-soft: rgba(251,146,60,0.14); --accent-glow: rgba(251,146,60,0.35); --accent-2: #fed7aa; }
body[data-accent="cyan"]   { --accent: #22d3ee; --accent-soft: rgba(34,211,238,0.14); --accent-glow: rgba(34,211,238,0.35); --accent-2: #a5f3fc; }

/* Responsive */
@media (max-width: 900px) {
  :root { --pad-section: 80px; }
}
