/* ================================
   VARIABLES Y ESTILOS GENERALES
================================ */

:root {
  --bg: #050816;
  --bg-soft: rgba(255, 255, 255, 0.06);
  --bg-card: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --muted-2: #94a3b8;
  --primary: #38bdf8;
  --secondary: #a855f7;
  --accent: #22c55e;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

/* Barra de desplazamiento */
html {
  scrollbar-color: var(--primary) var(--bg);
  scrollbar-width: auto;
}

::-webkit-scrollbar {
  width: 18px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--secondary), var(--primary));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.20), transparent 35%),
    linear-gradient(135deg, #030712 0%, #0f172a 45%, #020617 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent 75%);
  z-index: -3;
}

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

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

button,
input,
textarea {
  font-family: inherit;
}

section {
  scroll-margin-top: 110px;
}

.background-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.22;
  z-index: -2;
  pointer-events: none;
}

.background-glow-1 {
  top: 10%;
  left: -120px;
  background: var(--primary);
}

.background-glow-2 {
  right: -140px;
  bottom: 8%;
  background: var(--secondary);
}

/* ================================
   HEADER
================================ */

.header {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  transition: transform 0.35s ease;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22), 0 0 24px rgba(255, 255, 255, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.header.header-hidden {
  transform: translateX(-50%) translateY(-150%);
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(56, 189, 248, 0.24));
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 0;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  opacity: 0;
  transform: translateY(-50%);
  transition:
    left 0.35s ease,
    width 0.35s ease,
    opacity 0.25s ease;
  pointer-events: none;
}

.nav a {
  position: relative;
  z-index: 1;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.nav a.active {
  color: #07111f;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav a.active:hover {
  color: #07111f;
  background: transparent;
  transform: translateY(-1px);
}

.nav .nav-contacto {
  color: #07111f;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-weight: 800;
}

.nav .nav-contacto:hover {
  transform: translateY(-1px);
  color: #07111f;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.nav .nav-contacto.active {
  background: transparent;
  color: #07111f;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.menu-toggle:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
}

.menu-toggle.open {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
}

.menu-toggle-bar {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.2s ease, width 0.25s ease;
}

.menu-toggle.open .menu-toggle-bar {
  color: #06111f;
}

.menu-toggle.open .menu-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.open .menu-toggle-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}

.menu-toggle.open .menu-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ================================
   HERO
================================ */

.hero {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 150px 0 80px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.lang-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

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

.lang-btn.active {
  opacity: 1;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid rgba(56, 189, 248, 0.30);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.10);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.hero h1 span {
  display: block;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--primary), var(--secondary), #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  max-width: 660px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  color: #06111f;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-size: 160% 160%;
  background-position: 0% 50%;
  box-shadow: 0 18px 44px rgba(56, 189, 248, 0.18);
}

.btn-secondary {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.btn:hover {
  transform: translateY(-3px) scale(1.03);
}

.btn-primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 22px 50px rgba(56, 189, 248, 0.38), 0 12px 30px rgba(168, 85, 247, 0.28);
}

.btn-secondary:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.10);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.18);
}

.project-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 0.9rem;
}

.hero-image {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-card {
  position: relative;
  width: min(460px, 100%);
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 40px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(15, 23, 42, 0.55);
  box-shadow: var(--shadow);
}

.image-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 42px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.45), rgba(168, 85, 247, 0.35), transparent);
}

.profile-image {
  width: 100%;
  height: auto;
  border-radius: 30px;
  object-fit: cover;
  transform: scale(1.13);
  transform-origin: bottom center;
}

.fade-bottom {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 82%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 82%, rgba(0,0,0,0) 100%);
}

.quote {
  margin: 22px 0 0;
  color: var(--muted-2);
  font-size: 0.98rem;
  text-align: center;
}

/* ================================
   SECCIONES
================================ */

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 92px 0;
}

/* El título de Habilidades queda fijo (sticky) nada más entrar en la sección,
   así que no necesita el mismo espaciado superior que el resto: si lo tuviera,
   ese hueco se quedaría "congelado" en pantalla durante todo el scroll-jack. */
#tecnologias {
  padding-top: 24px;
  scroll-margin-top: 96px;
}

/* Al hacer clic en un enlace del header, el salto de scroll dejaba un hueco
   grande entre el header y el título por el padding-top general de .section. */
#sobre-mi,
#camino,
#proyectos,
#contacto {
  padding-top: 24px;
  scroll-margin-top: 96px;
}

.section-header {
  max-width: 760px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.section-header p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
  margin: 10px 0 0;
}

.card,
.project-card,
.contact-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
  box-shadow: 0 18px 50px rgba(0,0,0,0.20);
}

/* ================================
   SOBRE MÍ
================================ */

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

.card {
  padding: 28px;
}

.card p {
  color: var(--muted);
  line-height: 1.75;
}

.card p strong {
  color: var(--text);
  font-weight: 700;
}

.project-card h3,
.card h3,
.contact-info h3 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

/* ================================
   TECNOLOGÍAS
================================ */

.skills-scroll {
  position: relative;
  height: 180vh;
}

.skills-sticky {
  position: sticky;
  /* Mismo valor que el desplazamiento de aterrizaje al pulsar "Habilidades"
     en el header (scroll-margin-top + padding-top de #tecnologias), para que
     el título no dé un salto al engancharse el sticky. */
  top: 120px;
}

.skills-sticky-title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
  letter-spacing: -0.05em;
  text-align: center;
}

.skills-sticky-desc {
  max-width: 560px;
  margin: 10px auto 24px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
  text-align: center;
}

.skills-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  margin: 0 auto 24px;
  max-width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.skills-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

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

.skills-tab.active {
  background: var(--primary);
  color: #07111f;
  font-weight: 600;
}

.skills-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  padding: 44px 32px;
  min-height: 340px;
  display: flex;
  align-items: center;
}

.skills-panel-content {
  display: none;
  width: 100%;
}

.skills-panel-content.active {
  display: block;
}

.skills-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 28px;
  justify-items: center;
}

.skill-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  transition: transform 0.2s ease;
}

.skill-icon-item:hover {
  transform: translateY(-4px);
}

.skill-icon-item img,
.skill-icon-item svg {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.logo-us-icon {
  transform: scale(1.5);
}

.logo-santander-icon {
  transform: scale(0.75);
}

.skill-icon-item span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ================================
   PROYECTOS
================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 40px;
  column-gap: 36px;
  max-width: 820px;
  margin: 0 auto;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  transition: 0.25s ease;
}

.project-mac {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 4px auto 18px;
  aspect-ratio: 920 / 763;
}

.project-mac-screen {
  position: absolute;
  left: 8.9%;
  top: 8.2%;
  width: 81.4%;
  height: 55.2%;
  background: #fff;
  overflow: hidden;
}

.project-mac-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-mac-shot-topright {
  object-position: left top;
  transform: scale(1.4);
  transform-origin: top left;
}

.project-mac-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.project-actions .btn {
  flex: 1;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: 0.25s ease;
}

.btn-icon:hover {
  transform: translateY(-3px) scale(1.08) rotate(-6deg);
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #06111f;
  box-shadow: 0 16px 34px rgba(56, 189, 248, 0.35);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.project-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -75px;
  top: -75px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.20), transparent 70%);
  opacity: 0.7;
  transition: 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  box-shadow: 0 26px 60px rgba(56, 189, 248, 0.20), 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.project-card:hover::after {
  opacity: 1;
  transform: scale(1.3);
}

.project-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.project-number {
  color: rgba(255, 255, 255, 0.22);
  font-weight: 800;
  font-size: 2.2rem;
}

.project-status {
  padding: 7px 10px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.20);
  font-size: 0.78rem;
  font-weight: 700;
}

.project-card p {
  color: var(--muted);
  line-height: 1.7;
}

.projects-grid .project-card:nth-child(3) p,
.projects-grid .project-card:nth-child(4) p {
  min-height: 6.8em;
}

.projects-grid .project-card:nth-child(1) h3,
.projects-grid .project-card:nth-child(2) h3 {
  min-height: 2.6em;
  line-height: 1.3;
}

