/* ============================================================================
   PORTAFOLIO PROFESIONAL — DISEÑO GRÁFICO & PROGRAMACIÓN WEB
   Estética editorial suiza + precisión técnica frontend
   ============================================================================ */

:root {
  --bg-page: #faf9f6;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f2ed;
  --bg-dark: #111318;
  --bg-dark-elevated: #191d26;

  --header-bg: rgba(250, 249, 246, 0.88);
  --header-bg-scrolled: rgba(255, 255, 255, 0.94);
  --nav-hover-bg: rgba(17, 19, 24, 0.055);
  --hero-dot-color: rgba(17, 19, 24, 0.045);
  --lamina-stage-bg: #f2efe7;
  --about-bg-gradient: linear-gradient(180deg, #f1efe9 0%, #f7f6f2 45%, #faf9f6 100%);
  --laminas-section-gradient: linear-gradient(180deg, rgba(15, 118, 110, 0.028) 0%, rgba(250, 249, 246, 0) 100%);

  --pill-active-bg: #111318;
  --pill-active-ink: #faf9f6;
  --origin-propio-bg: #eff6ff;
  --origin-propio-ink: #1d4ed8;
  --origin-propio-border: rgba(29, 78, 216, 0.22);
  --avail-bg: #ecfdf5;
  --avail-ink: #065f46;
  --clarity-bg: rgba(230, 247, 245, 0.65);
  --clarity-border: rgba(15, 118, 110, 0.25);
  --feedback-ok-bg: #ecfdf5;
  --feedback-ok-border: #a7f3d0;
  --feedback-ok-ink: #065f46;
  --input-invalid-bg: #fef2f2;

  --ink-primary: #111318;
  --ink-secondary: #474e5d;
  --ink-muted: #6f7787;
  --ink-inverse: #faf9f6;

  --accent: #2546f0;
  --accent-hover: #1b38d1;
  --accent-soft: #eef2ff;
  --accent-border: rgba(37, 70, 240, 0.22);

  --border-hairline: rgba(17, 19, 24, 0.09);
  --border-strong: rgba(17, 19, 24, 0.16);

  --cat-code: #2546f0;
  --cat-code-soft: #eef2ff;
  --cat-ai: #c25e00;
  --cat-ai-soft: #fff4e5;
  --cat-ps: #0369a1;
  --cat-ps-soft: #e0f2fe;
  --cat-id: #be123c;
  --cat-id-soft: #ffe4e6;
  --cat-skp: #7c3aed;
  --cat-skp-soft: #f3e8ff;
  --cat-lam: #0f766e;
  --cat-lam-soft: #e6f7f5;

  --diff-easy-bg: #ecfdf5;
  --diff-easy-ink: #047857;
  --diff-med-bg: #fffbeb;
  --diff-med-ink: #b45309;
  --diff-hard-bg: #fef2f2;
  --diff-hard-ink: #b91c1c;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(17, 19, 24, 0.04);
  --shadow-sm: 0 4px 16px rgba(17, 19, 24, 0.05);
  --shadow-md: 0 14px 36px rgba(17, 19, 24, 0.08);
  --shadow-lg: 0 28px 64px rgba(17, 19, 24, 0.18);

  --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --header-h: 72px;
  --container-max: 1260px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* ============================================================================
   TEMA OSCURO (Activado mediante [data-theme="dark"] y guardado en localStorage)
   ============================================================================ */
:root[data-theme="dark"] {
  --bg-page: #0c0f15;
  --bg-surface: #141923;
  --bg-subtle: #1c2331;
  --bg-dark: #07090d;
  --bg-dark-elevated: #111622;

  --header-bg: rgba(12, 15, 21, 0.86);
  --header-bg-scrolled: rgba(16, 20, 29, 0.95);
  --nav-hover-bg: rgba(255, 255, 255, 0.07);
  --hero-dot-color: rgba(255, 255, 255, 0.055);
  --lamina-stage-bg: #181f2b;
  --about-bg-gradient: linear-gradient(180deg, #101520 0%, #0d111a 50%, #0c0f15 100%);
  --laminas-section-gradient: linear-gradient(180deg, rgba(45, 212, 191, 0.045) 0%, rgba(12, 15, 21, 0) 100%);

  --pill-active-bg: #4f73ff;
  --pill-active-ink: #ffffff;
  --origin-propio-bg: rgba(59, 130, 246, 0.16);
  --origin-propio-ink: #93c5fd;
  --origin-propio-border: rgba(96, 165, 250, 0.34);
  --avail-bg: rgba(16, 185, 129, 0.15);
  --avail-ink: #6ee7b7;
  --clarity-bg: rgba(45, 212, 191, 0.12);
  --clarity-border: rgba(45, 212, 191, 0.3);
  --feedback-ok-bg: rgba(16, 185, 129, 0.14);
  --feedback-ok-border: rgba(52, 211, 153, 0.35);
  --feedback-ok-ink: #6ee7b7;
  --input-invalid-bg: rgba(239, 68, 68, 0.12);

  --ink-primary: #f1f5f9;
  --ink-secondary: #b4bece;
  --ink-muted: #8492a8;
  --ink-inverse: #f8fafc;

  --accent: #5577ff;
  --accent-hover: #6d8bff;
  --accent-soft: rgba(85, 119, 255, 0.16);
  --accent-border: rgba(110, 141, 255, 0.36);

  --border-hairline: rgba(241, 245, 249, 0.09);
  --border-strong: rgba(241, 245, 249, 0.17);

  --cat-code: #7fa0ff;
  --cat-code-soft: rgba(85, 119, 255, 0.17);
  --cat-ai: #fb923c;
  --cat-ai-soft: rgba(251, 146, 60, 0.16);
  --cat-ps: #38bdf8;
  --cat-ps-soft: rgba(56, 189, 248, 0.16);
  --cat-id: #fb7185;
  --cat-id-soft: rgba(251, 113, 133, 0.16);
  --cat-skp: #a78bfa;
  --cat-skp-soft: rgba(167, 139, 250, 0.16);
  --cat-lam: #2dd4bf;
  --cat-lam-soft: rgba(45, 212, 191, 0.16);

  --diff-easy-bg: rgba(16, 185, 129, 0.16);
  --diff-easy-ink: #6ee7b7;
  --diff-med-bg: rgba(245, 158, 11, 0.16);
  --diff-med-ink: #fcd34d;
  --diff-hard-bg: rgba(239, 68, 68, 0.16);
  --diff-hard-ink: #fca5a5;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.36);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.48);
  --shadow-lg: 0 28px 68px rgba(0, 0, 0, 0.65);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

body.modal-open {
  overflow: hidden;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--bg-dark);
  color: var(--ink-inverse);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ============================================================================
   1. HEADER Y NAVEGACIÓN PRINCIPAL
   ============================================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-hairline);
  transition: box-shadow 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.site-header.is-scrolled {
  background: var(--header-bg-scrolled);
  box-shadow: var(--shadow-sm);
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-block: 6px;
}

.brand-logo-wrap {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-link:hover {
  color: var(--ink-primary);
  background-color: var(--nav-hover-bg);
}

.nav-link.is-active {
  color: var(--accent);
  background-color: var(--accent-soft);
  font-weight: 600;
}

.nav-separator {
  width: 1px;
  height: 22px;
  background-color: var(--border-strong);
  margin-inline: 2px;
  flex-shrink: 0;
}

.nav-about-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background-color: var(--pill-active-bg);
  color: var(--pill-active-ink);
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.nav-about-link:hover {
  background-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 70, 240, 0.24);
}

.nav-about-link.is-active {
  background-color: var(--accent);
  color: #ffffff;
}

/* Bloque derecho fijo del Header: Tema Claro/Oscuro + Menú Móvil */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.18s var(--ease);
}

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

/* Enlace discreto en portafolio.html para regresar a la Portada de Bienvenida */
.welcome-return-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.welcome-return-link:hover {
  border-color: var(--border-strong);
  background: var(--nav-hover-bg);
  color: var(--ink-primary);
}

.mobile-return-link {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 0.86rem;
  font-weight: 600;
}

.mobile-return-link:hover {
  color: var(--ink-primary);
  border-color: var(--accent);
}

/* ============================================================================
   INTERFAZ 1 EXCLUSIVA — PORTADA DE BIENVENIDA (index.html)
   ============================================================================ */

.welcome-body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 14% 16%, var(--accent-soft), transparent 44%),
    radial-gradient(circle at 86% 84%, var(--cat-skp-soft), transparent 42%),
    var(--bg-page);
}

