/* =============================================================
   Trayectoria — Archetype: Liquid Wave Backgrounds
   Olas SVG animadas, formas líquidas, paleta oceánica.
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #e0f7fa;
  --bg-alt: #c9f0f0;
  --bg-deep: #006064;
  --ink: #001f25;
  --mute: #33555c;
  --faint: #5c7d84;
  --accent: #00bfa5;
  --accent-2: #ffd166;
  --line: rgba(0, 31, 37, 0.12);
  --on-deep: #e0f7fa;

  --display: "Quicksand", "Inter", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hand: "Caveat", cursive;

  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --container: 1180px;
  --gutter: 1.25rem;
  --radius-blob: 42% 58% 61% 39% / 45% 42% 58% 55%;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  position: relative;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  text-wrap: balance; line-height: 1.1; letter-spacing: -0.01em;
  font-family: var(--display); font-weight: 700; color: var(--ink);
}
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--bg-deep); outline-offset: 3px; border-radius: 6px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 1; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--bg-deep); color: #fff;
  z-index: 9999; border-radius: 999px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  font-family: var(--hand);
  font-size: 1.25rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--bg-deep); margin-bottom: 0.6rem;
}
.eyebrow--onlight { color: var(--accent-2); }

/* Blob card: the archetype's signature soft container */
.blob-card {
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-blob);
  padding: 2rem 2.2rem;
  box-shadow: 0 18px 40px rgba(0, 96, 100, 0.1);
  transition: border-radius 0.6s var(--ease-soft), transform 0.4s var(--ease-soft);
}
.blob-card:hover { border-radius: 38% 62% 45% 55% / 55% 45% 55% 45%; }
.blob-card--deep { background: rgba(255, 255, 255, 0.08); box-shadow: none; }
.onlight { color: var(--on-deep); }

/* =============================================================
   4. Typography
   ============================================================= */
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); margin-bottom: 1.4rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); margin-bottom: 0.5rem; }
.section-lede { color: var(--mute); max-width: 62ch; font-size: 1.05rem; margin-bottom: 2.4rem; }
.section-lede.onlight { color: rgba(224, 247, 250, 0.75); }

section { position: relative; z-index: 1; padding-block: clamp(3.5rem, 8vw, 7rem); }

/* Wave dividers between sections */
.section-wave { display: block; width: 100%; height: 70px; margin-bottom: -1px; }
.section-wave--top { position: relative; top: 1px; }
.timeline-section, .education-section, .press-section, .contact-section, .footer { background: var(--bg-alt); }
.press-section, .footer { background: var(--bg-deep); color: var(--on-deep); }
.press-section h2, .footer p, .footer a { color: var(--on-deep); }

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.8rem; border-radius: 999px;
  font-weight: 700; font-size: 0.95rem; font-family: var(--display);
  transition: transform .4s var(--ease-soft), box-shadow .4s var(--ease-soft);
}
.btn-primary {
  background: var(--bg-deep); color: #fff;
  box-shadow: 0 12px 28px rgba(0, 96, 100, 0.35);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.02); }
.btn-ghost { color: var(--bg-deep); border: 1.5px solid var(--bg-deep); }
.btn-ghost:hover { transform: translateY(-3px); background: rgba(0, 96, 100, 0.08); }

/* Splash */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity .5s var(--ease-out), visibility .5s;
}
.splash-mark { font-family: var(--display); font-weight: 700; font-size: 2.2rem; color: var(--bg-deep); }
.splash.is-out { opacity: 0; visibility: hidden; pointer-events: none; }

