/* ========== VARIABLES ========== */
:root {
  --bg: #04070d;          /* azul marino casi negro */
  --bg-2: rgba(18, 32, 54, .45);  /* vidrio */
  --navy: #0a1628;
  --slate: #1c3150;       /* azul pizarra */
  --line: rgba(140, 180, 230, .14);
  --text: #eaf1fa;
  --muted: #8a9bb3;
  --accent: #8cc4ff;      /* azul hielo (brillo) */
  --cobalt: #2f5bff;      /* azul cobalto */
  --accent-ink: #04070d;
  --warn: #c9d8ff;
  --info: #5f8dff;
  --radius: 14px;
  --font: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
/* Grano sutil sobre todo el sitio, como en las referencias */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container { width: min(var(--max), 100% - 48px); margin-inline: auto; }

/* ========== HEADER ========== */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px max(24px, calc((100% - var(--max)) / 2));
  transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: rgba(4, 7, 13, .7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-block: 14px;
  border-color: var(--line);
}
.logo { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 28px; align-items: center; font-size: 15px; }
.nav a { color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav-cta {
  color: var(--accent-ink) !important; background: linear-gradient(180deg, #ffffff, #b9d9ff);
  box-shadow: 0 0 24px rgba(140, 196, 255, .35);
  padding: 8px 16px; border-radius: 999px; font-weight: 500;
}
.menu-btn { display: none; }

/* ========== HERO ========== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; padding: 120px 0 80px; overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 105%, rgba(140, 196, 255, .55), transparent 70%),
    radial-gradient(ellipse 45% 55% at 85% 30%, rgba(47, 91, 255, .28), transparent 70%),
    radial-gradient(ellipse 40% 40% at 10% 10%, rgba(28, 49, 80, .8), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--navy) 100%);
}
/* Barras de luz en el piso, inspiradas en "Make your move" */
.hero-grid::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: repeating-linear-gradient(90deg, transparent 0 90px, rgba(170, 210, 255, .08) 90px 92px);
  mask-image: linear-gradient(0deg, #000, transparent);
  -webkit-mask-image: linear-gradient(0deg, #000, transparent);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px 48px; align-items: end; }
.hero-inner > *:not(.terminal) { grid-column: 1; }
.eyebrow {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(140,196,255,.7); } 70% { box-shadow: 0 0 0 10px rgba(140,196,255,0); } 100% { box-shadow: 0 0 0 0 rgba(140,196,255,0); } }
.eyebrow { background: rgba(140,196,255,.06); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; backdrop-filter: blur(8px); }
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.9rem); line-height: 1.04;
  letter-spacing: -0.045em; font-weight: 600;
}
/* Degradado que viaja de un lado al otro dentro de las letras */
.accent {
  background: linear-gradient(90deg, #2f5bff 0%, #8cc4ff 25%, #ffffff 50%, #8cc4ff 75%, #2f5bff 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: accent-flow 5s ease-in-out infinite alternate;
}
@keyframes accent-flow {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) { .accent { animation: none; background-position: 50% 50%; } }
.hero-sub { color: var(--muted); max-width: 560px; font-size: 18px; }
.hero-sub strong { color: var(--text); font-weight: 500; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.btn {
  display: inline-flex; align-items: center; padding: 13px 22px; border-radius: 999px;
  font-weight: 500; font-size: 15px; transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(180deg, #ffffff, #b9d9ff); color: var(--accent-ink); box-shadow: 0 8px 30px -6px rgba(140,196,255,.55); }
.btn-ghost { border: 1px solid var(--line); background: rgba(140,196,255,.05); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--muted); }

.terminal {
  grid-column: 2; grid-row: 1 / span 4; align-self: center;
  background: rgba(10, 22, 40, .55); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.08);
  transform: rotate(1.5deg);
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.terminal-bar span { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.terminal pre { padding: 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.8; overflow-x: auto; }
.c-mute { color: var(--muted); }
.c-acc { color: var(--accent); }
.cursor { animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* ========== SECCIONES ========== */
.section { position: relative; padding: 110px 0; border-top: 1px solid var(--line); }
/* Halos de luz azul detrás de algunas secciones */
#proyectos::before, #stack::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 620px; height: 620px; border-radius: 50%; filter: blur(120px); opacity: .35;
}
#proyectos::before { top: 10%; right: -200px; background: var(--cobalt); }
#stack::before { top: 0; left: -260px; background: var(--slate); opacity: .7; }
main { position: relative; z-index: 0; overflow: clip; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 48px; }
.section-num { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.section h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; line-height: 1.1; }

/* Sobre mí */
.about { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.about .section-head { flex-direction: column; gap: 8px; }
.about-body p { color: var(--muted); margin-bottom: 18px; max-width: 640px; }
.about-body strong { color: var(--text); font-weight: 500; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 32px; }
.facts li { background: rgba(6,12,22,.9); padding: 18px; font-weight: 500; }
.facts span { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; margin-bottom: 4px; }

/* Proyectos */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project {
  background: linear-gradient(160deg, rgba(28,49,80,.45), rgba(10,22,40,.35));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 14px;
  transition: border-color .25s, transform .25s;
}
.project:hover { border-color: rgba(140,196,255,.4); transform: translateY(-4px); box-shadow: 0 20px 60px -20px rgba(47,91,255,.45), inset 0 1px 0 rgba(255,255,255,.08); }
.project.featured {
  grid-column: 1 / -1; padding: 36px;
  background:
    radial-gradient(ellipse 60% 120% at 100% 100%, rgba(140,196,255,.35), transparent 60%),
    radial-gradient(ellipse 50% 90% at 85% 110%, rgba(47,91,255,.5), transparent 70%),
    linear-gradient(160deg, rgba(28,49,80,.6), rgba(4,7,13,.6));
}
.project.featured h3 { font-size: 1.9rem; }
.project h3 { font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1.25; }
.project p { color: var(--muted); font-size: 16px; }
.project-meta { display: flex; justify-content: space-between; align-items: center; }
.tag { font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(140,196,255,.4); color: var(--accent); background: rgba(140,196,255,.08); }
.tag-wip { border-color: rgba(201,216,255,.25); color: var(--warn); background: rgba(201,216,255,.05); }
.tag-acad { border-color: rgba(95,141,255,.45); color: var(--info); background: rgba(47,91,255,.1); }
.year { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.chips li { font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 6px; background: rgba(4,7,13,.5); border: 1px solid var(--line); color: var(--muted); }
.project-links a { font-weight: 500; border-bottom: 1px solid var(--accent); padding-bottom: 2px; transition: color .2s; }
.project-links a:hover { color: var(--accent); }

.project:last-child:nth-child(even) { grid-column: 1 / -1; }

/* Timeline */
.timeline { border-left: 1px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 0 0 44px 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(140,196,255,.7); }
.tl-date { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 4px; }
.tl-body h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
.tl-org { color: var(--accent); font-size: 15px; margin-bottom: 8px; }
.tl-body p:last-child { color: var(--muted); font-size: 16px; max-width: 620px; }

/* Stack */
.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stack-col { background: rgba(6,12,22,.82); padding: 28px; }
.stack-col h3 { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 500; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .08em; }
.stack-col li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 16px; }
.stack-col li:last-child { border: 0; }

/* Contacto */
.contact {
  text-align: center; padding: 140px 0; overflow: hidden;
  background: radial-gradient(ellipse 55% 70% at 50% 120%, rgba(140,196,255,.4), rgba(47,91,255,.15) 45%, transparent 75%);
}
.contact-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.contact h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.contact p { color: var(--muted); max-width: 480px; }
.contact-mail {
  font-size: clamp(1.3rem, 3.4vw, 2.2rem); font-weight: 500; margin-top: 12px;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size .35s;
}
.contact-mail:hover { background-size: 100% 2px; }
.socials { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.socials a, .copy-btn {
  font: inherit; font-size: 15px; color: var(--text); background: transparent;
  border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.socials a:hover, .copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a:hover { color: var(--accent); }

/* ========== ANIMACIONES DE ENTRADA ========== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.terminal.reveal.visible { transform: rotate(1.5deg); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot, .cursor { animation: none; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .terminal { grid-column: 1; grid-row: auto; margin-top: 24px; transform: none; }
  .terminal.reveal.visible { transform: none; }
  .about { grid-template-columns: 1fr; gap: 0; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .menu-btn {
    display: flex; flex-direction: column; gap: 6px; background: none; border: 0; cursor: pointer; padding: 8px; z-index: 60;
  }
  .menu-btn span { width: 24px; height: 2px; background: var(--text); transition: transform .3s; }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 32px;
    background: var(--bg); font-size: 22px; opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  .nav.open { opacity: 1; pointer-events: auto; }
  .section { padding: 80px 0; }
  .projects { grid-template-columns: 1fr; }
  .project, .project.featured { padding: 24px; }
  .project.featured h3 { font-size: 1.5rem; }
  .facts { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding-left: 24px; }
  .stack-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   HERO CON MOTION GRAPHICS
   1 Intro cinética · 8 Cintas de seda
   9 Zoom por la "o" al hacer scroll
   ===================================================== */

/* --- Intro (1) --- */
.intro {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity .7s ease, visibility .7s;
}
.intro.done { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-word {
  font-size: clamp(3.6rem, 17vw, 13rem); font-weight: 800;
  letter-spacing: -0.065em; line-height: 1; text-align: center;
}
.intro-skip {
  position: absolute; right: 24px; bottom: 24px;
  font: 13px var(--mono); color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.intro-skip:hover { color: var(--text); border-color: var(--muted); }
body.intro-lock { overflow: hidden; }

/* --- Contenedor del zoom (9) --- */
.hero-wrap { position: relative; height: 170vh; }
.hero {
  position: sticky; top: 0;
  height: 100vh; height: 100svh; min-height: 0;
  padding: 96px 0 72px; display: flex; align-items: center; overflow: hidden;
  background: radial-gradient(ellipse 70% 60% at 50% 120%, rgba(28,49,80,.9), transparent 70%), var(--bg);
}

/* --- Cintas de seda (8) --- */
.hero-silk {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.6s ease;
}
.hero-silk.on { opacity: 1; }

/* --- Contenido --- */
.hero-content {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: center;
}
.hero-terminal .terminal { grid-column: auto; grid-row: auto; }
.hero-terminal { transition-delay: .25s; }
.hero-name {
  font-size: clamp(2.8rem, 7.2vw, 6.4rem); font-weight: 800;
  letter-spacing: -0.055em; line-height: .95; margin: 28px 0 20px;
  display: flex; flex-wrap: wrap; column-gap: .22em;
  transform-origin: 0 0;
}
.hero-name .line { display: block; overflow: hidden; padding-bottom: .08em; }
.hero-name .line > span { display: inline-block; transform: translateY(110%); }
.name-soft { color: transparent; -webkit-text-stroke: 1.5px rgba(234,241,250,.55); }
.hero-claim { font-size: clamp(1.35rem, 2.8vw, 2.25rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.hero-content .hero-sub { margin-top: 14px; }
.hero-content .hero-actions { margin-top: 26px; }

.hero-in { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.hero.ready .hero-in { opacity: 1; transform: none; }
.hero.ready .hero-name .line > span { transform: none; transition: transform 1s cubic-bezier(.2,.9,.1,1); }
.hero.ready .hero-name .line:nth-child(2) > span { transition-delay: .1s; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; translate: -50% 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font: 11px var(--mono); color: var(--muted); letter-spacing: .2em; text-transform: uppercase;
}
.scroll-hint span { width: 1px; height: 38px; background: linear-gradient(var(--accent), transparent); animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.hero-veil { position: absolute; inset: 0; z-index: 3; background: var(--bg); opacity: 0; pointer-events: none; }

/* Responsive */
@media (max-width: 960px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-terminal { display: none; }   /* en pantallas pequeñas no cabe junto al zoom */
}
@media (max-width: 720px) {
  .hero-wrap { height: 150vh; }
  .name-soft { -webkit-text-stroke-width: 1px; }
}
/* Sin animaciones si el sistema lo pide */
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .hero-wrap { height: auto; }
  .hero { position: relative; }
  .hero-in, .hero-name .line > span { opacity: 1; transform: none; transition: none; }
  .scroll-hint span { animation: none; }
}

/* =====================================================
   HEADER TIPO GLASS (de lado a lado)
   El vidrio va en ::before para que el menú móvil
   (position: fixed) pueda seguir ocupando toda la pantalla.
   ===================================================== */
.header,
.header.scrolled {
  top: 0; left: 0; right: 0; width: 100%; margin: 0;
  padding: 14px max(24px, calc((100% - var(--max)) / 2));
  background: transparent; border: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-radius: 0;
}
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(180deg, rgba(28, 49, 80, .38), rgba(10, 22, 40, .28));
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(140, 196, 255, .16);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, .04),
    0 12px 40px -12px rgba(0, 0, 0, .7);
  transition: background .3s, border-color .3s;
}
.header.scrolled::before {
  background: linear-gradient(180deg, rgba(28, 49, 80, .55), rgba(10, 22, 40, .48));
  border-bottom-color: rgba(140, 196, 255, .24);
}
.nav a:not(.nav-cta) { padding: 6px 2px; }

@media (max-width: 720px) {
  .header, .header.scrolled { padding: 12px 20px; }
  .menu-btn { position: relative; }
}

/* =====================================================
   SOBRE MÍ — texto que se ilumina con el scroll
   ===================================================== */
#sobre-mi { border-top: 0; padding: 140px 0 120px; }
.about-label {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 10px; margin-bottom: 28px;
}
.lit-text {
  font-size: clamp(1.7rem, 3.6vw, 3rem); font-weight: 500;
  line-height: 1.22; letter-spacing: -0.03em; max-width: 1000px;
}
.lit-text em { font-style: normal; }
.lit-word { color: rgba(234, 241, 250, .14); transition: color .35s ease; }
.lit-word.on { color: var(--text); }
.lit-word.accent-word.on { color: var(--accent); }
.about-foot {
  margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 40px; align-items: end;
}
.about-foot p { color: var(--muted); max-width: 460px; }
.about-foot .facts { margin-top: 0; }
@media (max-width: 960px) {
  .about-foot { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 720px) {
  #sobre-mi { padding: 100px 0 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .lit-word { color: var(--text); transition: none; }
  .lit-word.accent-word { color: var(--accent); }
}

/* =====================================================
   PROYECTOS — vitrina por escenas
   Dispositivo al centro, palabra gigante detrás,
   tarjetas de vidrio flotando y luz azul desde abajo.
   ===================================================== */
.projects-section { padding-bottom: 60px; }
#proyectos::before { display: none; }               /* quitamos el halo anterior */
.projects-section .about-label { margin-bottom: 0; }

.showcase { position: relative; height: calc(var(--count) * 75vh + 25vh); }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  --cx: 58%;                         /* centro horizontal del dispositivo */
  --cy: 46%;
}
.stage-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 38% 55% at var(--cx) 105%, rgba(140,196,255,.45), transparent 70%),
    radial-gradient(ellipse 60% 70% at var(--cx) 90%, rgba(47,91,255,.28), transparent 70%);
}

/* --- Escena --- */
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; --dw: min(46vw, 640px); }
.scene:has(.phone) { --dw: 240px; }
.scene.is-active { opacity: 1; visibility: visible; }

/* Palabra gigante de fondo */
.scene-bg {
  position: absolute; left: 50%; top: var(--cy); translate: -50% -50%;
  font-size: clamp(5rem, 15vw, 14rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1;
  white-space: nowrap; pointer-events: none; user-select: none;
  color: rgba(140,196,255,.07);
  -webkit-text-stroke: 1px rgba(140,196,255,.16);
  transform: translateX(6%); transition: transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.scene.is-active .scene-bg { transform: none; }

/* --- Dispositivos --- */
.device {
  position: absolute; left: var(--cx); top: var(--cy); translate: -50% -50%;
  width: var(--dw); z-index: 2;
  border: 1px solid rgba(140,196,255,.22); background: #070d18; overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 80px -20px rgba(47,91,255,.45), inset 0 1px 0 rgba(255,255,255,.08);
  transform: translateY(50px) scale(.96); opacity: 0;
  transition: transform 1s cubic-bezier(.2,.8,.2,1) .1s, opacity .8s ease .1s;
}
.scene.is-active .device { transform: none; opacity: 1; }
.device.browser { border-radius: 14px; }
.device.browser .screen { aspect-ratio: 16 / 10; }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(18,32,54,.6); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(140,196,255,.25); }
.browser-bar span { margin-left: 10px; font: 11px var(--mono); color: var(--muted); }
.device.phone { border-radius: 36px; padding: 10px; background: #0b1422; }
.device.phone .screen { aspect-ratio: 9 / 19; border-radius: 28px; }
.screen { position: relative; overflow: hidden; background: #060b14; }
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Esqueleto de interfaz (se ve mientras no haya captura) */
.skeleton { position: absolute; inset: 0; padding: 7%; display: flex; flex-direction: column; gap: 5%; }
.skeleton i { display: block; border-radius: 6px; background: rgba(140,196,255,.10); }
.sk-nav { height: 4%; width: 100%; }
.sk-hero { flex: 0 0 34%; background: linear-gradient(135deg, rgba(47,91,255,.55), rgba(140,196,255,.25) 60%, rgba(10,22,40,.4)) !important; border-radius: 10px !important; }
.sk-line { height: 4%; width: 70%; }
.sk-line.short { width: 45%; }
.sk-cards { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5%; }
.phone .sk-cards { grid-template-columns: 1fr; }
.phone .sk-cards i:nth-child(n+3) { display: none; }

/* --- Tarjetas flotantes de vidrio --- */
.float {
  position: absolute; z-index: 3;
  background: linear-gradient(160deg, rgba(28,49,80,.55), rgba(10,22,40,.45));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(140,196,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 20px 50px -20px rgba(0,0,0,.8);
  opacity: 0; transform: translateY(18px) scale(.96);
  transition: opacity .7s ease var(--d), transform .9s cubic-bezier(.2,.8,.2,1) var(--d);
}
.scene.is-active .float { opacity: 1; transform: none; }
.scene.is-active .float > * { animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -6px; } }

.float.pill { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 500; }
.float.pill > * { animation: none !important; }
.pill-dot { width: 10px; height: 10px; border-radius: 50%; background: #eaf1fa; box-shadow: 0 0 12px rgba(234,241,250,.8); }
.float.card { padding: 16px 18px; border-radius: 18px; display: flex; flex-direction: column; gap: 4px; min-width: 190px; }
.float.card strong { font-weight: 500; font-size: 16px; }
.float.card span { font-size: 13px; color: var(--muted); }
.float.ring { flex-direction: row; align-items: center; gap: 18px; }
.ring-wrap { position: relative; width: 64px; height: 64px; flex: none; }
.ring-svg { width: 64px; height: 64px; rotate: -90deg; }
.ring-svg circle { fill: none; stroke-width: 5; }
.ring-track { stroke: rgba(255,255,255,.08); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(140,196,255,.6)); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-size: 18px; }

/* Posiciones alrededor del dispositivo */
.float.l1 { right: calc(100% - var(--cx) + var(--dw) / 2 - 40px); top: 30%; }
.float.l2 { right: calc(100% - var(--cx) + var(--dw) / 2 - 30px); top: 60%; }
.float.r1 { left: calc(var(--cx) + var(--dw) / 2 - 60px); top: 18%; }
.float.r2 { left: calc(var(--cx) + var(--dw) / 2 - 30px); top: 62%; }

/* --- Información del proyecto --- */
.scene-info {
  position: absolute; z-index: 4; left: max(24px, calc((100% - var(--max)) / 2)); bottom: 48px; width: min(360px, 34vw);
  opacity: 0; transform: translateY(20px); transition: opacity .7s ease .2s, transform .8s ease .2s;
}
.scene.is-active .scene-info { opacity: 1; transform: none; }
.scene-count { font: 13px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.scene-count > span:first-child { color: var(--accent); }
.scene-count .tag { margin-left: 6px; }
.scene-info h3 { font-size: 1.6rem; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 10px; }
.scene-info > p:not(.scene-count) { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.scene-info .chips { margin: 0 0 16px; padding: 0; }
.scene-link { font-weight: 500; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.scene-link:hover { color: var(--accent); }

/* Puntos de navegación */
.stage-nav { position: absolute; z-index: 5; right: max(24px, calc((100% - var(--max)) / 2)); top: 50%; translate: 0 -50%; display: flex; flex-direction: column; gap: 12px; }
.dot-btn { width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; background: rgba(140,196,255,.25); cursor: pointer; transition: height .3s, background .3s; }
.dot-btn.is-active { height: 28px; background: var(--accent); }

/* --- Otros trabajos --- */
.more-work { margin-top: 40px; }
.more-title { font: 13px var(--mono); color: var(--muted); margin-bottom: 14px; }
.more-item { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.more-item h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.more-item p { color: var(--muted); font-size: 15px; max-width: 640px; }
.more-item .chips { margin: 0; padding: 0; flex: none; }

/* --- Pantallas medianas y celular: escenas apiladas, sin fijar --- */
@media (max-width: 960px) {
  .showcase { height: auto; }
  .stage { position: relative; height: auto; overflow: visible; display: flex; flex-direction: column; gap: 72px; padding: 40px 0; }
  .stage-glow, .stage-nav { display: none; }
  .scene { position: relative; inset: auto; opacity: 1; visibility: visible; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 24px; overflow: hidden; --dw: min(100%, 560px); }
  .scene:has(.phone) { --dw: 220px; }
  .scene::before { content: ""; position: absolute; inset: 20% 0 auto; height: 60%; background: radial-gradient(ellipse 50% 60% at 50% 70%, rgba(47,91,255,.3), transparent 70%); pointer-events: none; }
  .scene-bg { top: 32%; font-size: 22vw; }
  .device, .scene-info, .float { position: relative; left: auto; right: auto; top: auto; bottom: auto; translate: none; }
  .device { order: 1; }
  .float { order: 2; opacity: 1; transform: none; }
  .float.card { min-width: 0; }
  .scene-info { order: 3; width: 100%; max-width: 560px; }
  .scene .float, .scene .device, .scene .scene-info, .scene .scene-bg { transition: none; opacity: 1; transform: none; }
  .more-item { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .scene, .scene *, .scene-bg { transition: none !important; animation: none !important; }
}

/* Ajustes de la vitrina */
.float.ring > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.stage-nav { right: 22px; }
.scene-bg { top: 40%; }
@media (max-width: 960px) {
  .stage .scene .float { position: relative; left: auto; right: auto; top: auto; bottom: auto; }
  .stage .scene { gap: 14px; }
  .stage .scene .device { margin-bottom: 8px; }
  .scene-bg { top: 26%; }
}
/* Las capturas reales son panorámicas: pantalla del navegador en 2:1 */
.device.browser .screen { aspect-ratio: 2 / 1; }
.screen img { object-position: left top; }

/* =====================================================
   EXPERIENCIA Y FORMACIÓN — dos columnas
   ===================================================== */
#experiencia .about-label { margin-bottom: 40px; }
.career { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; }
.career-title { font-size: 1.5rem !important; letter-spacing: -0.02em; margin-bottom: 28px; }
.career .timeline li { grid-template-columns: 1fr; gap: 6px; }
.career .tl-date { padding-top: 0; }
@media (max-width: 960px) {
  .career { grid-template-columns: 1fr; gap: 56px; }
}

/* =====================================================
   SOBRE MÍ — panel claro (contraste con el resto)
   ===================================================== */
.about-light {
  --l-bg: #eceff3; --l-ink: #0a1628; --l-muted: #5b6878;
  position: relative; overflow: hidden;
  margin: 0 14px; border: 0; border-radius: 32px;
  background:
    radial-gradient(ellipse 50% 60% at 100% 0%, rgba(140,196,255,.35), transparent 70%),
    linear-gradient(180deg, #f2f4f7, var(--l-bg));
  color: var(--l-ink);
}
#sobre-mi.about-light { padding: 120px 0 110px; }
.about-light ::selection { background: var(--l-ink); color: #fff; }

.about-cubes {
  position: absolute; right: 4%; top: 40px; width: clamp(140px, 18vw, 240px);
  filter: drop-shadow(0 30px 40px rgba(10,22,40,.25));
  animation: cubes-float 8s ease-in-out infinite;
}
@keyframes cubes-float { 50% { transform: translateY(-10px) rotate(-1.5deg); } }

/* Etiqueta tipo píldora */
.pill-label {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px;
  padding: 5px 12px 5px 6px; border: 1px solid rgba(10,22,40,.18); border-radius: 8px;
  font: 12px var(--mono); color: var(--l-ink); background: rgba(255,255,255,.6);
}
.pill-num { padding: 2px 6px; border-radius: 4px; background: var(--l-ink); color: #fff; font-size: 11px; }

/* Texto que se ilumina, en versión clara */
.about-light .lit-text { color: var(--l-ink); max-width: 980px; }
.about-light .lit-word { color: rgba(10,22,40,.13); }
.about-light .lit-word.on { color: var(--l-ink); }
.about-light .lit-word.accent-word.on { color: var(--cobalt); }

/* Tarjetas */
.about-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 64px; }
.about-card {
  position: relative; min-height: 230px; padding: 22px; border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.about-card h3 { font-size: 1.4rem; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 8px; }
.about-card p { font-size: 14px; line-height: 1.5; }
.card-icon {
  position: absolute; top: 20px; left: 20px; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
}
.card-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.card-cobalt {
  color: #fff;
  background:
    radial-gradient(ellipse 80% 70% at 20% 0%, rgba(185,217,255,.75), transparent 60%),
    linear-gradient(180deg, #2f5bff 0%, #123266 60%, #0a1628 100%);
}
.card-cobalt p { color: rgba(234,241,250,.75); }
.card-cobalt .card-icon { background: rgba(255,255,255,.18); }

.card-navy {
  color: #fff;
  background:
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(47,91,255,.35), transparent 70%),
    linear-gradient(180deg, #1c3150, #0a1628);
}
.card-navy p { color: rgba(234,241,250,.7); }
.card-navy .card-icon { background: #eaf1fa; color: var(--l-ink); }

.card-light { background: #fff; color: var(--l-ink); border: 1px solid rgba(10,22,40,.08); }
.card-light p { color: var(--l-muted); }
.card-light .card-icon { background: var(--l-ink); color: #fff; }

.about-card { transition: transform .35s ease, box-shadow .35s ease; }
.about-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(10,22,40,.45); }

@media (max-width: 960px) {
  .about-cards { grid-template-columns: 1fr; }
  .about-card { min-height: 170px; }
  .about-cubes { width: 120px; top: 24px; right: 16px; opacity: .9; }
}
@media (max-width: 720px) {
  .about-light { margin: 0 8px; border-radius: 24px; }
  #sobre-mi.about-light { padding: 96px 0 72px; }
}
@media (prefers-reduced-motion: reduce) { .about-cubes { animation: none; } }
#proyectos { border-top: 0; }

/* Forma abstracta difuminada en Sobre mí (reemplaza los cubos) */
.about-light {
  background:
    radial-gradient(ellipse 50% 60% at 100% 0%, rgba(140,196,255,.30), transparent 70%),
    linear-gradient(180deg, #eef2f6, #e2e8ef);
}
.about-light::after {                 /* grano como en el póster */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .25 0 0 0 0 .35 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.about-light > .container { position: relative; z-index: 1; }
.about-blur {
  position: absolute; z-index: 0; right: -6%; top: 2%; width: 58%; height: 62%;
  pointer-events: none; transform-origin: 70% 50%;
  animation: smear-drift 14s ease-in-out infinite alternate;
}
@keyframes smear-drift {
  0%   { transform: translateX(0) skewX(0deg) scaleY(1); }
  50%  { transform: translateX(-2%) skewX(-6deg) scaleY(1.06); }
  100% { transform: translateX(1.5%) skewX(4deg) scaleY(.95); }
}
.about-light .lit-text { max-width: 780px; }
@media (max-width: 960px) {
  .about-blur { width: 120%; height: 40%; right: -40%; top: 0; opacity: .55; }
}
@media (prefers-reduced-motion: reduce) { .about-blur { animation: none; } }
/* Ajuste: el contenedor fijo recorta y desvanece; la forma se mueve adentro */
.about-blur-wrap {
  position: absolute; z-index: 0; right: -4%; top: 6%; width: 50%; height: 60%;
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 8%, #000 40%, #000 100%), linear-gradient(180deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, transparent 8%, #000 40%, #000 100%), linear-gradient(180deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  mask-composite: intersect;
}
.about-blur-wrap .about-blur { position: absolute; left: -4%; top: -4%; width: 108%; height: 108%; right: auto; }
.about-light .lit-text { max-width: 680px; }
@media (max-width: 960px) {
  .about-blur-wrap { width: 110%; height: 34%; right: -30%; top: 0; opacity: .5; }
  .about-light .lit-text { max-width: none; }
}

/* =====================================================
   SOBRE MÍ — vidrio esmerilado con siluetas detrás
   (reemplaza la forma abstracta y las tarjetas)
   ===================================================== */
.about-light {
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, rgba(255,255,255,.75), transparent 70%),
    linear-gradient(180deg, #e6eef7 0%, #c4d8ee 55%, #93b6de 100%);
}
#sobre-mi.about-light { padding: 150px 0 190px; }
.about-light::after { opacity: .14; }                 /* grano más suave */

.glass-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glass-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Neblina del vidrio: lo de abajo se ve más lavado */
.glass-scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(230,238,247,.15) 0%, rgba(230,238,247,0) 40%, rgba(196,216,238,.55) 100%);
  backdrop-filter: blur(2px);
}
.pane-seam {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.35));
  box-shadow: 1px 0 0 rgba(10,22,40,.08);
}
.glass-person { animation: walk-by 22s ease-in-out infinite alternate; }
@keyframes walk-by {
  0%   { transform: translateX(-60px); }
  100% { transform: translateX(260px); }
}

.glass-note {
  position: absolute; z-index: 1; font-size: 15px; color: rgba(10,22,40,.75); letter-spacing: .01em;
}
.glass-note-a { left: calc(33.3% + 24px); top: 64px; word-spacing: .2em; }
.glass-note-b { right: max(24px, calc((100% - var(--max)) / 2)); top: 56px; text-align: center; line-height: 1.5; }

.about-light .lit-text { max-width: 900px; }
.about-light .lit-word { color: rgba(10,22,40,.16); }

@media (max-width: 960px) {
  .glass-note-a { left: 24px; top: 28px; }
  .glass-note-b { display: none; }
  #sobre-mi.about-light { padding: 110px 0 140px; }
}
@media (prefers-reduced-motion: reduce) { .glass-person { animation: none; } }

/* =====================================================
   EXPERIENCIA — fondo claro, forma oscura con halo azul
   ===================================================== */
.exp-light {
  --l-ink: #0a1628;
  position: relative; overflow: hidden;
  margin: 40px 14px 0; border: 0 !important; border-radius: 32px;
  background:
    radial-gradient(ellipse 55% 45% at 50% 50%, #ffffff, transparent 75%),
    linear-gradient(180deg, #eef3fa, #dfe8f4);
  color: var(--l-ink);
}
#experiencia.exp-light { padding: 110px 0 120px; }
.exp-light .pill-label { margin-bottom: 56px; }

.exp-orb { position: relative; isolation: isolate; padding: 110px 72px 90px; color: var(--text); }
/* Halo azul exterior, muy difuminado */
.exp-orb::after {
  content: ""; position: absolute; inset: -10px; z-index: -2;
  border-radius: 44% 56% 48% 52% / 52% 44% 56% 48%;
  background: radial-gradient(ellipse at 50% 50%, #2f5bff 30%, #8cc4ff 65%, transparent 80%);
  filter: blur(46px); opacity: .9;
  animation: orb-morph 18s ease-in-out infinite alternate;
}
/* Forma oscura con el borde suavizado */
.exp-orb::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: 44% 56% 48% 52% / 52% 44% 56% 48%;
  background: radial-gradient(ellipse 70% 70% at 45% 40%, #070d18 40%, #0a1628 70%, #13285a 100%);
  filter: blur(6px);
  box-shadow: inset 0 0 60px 10px rgba(47,91,255,.35);
  animation: orb-morph 18s ease-in-out infinite alternate;
}
@keyframes orb-morph {
  0%   { border-radius: 44% 56% 48% 52% / 52% 44% 56% 48%; transform: rotate(0deg) scale(1); }
  50%  { border-radius: 52% 48% 56% 44% / 46% 54% 46% 54%; transform: rotate(1.5deg) scale(1.015); }
  100% { border-radius: 48% 52% 44% 56% / 56% 48% 52% 44%; transform: rotate(-1deg) scale(.99); }
}

.exp-mark {
  display: block; width: 46px; height: 46px; margin: 0 auto 48px; fill: #fff;
  filter: drop-shadow(0 0 14px rgba(140,196,255,.6));
  animation: mark-spin 30s linear infinite;
}
@keyframes mark-spin { to { transform: rotate(360deg); } }

.exp-orb .career { max-width: 920px; margin: 0 auto; }
.exp-orb .career-title { color: #fff; }
.exp-orb .timeline { border-left-color: rgba(140,196,255,.18); }

.exp-caption {
  margin-top: 56px; text-align: center; color: rgba(234,241,250,.85);
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1.3;
}

@media (max-width: 960px) {
  .exp-orb { padding: 80px 32px 64px; }
  .exp-orb::before, .exp-orb::after { border-radius: 48px; animation: none; }
}
@media (max-width: 720px) {
  .exp-light { margin: 32px 8px 0; border-radius: 24px; }
  #experiencia.exp-light { padding: 80px 0 72px; }
  .exp-orb { margin: 0 -12px; padding: 64px 24px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .exp-orb::before, .exp-orb::after, .exp-mark { animation: none; }
}

/* =====================================================
   SOBRE MÍ — póster editorial (estilo Solwy)
   Reemplaza el vidrio esmerilado
   ===================================================== */
.about-poster {
  background: linear-gradient(180deg, #eef2f6, #dfe6ee);
}
#sobre-mi.about-poster { padding: 64px 0 64px; }
.about-poster::after { opacity: .22; }

.poster-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.poster-top .pill-label { margin: 0; flex: none; }
.poster-text { max-width: 520px; }
.poster-text p { font-size: 17px; line-height: 1.6; color: #16243a; text-indent: 2.2em; }
.poster-text p + p { margin-top: 14px; }

.poster-smear {
  position: relative; z-index: 0; height: clamp(220px, 34vw, 380px); margin: 8px 0;
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}
.poster-smear svg {
  position: absolute; left: -5%; top: 0; width: 110%; height: 100%;
  animation: poster-drift 16s ease-in-out infinite alternate;
}
@keyframes poster-drift {
  0%   { transform: translateX(-1.5%) skewX(0deg) scaleY(1); }
  50%  { transform: translateX(1%) skewX(-4deg) scaleY(1.05); }
  100% { transform: translateX(2%) skewX(3deg) scaleY(.96); }
}

.poster-bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.poster-title {
  font-size: clamp(2.8rem, 7.2vw, 6.6rem) !important; font-weight: 700; letter-spacing: -0.05em !important;
  line-height: .95 !important; color: #0a1628;
}
.poster-facts { display: grid; gap: 14px; flex: none; min-width: 220px; padding-bottom: 8px; }
.poster-facts li { font-size: 16px; font-weight: 500; color: #0a1628; border-top: 1px solid rgba(10,22,40,.18); padding-top: 8px; }
.poster-facts span { display: block; font: 12px var(--mono); color: #4a5a6e; margin-bottom: 2px; }

@media (max-width: 960px) {
  .poster-top, .poster-bottom { flex-direction: column; align-items: flex-start; gap: 24px; }
  .poster-text { max-width: none; }
  .poster-facts { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  #sobre-mi.about-poster { padding: 48px 0 48px; }
  .poster-text p { font-size: 16px; }
  .poster-facts { grid-template-columns: 1fr; }
  .poster-title { font-size: 2.15rem !important; }
}
@media (prefers-reduced-motion: reduce) { .poster-smear svg { animation: none; } }

/* Títulos solo para lectores de pantalla (las secciones ya no llevan etiqueta visible) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.poster-top { justify-content: flex-end; }
#experiencia.exp-light { padding-top: 90px; }

/* =====================================================
   HEADER SOBRE SECCIONES CLARAS
   script.js agrega .on-light cuando el header pasa por
   "Sobre mí" o "Experiencia" (fondos claros)
   ===================================================== */
.header::before { transition: background .35s ease, border-color .35s ease; }
.logo, .nav a, .menu-btn span { transition: color .35s ease, background-color .35s ease; }
.header.on-light::before {
  background: linear-gradient(180deg, rgba(248,250,252,.78), rgba(238,242,247,.68));
  border-bottom-color: rgba(10,22,40,.10);
  box-shadow: 0 12px 40px -18px rgba(10,22,40,.25);
}
.header.on-light .logo { color: #0a1628; }
.header.on-light .logo span { color: var(--cobalt); }
.header.on-light .nav:not(.open) a:not(.nav-cta) { color: #4a5a6e; }
.header.on-light .nav:not(.open) a:not(.nav-cta):hover,
.header.on-light .nav:not(.open) a.active { color: #0a1628; }
.header.on-light .nav-cta { background: #0a1628; color: #fff !important; box-shadow: 0 6px 20px -6px rgba(10,22,40,.5); }
.header.on-light .menu-btn[aria-expanded="false"] span { background: #0a1628; }
@media (max-width: 720px) {
  .header.on-light .nav.open .nav-cta { background: linear-gradient(180deg, #ffffff, #b9d9ff); color: var(--accent-ink) !important; }
}

/* =====================================================
   STACK — columnas limpias con cintas tenues detrás
   ===================================================== */
.stack-section { position: relative; overflow: hidden; border-top: 0; padding: 130px 0; }
#stack::before { display: none; }
.stack-silk { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .6; pointer-events: none; }
.stack-section .container { position: relative; z-index: 1; }
.stack-section .stack-grid { gap: 32px; background: none; border: 0; border-radius: 0; overflow: visible; }
.stack-section .stack-col { background: none; padding: 0; }
.stack-section .stack-col li { border-bottom-color: rgba(140,196,255,.15); }
.stack-section .stack-col li:last-child { border-bottom: 1px dashed rgba(140,196,255,.15); }
@media (max-width: 960px) { .stack-section .stack-grid { gap: 40px 24px; } }
@media (max-width: 720px) { .stack-section { padding: 90px 0; } }
.poster-facts { min-width: 0; width: 240px; }
.stack-silk { opacity: .8; }
@media (max-width: 960px) { .poster-facts { width: 100%; } }

/* =====================================================
   STACK — foto de fondo a la derecha, fundida con la sección
   ===================================================== */
.stack-section { min-height: 680px; display: flex; align-items: center; }
.stack-section > .container { width: min(var(--max), 100% - 48px); }
.stack-photo {
  position: absolute; right: 0; top: 0; height: 100%; width: min(52%, 760px);
  object-fit: cover; object-position: 30% 35%;
  opacity: .9; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.4) 22%, #000 48%), linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.4) 22%, #000 48%), linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-composite: intersect;
}
.stack-silk { z-index: 0; }
.stack-section .container { z-index: 2; }
.stack-section .section-head, .stack-section .stack-grid { max-width: 56%; }
.stack-section .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }

@media (max-width: 960px) {
  .stack-section { display: block; min-height: 0; padding-top: 360px !important; }
  .stack-photo {
    width: 100%; height: 440px; object-position: 35% 30%;
    -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
    opacity: .75;
  }
  .stack-section .section-head, .stack-section .stack-grid { max-width: none; }
}

/* =====================================================
   SOBRE MÍ — polaroid junto a los párrafos
   ===================================================== */
.poster-intro { display: flex; align-items: flex-start; gap: 44px; }
.polaroid {
  flex: none; width: 190px; margin: 6px 0 0; padding: 10px 10px 0;
  background: #fbfbf8; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(10,22,40,.15), 0 18px 40px -14px rgba(10,22,40,.45);
  transform: rotate(-4deg); transform-origin: 50% 0;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s ease;
  position: relative;
}
.polaroid.reveal.visible { transform: rotate(-4deg); }
.polaroid:hover, .polaroid.reveal.visible:hover { transform: rotate(-1deg) translateY(-4px) scale(1.03); box-shadow: 0 2px 4px rgba(10,22,40,.15), 0 26px 50px -16px rgba(10,22,40,.5); }
/* cinta adhesiva */
.polaroid::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 74px; height: 24px; translate: -50% 0; rotate: 3deg;
  background: rgba(185,217,255,.55); backdrop-filter: blur(2px);
  box-shadow: 0 1px 2px rgba(10,22,40,.12);
}
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; filter: saturate(.95); }
.polaroid figcaption { font: 500 22px 'Caveat', cursive; color: #1c3150; text-align: center; padding: 8px 0 12px; line-height: 1; }

@media (max-width: 960px) {
  .poster-intro { flex-direction: column; gap: 32px; }
  .polaroid { width: 160px; margin-left: 8px; }
}
/* Polaroid centrada en la columna izquierda del póster */
.poster-top { justify-content: stretch; }
.poster-intro { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 40px; align-items: center; }
.poster-intro .polaroid { justify-self: center; width: 210px; margin: 0; }
@media (max-width: 960px) {
  .poster-intro { grid-template-columns: 1fr; gap: 32px; }
  .poster-intro .polaroid { justify-self: start; width: 160px; margin-left: 8px; }
}
/* Experiencia: más espacio dentro de la forma para que todo el texto quede sobre lo oscuro */
.exp-orb { padding: 120px 120px 150px; }
.exp-orb::before, .exp-orb::after { inset: -30px -20px; }
.exp-orb .career { max-width: 860px; }
@media (max-width: 960px) { .exp-orb { padding: 80px 32px 64px; } .exp-orb::before, .exp-orb::after { inset: 0; } }
@media (max-width: 720px) { .exp-orb { padding: 64px 24px 48px; } }

/* =====================================================
   AJUSTES DE CELULAR
   ===================================================== */
.m-proj-head, .m-dots { display: none; }

@media (max-width: 720px) {
  /* Hero: contenido arriba, cerca del header */
  .hero { align-items: flex-start; padding-top: 92px; }

  /* Sobre mí: polaroid centrada */
  .poster-intro .polaroid { justify-self: center; margin: 8px auto 0; }
}

@media (max-width: 960px) {
  /* Proyectos: encabezado y carrusel deslizable */
  .m-proj-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 0; }
  .m-proj-head h2 { font-size: 2rem; letter-spacing: -0.03em; }
  .m-proj-head p { font: 13px var(--mono); color: var(--accent); white-space: nowrap; }

  .showcase .stage {
    flex-direction: row; gap: 14px; padding: 24px 24px 8px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 24px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .showcase .stage::-webkit-scrollbar { display: none; }
  .showcase .stage .scene {
    flex: 0 0 86%; scroll-snap-align: start;
    flex-direction: row; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 8px;
    padding: 12px 12px 20px; border-radius: 20px;
    background: linear-gradient(160deg, rgba(28,49,80,.45), rgba(10,22,40,.6));
    border: 1px solid rgba(140,196,255,.16);
    --dw: 100%;
  }
  .showcase .stage .scene::before, .showcase .stage .scene-bg { display: none; }
  .showcase .stage .scene .device { width: 100%; margin: 0 0 8px; order: 0; }
  .showcase .stage .scene .device.phone { width: 150px; margin: 0 auto 8px; }

  /* Puntos clave: pequeñas píldoras dentro de la tarjeta */
  .showcase .stage .scene .float {
    order: 1; width: auto; min-width: 0; padding: 5px 10px; border-radius: 999px;
    flex-direction: row; align-items: center; gap: 6px;
    font-size: 12px; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    background: rgba(140,196,255,.08);
  }
  .showcase .stage .scene .float > * { animation: none !important; }
  .showcase .stage .scene .float strong { font-size: 12px; }
  .showcase .stage .scene .float span { font-size: 12px; }
  .showcase .stage .scene .float.ring > div:first-child { flex-direction: row; gap: 6px; }
  .showcase .stage .scene .ring-wrap, .showcase .stage .scene .pill-dot { display: none; }

  .showcase .stage .scene .scene-info { order: 2; width: 100%; margin-top: 10px; }
  .showcase .stage .scene .scene-info h3 { font-size: 1.3rem; }
  .showcase .stage .scene .scene-info > p:not(.scene-count) { font-size: 14px; }

  .m-dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0 0; }
  .m-dots span { width: 7px; height: 7px; border-radius: 999px; background: rgba(140,196,255,.25); transition: width .3s, background .3s; }
  .m-dots span.on { width: 22px; background: var(--accent); }
}

/* Hero en celular: distribuido en toda la pantalla
   arriba: disponibilidad · centro: nombre y frase · abajo: botones */
@media (max-width: 720px) {
  .hero { align-items: stretch; padding: 84px 0 76px; }
  .hero-content { display: flex; flex-direction: column; height: 100%; }
  .hero-text { flex: 1; display: flex; flex-direction: column; }
  .eyebrow { align-self: flex-start; }
  .eyebrow-extra { display: none; }
  .hero-name { font-size: 15vw; line-height: .9; margin: auto 0 18px; }
  .hero-claim { font-size: 1.45rem; }
  .hero-content .hero-sub { font-size: 16px; }
  .hero-content .hero-actions { margin-top: auto; padding-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-content .hero-actions .btn { justify-content: center; }
  .scroll-hint { bottom: 18px; }
}
@media (max-width: 720px) {
  .hero { padding-bottom: 96px; }
  .scroll-hint { bottom: 16px; gap: 6px; }
  .scroll-hint span { height: 26px; }
}