.welcome-topbar {
  padding: 20px 0 8px;
}

.welcome-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.welcome-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.welcome-stage {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 24px 0 48px;
}

.welcome-card {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 44px;
  align-items: center;
  padding: 46px 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--hero-dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.72), transparent 68%);
}

.welcome-card--no-photo {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}

.welcome-photo-col,
.welcome-copy-col {
  position: relative;
  z-index: 1;
}

.welcome-photo-frame {
  width: 100%;
  aspect-ratio: 4 / 4.8;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}

.welcome-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.welcome-fullname {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.2vw, 3.45rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink-primary);
}

.welcome-role {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.7vw, 1.38rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.015em;
}

.welcome-short-bio {
  margin: 0 0 28px;
  font-size: 1rem;
  line-height: 1.68;
  color: var(--ink-secondary);
  max-width: 56ch;
}

.welcome-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-welcome-enter {
  padding: 14px 28px;
  font-size: 0.98rem;
  font-weight: 700;
}

.theme-icon--sun {
  display: none;
}

.theme-icon--moon {
  display: block;
}

:root[data-theme="dark"] .theme-icon--sun {
  display: block;
  color: #fbbf24;
}

:root[data-theme="dark"] .theme-icon--moon {
  display: none;
}

.mobile-controls-panel {
  display: grid;
  gap: 12px;
}

.mobile-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  gap: 4px;
}

.theme-choice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.theme-choice-btn:hover {
  color: var(--ink-primary);
}

.theme-choice-btn.is-active {
  background: var(--pill-active-bg);
  color: var(--pill-active-ink);
  box-shadow: 0 3px 10px rgba(17, 19, 24, 0.22);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  cursor: pointer;
}

.hamburger-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 18px;
}

.hamburger-lines span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-primary);
  transition: transform 0.22s var(--ease), opacity 0.2s var(--ease);
}

.mobile-menu-btn[aria-expanded="true"] .hamburger-lines span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] .hamburger-lines span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn[aria-expanded="true"] .hamburger-lines span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-drawer {
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}

.mobile-nav-inner {
  padding-block: 18px 22px;
}

.mobile-nav-label {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

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

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink-primary);
}

.mobile-nav-link:hover,
.mobile-nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border-hairline);
  margin: 14px 0;
}

.mobile-about-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-dark);
  color: var(--ink-inverse);
  font-weight: 600;
}

/* ============================================================================
   2. HERO BANNER PRINCIPAL
   ============================================================================ */

.hero-section {
  padding: 34px 0 30px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 40px;
  align-items: center;
  padding: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-card--no-banner {
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--hero-dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  mask-image: linear-gradient(125deg, rgba(0, 0, 0, 0.7), transparent 65%);
}

.hero-copy,
.hero-visual-col {
  position: relative;
  z-index: 1;
}

.hero-eyebrow-wrap {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  margin-bottom: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  flex-shrink: 0;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.hero-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 3.6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--ink-primary);
}

.hero-role-line {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.5vw, 1.32rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.015em;
}

.hero-specialty-card {
  margin: 0 0 18px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-specialty-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.hero-specialty-text {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.45;
}

.hero-subtitle {
  margin: 0 0 26px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

.btn-hero-cta {
  padding: 13px 26px;
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(37, 70, 240, 0.24);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 70, 240, 0.3);
}

.btn-secondary {
  background: var(--bg-page);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--ink-primary);
}

.hero-highlights {
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--border-hairline);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.highlight-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.highlight-item dt {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.highlight-item dd {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-primary);
}

.hero-banner-frame {
  margin: 0;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-md);
}

.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.hero-banner-frame:hover .hero-banner-img {
  transform: scale(1.03);
}

.hero-banner-badge {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(17, 19, 24, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.badge-mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #93c5fd;
}

.badge-disciplines {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

/* ============================================================================
   3. SECCIONES DE CATEGORÍAS Y FILTROS
   ============================================================================ */

.category-section {
  padding: 68px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.category-section--laminas {
  background: var(--laminas-section-gradient);
}

.category-header {
  margin-bottom: 24px;
}

.category-kicker-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.category-index {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.category-pill--code {
  background: var(--cat-code-soft);
  color: var(--cat-code);
}

.category-pill--ai {
  background: var(--cat-ai-soft);
  color: var(--cat-ai);
}

.category-pill--ps {
  background: var(--cat-ps-soft);
  color: var(--cat-ps);
}

.category-pill--id {
  background: var(--cat-id-soft);
  color: var(--cat-id);
}

.category-pill--skp {
  background: var(--cat-skp-soft);
  color: var(--cat-skp);
}

.category-pill--lam {
  background: var(--cat-lam-soft);
  color: var(--cat-lam);
}

.academic-only-badge,
.clarity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--ink-secondary);
  border: 1px solid var(--border-strong);
}

.clarity-badge {
  color: var(--cat-lam);
  border-color: var(--clarity-border);
  background: var(--clarity-bg);
}

.category-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-left: auto;
}

.category-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.category-desc {
  margin: 0;
  max-width: 68ch;
  color: var(--ink-secondary);
  font-size: 0.98rem;
}

/* Barra de Filtros */
.filter-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 24px;
  padding: 16px 20px;
  margin-bottom: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.filter-toolbar--dual {
  justify-content: space-between;
}

.filter-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group--right {
  align-items: flex-end;
}

.filter-group--right .filter-pills {
  justify-content: flex-end;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-page);
  color: var(--ink-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.filter-pill:hover {
  border-color: var(--ink-primary);
  color: var(--ink-primary);
}

.filter-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 70, 240, 0.22);
}

.filter-reset-btn {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.18s var(--ease);
}

.filter-reset-btn--inline {
  margin-left: 0;
}

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

/* ============================================================================
   4. VISUALIZACIÓN DE PROYECTOS — GRILLA INTERACTIVA + MODAL AMPLIADO
   ============================================================================ */

.card-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-mono-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border: 1px solid var(--border-hairline);
}

.badge-difficulty {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-difficulty--easy {
  background: var(--diff-easy-bg);
  color: var(--diff-easy-ink);
}

.badge-difficulty--medium {
  background: var(--diff-med-bg);
  color: var(--diff-med-ink);
}

.badge-difficulty--hard {
  background: var(--diff-hard-bg);
  color: var(--diff-hard-ink);
}

.badge-origin {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--bg-page);
  color: var(--ink-secondary);
  border: 1px solid var(--border-strong);
}

.badge-origin--propio {
  background: var(--origin-propio-bg);
  color: var(--origin-propio-ink);
  border-color: var(--origin-propio-border);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.spec-block {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
}

.spec-block-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.spec-block p {
  margin: 0;
  font-size: 0.915rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.84rem;
}

/* Grilla permanente de miniaturas con título, etiquetas y apertura de modal */
.projects-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.project-thumb-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.project-thumb-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-border);
}

.thumb-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-subtle);
  overflow: hidden;
}

.thumb-media-wrap--lamina {
  aspect-ratio: 4 / 4.6;
  background: var(--lamina-stage-bg);
  padding: 14px;
}

.thumb-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.thumb-media-wrap--lamina .thumb-media-img {
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(17, 19, 24, 0.1);
}

.project-thumb-card:hover .thumb-media-img {
  transform: scale(1.045);
}

.thumb-gallery-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(17, 19, 24, 0.78);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.thumb-gallery-badge--pdf {
  background: rgba(153, 27, 27, 0.9);
  border-color: rgba(254, 202, 202, 0.36);
}

.thumb-media-wrap--pdf {
  background: var(--lamina-stage-bg);
  padding: 12px;
}

.thumb-media-wrap--pdf .thumb-media-img {
  object-fit: contain;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(17, 19, 24, 0.16), 4px 4px 0 rgba(255, 255, 255, 0.72), 4px 4px 0 1px rgba(17, 19, 24, 0.1);
}

.thumb-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 19, 24, 0) 45%, rgba(17, 19, 24, 0.72) 100%);
  opacity: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 16px;
  transition: opacity 0.24s var(--ease);
}

.project-thumb-card:hover .thumb-hover-overlay,
.project-thumb-card:focus-visible .thumb-hover-overlay {
  opacity: 1;
}

.thumb-open-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #111318;
  font-size: 0.78rem;
  font-weight: 700;
}

.thumb-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.thumb-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.thumb-footer-row {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border-hairline);
}

.thumb-expand-word {
  color: var(--accent);
  font-weight: 700;
}

/* Estado vacío al combinar filtros */
.empty-state-card {
  grid-column: 1 / -1;
  padding: 48px 28px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
}

.empty-state-text {
  margin: 0 0 18px;
  color: var(--ink-secondary);
  font-size: 0.94rem;
}

/* ============================================================================
   6. SECCIÓN SEPARADA: SOBRE MÍ Y CONTACTO
   ============================================================================ */

.about-contact-section {
  padding: 92px 0 96px;
  background: var(--about-bg-gradient);
  border-top: 2px solid var(--border-strong);
  position: relative;
}

.about-section-banner {
  margin-bottom: 42px;
  max-width: 66ch;
}

.about-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.about-section-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.about-section-lead {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 1.02rem;
}

.about-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 32px;
  align-items: start;
}

.profile-card,
.contact-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 34px;
  box-shadow: var(--shadow-sm);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
}

.profile-photo-frame {
  width: 112px;
  height: 132px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--avail-bg);
  color: var(--avail-ink);
  font-size: 0.74rem;
  font-weight: 600;
}

.profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.profile-role {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  font-weight: 500;
}

.profile-bio {
  margin: 0 0 24px;
  color: var(--ink-secondary);
  font-size: 0.96rem;
  line-height: 1.7;
}

.direct-contact-list {
  display: grid;
  gap: 12px;
  margin-bottom: 26px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
}

.contact-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.contact-item-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.contact-item-value {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-primary);
  overflow-wrap: anywhere;
}

.contact-item-value:hover {
  color: var(--accent);
}

.copy-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s var(--ease);
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.socials-block {
  padding-top: 22px;
  border-top: 1px solid var(--border-hairline);
}

.socials-label {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
}

.socials-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border-radius: 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-primary);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.social-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.social-chip svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Formulario de contacto */
.form-card-header {
  margin-bottom: 24px;
}

.form-card-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.form-card-subtitle {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.field-label span {
  color: var(--accent);
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--bg-page);
  color: var(--ink-primary);
  font-size: 0.94rem;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field-input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 70, 240, 0.12);
}

.field-input.is-invalid {
  border-color: #dc2626;
  background: var(--input-invalid-bg);
}

.field-textarea {
  resize: vertical;
  min-height: 128px;
}

.field-error {
  font-size: 0.78rem;
  font-weight: 500;
  color: #dc2626;
  min-height: 1em;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-submit {
  width: 100%;
  padding: 14px 24px;
}

.contact-feedback {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}

.contact-feedback.is-success {
  background: var(--feedback-ok-bg);
  border: 1px solid var(--feedback-ok-border);
  color: var(--feedback-ok-ink);
}

.contact-feedback a {
  font-weight: 700;
  text-decoration: underline;
}

/* ============================================================================
   7. FOOTER SINCRONIZADO
   ============================================================================ */

.site-footer {
  background: var(--bg-dark);
  color: var(--ink-inverse);
  padding: 64px 0 32px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.footer-tagline {
  margin: 0;
  color: rgba(250, 249, 246, 0.68);
  max-width: 38ch;
  font-size: 0.92rem;
}

.footer-col-title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(250, 249, 246, 0.54);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.footer-links a {
  font-size: 0.9rem;
  color: rgba(250, 249, 246, 0.82);
  transition: color 0.18s var(--ease);
}

.footer-links a:hover {
  color: #93c5fd;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.footer-social-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.footer-social-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.footer-social-btn svg {
  width: 16px;
  height: 16px;
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: rgba(250, 249, 246, 0.58);
}

.footer-copy {
  margin: 0;
}

.footer-sync-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
}

/* ============================================================================
   8. MODAL / VISTA AMPLIADA DE PROYECTOS
   ============================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(11, 14, 22, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s var(--ease);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 980px;
  max-height: calc(100vh - 48px);
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 0.24s var(--ease);
}

.modal-topbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.modal-topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-counter {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.modal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-page);
  color: var(--ink-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.modal-icon-btn:hover:not(:disabled) {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

.modal-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.modal-scroll-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-media-stage {
  position: relative;
  background: #14171f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 280px;
}

.modal-project-img {
  max-height: 60vh;
  width: auto;
  max-width: 100%;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  cursor: zoom-in;
}

.modal-project-img[hidden] {
  display: none;
}

.modal-zoom-pill {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(17, 19, 24, 0.82);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color 0.2s var(--ease);
}

.modal-zoom-pill[hidden] {
  display: none;
}

.modal-zoom-pill:hover {
  background: var(--accent);
}

/* Barra y vistas de lectura por páginas para proyectos PDF */
.modal-pdf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
}

.modal-pdf-bar[hidden] {
  display: none;
}

.modal-pdf-info {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.modal-pdf-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: #b91c1c;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.modal-pdf-summary {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.modal-pdf-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
}

.modal-pdf-view-tabs[hidden] {
  display: none;
}

.pdf-view-tab {
  padding: 6px 11px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.pdf-view-tab:hover {
  color: var(--ink-primary);
}

.pdf-view-tab.is-active {
  background: var(--accent);
  color: #ffffff;
}

.modal-media-stage--pdf {
  background: radial-gradient(circle at top, #1f2433 0%, #12151e 100%);
  padding: 26px 64px 54px;
}

.modal-media-stage--pdf-scroll {
  padding: 22px 24px;
  align-items: flex-start;
  max-height: 64vh;
  overflow-y: auto;
}

.modal-project-img--page {
  background: #ffffff;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.modal-pdf-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 820px;
  align-items: start;
}

.modal-pdf-spread[hidden] {
  display: none;
}

.pdf-spread-sheet {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: zoom-in;
  transition: transform 0.2s var(--ease);
}

.pdf-spread-sheet:hover {
  transform: translateY(-2px);
}

.pdf-spread-sheet img {
  width: 100%;
  max-height: 54vh;
  object-fit: contain;
  background: #ffffff;
  border-radius: 5px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
}

.pdf-sheet-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.78);
}

.modal-pdf-scroll {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.modal-pdf-scroll[hidden] {
  display: none;
}

.pdf-scroll-page {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-scroll-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.8);
}

.pdf-scroll-zoom-btn {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s var(--ease);
}

.pdf-scroll-zoom-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.pdf-scroll-page img {
  width: 100%;
  height: auto;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
}

.modal-gallery-thumb-btn--pdf {
  width: 64px;
  height: 78px;
  background: #ffffff;
}

.modal-gallery-thumb-btn--pdf img {
  object-fit: contain;
  background: #ffffff;
}

/* Carrusel de capturas y tira de miniaturas en el Modal */
.modal-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(17, 19, 24, 0.72);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.modal-gallery-arrow[hidden] {
  display: none;
}

.modal-gallery-arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.06);
}

.modal-gallery-arrow--prev {
  left: 16px;
}

.modal-gallery-arrow--next {
  right: 16px;
}

.modal-gallery-counter {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 4;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(17, 19, 24, 0.78);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-gallery-counter[hidden] {
  display: none;
}

.modal-gallery-thumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
  overflow-x: auto;
  scrollbar-width: thin;
}

.modal-gallery-thumbs[hidden] {
  display: none;
}

.modal-gallery-thumb-btn {
  position: relative;
  width: 82px;
  height: 58px;
  padding: 0;
  border-radius: 9px;
  border: 2px solid transparent;
  background: var(--bg-surface);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.68;
  transition: opacity 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.modal-gallery-thumb-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.modal-gallery-thumb-btn.is-active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 70, 240, 0.24);
}

.modal-gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-gallery-thumb-num {
  position: absolute;
  bottom: 3px;
  right: 4px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(17, 19, 24, 0.78);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .modal-gallery-arrow {
    width: 36px;
    height: 36px;
  }

  .modal-gallery-arrow--prev {
    left: 10px;
  }

  .modal-gallery-arrow--next {
    right: 10px;
  }

  .modal-gallery-counter {
    left: 12px;
    bottom: 12px;
    font-size: 0.68rem;
    padding: 5px 10px;
  }

  .modal-zoom-pill {
    right: 12px;
    bottom: 12px;
    padding: 6px 11px;
    font-size: 0.72rem;
  }

  .modal-gallery-thumbs {
    padding: 10px 14px;
    gap: 8px;
  }

  .modal-gallery-thumb-btn {
    width: 68px;
    height: 48px;
  }

  .modal-gallery-thumb-btn--pdf {
    width: 54px;
    height: 68px;
  }

  .modal-media-stage--pdf {
    padding: 18px 14px 48px;
  }

  .modal-pdf-spread {
    grid-template-columns: 1fr;
  }

  .modal-pdf-bar {
    padding: 10px 14px;
  }
}