/* Nav */
.nav { position: fixed; top: 0; inset-inline: 0; z-index: 500; background: rgba(224, 247, 250, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
}
.nav-brand { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--bg-deep); }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-link { font-size: 0.92rem; font-weight: 600; color: var(--mute); }
.nav-link:hover { color: var(--bg-deep); }
.nav-link--cta {
  background: var(--bg-deep); color: #fff; padding: 0.55rem 1.2rem; border-radius: 999px;
}
.nav-burger { display: none; flex-direction: column; gap: 4px; padding: 0.5rem; }
.nav-burger span { width: 20px; height: 2px; background: var(--bg-deep); border-radius: 2px; }
.nav-mobile {
  display: none; position: absolute; top: 100%; inset-inline: 0.6rem;
  flex-direction: column; padding: 1rem; gap: 0.2rem;
  background: #fff; border-radius: 24px; box-shadow: 0 20px 44px rgba(0,31,37,0.15);
}
.nav-mobile[data-open="true"] { display: flex; }
.nav-mobile-link { padding: 0.7rem 0.8rem; font-weight: 600; border-radius: 14px; }
.nav-mobile-link:hover { background: rgba(0, 191, 165, 0.12); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
}

/* Hero */
.hero { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; padding-top: 6rem; overflow: hidden; }
.hero-wave { position: absolute; bottom: -1px; left: 0; width: 100%; height: 160px; z-index: 0; }
.hero-content { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; position: relative; z-index: 1; }
.hero-title { font-size: clamp(2.3rem, 5vw, 3.8rem); margin-block: 0.5rem 0.7rem; }
.hero-title em { font-style: normal; color: var(--bg-deep); }
.hero-tagline { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink); max-width: 46ch; margin-bottom: 0.6rem; }
.hero-roles { color: var(--mute); font-size: 0.95rem; margin-bottom: 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero-photo { position: relative; aspect-ratio: 4 / 5; }
.hero-photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-blob); box-shadow: 0 30px 60px rgba(0, 31, 37, 0.18); }
.blob-shape { position: absolute; inset: -6% -6% 6% 6%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: var(--radius-blob); z-index: 0; opacity: 0.55; }
.hero-photo--float { animation: floatY 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .hero-photo--float { animation: none; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

@media (max-width: 860px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 280px; margin-inline: auto; }
}

.hero-scroll-cue {
  position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--bg-deep); border-radius: 999px; z-index: 2;
}
.hero-scroll-cue span {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 8px; background: var(--accent); border-radius: 999px;
  animation: cueMove 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .hero-scroll-cue span { animation: none; } }
@keyframes cueMove { 0%,100% { top: 6px; opacity: 1; } 50% { top: 18px; opacity: 0.3; } }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; align-items: start; }
.stat-num { font-family: var(--display); font-size: clamp(2.4rem, 4.5vw, 3.2rem); color: var(--bg-deep); line-height: 1; margin-bottom: 0.5rem; }
.stat-label { font-weight: 700; margin-bottom: 0.2rem; }
.stat-note { color: var(--faint); font-size: 0.88rem; }

/* Story */
.story { overflow: hidden; }
.story-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.story-figure { overflow: hidden; border-radius: var(--radius-blob); aspect-ratio: 4/5; }
.story-figure img { width: 100%; height: 100%; object-fit: cover; }
.story-text p { margin-bottom: 1.1rem; color: var(--mute); }
.story-lede { font-weight: 600; color: var(--ink) !important; font-size: 1.1rem; }
.story-personal { font-family: var(--hand); font-size: 1.3rem; color: var(--bg-deep) !important; }

@media (max-width: 860px) { .story-grid { grid-template-columns: 1fr; } .story-figure { max-width: 320px; margin-inline: auto; } }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 1.4rem; margin-top: 2rem; }
.tl-item { display: grid; grid-template-columns: 200px 1fr; gap: 1.6rem; }
.tl-item--current { box-shadow: 0 18px 40px rgba(0, 191, 165, 0.28); }
.tl-year { font-weight: 700; color: var(--bg-deep); font-family: var(--display); }
.tl-body p { color: var(--mute); margin-top: 0.5rem; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.tl-tags li { font-size: 0.82rem; padding: 0.35rem 0.9rem; background: rgba(0, 191, 165, 0.14); border-radius: 999px; color: var(--bg-deep); font-weight: 600; }
.timeline-side-photo { margin-top: 2rem; max-width: 340px; overflow: hidden; border-radius: var(--radius-blob); aspect-ratio: 4/3; }
.timeline-side-photo img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 700px) { .tl-item { grid-template-columns: 1fr; } }