.projects-grid .project-card:nth-child(1) p,
.projects-grid .project-card:nth-child(2) p {
  min-height: 10.2em;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/* ================================
   TIMELINE
================================ */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--border) 0%, var(--primary) 55%, var(--secondary) 100%);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding-bottom: 64px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  display: flex;
  align-items: center;
  gap: 14px;
  height: fit-content;
  position: sticky;
  top: 120px;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(56, 189, 248, 0.55);
}

.timeline-year-big {
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--muted-2);
}

.timeline-body h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.timeline-body h4 {
  margin: 36px 0 12px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 1.35rem;
}

.timeline-body h4:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.timeline-body p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.75;
}

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

.timeline-body a {
  color: var(--primary);
  text-decoration: none;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.timeline-tags span {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.82rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.timeline-tags span:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

.timeline-shot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
  font-size: 0.85rem;
  overflow: hidden;
}

.timeline-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-shot-compact {
  min-height: 0;
  width: 320px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
}

.timeline-shot-promove {
  min-height: 0;
  width: 700px;
  max-width: 100%;
  aspect-ratio: 1892 / 1017;
}

.timeline-gallery {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  width: 100%;
  margin-bottom: 20px;
}

.timeline-gallery > .timeline-shot {
  min-height: 0;
  width: auto;
  min-width: 0;
}

.timeline-gallery-ascensor {
  max-width: 860px;
}

.timeline-gallery .timeline-shot-compact {
  flex: 1.333 1 0%;
}

.timeline-shot-wide {
  flex: 2.63 1 0%;
  aspect-ratio: 1541 / 586;
}

.timeline-gallery-bingo {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto auto;
  max-width: 900px;
}

.timeline-shot-bingocodigo {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 0;
  width: auto;
}

.timeline-shot-bingo1 {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  width: auto;
  aspect-ratio: 444 / 206;
}

.timeline-shot-bingo2 {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  width: auto;
  aspect-ratio: 459 / 124;
}

.timeline-shot-macportfolio {
  min-height: 0;
  width: 500px;
  max-width: 100%;
  aspect-ratio: 920 / 763;
  margin-bottom: 20px;
  border: none;
  background: none;
}

.timeline-shot-macportfolio img {
  object-fit: contain;
}

.timeline-gallery-bloc {
  max-width: 860px;
}

.timeline-gallery-bloc .timeline-shot-bloc {
  min-height: 0;
  flex: 1 1 0%;
  aspect-ratio: 3 / 2;
}

.timeline-gallery-bloc .timeline-shot-bloc img {
  object-fit: fill;
}

.timeline-gallery-alexa {
  max-width: 860px;
}

.timeline-gallery-alexa .timeline-shot-alexa {
  min-height: 0;
  flex: 1 1 0%;
  aspect-ratio: 3 / 2;
}

.timeline-gallery-alexa .timeline-shot-alexa-top img {
  object-position: top;
}

.timeline-gallery-restaurantes {
  max-width: 900px;
}

.timeline-gallery-restaurantes .timeline-shot-restaurante {
  min-height: 0;
  flex: 1 1 0%;
  aspect-ratio: 1392 / 889;
}

/* ================================
   CONTACTO
================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: stretch;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.contact-image {
  width: 100%;
  aspect-ratio: 9 / 8;
  object-fit: cover;
  object-position: bottom;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--border);
  font-weight: 700;
  transition: 0.25s ease;
}

.social-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.social-links a:hover {
  transform: translateY(-2px);
  background: rgba(56, 189, 248, 0.14);
}

.contact-form {
  padding: 28px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

label {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

label span {
  color: var(--danger);
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 15px 16px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.46);
  outline: none;
  resize: vertical;
  transition: 0.25s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(203, 213, 225, 0.55);
}

input:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.70);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.10);
}

.form-button {
  width: 100%;
  border: 0;
  margin-top: 4px;
}

.form-privacy-note {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 0.8rem;
  text-align: center;
}

.form-privacy-note a {
  color: var(--primary);
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ================================
   FOOTER
================================ */

.footer {
  width: 100%;
  margin: 0;
  padding: 34px 16px calc(44px + env(safe-area-inset-bottom));
  color: var(--muted-2);
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.footer-links a {
  color: var(--muted-2);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

/* ================================
   PÁGINAS LEGALES
================================ */

.legal-section {
  padding: 160px 0 92px;
}

.legal-content {
  max-width: 780px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}

.legal-content .legal-updated {
  color: var(--muted-2);
  font-size: 0.9rem;
  margin: 0 0 40px;
}

.legal-content h2 {
  font-size: 1.3rem;
  margin: 40px 0 14px;
  letter-spacing: -0.02em;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  line-height: 1.75;
}

.legal-content ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.legal-content p {
  margin: 0 0 16px;
}

.legal-content a {
  color: var(--primary);
}

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

/* ================================
   ANIMACIONES
================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: 0.75s ease;
}

/* ================================
   BOTÓN FLOTANTE CV
================================ */

.cv-float {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 999px;
  color: var(--primary);
  font-weight: 800;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35), 0 0 24px rgba(56, 189, 248, 0.14);
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.25s ease,
    border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.cv-float.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cv-float:hover {
  transform: translateY(-3px) scale(1.05);
  color: #06111f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4), 0 0 32px rgba(56, 189, 248, 0.3);
}

.cv-float svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 980px) {
  .hero,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 34px;
    padding-top: 140px;
  }

  .hero-image {
    order: -1;
  }

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

  .skills-icon-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-indicator {
    display: none;
  }

  .nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(2, 6, 23, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }

  .nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav a {
    padding: 14px 16px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease;
  }

  .nav.open a {
    opacity: 1;
    transform: translateY(0);
  }

  .nav.open a:nth-of-type(1) { transition-delay: 0.03s; }
  .nav.open a:nth-of-type(2) { transition-delay: 0.06s; }
  .nav.open a:nth-of-type(3) { transition-delay: 0.09s; }
  .nav.open a:nth-of-type(4) { transition-delay: 0.12s; }
  .nav.open a:nth-of-type(5) { transition-delay: 0.15s; }

  .nav a.active {
    background: rgba(255, 255, 255, 0.96);
    color: #07111f;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .header {
    top: max(12px, env(safe-area-inset-top));
    width: calc(100% - 20px);
    padding: 10px;
  }

  .cv-float {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    padding: 12px;
  }

  .cv-float span {
    display: none;
  }

  .logo {
    width: 46px;
    height: 46px;
  }

  .lang-btn {
    width: 24px;
    height: 24px;
  }

  .hero,
  .section {
    width: min(100% - 24px, 1120px);
  }

  .hero {
    padding-top: 122px;
    min-height: auto;
  }

  .hero h1 {
    letter-spacing: -0.055em;
  }

  /* La foto (con su fundido inferior) queda ligeramente por detrás y el
     bloque de texto sube sobre ella, como una tarjeta de cristal. */
  .hero-content {
    position: relative;
    z-index: 2;
    margin-top: -90px;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 22px 20px 26px;
  }

  .hero-image .quote {
    display: none;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

  .skills-scroll {
    height: 165vh;
  }

  .skills-sticky {
    top: 120px;
  }

  .skills-tabs {
    gap: 4px;
    padding: 4px;
  }

  .skills-tab {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .skills-panel {
    padding: 30px 20px;
    min-height: 260px;
  }

  .skills-icon-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 18px;
  }

  .skill-icon-item img,
  .skill-icon-item svg {
    width: 62px;
    height: 62px;
  }

  .timeline {
    padding-left: 20px;
  }

  .timeline::before {
    left: 31px;
  }

  .timeline-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 44px;
  }

  .timeline-marker {
    position: static;
  }

  .timeline-year-big {
    font-size: 2.1rem;
  }

  .timeline-body {
    padding-left: 28px;
  }

  .timeline-gallery {
    flex-direction: column;
  }

  .timeline-gallery > .timeline-shot {
    width: 100%;
    flex: none;
  }

  .timeline-gallery-bingo {
    display: flex;
    flex-direction: column;
  }

  .card,
  .project-card,
  .contact-form {
    padding: 22px;
  }
}