.modal-content-body {
  padding: 28px 32px 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-project-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.modal-details-container {
  display: grid;
  gap: 14px;
}

.modal-live-action {
  padding-top: 6px;
}

.btn-live {
  padding: 13px 26px;
}

/* ============================================================================
   9. VISOR AMPLIADO DE ALTA NITIDEZ (LÁMINAS Y ZOOM PROFUNDO)
   ============================================================================ */

.reader-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  background: #0d1017;
  color: #f8fafc;
  animation: fadeIn 0.18s var(--ease);
}

.reader-backdrop[hidden] {
  display: none;
}

.reader-backdrop[data-theme="light"] {
  background: #eceae3;
  color: var(--ink-primary);
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(17, 20, 29, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-wrap: wrap;
  z-index: 2;
}

.reader-backdrop[data-theme="light"] .reader-toolbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--border-strong);
}

.reader-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.reader-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
}

.reader-backdrop[data-theme="light"] .reader-kicker {
  color: var(--cat-lam);
}

.reader-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 44vw;
}

.reader-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.reader-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.reader-btn--text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding-inline: 11px;
}

.reader-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.reader-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.reader-backdrop[data-theme="light"] .reader-btn {
  background: var(--bg-page);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

.reader-backdrop[data-theme="light"] .reader-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #ffffff;
}

.reader-zoom-readout {
  min-width: 66px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.reader-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.16);
  margin-inline: 4px;
}

.reader-backdrop[data-theme="light"] .reader-divider {
  background: var(--border-strong);
}

.reader-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  cursor: zoom-in;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}

.reader-viewport.is-zoomed {
  cursor: grab;
  justify-content: flex-start;
}

.reader-viewport.is-dragging {
  cursor: grabbing;
}

.reader-canvas {
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reader-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 1180px);
  max-height: calc(100vh - 190px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: #ffffff;
  image-rendering: -webkit-optimize-contrast;
}

.reader-viewport.is-zoomed .reader-img {
  max-width: none;
  max-height: none;
  height: auto;
}

.reader-footer-bar {
  padding: 12px 20px;
  background: rgba(17, 20, 29, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.reader-backdrop[data-theme="light"] .reader-footer-bar {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: var(--border-strong);
}

.reader-footer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 240px;
}

.reader-topic {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: #34d399;
}

.reader-backdrop[data-theme="light"] .reader-topic {
  color: var(--cat-lam);
}

.reader-description {
  margin: 0;
  font-size: 0.84rem;
  opacity: 0.86;
  max-width: 78ch;
}

.reader-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.65;
}

/* ============================================================================
   10. TOAST & ANIMACIONES
   ============================================================================ */

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--bg-dark);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: slideToast 0.24s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideToast {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   11. RESPONSIVIDAD (TABLET Y MÓVIL)
   ============================================================================ */

@media (max-width: 1220px) {
  .primary-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero-card {
    grid-template-columns: 1fr;
    padding: 30px;
    gap: 28px;
  }

  .projects-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .welcome-card {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 30px 24px;
  }

  .welcome-photo-frame {
    max-width: 180px;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
  }
}

@media (max-width: 780px) {
  .filter-toolbar-right {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .filter-group--right {
    align-items: flex-start;
  }

  .filter-group--right .filter-pills {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 64px;
  }

  .container {
    padding-inline: 16px;
  }

  .welcome-return-label,
  .theme-toggle-label {
    display: none;
  }

  .welcome-return-link {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
  }

  .theme-toggle-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
  }

  .brand-sub {
    display: none;
  }

  .hero-section {
    padding: 20px 0 22px;
  }

  .hero-card {
    padding: 22px;
    border-radius: var(--radius-lg);
  }

  .hero-highlights {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .category-section {
    padding: 48px 0;
  }

  .filter-toolbar {
    padding: 14px;
  }

  .projects-container {
    grid-template-columns: 1fr;
  }

  .profile-card,
  .contact-form-card {
    padding: 22px;
    border-radius: var(--radius-lg);
  }

  .profile-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-content-body {
    padding: 20px;
  }

  .reader-title {
    max-width: 82vw;
  }

  .reader-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
