/* ===== Variables ===== */
:root {
  --bg: #0a0d12;
  --bg-alt: #10141b;
  --text: #e8eaed;
  --text-dim: #9aa2ad;
  --accent: #e3a458;
  --accent-2: #c9714f;
  --border: rgba(255,255,255,0.08);
  --bg-rgb: 10, 13, 18;
  --bg-alt-rgb: 16, 20, 27;
  --font-head: "Fraunces", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Foco visible y consistente para todo lo interactivo (teclado). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ===== Atmósfera de fondo (fija, decorativa) ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(620px circle at 10% 15%, rgba(227, 164, 88, 0.10), transparent 60%),
    radial-gradient(700px circle at 90% 20%, rgba(201, 113, 79, 0.08), transparent 60%),
    radial-gradient(650px circle at 15% 85%, rgba(201, 113, 79, 0.07), transparent 60%),
    radial-gradient(600px circle at 88% 88%, rgba(227, 164, 88, 0.08), transparent 60%);
  animation: driftBlobs 34s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 25%, black 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% 25%, black 30%, transparent 85%);
}

@keyframes driftBlobs {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2.5%, 3%) scale(1.06); }
}

/* ===== Polvo flotante (partículas sutiles a trasluz) ===== */
.dust {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.dust span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 164, 88, 0.6), transparent 70%);
  filter: blur(0.4px);
  animation-name: floatDust, dustFlicker;
  animation-timing-function: ease-in-out, ease-in-out;
  animation-iteration-count: infinite, infinite;
  animation-direction: alternate, alternate;
}

.dust span.dust--alt {
  background: radial-gradient(circle, rgba(201, 113, 79, 0.55), transparent 70%);
}

@keyframes floatDust {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(var(--dx1, 12px), var(--dy1, -18px)); }
  50%  { transform: translate(var(--dx2, -10px), var(--dy2, -6px)); }
  75%  { transform: translate(var(--dx3, 14px), var(--dy3, 10px)); }
  100% { transform: translate(var(--dx1, 12px), var(--dy2, -6px)); }
}

@keyframes dustFlicker {
  0%   { opacity: 0.18; }
  100% { opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
  .dust { display: none; }
}

/* ===== Luz que sigue al cursor ===== */
.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s ease;
  background:
    radial-gradient(circle 220px at var(--mx, 50%) var(--my, 50%), rgba(227, 164, 88, 0.03), transparent 70%),
    radial-gradient(circle 110px at var(--mx, 50%) var(--my, 50%), rgba(201, 113, 79, 0.025), transparent 70%);
  mix-blend-mode: screen;
}

.cursor-glow.is-active {
  opacity: 0.55;
  animation: glowBreathe 5s ease-in-out infinite;
}

@keyframes glowBreathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

/* ===== Red de nodos que se conectan cerca del cursor ===== */
.cursor-net {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .cursor-glow, .cursor-net { display: none; }
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; }

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

.section__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 120px 32px;
}

.section__label {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 48px;
}

#about .section__label {
  text-align: center;
}

.portfolio__intro {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 640px;
  margin: -28px 0 40px;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,13,18,0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.nav__logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
}

.nav__identity {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.nav__name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
}

.nav__tagline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav__links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav__links a {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-dim);
  transition: color 0.2s;
  padding-bottom: 2px;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__links a.nav__cta::after { display: none; }

.nav__cta {
  border: 1.5px solid var(--accent);
  padding: 8px 18px;
  border-radius: 8px;
  color: var(--accent) !important;
  transition: background 0.2s, color 0.2s;
}

.nav__cta:hover {
  background: var(--accent);
  color: #1a1206 !important;
}

.nav__lang {
  font-family: var(--font-mono, inherit);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid var(--border, rgba(255,255,255,0.2));
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--text-dim) !important;
}

.nav__lang::after { display: none; }
.nav__lang:hover { color: var(--text) !important; border-color: var(--text-dim); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* ===== Hero ===== */
.hero {
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, rgba(227, 164, 88, 0.08), transparent 55%),
              radial-gradient(circle at 75% 70%, rgba(201, 113, 79, 0.08), transparent 55%);
}

.hero__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
  transition: opacity 1s ease;
}

.hero.is-idle .hero__bottom,
.hero.is-idle .hero__scroll-cue {
  opacity: 0;
  pointer-events: none;
}

.hero.is-idle .hero__scrim {
  opacity: 0.35;
}

