/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  padding-top: var(--header-h);
}

h1, h2, h3, .font-display {
  font-family: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

:root {
  --bg: #ececea;
  --fg: #141414;
  --muted: #6b6b6b;
  --border: #dcdcd9;
  --chip-bg: #ffffff;
  --chip-fg: #333;
  --chip-active-bg: #141414;
  --chip-active-fg: #ececea;
  --header-bg: rgba(236, 236, 234, 0.9);
  --placeholder-bg: #e2e2df;
  --text-body: #333;
  --accent: #3f6b4f;
  --accent-soft: #7fa687;
  --accent-fg: #fafafa;
  --header-h: 84px;
  --gutter: 22px;
  --max-width: 1800px;
}

/* Tema oscuro: sigue el sistema operativo por defecto (prefers-color-scheme),
   pero el toggle manual (data-theme en <html>, ver js/theme.js) siempre gana. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --fg: #f2f2f0;
    --muted: #9a9a94;
    --border: #2a2a2e;
    --chip-bg: #1e1e22;
    --chip-fg: #d8d8d4;
    --chip-active-bg: #f2f2f0;
    --chip-active-fg: #121212;
    --header-bg: rgba(18, 18, 18, 0.85);
    --placeholder-bg: #232326;
    --text-body: #cfcfca;
    --accent: #6fa77e;
    --accent-soft: #8fc19c;
    --accent-fg: #0d1a12;
  }
}
:root[data-theme="dark"] {
  --bg: #121212;
  --fg: #f2f2f0;
  --muted: #9a9a94;
  --border: #2a2a2e;
  --chip-bg: #1e1e22;
  --chip-fg: #d8d8d4;
  --chip-active-bg: #f2f2f0;
  --chip-active-fg: #121212;
  --header-bg: rgba(18, 18, 18, 0.85);
  --placeholder-bg: #232326;
  --text-body: #cfcfca;
  --accent: #6fa77e;
  --accent-soft: #8fc19c;
  --accent-fg: #0d1a12;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }

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

/* ---------- Header: 3 zonas ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 600; letter-spacing: 0.3px; }
.brand-location { font-size: 11px; color: var(--muted); }

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}
.site-nav ul { display: flex; gap: clamp(16px, 2.6vw, 32px); } /* 4 links: más juntos en pantallas medianas */
.site-nav a {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.socials {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}
.socials a {
  width: 19px; height: 19px;
  display: flex;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.socials a:hover { opacity: 1; }
.socials img { width: 100%; height: 100%; }

/* Toggle de tema claro/oscuro — pensado para restylear fácil más adelante:
   un solo botón, dos SVG superpuestos, CSS decide cuál mostrar según data-theme. */
.theme-toggle {
  width: 19px; height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { opacity: 1; color: var(--fg); }
.theme-toggle svg { width: 100%; height: 100%; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* Hamburger — solo visible en mobile, sin JS */
.nav-toggle { display: none; }
.hamburger {
  display: none;
  width: 24px; height: 18px;
  position: relative;
  cursor: pointer;
}
.hamburger span,
.hamburger span::before,
.hamburger span::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--fg);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger span { top: 8px; }
.hamburger span::before { top: -8px; }
.hamburger span::after { top: 8px; }

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 20px 28px 28px;
}
.mobile-panel ul { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.mobile-panel a { font-size: 15px; text-transform: uppercase; letter-spacing: 0.6px; }
.mobile-panel .socials { justify-content: flex-start; }

@media (max-width: 768px) {
  .site-nav, .wrap > .socials { display: none; }
  /* El botón va en el HTML después de la fila del encabezado, así que caía debajo de ella, a la izquierda.
     Se fija dentro del encabezado, a la derecha y centrado en alto, con un área de toque más cómoda. (22-nov-2026) */
  .hamburger { display: block; position: absolute; right: 26px; top: calc(var(--header-h) / 2 - 9px); }
  .hamburger::after { content: ""; position: absolute; inset: -14px; }
  .nav-toggle:checked ~ .mobile-panel { display: block; }
  .nav-toggle:checked ~ .hamburger span { transform: rotate(45deg); }
  .nav-toggle:checked ~ .hamburger span::before { opacity: 0; }
  .nav-toggle:checked ~ .hamburger span::after { transform: rotate(-90deg); top: 0; }
}

.empty-state {
  padding: 80px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 28px 64px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* Imágenes con transparencia (las .webp: el editor solo guarda en WebP las
   que traen alfa). Ni la imagen ni su marco llevan fondo gris: por el alfa
   se ve exactamente el fondo de la página, en tema claro y oscuro. */
img[src$=".webp"] { background-color: transparent !important; }
:has(> img[src$=".webp"]) { background-color: transparent !important; }
