/* ==========================================================================
   Nextor — estilos del portafolio
   Índice:
   0. Tipografías locales
   1. Variables de diseño y colores por área
   2. Base y accesibilidad
   3. Utilidades y componentes comunes (botones, tarjetas, insignias)
   4. Encabezado y navegación
   5. Portada
   6. Secciones de la página principal
   7. Pie de página
   8. Páginas legales
   9. Animaciones y movimiento reducido
   ========================================================================== */

/* 0. Tipografías locales (SIL Open Font License 1.1, ver assets/fonts/) -- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
}

/* 1. Variables de diseño ------------------------------------------------- */
:root {
  --bg: #0b1020;
  --surface: #141c2e;
  --surface-2: #19223a;
  --border: #2b3850;
  --border-strong: #3a4a66;

  --text: #f3f5f9;
  --text-2: #b6c2d4;
  --text-3: #8c9ab0;
  --ink: #0b1020; /* texto sobre botones de color */

  --accent: #5eead4;
  --accent-hover: #8ff2e2;
  --accent-soft: rgba(94, 234, 212, 0.1);
  --accent-line: rgba(94, 234, 212, 0.35);

  /* Colores por área: cada sección los toma con .area-web / .area-sec / .area-game */
  --web: #5eead4;
  --web-surface: #141c2e;
  --sec: #00d6a0;
  --sec-surface: #0b1210;
  --sec-text: #e7f0f5;
  --game: #a78bfa;
  --game-surface: #11101a;
  --game-text: #f1eff8;
  --coral: #ff4055;

  --ok: #00d6a0;
  --wip: #f5c26b;

  --font-display: "Manrope", system-ui, sans-serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-space: clamp(72px, 10vw, 120px);
  --header-h: 68px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.area-web {
  --area: var(--web);
  --area-surface: var(--web-surface);
  --area-text: var(--text);
}

.area-sec {
  --area: var(--sec);
  --area-surface: var(--sec-surface);
  --area-text: var(--sec-text);
}

.area-game {
  --area: var(--game);
  --area-surface: var(--game-surface);
  --area-text: var(--game-text);
}

/* 2. Base y accesibilidad ------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--ink);
}

/* 3. Utilidades y componentes comunes ------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-space);
  border-top: 1px solid rgba(43, 56, 80, 0.6);
}

.section-head {
  max-width: 680px;
  margin: 0 0 clamp(40px, 6vw, 56px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

.section-title {
  font-size: clamp(1.875rem, 4.2vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.section-lead {
  margin-top: 16px;
  font-size: 1.125rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9875rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.btn svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--ink);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  border-color: var(--accent-line);
  color: var(--accent);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.card {
  position: relative;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--area-surface, var(--surface));
}

.icon-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--area, var(--accent));
}

.icon-badge svg {
  width: 22px;
  height: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-done {
  border-color: rgba(0, 214, 160, 0.45);
  background: rgba(0, 214, 160, 0.08);
  color: var(--ok);
}

.badge-wip {
  border-color: rgba(245, 194, 107, 0.4);
  color: var(--wip);
}

.badge-soon {
  color: var(--text-3);
}

.badge-pending {
  border-color: rgba(245, 194, 107, 0.45);
  background: rgba(245, 194, 107, 0.08);
  color: var(--wip);
}

.area-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--area, var(--accent)) 40%, transparent);
  border-radius: 6px;
  color: var(--area, var(--accent));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(11, 16, 32, 0.6);
  color: var(--text-2);
  font-size: 0.975rem;
}

.note svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--area, var(--text-3));
}

/* 4. Encabezado y navegación --------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(11, 16, 32, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 30px;
  height: 30px;
}

.nav-list {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  position: relative;
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.975rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-list a:hover {
  color: var(--text);
}

.nav-list a[aria-current="true"] {
  color: var(--text);
}

.nav-list a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

@media (max-width: 920px) {
  .nav-toggle {
    display: grid;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 8px var(--gutter) 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
  }

  .nav-list a {
    padding: 12px 14px;
    font-size: 1.0625rem;
  }

  .nav-list a[aria-current="true"]::after {
    left: 0;
    right: auto;
    top: 12px;
    bottom: 12px;
    width: 2px;
    height: auto;
  }

  /* Sin JavaScript el menú se muestra siempre para no bloquear la navegación. */
  .no-js .nav-toggle {
    display: none;
  }

  .no-js .site-nav {
    position: static;
    display: block;
    padding: 0 0 12px;
    border: 0;
    background: none;
  }

  .no-js .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
  }

  .no-js .site-header {
    position: static;
  }
}