.hero__video-el {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: opacity 1s ease;
  /* Franja oscura arriba (título) y abajo (resto de info), centro despejado
     para que se vea bien el vídeo. */
  background: linear-gradient(180deg,
    rgba(10, 13, 18, 0.75) 0%,
    rgba(10, 13, 18, 0.2) 20%,
    transparent 38%,
    transparent 58%,
    rgba(10, 13, 18, 0.55) 72%,
    rgba(10, 13, 18, 0.82) 85%,
    rgba(10, 13, 18, 0.94) 100%);
}

.hero__video-toggle {
  position: absolute;
  right: 28px;
  bottom: 28px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(10, 13, 18, 0.55);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.hero__video-toggle:hover { border-color: var(--accent); }

.hero__scroll-cue {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(10, 13, 18, 0.55);
  backdrop-filter: blur(6px);
  padding: 10px 14px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.hero__scroll-cue span {
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollCue 2s ease-in-out infinite;
}

@keyframes scrollCue {
  0%, 100% { transform: scaleY(0.6); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-cue span { animation: none; }
}

.hero__subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--text);
  max-width: 760px;
  margin: 0 auto 8px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

.hero__support {
  color: var(--text-dim);
  max-width: 720px;
  margin: 0 auto 20px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.hero__pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}

.pill {
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-mono);
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.pill--alt {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.hero__cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.hero__reel-link {
  display: block;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.hero__reel-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.has-media {
  position: relative;
  overflow: hidden;
}

.about__portrait.has-media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -24px 36px -16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.has-video {
  border: none !important;
}

.has-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.has-img {
  border: none !important;
  background-color: rgba(255, 255, 255, 0.03);
}

.has-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s, color 0.2s;
}

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

.btn--primary {
  background: var(--accent);
  color: #1a1206;
  box-shadow: 0 8px 24px -6px rgba(227, 164, 88, 0.4);
}

.btn--primary:hover {
  box-shadow: 0 12px 32px -6px rgba(227, 164, 88, 0.55);
}

.btn--ghost {
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: rgba(227, 164, 88, 0.08);
  color: var(--accent);
}

/* ===== About ===== */
.about {
  background: rgba(var(--bg-alt-rgb), 0.82);
  position: relative;
}

.about::before,
.experience::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(var(--bg), transparent);
  pointer-events: none;
}

.about__intro {
  font-size: 1.1rem;
  color: var(--text);
  margin: 0 auto 24px;
  text-align: center;
}

.about__story {
  color: var(--text-dim);
  font-size: 0.98rem;
  line-height: 1.7;
  margin: 0 auto 48px;
  text-align: center;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
  margin-bottom: 48px;
}

.about__pillar {
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  transition: transform 0.25s ease;
}

.about__pillar:hover { transform: translateX(4px); }

.about__pillar--alt { border-left-color: var(--accent-2); }

.about__pillar-title {
  font-size: 1.05rem;
  margin-bottom: 14px;
  color: var(--accent);
}

.about__pillar--alt .about__pillar-title { color: var(--accent-2); }

.about__pillar p { color: var(--text-dim); font-size: 0.95rem; }

.about__footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

.about__footer.has-portrait {
  grid-template-columns: 160px 1fr;
}

.about__closing {
  color: var(--text);
  font-weight: 500;
  font-size: 1.1rem;
}

.about__portrait {
  /* Sin foto real todavía: se queda oculto (nada de placeholder con
     corchetes) hasta que retrato.jpg exista y cargue, momento en el que
     main.js añade .has-img y esta regla se sobreescribe más abajo. */
  display: none;
  aspect-ratio: 3/4;
  border: 1px dashed var(--border);
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 12px;
}

.about__portrait.has-img {
  display: flex;
}

/* ===== Cards (Portfolio) ===== */
.portfolio__group-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 40px 0 20px;
  font-family: var(--font-mono);
  font-weight: 500;
}

.portfolio__group-title--alt { color: var(--accent-2); }

.reel-embed { margin-bottom: 32px; }

.reel-embed__frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.reel-embed__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.reel-embed__caption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px 36px;
  margin-bottom: 8px;
}

/* Sin "ficha": ni fondo ni borde de caja — el bloque es solo
   imagen + texto, integrado directamente en la sección. */
.card {
  background: none;
  border: none;
  padding: 0;
  transition: transform 0.3s ease;
}

