/* ==========================================================================
   Iván López Martínez — Personal Bio Site
   ========================================================================== */

:root {
  --navy: #0A2E5B;
  --navy-dark: #061F3F;
  --teal: #2EB6B2;
  --teal-dark: #1F8E8A;
  --ink: #14171F;
  --muted: #5A6475;
  --line: #E4E8EF;
  --bg: #FFFFFF;
  --bg-soft: #F5F7FA;
  --bg-navy: #0A2E5B;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --container: 1180px;
  --shadow-sm: 0 1px 2px rgba(10, 46, 91, .06), 0 2px 6px rgba(10, 46, 91, .04);
  --shadow-md: 0 10px 30px rgba(10, 46, 91, .08);
  --shadow-lg: 0 30px 60px rgba(10, 46, 91, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: var(--teal-dark); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--navy); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Typography ===== */
h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; color: var(--navy); margin: 0 0 .4em; line-height: 1.18; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -0.01em; }
h3 { font-size: 1.18rem; font-family: 'Inter', sans-serif; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--ink); }

.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section__kicker {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0 0 14px;
}
.section__title { margin-bottom: 24px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 72px 0; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  letter-spacing: .01em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn--primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn--primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--navy); border-color: rgba(10, 46, 91, .2); }
.btn--ghost:hover { border-color: var(--navy); color: var(--navy); background: rgba(10, 46, 91, .04); }

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 700;
}
.nav__brand:hover { color: var(--navy); }
.nav__brand-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.nav__brand-name { font-size: .98rem; }

.nav__menu {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__menu a {
  color: var(--ink);
  font-weight: 500;
  font-size: .95rem;
  transition: color .15s ease;
}
.nav__menu a:hover { color: var(--teal-dark); }
.nav__menu a.nav__cta {
  padding: 10px 20px;
  background: var(--navy);
  color: #fff;
  border-radius: 999px;
}
.nav__menu a.nav__cta:hover { background: var(--navy-dark); color: #fff; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
  margin-left: 8px;
}
.lang-switch__btn {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: .05em;
  transition: background .2s ease, color .2s ease;
}
.lang-switch__btn.is-active {
  background: var(--navy);
  color: #fff;
}

.nav__toggle {
  display: none;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
}
.nav__toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

@media (max-width: 860px) {
  .nav__brand-name { display: none; }
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed;
    top: 72px;
    left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px 24px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
  }
  .nav__menu.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__menu a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav__menu a:last-of-type { border-bottom: 0; }
  .nav__menu a.nav__cta { margin-top: 12px; text-align: center; }
  .lang-switch { margin: 14px 0 0; align-self: flex-start; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 120px 0 100px;
  overflow: hidden;
  color: #fff;
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(46, 182, 178, .28), transparent 60%),
    radial-gradient(900px 500px at 90% 100%, rgba(46, 182, 178, .22), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  z-index: -1;
}
.hero__bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 40%, black 40%, transparent 80%);
}
.hero__inner { position: relative; max-width: 920px; }
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 18px;
}
.hero__title {
  color: #fff;
  margin-bottom: 22px;
  font-weight: 700;
}
.hero__title span { color: var(--teal); font-style: italic; }
.hero__subtitle {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: rgba(255, 255, 255, .82);
  max-width: 720px;
  margin-bottom: 36px;
}
.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 72px;
}
.hero__actions .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero__actions .btn--ghost:hover { background: rgba(255, 255, 255, .08); border-color: #fff; color: #fff; }
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 560px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.hero__stats strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  color: var(--teal);
  line-height: 1;
  margin-bottom: 4px;
}
.hero__stats span {
  font-size: .85rem;
  color: rgba(255, 255, 255, .72);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ===== About ===== */
.section--about { background: var(--bg); }
.about__media { position: relative; }
.about__photo-placeholder {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(46, 182, 178, .18), rgba(10, 46, 91, .18)),
    linear-gradient(135deg, #EAF2F1, #E0E8F0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .92rem;
  text-align: center;
  border: 1px dashed rgba(10, 46, 91, .2);
}
.about__highlights {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 10px;
}
.about__highlights li {
  background: var(--bg-soft);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  border-left: 3px solid var(--teal);
}

/* ===== Experience — Timeline ===== */
.section--experience { background: var(--bg-soft); }
.timeline {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 140px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--teal), rgba(46, 182, 178, .1));
}
.timeline__item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 40px;
  padding: 22px 0;
  position: relative;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: 134px;
  top: 32px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--teal);
  box-shadow: 0 0 0 4px var(--bg-soft);
}
.timeline__date {
  text-align: right;
  font-weight: 700;
  color: var(--navy);
  padding-top: 26px;
  font-size: .95rem;
  letter-spacing: .02em;
}
.timeline__content {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
}
.timeline__content h3 { margin-bottom: 4px; }
.timeline__org {
  color: var(--teal-dark);
  font-weight: 600;
  font-size: .92rem;
  margin: 0 0 12px;
}
.timeline__content p:last-child { margin-bottom: 0; color: var(--muted); font-size: .95rem; }

@media (max-width: 720px) {
  .timeline::before { left: 10px; }
  .timeline__item { grid-template-columns: 1fr; gap: 10px; padding-left: 36px; }
  .timeline__item::before { left: 4px; top: 10px; }
  .timeline__date { text-align: left; padding-top: 0; font-size: .85rem; color: var(--teal-dark); }
}

/* ===== Expertise / Pillars ===== */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 36px;
}
.pillar {
  padding: 30px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.pillar:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(46, 182, 178, .4);
}
.pillar__icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: rgba(46, 182, 178, .12);
}
.pillar h3 { margin-bottom: 8px; }
.pillar p { color: var(--muted); font-size: .93rem; margin: 0; }

@media (max-width: 1000px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pillars { grid-template-columns: 1fr; } }

/* ===== Education ===== */
.section--education { background: var(--bg-soft); }
.education {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.education li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  align-items: center;
}
.education__year {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal-dark);
  text-align: center;
}
.education h3 { margin: 0 0 2px; font-size: 1rem; }
.education p { margin: 0; font-size: .9rem; color: var(--muted); }

/* ===== Languages ===== */
.languages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}
.language {
  padding: 28px 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.language__flag { font-size: 2.4rem; display: block; margin-bottom: 10px; }
.language h3 { margin-bottom: 4px; }
.language p { margin: 0; color: var(--muted); font-size: .92rem; }
@media (max-width: 640px) { .languages { grid-template-columns: 1fr; } }

/* ===== Contact ===== */
.section--contact { background: #fff; }
.contact__info {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: grid;
  gap: 16px;
}
.contact__info li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.contact__info li:last-child { border-bottom: 0; }
.contact__label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--muted);
  font-weight: 600;
}
.contact__info a { font-size: 1.05rem; color: var(--navy); font-weight: 500; }
.contact__info a:hover { color: var(--teal-dark); }

.contact__form {
  display: grid;
  gap: 14px;
  background: var(--bg-soft);
  padding: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.contact__form label { display: grid; gap: 6px; }
.contact__form span {
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .02em;
}
.contact__form input,
.contact__form textarea {
  font-family: inherit;
  font-size: .98rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.contact__form input:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(46, 182, 178, .18);
}
.contact__form button { margin-top: 6px; justify-self: start; }

/* ===== Footer ===== */
.footer {
  background: var(--navy);
  color: rgba(255, 255, 255, .7);
  padding: 40px 0;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer__name { color: #fff; font-weight: 700; margin: 0; font-size: 1rem; }
.footer__tag { margin: 2px 0 0; font-size: .88rem; color: rgba(255, 255, 255, .65); }
.footer__right p { margin: 0; font-size: .85rem; color: rgba(255, 255, 255, .6); }

/* ===== Nav current state ===== */
.nav__menu a.is-current { color: var(--teal-dark); }
.nav__menu a.is-current::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
  margin-top: 4px;
}

/* ===== Page hero (non-home pages) ===== */
.page-hero {
  position: relative;
  padding: 140px 0 90px;
  overflow: hidden;
  color: #fff;
}
.page-hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 80% 0%, rgba(46, 182, 178, .28), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  z-index: -1;
}
.page-hero__inner { max-width: 820px; }
.page-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--teal);
  margin: 0 0 14px;
}
.page-hero__title { color: #fff; margin: 0 0 18px; }
.page-hero__subtitle {
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  color: rgba(255, 255, 255, .82);
  margin: 0;
}

/* ===== Filter chips ===== */
.protocol-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 36px;
}
.chip {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { border-color: var(--teal); color: var(--teal-dark); }
.chip.is-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ===== Protocols grid ===== */
.protocols-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 1000px) { .protocols-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .protocols-grid { grid-template-columns: 1fr; } }

.protocol-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
}
.protocol-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(46, 182, 178, .4);
}
.protocol-card__thumb {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(46, 182, 178, .08), rgba(10, 46, 91, .06));
  position: relative;
  border-bottom: 1px solid var(--line);
}
.protocol-card__thumb::after {
  content: "PDF";
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(10, 46, 91, .9);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  padding: 4px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.protocol-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .5s ease;
}
.protocol-card:hover .protocol-card__thumb img { transform: scale(1.03); }
.protocol-card__body {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 22px;
  flex: 1;
}
.protocol-card__tag {
  display: inline-block;
  background: rgba(46, 182, 178, .12);
  color: var(--teal-dark);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  align-self: flex-start;
}
.protocol-card h3 { margin: 0 0 10px; font-size: 1.08rem; line-height: 1.3; }
.protocol-card__body > p { color: var(--muted); font-size: .93rem; margin: 0 0 18px; }
.protocol-card__meta {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: .82rem;
  color: var(--muted);
}
.protocol-card__meta li { display: flex; align-items: center; gap: 4px; }
.protocol-card__btn {
  margin-top: auto;
  align-self: stretch;
  justify-content: center;
  padding: 12px 18px;
  font-size: .92rem;
}

.protocols-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
}
.protocols-note {
  margin-top: 36px;
  background: var(--bg-soft);
  border-left: 3px solid var(--teal);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--muted);
}
.protocols-note p { margin: 0; }
.protocols-note strong { color: var(--navy); }

/* ===== CTA band ===== */
.section--cta { padding: 72px 0; background: var(--bg-soft); }
.cta-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 40px 44px;
  border-radius: var(--radius-lg);
}
.cta-band h2 { color: #fff; margin: 0 0 8px; font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
.cta-band p { color: rgba(255, 255, 255, .8); margin: 0; max-width: 540px; }
.cta-band .btn--primary { white-space: nowrap; }
@media (max-width: 640px) { .cta-band { padding: 30px 26px; } }

/* ===== Scroll-reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