/* 5. Portada ------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(48px, 8vw, 104px) clamp(48px, 7vw, 80px);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.hero-roles li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
}

.hero-roles svg {
  width: 16px;
  height: 16px;
  color: var(--area, var(--accent));
}

.hero-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 11vw, 7.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-transform: uppercase;
}

.hero-title::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 22px;
  border-radius: 2px;
  background: var(--accent);
}

.hero-tagline {
  max-width: 560px;
  margin-top: 26px;
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 500;
  line-height: 1.4;
}

.hero-tagline strong {
  color: var(--text);
  font-weight: 700;
}

.hero-text {
  max-width: 540px;
  margin-top: 12px;
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  margin: 28px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text-2);
  font-size: 0.975rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.social-link img {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.social-link:hover {
  color: var(--text);
}

.hero-media {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 380px;
}

/* Degradado turquesa tenue, solo detrás del avatar */
.hero-media::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: 0;
  background: radial-gradient(closest-side, rgba(94, 234, 212, 0.16), rgba(94, 234, 212, 0.05) 55%, transparent);
  pointer-events: none;
}

.avatar {
  position: relative;
  z-index: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.avatar::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  border-top-left-radius: 12px;
  pointer-events: none;
}

.avatar img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
}

.scroll-cue {
  grid-column: 1 / -1;
  justify-self: start;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-3);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.scroll-cue:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.scroll-cue svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .hero-media {
    order: -1;
    justify-self: start;
    max-width: 240px;
  }

  .hero-media::before {
    inset: -25%;
  }
}

@media (max-width: 560px) {
  .hero-actions .btn {
    flex: 1 1 calc(50% - 6px);
    padding-inline: 14px;
  }

  .hero-actions .btn-primary {
    flex-basis: 100%;
  }

  .hero-media {
    max-width: 200px;
  }
}

/* 6. Secciones de la página principal ------------------------------------ */

/* Sobre mí */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.about-text p + p {
  margin-top: 16px;
}

.about-text .lead {
  color: var(--text);
  font-size: clamp(1.1875rem, 2.2vw, 1.375rem);
  line-height: 1.55;
}

.focus-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.focus-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--area, var(--accent));
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.focus-list svg {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--area, var(--accent));
}

.terminal {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.terminal-bar .dots {
  display: inline-flex;
  gap: 6px;
  margin-right: 8px;
}

.terminal-bar .dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.terminal-bar .dots span:first-child {
  background: var(--accent);
}

.terminal-body {
  flex: 1;
  margin: 0;
  padding: 22px 22px 26px;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.terminal-body dt {
  color: var(--text);
}

.terminal-body dt::before {
  content: "$ ";
  color: var(--accent);
}

.terminal-body dd {
  margin: 0 0 14px;
  color: var(--text-2);
}

.terminal-body dd:last-child {
  margin-bottom: 0;
}

/* Servicios */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.service-card:hover {
  border-color: color-mix(in srgb, var(--area, var(--accent)) 45%, var(--border));
  transform: translateY(-2px);
}

.service-card h3 {
  font-size: 1.25rem;
}

.service-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
  font-size: 1rem;
}

.service-card li {
  position: relative;
  padding-left: 20px;
}

.service-card li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 2px;
  width: 8px;
  height: 2px;
  background: var(--area, var(--accent));
}

.services-foot {
  max-width: 760px;
  margin: 28px 0 0;
}

/* Conocimientos */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.skill-panel {
  border-top: 2px solid var(--area, var(--accent));
}

.skill-panel h3 {
  margin-bottom: 4px;
  color: var(--area-text, var(--text));
  font-size: 1.125rem;
  font-weight: 700;
}

.skill-panel .panel-desc {
  margin-bottom: 24px;
  color: var(--text-3);
  font-size: 0.9375rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 20px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.tile-icon img {
  width: 30px;
  height: 30px;
}

.tile:hover .tile-icon {
  border-color: color-mix(in srgb, var(--area, var(--accent)) 55%, var(--border));
  transform: translateY(-2px);
}

.tile-label {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.tile--soon .tile-icon {
  border-style: dashed;
  background: transparent;
}

.tile--soon .tile-icon img {
  opacity: 0.75;
}

.skill-panel .note {
  margin-top: 24px;
}

/* Proyectos */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 20px;
}

.projects-grid {
  display: grid;
  /* La tarjeta de Roblox es algo más ancha para que su proyecto quepa en una fila. */
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-line {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-line h3 {
  color: var(--area-text, var(--text));
  font-size: 1.1875rem;
}

.project-line > p {
  font-size: 1rem;
}

/* Videojuegos: tarjeta un poco más expresiva con formas geométricas sencillas */
.project-line.area-game {
  overflow: hidden;
  border-color: rgba(167, 139, 250, 0.35);
}

.project-line.area-game::before,
.project-line.area-game::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.project-line.area-game::before {
  bottom: -46px;
  right: -46px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 24px;
  transform: rotate(18deg);
}

.project-line.area-game::after {
  bottom: 84px;
  right: 22px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--coral);
  opacity: 0.75;
  transform: rotate(18deg);
}

.project-line.area-game > * {
  position: relative;
  z-index: 1;
}

.project-line.area-game .icon-badge {
  border-color: rgba(167, 139, 250, 0.4);
}

.project-list {
  display: grid;
  gap: 12px;
  margin: auto 0 0;
  padding: 16px 0 0;
  border-top: 1px dashed var(--border);
  list-style: none;
}

.project-empty {
  color: var(--text-3);
  font-size: 0.9375rem;
  font-style: italic;
}

/* Proyecto compacto: miniatura | nombre y estado | botón (el botón baja si falta espacio) */
.project-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--area, var(--accent)) 30%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--bg);
}

/* Miniatura con icono de juego de respaldo debajo de la imagen */
.project-thumb {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--area, var(--accent));
}

.project-thumb svg {
  width: 26px;
  height: 26px;
}

.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-item-info {
  display: flex;
  flex: 1 1 110px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.project-item h4 {
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.project-item p {
  font-size: 0.9375rem;
}

.project-link {
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
  border-color: color-mix(in srgb, var(--area, var(--accent)) 55%, transparent);
  color: var(--area, var(--accent));
  font-size: 0.9375rem;
}

.project-link:hover {
  border-color: var(--area, var(--accent));
  background: color-mix(in srgb, var(--area, var(--accent)) 12%, transparent);
  color: var(--area, var(--accent));
}

@media (max-width: 400px) {
  .project-link {
    flex: 1 1 100%;
  }
}

/* Contenido */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.channel-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.channel-logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.channel-logo img {
  width: 26px;
  height: 26px;
}

.channel-head h3 {
  font-size: 1.25rem;
}

.handle {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.channel-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

.content-note {
  max-width: 760px;
  margin: 28px 0 0;
}

/* Contacto */
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px 48px;
  align-items: center;
  padding: clamp(28px, 5vw, 52px);
  border-left: 3px solid var(--accent);
}

.contact-card .eyebrow,
.contact-card .section-title,
.contact-card > p:not(.contact-privacy) {
  grid-column: 1;
}

.contact-card .section-title {
  margin-top: -4px;
}

.contact-card > p {
  max-width: 600px;
  font-size: 1.125rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-card .contact-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  justify-content: flex-start;
}

.contact-soon {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}

.contact-soon svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--wip);
}

.contact-privacy {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.9375rem !important;
}

@media (max-width: 960px) {
  .services-grid,
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services-grid > :last-child:nth-child(odd),
  .projects-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-card .contact-actions {
    grid-column: 1;
    grid-row: auto;
    margin-top: 12px;
  }
}

@media (max-width: 720px) {
  .services-grid,
  .projects-grid,
  .skills-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .focus-list {
    grid-template-columns: 1fr;
  }

  .tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  }

  .tile-icon {
    width: 62px;
    height: 62px;
  }
}

/* 7. Pie de página ------------------------------------------------------- */
.site-footer {
  padding-block: 48px 32px;
  border-top: 1px solid var(--border);
  background: #090d1a;
  font-size: 0.975rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.footer-brand p {
  max-width: 340px;
  margin-top: 12px;
  color: var(--text-3);
}

.footer-nav h2 {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-nav ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: var(--text-2);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.2s var(--ease);
}

.footer-social a:hover {
  border-color: var(--border-strong);
}

.footer-social img {
  width: 20px;
  height: 20px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* 8. Páginas legales ----------------------------------------------------- */
.legal + .site-footer {
  padding-block: 24px;
}

.legal + .site-footer .footer-bottom {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal {
  padding-block: clamp(40px, 7vw, 72px) var(--section-space);
}

.legal-inner {
  max-width: 800px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--text-2);
  font-size: 0.975rem;
  text-decoration: none;
}

.back-link svg {
  width: 18px;
  height: 18px;
}

.back-link:hover {
  color: var(--text);
}

.legal h1 {
  font-size: clamp(2.125rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.legal .updated {
  margin-top: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.legal .draft-note {
  margin-top: 24px;
  border-color: rgba(245, 194, 107, 0.4);
  background: rgba(245, 194, 107, 0.06);
}

.legal .draft-note svg {
  color: var(--wip);
}

.legal-toc {
  margin-top: 32px;
}

.legal-toc h2 {
  margin-bottom: 12px;
  font-size: 1.0625rem;
}

.legal-toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
}

.legal section {
  margin-top: 48px;
}

.legal h2 {
  font-size: clamp(1.375rem, 3vw, 1.625rem);
}

.legal section > h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.legal h3 {
  margin-top: 24px;
  font-size: 1.125rem;
}

.legal section p,
.legal section ul,
.legal section ol {
  margin-top: 14px;
}

.legal ul,
.legal ol {
  padding-left: 22px;
}

.legal li + li {
  margin-top: 6px;
}

.legal strong {
  color: var(--text);
}

.legal .badge {
  vertical-align: 1px;
}

.legal .note {
  margin-top: 16px;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.legal table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.975rem;
}

.legal th,
.legal td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.legal th {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
}

.legal tr:last-child td {
  border-bottom: 0;
}

/* 9. Animaciones y movimiento reducido ----------------------------------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .hero-media {
    animation: rise 0.6s var(--ease) both;
  }

  .hero-copy > :nth-child(2) { animation-delay: 0.05s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.1s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.15s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.2s; }
  .hero-copy > :nth-child(n + 6) { animation-delay: 0.25s; }
  .hero-media { animation-delay: 0.12s; }

  /* Las secciones solo se ocultan si JavaScript está activo para revelarlas. */
  .js .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
