/* ---------- Tokens de tema ---------- */
:root {
  --bg: #0e1116;
  --card: #151a21;
  --line: #263040;
  --chip: #3a4552;
  --text: #e6edf3;
  --muted: #9aa7b4;
  --body: #b4bfcb;
  --accent: #5eead4;
  --onaccent: #0e1116;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gap: clamp(48px, 8vw, 72px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f6f8fa;
    --card: #ffffff;
    --line: #d0d7de;
    --chip: #b8c1cb;
    --text: #1f2328;
    --muted: #57606a;
    --body: #424a53;
    --accent: #0f766e;
    --onaccent: #ffffff;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f6f8fa;
  --card: #ffffff;
  --line: #d0d7de;
  --chip: #b8c1cb;
  --text: #1f2328;
  --muted: #57606a;
  --body: #424a53;
  --accent: #0f766e;
  --onaccent: #ffffff;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --card: #151a21;
  --line: #263040;
  --chip: #3a4552;
  --text: #e6edf3;
  --muted: #9aa7b4;
  --body: #b4bfcb;
  --accent: #5eead4;
  --onaccent: #0e1116;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-wrap: break-word;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { opacity: 0.8; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  background: var(--accent); color: var(--onaccent);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.page {
  width: 100%; max-width: 1360px; margin: 0 auto;
  padding: clamp(12px, 3vw, 24px) clamp(16px, 5vw, 80px) clamp(56px, 8vw, 80px);
  display: flex; flex-direction: column; gap: var(--gap);
}
main { display: flex; flex-direction: column; gap: var(--gap); }
section { display: flex; flex-direction: column; gap: 24px; }

.section-title {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(18px, 3vw, 22px); color: var(--accent);
}

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding: 8px clamp(16px, 3vw, 24px);
  background: var(--card); border: 1px solid var(--line); border-radius: 28px;
}
.brand { font-weight: 600; font-size: 17px; color: var(--text); text-decoration: none; }
.sitenav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px;
  font-family: var(--mono); font-size: 14px;
}
.navlink {
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.navlink--muted { color: var(--muted); }

.theme-switch {
  display: none; gap: 2px; padding: 2px;
  border: 1px solid var(--line); border-radius: 999px;
}
.js .theme-switch { display: flex; }
.tbtn {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  font: 500 13px var(--mono); cursor: pointer;
}
.tbtn[aria-pressed="true"] { background: var(--accent); color: var(--onaccent); }

.menubtn {
  display: none; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text);
  font: 500 14px var(--mono); cursor: pointer;
}

@media (max-width: 720px) {
  .js .menubtn { display: inline-flex; }
  .sitenav {
    width: 100%; flex-direction: column; align-items: stretch;
    gap: 0; padding: 8px 0 12px; border-top: 1px solid var(--line);
  }
  .js .sitenav { display: none; }
  .js .sitenav.open { display: flex; }
  .sitenav .navlink { min-height: 48px; padding: 0 4px; }
  .theme-switch { align-self: flex-start; margin-top: 8px; }
}

/* ---------- Hero ---------- */
.hero {
  align-items: center; text-align: center;
  gap: clamp(20px, 3vw, 28px); padding-top: clamp(8px, 3vw, 32px);
}
.avatar {
  width: clamp(112px, 18vw, 152px); height: clamp(112px, 18vw, 152px);
  border-radius: 50%; object-fit: cover; object-position: 50% 30%;
  border: 3px solid var(--accent);
}
.eyebrow {
  font-family: var(--mono); font-size: clamp(13px, 2.4vw, 15px);
  color: var(--accent); font-weight: 600;
}
.hero h1 {
  width: 100%; font-size: clamp(34px, 8vw, 84px); line-height: 1.05;
  font-weight: 700; letter-spacing: -0.03em;
}
.lead {
  width: 100%; max-width: 760px; color: var(--muted);
  font-size: clamp(17px, 3.4vw, 22px); line-height: 1.5;
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 30px; border-radius: 999px;
  font-weight: 500; text-decoration: none;
}
.btn--primary { background: var(--accent); color: var(--onaccent); font-weight: 600; }
.btn--primary:hover { color: var(--onaccent); }
.btn--ghost { background: var(--card); border: 1px solid var(--chip); color: var(--text); }
.btn--ghost:hover { color: var(--text); }

.chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: 8px; font-family: var(--mono); font-size: 13px; list-style: none; padding: 0;
}
.chips--left { justify-content: flex-start; gap: 8px; font-size: 12px; margin-top: 0; }
.chip {
  padding: 6px 12px; border: 1px solid var(--chip); border-radius: 999px; color: var(--muted);
}
.chips--left .chip { padding: 4px 10px; }
.chip--accent { border-color: var(--accent); color: var(--accent); }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid--thirds { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: clamp(20px, 4vw, 28px); display: flex; flex-direction: column; gap: 10px;
}
.card h3 { font-size: clamp(18px, 3vw, 20px); font-weight: 600; line-height: 1.3; }
.grid--wide .card { gap: 12px; }
.grid--wide .card h3 { font-size: clamp(18px, 3vw, 22px); }
.card p { color: var(--body); line-height: 1.6; }
.card .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.card .tag { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.card .ai-note .tag { margin-right: 4px; }

.stat-value { font-size: clamp(34px, 6vw, 48px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 16px; }

/* ---------- Contacto ---------- */
.contact {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
  padding: clamp(36px, 7vw, 56px) clamp(16px, 4vw, 32px);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.contact h2 { font-size: clamp(30px, 6vw, 44px); font-weight: 700; letter-spacing: -0.02em; }
.contact-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px;
  font-family: var(--mono); font-size: 16px;
}
.contact-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Botones flotantes ---------- */
.fabs {
  position: fixed; right: clamp(12px, 3vw, 24px); bottom: clamp(12px, 3vw, 24px);
  display: flex; gap: 12px; z-index: 50;
  opacity: 1; visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
:root[data-at-contact] .fabs { opacity: 0; visibility: hidden; pointer-events: none; }
.fab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.fab:hover { color: var(--accent); border-color: var(--accent); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fabs { transition: none; }
}
