/* =========================================================
   1. COLORES Y FUENTES
   Cambia aquí los valores y se actualiza toda la página.
   ========================================================= */
:root {
  --bg: #d5e0ff;          /* fondo de la página */
  --surface: #b5c8fe;     /* fondo de las tarjetas */
  --ink: #202127;         /* color del texto */
  --muted: #5a6082;       /* texto secundario */
  --line: #4b4b4b;        /* bordes */
  --accent: #6f4ffd;      /* color principal (botones, enlaces) */
  --accent-ink: #ffffff;  /* texto sobre el color principal */

  --font-title: 'Bricolage Grotesque', Georgia, sans-serif;
  --font-body: 'DM Sans', Arial, sans-serif;
}

/* Tema oscuro: el JavaScript pone data-theme="dark" en <html> */
[data-theme="dark"] {
  --bg: #0f1226;
  --surface: #181c3a;
  --ink: #eceffd;
  --muted: #a2a9d0;
  --line: #2a2f5a;
  --accent: #9d87ff;
  --accent-ink: #0f1226;
}

/* =========================================================
   2. BASE
   ========================================================= */
* { box-sizing: border-box; }

html { scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--font-title);
  line-height: 1.15;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.3rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; max-width: 65ch; }

a { color: inherit; }

/* Contenedor que centra el contenido y limita el ancho */
.container {
  width: min(100% - 2.5rem, 960px);
  margin-inline: auto;
}

/* Borde visible al navegar con teclado */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* =========================================================
   3. BARRA SUPERIOR
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
}

/* En celular, el menú está oculto hasta que se abre */
.nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  padding: 0.5rem 1.25rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav.abierto { display: flex; }
.nav a {
  padding: 0.6rem 0;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}
.nav a:hover { color: var(--accent); }

.topbar-actions { display: flex; gap: 0.5rem; }

.icon-btn {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* En pantallas grandes, el menú se ve en línea */
@media (min-width: 720px) {
  .menu-btn { display: none; }
  .nav {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 1.5rem;
    padding: 0;
    border: 0;
    background: none;
  }
  .nav a { padding: 0; }
}

/* =========================================================
   4. PORTADA
   ========================================================= */
.hero { padding: 5rem 0 4rem; }
.lead { font-size: 1.25rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Botones */
.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--accent);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.88; }
.btn-ghost { color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-ink); }

/* =========================================================
   5. SECCIONES
   ========================================================= */
.section { padding: 3.5rem 0; border-top: 1px solid var(--line); }

/* Sobre mí */
.about { display: grid; gap: 2rem; }
@media (min-width: 720px) {
  .about { grid-template-columns: 1.6fr 1fr; }
}
.facts { margin: 0; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0 0 0.9rem; color: var(--muted); }
.facts dd:last-child { margin-bottom: 0; }

/* Habilidades */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chips li {
  padding: 0.4rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 500;
}

/* Proyectos */
.projects { display: grid; gap: 1.25rem; }
@media (min-width: 720px) {
  .projects { grid-template-columns: repeat(3, 1fr); }
}
.project {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.project:hover { border-color: var(--tone); }

/* Cada proyecto toma su color de --tone (definido en el HTML) */
.project-cover {
  display: grid;
  place-items: center;
  height: 140px;
  background: var(--tone);
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 800;
}
.project-body { padding: 1.25rem; }
.project-body p { color: var(--muted); font-size: 0.97rem; }

/* Enlaces de texto */
.link { color: var(--accent); font-weight: 700; }
.social { display: flex; gap: 1.25rem; margin-top: 1.5rem; }

/* =========================================================
   6. PIE DE PÁGINA
   ========================================================= */
.footer { padding: 2rem 0 3rem; color: var(--muted); border-top: 1px solid var(--line); }
.footer p { margin: 0; }
.project-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* Botones */
.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font: inherit;          /* hace que el botón use la misma letra que el resto */
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--accent);
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-ink); }

/* Los botones de contacto, uno al lado del otro y del mismo ancho */
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.contact-actions .btn { min-width: 13rem; text-align: center; }
.btn-discord { border-color: #5865f2; color: #5865f2; }
.btn-discord:hover { background: #5865f2; color: #ffffff; }