/* =========================================================
   PLANTILLA DE PORTAFOLIO · estilos
   Para personalizar: cambia solo las variables de :root
   y de los bloques [data-accent] / [data-theme].
   ========================================================= */

@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-weight: 300 700; font-display: swap; src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tema (oscuro por defecto) ---------- */
:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --card: #151922;
  --fg: #eef1f7;
  --muted: #98a2b5;
  --line: rgba(255, 255, 255, .09);
  --accent: #c6f432;
  --accent-ink: #0b0f05;
  --accent-fg: var(--accent);        /* acento usado como color de texto */
  --radius: 22px;
  --max: 1180px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f6f6f1;
  --bg-2: #ecece4;
  --card: #ffffff;
  --fg: #12141a;
  --muted: #5b6475;
  --line: rgba(0, 0, 0, .1);
  --accent-fg: color-mix(in oklab, var(--accent) 45%, #000);
  color-scheme: light;
}

/* ---------- Colores de acento (cambia data-accent en <html>) ---------- */
html[data-accent="lima"]    { --accent: #c6f432; --accent-ink: #0b0f05; }
html[data-accent="violeta"] { --accent: #a78bfa; --accent-ink: #120a2e; }
html[data-accent="coral"]   { --accent: #ff7a59; --accent-ink: #2a0d05; }
html[data-accent="cian"]    { --accent: #38d6e8; --accent-ink: #04222a; }
html[data-accent="ambar"]   { --accent: #ffb938; --accent-ink: #2a1a02; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 1rem; line-height: 1.65; overflow-x: hidden; transition: background-color .4s, color .4s; }
body.bloqueado { overflow: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap { width: min(100% - 40px, var(--max)); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }

/* ---------- Capas decorativas ---------- */
.grain { position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.glow { position: fixed; z-index: 0; top: 0; left: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 22%, transparent), transparent); opacity: 0; transition: opacity .6s; }
.glow.on { opacity: .8; }
.progress { position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- Preloader (solo existe cuando hay animaciones) ---------- */
.preloader { display: none; position: fixed; inset: 0; z-index: 200; background: var(--accent); color: var(--accent-ink); flex-direction: column; justify-content: space-between; padding: 28px; }
.anim .preloader { display: flex; }
.preloader__name { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.1rem, 3vw, 1.6rem); }
.preloader__count { font-family: var(--font-display); font-weight: 700; font-size: clamp(5rem, 22vw, 16rem); line-height: .8; align-self: flex-end; font-variant-numeric: tabular-nums; }

/* ---------- Navegación ---------- */
.nav { position: fixed; z-index: 70; top: 14px; left: 0; right: 0; margin-inline: auto; width: min(100% - 24px, 900px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 18px;
  background: color-mix(in oklab, var(--bg) 70%, transparent); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line); border-radius: 999px; }
.nav__logo { display: inline-flex; align-items: baseline; gap: 2px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.nav__logo i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav__links { display: none; gap: 4px; }
.nav__links a { text-decoration: none; font-size: .92rem; padding: 8px 14px; border-radius: 999px; color: var(--muted); transition: color .2s, background-color .2s; }
.nav__links a:hover, .nav__links a[aria-current="true"] { color: var(--fg); background: var(--line); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; transition: background-color .2s; }
.icon-btn:hover { background: var(--line); }
.nav .nav__cta { display: none; }
.nav__burger { flex-direction: column; gap: 5px; display: inline-flex; align-items: center; justify-content: center; }
.nav__burger span { display: block; width: 16px; height: 2px; background: currentColor; transition: transform .3s var(--ease); }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
@media (min-width: 820px) {
  .nav__links { display: flex; } .nav .nav__cta { display: inline-flex; } .nav__burger { display: none; }
}

.menu { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 24px; }
.menu[hidden] { display: none; }
.menu a { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 11vw, 4rem); text-decoration: none; line-height: 1.15; }
.menu a:hover { color: var(--accent-fg); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); padding: 14px 24px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid var(--accent); transition: background-color .2s, color .2s, border-color .2s; will-change: transform; }
.btn:hover { background: transparent; color: var(--accent-fg); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-fg); }
.btn--small { padding: 9px 18px; font-size: .9rem; }

/* ---------- Tipografía de sección ---------- */
.section { position: relative; z-index: 1; padding: clamp(72px, 12vw, 150px) 0; }
.kicker { font-family: var(--font-display); font-weight: 500; color: var(--accent-fg); letter-spacing: .04em; margin-bottom: 14px; }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 5.5vw, 3.8rem); line-height: 1.08; letter-spacing: -.02em; max-width: 20ch; margin-bottom: clamp(28px, 5vw, 56px); }
.h2--xl { font-size: clamp(2.8rem, 10vw, 8rem); max-width: none; line-height: .98; margin-bottom: 24px; }
.manifesto { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.25rem, 2.8vw, 2rem); line-height: 1.35; max-width: 34ch; margin-bottom: clamp(36px, 6vw, 72px); }
.manifesto .word { display: inline-block; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 120px 0 80px; overflow: hidden; }
.hero__inner { position: relative; z-index: 2; }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; margin-bottom: 28px; }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulso 2s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.hero__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 9.2vw, 8rem); line-height: .98; letter-spacing: -.03em; margin-bottom: 28px; }
.hero__title em { font-style: normal; color: var(--accent-fg); }
.hero__lead { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--muted); max-width: 52ch; margin-bottom: 32px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.social { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.social a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.social a:hover { color: var(--accent-fg); border-color: var(--accent); }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; pointer-events: none; z-index: 0; background: var(--accent); }
.blob--a { width: 46vw; height: 46vw; max-width: 560px; max-height: 560px; right: -10vw; top: 6vh; }
.blob--b { width: 30vw; height: 30vw; max-width: 380px; max-height: 380px; left: -8vw; bottom: -6vh; opacity: .2; }
.scroll-cue { position: absolute; z-index: 2; bottom: 24px; left: 50%; width: 26px; height: 42px; margin-left: -13px; border: 2px solid var(--line); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: cue 1.8s infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80%, 100% { transform: translateY(14px); opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee { position: relative; z-index: 1; overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; background: var(--bg-2); }
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group { display: flex; flex-shrink: 0; }
.marquee__group li { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 5vw, 3.4rem); letter-spacing: -.02em; padding: 0 clamp(18px, 3vw, 40px); white-space: nowrap; color: transparent; -webkit-text-stroke: 1px var(--muted); }
.marquee__group li:nth-child(3n) { color: var(--fg); -webkit-text-stroke: 0; }
.marquee__group li::after { content: "✦"; margin-left: clamp(18px, 3vw, 40px); color: var(--accent-fg); -webkit-text-stroke: 0; font-size: .55em; vertical-align: middle; }

/* ---------- Tarjetas / Bento ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: border-color .3s, background-color .4s; }
.card:hover { border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin-bottom: 10px; }
.card p { color: var(--muted); }
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.bento__photo { grid-column: span 2; padding: 0; overflow: hidden; aspect-ratio: 4 / 3; }
.bento__photo img { width: 100%; height: 100%; object-fit: cover; }
.bento__bio, .bento__now { grid-column: span 2; }
.bento__stats { grid-column: span 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: center; }
.stat { display: flex; flex-direction: column; gap: 2px; color: var(--fg) !important; }
.stat span { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 7vw, 4rem); line-height: 1; color: var(--accent-fg); font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: .9rem; }
.bento__cv { grid-column: span 2; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.bento__cv p { margin-bottom: 14px; }
.list li { position: relative; padding-left: 20px; color: var(--muted); margin-bottom: 6px; }
.list li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (min-width: 860px) {
  .bento { grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(150px, auto); }
  .bento__photo { grid-column: 1 / span 2; grid-row: 1 / span 2; aspect-ratio: auto; }
  .bento__bio, .bento__stats { grid-column: span 4; }
  .bento__now, .bento__cv { grid-column: span 3; }
}

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: .88rem; color: var(--muted); background: color-mix(in oklab, var(--bg) 60%, transparent); }

/* ---------- Proyectos ---------- */
.projects { display: grid; gap: clamp(56px, 9vw, 120px); }
.project { display: grid; gap: 24px; align-items: center; }
.project__media { display: block; border-radius: 24px; overflow: hidden; background: var(--card); border: 1px solid var(--line); aspect-ratio: 1200 / 760; will-change: clip-path; }
.project__media img { width: 100%; height: 100%; object-fit: cover; transition: scale .8s var(--ease); }
.project__media:hover img { scale: 1.06; }
.project__meta { color: var(--accent-fg); font-family: var(--font-display); font-weight: 500; font-size: .9rem; margin-bottom: 8px; }
.project__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 14px; }
.project__body > p { color: var(--muted); margin-bottom: 16px; max-width: 46ch; }
.project__links { display: flex; gap: 20px; margin-top: 20px; }
.project__links a { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.project__links a:hover { color: var(--accent-fg); }
@media (min-width: 900px) {
  .project { grid-template-columns: 1.25fr 1fr; gap: 56px; }
  .project:nth-child(even) .project__media { order: 2; }
}

/* ---------- Trayectoria ---------- */
.timeline { position: relative; padding-left: 28px; max-width: 760px; }
.timeline__line { position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--accent); transform-origin: 50% 0; border-radius: 2px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 44px; }
.tl-item::before { content: ""; position: absolute; left: -29px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); z-index: 1; }
.tl-item__date { color: var(--accent-fg); font-family: var(--font-display); font-weight: 500; }
.tl-item h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin: 4px 0 2px; }
.tl-item__org { color: var(--fg) !important; font-weight: 500; margin-bottom: 6px; }
.tl-item p { color: var(--muted); }

/* ---------- Habilidades ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* ---------- Contacto ---------- */
.contact { background: var(--bg-2); border-top: 1px solid var(--line); }
.contact__lead { color: var(--muted); font-size: 1.15rem; max-width: 46ch; margin-bottom: 32px; }
.contact__mail { display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 5.5vw, 3.4rem); letter-spacing: -.02em; text-decoration: none; border-bottom: 3px solid var(--accent); padding-bottom: 4px; margin-bottom: 36px; word-break: break-all; transition: color .2s; will-change: transform; }
.contact__mail:hover { color: var(--accent-fg); }
.social--big a { font-size: 1.1rem; }

.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: .92rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer__top { text-decoration: none; }
.footer__top:hover { color: var(--accent-fg); }

/* ---------- Estados iniciales de animación (solo si JS/GSAP está activo) ----------
   Si GSAP no carga, main.js quita la clase .anim y todo se muestra normal. */
.anim [data-reveal], .anim [data-split], .anim [data-split-hero], .anim [data-fill], .anim [data-stagger] > * { visibility: hidden; }

/* ---------- Accesibilidad: reducir movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .marquee__track { overflow-x: auto; }
}