/* Talks / ponencias */
.talk-categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; align-items: start; }
.talk-cat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.talk-cat-icon { width: 44px; height: 44px; border-radius: var(--radius-blob); background: rgba(0, 191, 165, 0.16); color: var(--bg-deep); display: flex; align-items: center; justify-content: center; }
.talk-cat-icon svg { width: 22px; height: 22px; }
.talk-cat-count { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--bg-deep); }
.talk-cat-examples li { font-size: 0.9rem; color: var(--mute); padding-block: 0.5rem; border-top: 1px solid var(--line); }
.talk-cat-examples li:first-child { border-top: none; }

/* Education */
.education-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; align-items: start; }
.education-list li { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding-block: 0.8rem; border-top: 1px solid var(--line); }
.education-list li:first-child { border-top: none; }
.edu-period { color: var(--faint); font-size: 0.85rem; font-weight: 700; }
.edu-body { color: var(--mute); font-size: 0.92rem; }
.edu-body strong { color: var(--ink); }

/* Articles */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; margin-bottom: 1.6rem; align-items: start; }
.article-card p { color: var(--mute); font-size: 0.92rem; margin-top: 0.4rem; }
.link-arrow { display: inline-block; font-weight: 700; color: var(--bg-deep); margin-right: 1.6rem; }
.link-arrow:hover { text-decoration: underline; }

/* Press (testimonial) */
.press-grid { display: grid; place-items: center; }
.press-text { max-width: 780px; text-align: center; }
.press-quote { margin-block: 1.4rem; }
.press-quote p { font-family: var(--display); font-weight: 600; font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: #fff; }
.press-source { color: rgba(224, 247, 250, 0.65); font-size: 0.85rem; margin-top: 1rem; }

/* Collab marquee */
.collab-section { padding-block: clamp(2.5rem, 5vw, 4rem); }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-row { display: flex; width: max-content; animation: marquee 32s linear infinite; }
@media (prefers-reduced-motion: reduce) { .marquee-row { animation: none; overflow-x: auto; } }
.marquee-track { display: flex; gap: 1rem; padding-inline: 1rem; white-space: nowrap; font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--faint); }
.marquee-track span:nth-child(odd) { color: var(--bg-deep); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Contact */
.contact-section { position: relative; overflow: hidden; }
.contact-bg { position: absolute; inset: 0; z-index: 0; opacity: 0.16; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; }
.contact-content { position: relative; z-index: 1; text-align: center; }
.contact-content h2 { max-width: 22ch; margin-inline: auto; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-block: 2.2rem; text-align: left; align-items: start; }
.contact-card { display: block; }
.contact-card p { color: var(--mute); font-size: 0.9rem; margin-block: 0.5rem 0.8rem; }
.contact-card-cta { color: var(--bg-deep); font-weight: 700; font-size: 0.9rem; }
.contact-direct { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; }

/* Footer */
.footer { position: relative; padding-block: 2.4rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; color: rgba(224, 247, 250, 0.7); font-size: 0.85rem; }
.footer-top { color: var(--accent-2); font-weight: 700; }
.trayectoria-credit { display: inline-flex; align-items: center; gap: 0.35rem; opacity: 0.85; transition: opacity .2s; }
.trayectoria-credit:hover { opacity: 1; }
.trayectoria-credit img { display: block; border-radius: 2px; }

/* Wave-reveal mask on scroll (figures) */
.wave-mask {
  clip-path: polygon(0% 18%, 16.6% 6%, 33% 18%, 50% 6%, 66% 18%, 83% 6%, 100% 18%, 100% 100%, 0% 100%);
  transition: clip-path 1s var(--ease-soft), opacity .6s ease;
  opacity: 0;
}
.wave-mask.is-revealed {
  clip-path: polygon(0% 0%, 16.6% 0%, 33% 0%, 50% 0%, 66% 0%, 83% 0%, 100% 0%, 100% 100%, 0% 100%);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) { .wave-mask { clip-path: none; opacity: 1; transition: none; } }

/* Reveal on scroll (generic) */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
[data-reveal].is-revealed { opacity: 1; transform: none; }
[data-reveal].wave-mask { transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }
