:root {
  --navy: #0f2a4a;
  --navy-deep: #081d35;
  --navy-soft: #173b65;
  --ink: #2b2b2b;
  --text: #444444;
  --muted: #66717d;
  --line: #dce3ea;
  --cloud: #f4f7fa;
  --paper: #ffffff;
  --shadow: 0 24px 60px rgba(15, 42, 74, 0.12);
  --radius: 26px;
  --container: 1180px;
  --header: 84px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 18px);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  font-weight: 700;
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: -80px;
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--navy);
  transition: top .2s ease;
}

.skip-link:focus {
  top: 18px;
}

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

.section-pad {
  padding: 110px 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header);
  border-bottom: 1px solid rgba(15, 42, 74, .10);
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(18px);
  transition: box-shadow .25s ease, background-color .25s ease;
}

.site-header.scrolled {
  box-shadow: 0 12px 35px rgba(15, 42, 74, .08);
}

.nav-shell {
  width: min(var(--container), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  color: var(--navy);
  font-size: .9rem;
  letter-spacing: .015em;
  text-transform: uppercase;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.main-nav a {
  position: relative;
  padding: 10px 0;
  color: #526171;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .025em;
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 2px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--navy);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--cloud);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--navy);
  transition: transform .25s ease, opacity .2s ease;
}

.hero {
  position: relative;
  min-height: calc(100vh - var(--header));
  display: grid;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 18%, rgba(15, 42, 74, .075) 0 15%, transparent 16%),
    linear-gradient(130deg, #fff 0 58%, #f3f6f9 58% 100%);
}

.hero::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -210px;
  bottom: -180px;
  border: 1px solid rgba(15, 42, 74, .15);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(15, 42, 74, .025), 0 0 0 92px rgba(15, 42, 74, .02);
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, .7fr);
  gap: 72px;
  align-items: center;
}

.eyebrow,
.section-label,
.mini-label {
  margin-bottom: 16px;
  color: var(--navy);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 24px;
  color: var(--navy-deep);
  font-size: clamp(3.4rem, 7vw, 7.2rem);
  line-height: .9;
  letter-spacing: -.055em;
}

.hero h1 span {
  color: transparent;
  -webkit-text-stroke: 1.6px var(--navy);
  text-stroke: 1.6px var(--navy);
}

.hero-subtitle {
  max-width: 720px;
  margin-bottom: 34px;
  color: #526171;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.55;
}

.hero-subtitle span,
.contact-copy > p span,
.site-footer p span {
  padding: 0 .35em;
  color: #9ba8b5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

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

.btn-primary {
  color: #fff;
  background: var(--navy);
  box-shadow: 0 14px 30px rgba(15, 42, 74, .18);
}

.btn-primary:hover {
  box-shadow: 0 18px 34px rgba(15, 42, 74, .24);
}

.btn-ghost {
  color: var(--navy);
  background: transparent;
}

.btn-ghost:hover {
  color: #fff;
  background: var(--navy);
}

.identity-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(15, 42, 74, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.identity-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--navy);
}

.identity-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.monogram {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--navy);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.identity-header .mini-label {
  margin: 0 0 3px;
  font-size: .66rem;
}

.identity-header h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 1.25rem;
}

.contact-list {
  margin: 0;
}

.contact-list > div {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.contact-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.contact-list dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.contact-list dd {
  margin: 0;
  color: #334355;
  font-size: .94rem;
  line-height: 1.5;
}

.contact-list a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero-lines {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  opacity: .65;
}

.hero-lines span {
  height: 3px;
  background: var(--navy);
}

.hero-lines span:nth-child(2) {
  opacity: .2;
}

.hero-lines span:nth-child(3) {
  opacity: .45;
}

.profile {
  background: var(--paper);
}

.split-heading {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 80px;
}

.section-kicker {
  padding-top: 8px;
}

.section-number {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  margin-bottom: 16px;
  border: 1px solid rgba(15, 42, 74, .28);
  border-radius: 999px;
  color: var(--navy);
  font-size: .72rem;
  font-weight: 700;
}

.section-number.inverse {
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
}

.section-kicker p {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.profile-panel {
  position: relative;
  padding: 44px 48px;
  border-left: 5px solid var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--cloud);
}

.profile-panel h2 {
  max-width: 830px;
  margin-bottom: 28px;
  color: var(--navy-deep);
  font-size: clamp(2rem, 4vw, 3.45rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.profile-panel p {
  max-width: 900px;
  margin-bottom: 16px;
  color: var(--text);
  font-size: 1.02rem;
}

.profile-panel p:last-child {
  margin-bottom: 0;
}

.skills {
  background: #f6f8fb;
}

.section-head {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  align-items: end;
  gap: 54px;
  margin-bottom: 48px;
}

.section-head .section-number {
  margin-bottom: 12px;
}

.section-head .section-label {
  margin: 0;
}

.section-head h2 {
  max-width: 680px;
  margin: 0;
  color: var(--navy-deep);
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.skill-card {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  padding: 34px;
  border: 1px solid #dfe6ed;
  border-radius: 24px;
  background: #fff;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(15, 42, 74, .22);
  box-shadow: 0 24px 50px rgba(15, 42, 74, .10);
}

.card-index {
  position: absolute;
  top: 30px;
  right: 30px;
  color: #b9c5d0;
  font-size: .75rem;
  font-weight: 700;
}

.icon-box {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 34px;
  border-radius: 16px;
  color: #fff;
  background: var(--navy);
}

.icon-box svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skill-card h3 {
  max-width: 360px;
  margin-bottom: 14px;
  color: var(--navy-deep);
  font-size: 1.55rem;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.skill-card p {
  margin: 0;
  color: var(--text);
}

.experience {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--navy-deep);
}

.experience::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .25;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 92%);
}

.experience .container {
  position: relative;
  z-index: 2;
}

.section-head.light .section-number {
  color: #fff;
  border-color: rgba(255, 255, 255, .34);
}

.section-head.light .section-label {
  color: #b9c9da;
}

.section-head.light h2 {
  color: #fff;
}

.timeline {
  position: relative;
  margin-top: 14px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 20px;
  left: 206px;
  width: 1px;
  background: rgba(255, 255, 255, .18);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 70px;
  padding: 38px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 51px;
  left: 199px;
  width: 13px;
  height: 13px;
  border: 4px solid var(--navy-deep);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45);
}

.time-meta {
  padding-top: 7px;
}

.time-meta span {
  color: #b9c9da;
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.time-content h3 {
  margin-bottom: 12px;
  color: #fff;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.16;
  letter-spacing: -.02em;
}

.time-content h3 small {
  display: inline-block;
  margin-left: 10px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  color: #ccd8e4;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  vertical-align: middle;
  text-transform: uppercase;
}

.location-line {
  margin-bottom: 18px;
  color: #9fb3c7;
  font-size: .9rem;
  font-style: italic;
}

.time-content ul {
  max-width: 900px;
  color: #dbe4ed;
}

.time-content li {
  padding-left: 5px;
  margin-bottom: 10px;
}

.time-content li:last-child {
  margin-bottom: 0;
}

.time-content li::marker {
  color: #8aa5bf;
}

.institution-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 20px;
}

.institution-chips span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  color: #c8d5e2;
  background: rgba(255, 255, 255, .045);
  font-size: .75rem;
}

.education {
  background: #fff;
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.education-card {
  position: relative;
  min-height: 210px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.education-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 42, 74, .22);
  box-shadow: 0 18px 38px rgba(15, 42, 74, .08);
}

.edu-year {
  display: inline-block;
  margin-bottom: 26px;
  color: var(--navy);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.education-card h3 {
  max-width: 520px;
  margin-bottom: 10px;
  color: var(--navy-deep);
  font-size: 1.4rem;
  line-height: 1.16;
}

.education-card p {
  margin: 0;
  color: var(--muted);
}

.education-card-wide {
  grid-column: 1 / -1;
  min-height: auto;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  column-gap: 24px;
}

.education-card-wide .edu-year {
  grid-row: 1 / span 2;
  margin: 0;
}

.contact {
  color: #fff;
  background: var(--navy);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 80px;
  align-items: start;
}

.contact-copy .section-label {
  color: #b6c7d8;
}

.contact-copy h2 {
  max-width: 560px;
  margin-bottom: 18px;
  color: #fff;
  font-size: clamp(2.2rem, 4.5vw, 4.3rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.contact-copy > p:last-child {
  max-width: 520px;
  color: #c7d4e0;
}

.contact-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 24px;
  background: rgba(255, 255, 255, .045);
}

.contact-row {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  transition: background-color .2s ease;
}

.contact-row:last-child {
  border-bottom: 0;
}

.contact-row:not(.static-row):hover {
  background: rgba(255, 255, 255, .07);
}

.contact-row-label {
  color: #9fb3c7;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.contact-row strong {
  color: #fff;
  font-size: .98rem;
  overflow-wrap: anywhere;
}

.arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  transition: transform .2s ease, background-color .2s ease;
}

.contact-row:hover .arrow {
  transform: translate(2px, -2px);
  background: rgba(255, 255, 255, .08);
}

.site-footer {
  padding: 30px 0;
  color: #a8bacb;
  background: var(--navy-deep);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.site-footer strong {
  color: #fff;
  font-size: .9rem;
}

.site-footer p {
  margin: 5px 0 0;
  font-size: .77rem;
}

.back-top {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: #fff;
  transition: background-color .2s ease, transform .2s ease;
}

.back-top:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, .08);
}

/* El contenido permanece visible por defecto. Las animaciones solo se
   habilitan cuando main.js confirma que puede ejecutarlas. */
.reveal {
  opacity: 1;
  transform: none;
}

.motion-ready .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s ease, transform .65s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal,
  .motion-ready .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  :root {
    --header: 76px;
  }

  .site-header {
    height: var(--header);
  }

  .menu-toggle {
    display: block;
    position: relative;
    z-index: 1002;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .main-nav {
    position: fixed;
    inset: var(--header) 0 auto 0;
    display: grid;
    gap: 0;
    padding: 14px 24px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .985);
    box-shadow: 0 22px 40px rgba(15, 42, 74, .12);
    transform: translateY(-120%);
    visibility: hidden;
    opacity: 0;
    transition: transform .28s ease, opacity .2s ease, visibility .28s;
  }

  .main-nav.open {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
  }

  .main-nav a {
    padding: 15px 0;
    border-bottom: 1px solid #edf0f4;
  }

  .main-nav a:last-child {
    border-bottom: 0;
  }

  .main-nav a::after {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 90px 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .identity-card {
    max-width: 720px;
  }

  .split-heading {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .timeline::before,
  .timeline-item::before {
    display: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .time-meta {
    padding-top: 0;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }
}

@media (max-width: 720px) {
  .container,
  .nav-shell {
    width: min(100% - 32px, var(--container));
  }

  .section-pad {
    padding: 78px 0;
  }

  .brand-copy small {
    display: none;
  }

  .hero {
    padding: 64px 0 74px;
    background: linear-gradient(160deg, #fff 0 72%, #f4f7fa 72% 100%);
  }

  .hero h1 {
    font-size: clamp(3rem, 16vw, 5.2rem);
  }

  .hero h1 span {
    -webkit-text-stroke-width: 1px;
  }

  .hero-subtitle span,
  .contact-copy > p span,
  .site-footer p span {
    display: none;
  }

  .hero-subtitle {
    line-height: 1.5;
  }

  .identity-card,
  .skill-card,
  .education-card,
  .contact-panel {
    border-radius: 20px;
  }

  .identity-card {
    padding: 26px;
  }

  .profile-panel {
    padding: 32px 28px;
    border-left-width: 4px;
  }

  .skills-grid,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .skill-card {
    min-height: auto;
    padding: 28px;
  }

  .education-card-wide {
    grid-column: auto;
    display: block;
  }

  .education-card-wide .edu-year {
    margin-bottom: 26px;
  }

  .timeline-item {
    padding: 30px 0;
  }

  .contact-row {
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    padding: 22px;
  }

  .contact-row-label {
    grid-column: 1 / -1;
  }

  .static-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: flex-start;
  }

  .site-footer p {
    max-width: 290px;
  }
}

@media (max-width: 430px) {
  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .brand-copy strong {
    max-width: 190px;
    font-size: .76rem;
    white-space: normal;
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .identity-header {
    align-items: flex-start;
  }

  .monogram {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }
}