.card:hover { transform: translateY(-3px); }

.card:hover h3 { color: var(--accent); }

.card__media {
  aspect-ratio: 16/10;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 12px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.card:hover .card__media { border-color: rgba(227, 164, 88, 0.35); }

/* Fade suave en el borde inferior de la imagen: la funde con el texto
   de debajo en vez de cortar en seco con el borde de una caja. */
.card__media.has-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 55%,
    rgba(10, 13, 18, 0.28) 82%,
    rgba(10, 13, 18, 0.55) 100%);
  pointer-events: none;
}

.has-img img,
.has-video video {
  transition: transform 0.5s ease, filter 0.5s ease;
}

.card:hover .has-img img,
.card:hover .has-video video {
  transform: scale(1.035);
  filter: brightness(1.04);
}

/* ===== Tarjetas de vídeo con poster + lightbox ===== */
.card__media--video { cursor: pointer; }

.card__media--video.has-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(6, 8, 11, 0.2);
  transition: background 0.3s ease;
}

.card:hover .card__media--video.has-media::before {
  background: rgba(6, 8, 11, 0.35);
}

.card__play-icon {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.card__play-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(10, 13, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.card:hover .card__play-icon-circle {
  transform: scale(1.08);
  background: rgba(227, 164, 88, 0.25);
  border-color: var(--accent);
}

.card__play-icon-circle::after {
  content: "";
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--text);
  margin-left: 4px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 11, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox__inner {
  position: relative;
  width: min(90vw, 1100px);
  max-height: 85vh;
}

.lightbox__video {
  width: 100%;
  max-height: 85vh;
  border-radius: 14px;
  display: block;
  background: #000;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

.lightbox__close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(10, 13, 18, 0.7);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.2s, color 0.2s;
}

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

@media (max-width: 640px) {
  .lightbox__close { top: 10px; right: 10px; z-index: 1; }
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  transition: color 0.3s ease;
}

.card__tag {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

.card__desc { color: var(--text-dim); font-size: 0.9rem; }

.card__list {
  list-style: none;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.card__list li {
  position: relative;
  padding: 7px 0 7px 18px;
}

.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}

/* ===== Skills ===== */
.skills { background: rgba(var(--bg-rgb), 0.82); }

.skills__pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.skills__pillar {
  padding-top: 18px;
  border-top: 2px solid var(--accent);
  transition: transform 0.25s ease;
}

.skills__pillar:hover { transform: translateY(-3px); }

.skills__pillar--alt { border-top-color: var(--accent-2); }

.skills__pillar-title {
  font-size: 1.05rem;
  margin-bottom: 16px;
  color: var(--accent);
}

.skills__pillar--alt .skills__pillar-title { color: var(--accent-2); }

.skills__list { list-style: none; }

.skills__list li {
  position: relative;
  color: var(--text-dim);
  font-size: 0.95rem;
  padding: 9px 0 9px 20px;
  transition: color 0.2s, padding-left 0.2s;
}

.skills__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.skills__pillar--alt .skills__list li::before { background: var(--accent-2); }

.skills__list li:hover {
  color: var(--text);
  padding-left: 26px;
}

.skills__note {
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
}

/* ===== Experience / Timeline ===== */
.experience {
  background: rgba(var(--bg-alt-rgb), 0.82);
  position: relative;
}

.timeline {
  border-left: 2px solid var(--border);
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.timeline__item { position: relative; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline__date {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-mono);
  display: block;
  margin-bottom: 6px;
}

.timeline__item h3 { font-size: 1.1rem; margin-bottom: 6px; }

.timeline__item p { color: var(--text-dim); font-size: 0.9rem; }

/* ===== Contact ===== */
.contact { text-align: center; }

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

.contact__text { color: var(--text-dim); max-width: 480px; margin-bottom: 32px; }

.contact__links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }

.contact__links a {
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.contact__links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(227, 164, 88, 0.08);
}

.contact__form {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 28px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact__row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact__row .field { flex: 1 1 200px; }

.field label {
  display: block;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.contact__submit {
  align-self: flex-start;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.contact__submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none !important;
}

.contact__form-status {
  min-height: 20px;
  font-size: 0.88rem;
  text-align: center;
  margin: -4px 0 0;
}

.contact__form-status[data-state="ok"] { color: var(--accent); }
.contact__form-status[data-state="error"] { color: #f87171; }

.contact__or {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

/* ===== Legal ===== */
.legal { padding-top: 40px; }

.legal__inner { max-width: 820px; }

.legal__updated {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

.legal__toc {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 0;
  margin-bottom: 40px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.legal__toc a { color: var(--accent); }
.legal__toc a:hover { text-decoration: underline; }

.legal__block { margin-bottom: 56px; scroll-margin-top: 100px; }

.legal__block h2,
.post__body h2 {
  font-size: 1.5rem;
  margin: 48px 0 18px;
  color: var(--text);
}

.legal__block h3,
.post__body h3 {
  font-size: 1.05rem;
  margin: 24px 0 8px;
  color: var(--accent-2);
}

.legal__block p,
.post__body p {
  color: var(--text-dim);
  font-size: 1.04rem;
  line-height: 1.85;
  margin-bottom: 22px;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

.legal__block a,
.post__body a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.legal__block a:hover,
.post__body a:hover { border-color: var(--accent); }

.legal__list,
.post__body ul {
  list-style: none;
  color: var(--text-dim);
  font-size: 0.96rem;
  line-height: 1.8;
  margin-bottom: 14px;
}

.post__body ul li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 6px;
}

.post__body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.legal__block code,
.post__body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.post__body h2:first-child { margin-top: 0; }

.legal__disclaimer {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* ===== Blog ===== */
.blog { padding-top: 40px; }

.blog__intro {
  color: var(--text-dim);
  max-width: 640px;
  margin: -28px 0 48px;
}

.blog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.blog-card {
  display: block;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  transition: transform 0.2s;
}

.blog-card:hover { transform: translateY(-2px); }

.blog-card__meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.blog-card__title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text);
}

.blog-card:hover .blog-card__title { color: var(--accent); }

.blog-card__excerpt {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

.blog-card__link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

/* Post (article) page */
.post { padding-top: 40px; }

.post__inner { max-width: 880px; }

.post__back {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.post__back:hover { color: var(--accent); }

.post__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.post__lead {
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 32px;
}

.post__cta {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.post__cta p { color: var(--text-dim); margin-bottom: 16px; }

.post__figure {
  margin: 36px 0;
}

.post__figure img {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.post__figure figcaption {
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 10px;
}

.post__pullquote {
  font-family: var(--font-head);
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 24px;
  margin: 32px 0;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.footer__legal {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.footer__legal a,
.footer__cookie-btn {
  color: var(--text-dim);
  transition: color 0.2s;
}

.footer__legal a:hover,
.footer__cookie-btn:hover {
  color: var(--accent);
}

.footer__cookie-btn {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

/* ===== Cookie banner ===== */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 400;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
}

.cookie-banner.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner__inner {
  max-width: 900px;
  margin: 0 16px 16px;
  margin-inline: auto;
  background: rgba(16, 20, 27, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 26px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

.cookie-banner__text {
  flex: 1 1 380px;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

.cookie-banner__text a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.cookie-banner__text a:hover { border-color: var(--accent); }

.cookie-banner__actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: 10px 20px;
  font-size: 0.88rem;
  cursor: pointer;
}

/* El .btn--ghost genérico usa un borde casi invisible (pensado para ir
   sobre el vídeo del Hero) — aquí, sobre el panel oscuro del banner,
   necesita más contraste para que "Rechazar" se vea igual de bien que
   "Aceptar" y no parezca una opción escondida. */
#cookieBanner .btn--ghost {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text);
}

#cookieBanner .btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .cookie-banner__inner { flex-direction: column; align-items: stretch; }
  .cookie-banner__actions { justify-content: flex-end; }
}

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .reveal { transition: none; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav__toggle { display: flex; }

  .nav__tagline { display: none; }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav__links.is-open { display: flex; }

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

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

  .about__portrait { order: -1; aspect-ratio: 16/9; }

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

  .section__inner { padding: 80px 24px; }
}

@media (max-width: 480px) {
  .nav__inner { padding: 14px 20px; }

  .hero__bottom { padding: 0 20px; }

  .hero__bottom { bottom: 32px; }

  .hero__cta { gap: 12px; }

  .hero__video-toggle,
  .hero__scroll-cue { transform: scale(0.9); }

  .section__inner { padding: 64px 20px; }

  .timeline { padding-left: 24px; }
  .timeline__item::before { left: -30px; }

  .contact__row { flex-direction: column; }
}
