:root {
  --black: #07090d;
  --black-2: #0c1017;
  --black-3: #111824;
  --white: #ffffff;
  --paper: #f5f7fa;
  --ink: #101521;
  --muted: #aab4c3;
  --muted-dark: #667180;
  --blue: #2f7ee6;
  --blue-bright: #55a5ff;
  --blue-deep: #123d79;
  --cyan: #9fe6ef;
  --line: rgba(255,255,255,.13);
  --line-dark: rgba(9,20,38,.12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --header-h: 86px;
  --radius: 24px;
  --shadow: 0 28px 70px rgba(0, 15, 40, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
::selection { background: rgba(66, 145, 240, .34); color: #fff; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 999; background: #fff; color: #111; padding: .8rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.section-shell, .header-shell, .hero-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}
.section { padding: 112px 0; position: relative; }
.section--dark { background: var(--black-2); }
.section--soft { background: var(--paper); color: var(--ink); }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: linear-gradient(180deg, rgba(5,7,11,.92), rgba(5,7,11,.66));
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  transition: height .3s ease, background .3s ease, box-shadow .3s ease;
}
.site-header.scrolled { height: 72px; background: rgba(6,9,14,.94); box-shadow: 0 12px 36px rgba(0,0,0,.25); }
.header-shell { height: 100%; display: grid; grid-template-columns: 260px 1fr auto; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; width: 250px; }
.brand img { width: 100%; height: auto; }
.main-nav { justify-self: end; display: flex; align-items: center; gap: 28px; font-size: .9rem; font-weight: 600; }
.main-nav a { position: relative; color: rgba(255,255,255,.86); padding: 10px 0; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 3px; height: 1px; background: var(--blue-bright); transition: right .3s ease; }
.main-nav a:hover::after, .main-nav a:focus-visible::after { right: 0; }
.menu-toggle { display: none; border: 0; background: none; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; background: #fff; margin: 6px 0; transition: transform .25s ease, opacity .25s ease; }

.button {
  --button-bg: transparent;
  position: relative;
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 9px;
  background: var(--button-bg);
  color: #fff;
  font-weight: 700;
  letter-spacing: .01em;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.button span { position: relative; z-index: 2; }
.button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; position: relative; z-index: 2; }
.button:hover { transform: translateY(-2px); }
.button--small { min-height: 44px; padding: 0 18px; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.button--primary { --button-bg: linear-gradient(135deg, #338be9, #1450a6); border-color: rgba(101,171,255,.78); box-shadow: 0 12px 34px rgba(25,103,210,.28), inset 0 1px rgba(255,255,255,.18); }
.button--primary:hover { box-shadow: 0 17px 45px rgba(25,103,210,.42), inset 0 1px rgba(255,255,255,.22); }
.button--ghost { background: rgba(7,11,18,.32); backdrop-filter: blur(8px); }
.button--ghost:hover { border-color: rgba(130,196,255,.8); background: rgba(34,96,170,.18); }
.button--shine::before { content: ""; position: absolute; z-index: 1; inset: -45% auto -45% -35%; width: 28%; transform: skewX(-22deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.78), transparent); filter: blur(1px); animation: shine 3.6s ease-in-out infinite; }
.button--shine::after { content: ""; position: absolute; inset: 1px; border-radius: inherit; box-shadow: inset 0 0 16px rgba(139,211,255,.17); pointer-events: none; }
@keyframes shine { 0%, 55% { left: -42%; opacity: 0; } 62% { opacity: 1; } 82%,100% { left: 125%; opacity: 0; } }

.hero { position: relative; min-height: 920px; display: grid; align-items: center; overflow: hidden; background: #080b10; }
.hero-media, .hero-photo, .hero-gradient, .hero-grid { position: absolute; inset: 0; }
.hero-photo { inset: -6% -2%; background: url("../img/hero-sebastian-vallejo.webp") 68% 48% / cover no-repeat; transform: translate3d(0,0,0) scale(1.04); will-change: transform; }
.hero-gradient { background: linear-gradient(90deg, rgba(5,8,13,.99) 0%, rgba(5,8,13,.96) 28%, rgba(5,8,13,.76) 49%, rgba(5,8,13,.12) 75%, rgba(5,8,13,.16) 100%), linear-gradient(180deg, rgba(4,7,11,.18), rgba(4,7,11,.12) 60%, rgba(4,7,11,.8)); }
.hero-grid { opacity: .16; background-image: linear-gradient(rgba(93,163,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(93,163,255,.18) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(90deg, #000, transparent 66%); }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); mix-blend-mode: screen; opacity: .26; will-change: transform; }
.orb--one { width: 390px; height: 390px; background: #176bd6; left: 26%; bottom: 6%; }
.orb--two { width: 290px; height: 290px; background: #8eefff; right: 12%; top: 12%; opacity: .12; }
.particle { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: rgba(173,222,255,.75); box-shadow: 0 0 12px rgba(111,190,255,.9); animation: drift var(--duration) ease-in-out infinite alternate; animation-delay: var(--delay); }
@keyframes drift { to { transform: translate3d(var(--x), var(--y), 0); opacity: .15; } }
.hero-shell { position: relative; z-index: 2; padding-top: var(--header-h); }
.hero-copy { width: min(650px, 58vw); padding: 84px 0 62px; }
.eyebrow { margin: 0 0 18px; color: #b6d9ff; display: flex; align-items: center; gap: 12px; font-size: .75rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow span { display: inline-block; width: 35px; height: 1px; background: linear-gradient(90deg, var(--blue-bright), var(--cyan)); box-shadow: 0 0 12px rgba(95,181,255,.7); }
.eyebrow--dark { color: var(--blue-deep); }
.hero h1 { margin: 0; max-width: 700px; font-family: var(--serif); font-weight: 400; font-size: clamp(3.25rem, 5vw, 5.55rem); line-height: .99; letter-spacing: -.045em; text-wrap: balance; }
.hero h1 em { display: block; color: #d8eaff; font-style: italic; font-weight: 400; text-shadow: 0 0 32px rgba(67,143,237,.22); }
.hero-lead { max-width: 600px; margin: 28px 0 24px; font-size: clamp(1.05rem,1.4vw,1.25rem); color: #cbd4df; }
.hero-points { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 28px; padding: 0; margin: 0 0 32px; list-style: none; }
.hero-points li { color: #e6edf5; display: flex; align-items: center; gap: 10px; font-size: .98rem; }
.hero-points li::before { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(-45deg); box-shadow: -2px 2px 8px rgba(117,226,239,.35); }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-proof { margin-top: 44px; display: flex; gap: 0; border-top: 1px solid rgba(255,255,255,.12); width: fit-content; }
.hero-proof div { display: grid; gap: 2px; padding: 18px 30px 0 0; margin-right: 30px; border-right: 1px solid rgba(255,255,255,.12); }
.hero-proof div:last-child { border: 0; margin: 0; }
.hero-proof strong { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }
.hero-proof span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.scroll-hint { position: absolute; z-index: 3; bottom: 34px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.62); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .65rem; text-transform: uppercase; letter-spacing: .18em; }
.scroll-hint span { width: 1px; height: 40px; background: linear-gradient(#fff,transparent); animation: scrollPulse 1.7s ease-in-out infinite; }
@keyframes scrollPulse { 0%,100% { transform: scaleY(.45); transform-origin: top; opacity: .35; } 50% { transform: scaleY(1); opacity: 1; } }

.trust-strip { background: #07111e; border-block: 1px solid rgba(89,164,248,.18); }
.trust-grid { display: grid; grid-template-columns: repeat(4,1fr); }
.trust-grid p { margin: 0; padding: 25px 24px; color: #c8d4e2; border-right: 1px solid rgba(255,255,255,.08); font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; }
.trust-grid p:first-child { padding-left: 0; }
.trust-grid p:last-child { border: 0; }
.trust-grid span { color: var(--blue-bright); margin-right: 8px; font-weight: 800; }

.doctor { background: #fff; color: var(--ink); overflow: hidden; }
.doctor::before { content: ""; position: absolute; width: 560px; height: 560px; left: -250px; bottom: -280px; border-radius: 50%; background: radial-gradient(circle, rgba(64,141,233,.14), transparent 65%); }
.doctor-grid { display: grid; grid-template-columns: minmax(360px,.86fr) 1.14fr; gap: 90px; align-items: center; }
.doctor-visual { position: relative; }
.image-frame { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #101823; transform-style: preserve-3d; transition: transform .18s ease-out; }
.image-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 50%, rgba(34,127,233,.12)); pointer-events: none; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; }
.image-frame--portrait { aspect-ratio: .82; }
.image-frame--portrait img { object-position: 52% center; }
.image-frame--landscape { aspect-ratio: 1.08; }
.image-frame--landscape img { object-position: 55% center; }
.image-frame__line { position: absolute; inset: 16px; border: 1px solid rgba(155,220,255,.32); border-radius: calc(var(--radius) - 7px); }
.floating-card { position: absolute; display: flex; align-items: center; gap: 13px; padding: 16px 18px; border-radius: 14px; background: rgba(8,15,26,.88); color: #fff; border: 1px solid rgba(106,179,255,.35); backdrop-filter: blur(15px); box-shadow: 0 18px 42px rgba(0,20,55,.24); }
.credential-card { right: -45px; bottom: 45px; }
.credential-card__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--blue-bright); color: var(--cyan); font-family: var(--serif); }
.floating-card strong, .floating-card small { display: block; }
.floating-card small { color: #aebccc; }
.doctor-copy h2, .technology-copy h2, .section-heading h2, .contact-copy h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.6rem,4vw,4.35rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 400; text-wrap: balance; }
.doctor-role { margin: 13px 0 26px; color: var(--blue-deep); font-weight: 750; }
.doctor-copy > p:not(.eyebrow):not(.doctor-role) { color: var(--muted-dark); font-size: 1.04rem; }
.education-list { display: grid; gap: 14px; margin: 30px 0; }
.education-list article { display: flex; gap: 15px; align-items: center; padding: 14px 16px; border: 1px solid var(--line-dark); border-radius: 13px; background: #f8fafc; }
.education-mark { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--blue), var(--blue-deep)); font-family: var(--serif); font-size: .83rem; box-shadow: 0 8px 20px rgba(22,83,158,.24); }
.education-list strong, .education-list small { display: block; }
.education-list strong { font-size: .94rem; }
.education-list small { color: var(--muted-dark); }
.doctor-highlights { display: grid; gap: 10px; margin: 28px 0; }
.doctor-highlights p { margin: 0; display: flex; gap: 12px; align-items: center; color: #374151; }
.doctor-highlights span { color: var(--blue); font-weight: 900; }
.text-link { display: inline-flex; gap: 12px; align-items: center; margin-top: 8px; color: var(--blue-deep); font-weight: 800; border-bottom: 1px solid rgba(18,61,121,.25); padding-bottom: 4px; }
.text-link span { transition: transform .2s ease; }
.text-link:hover span { transform: translate(3px,-3px); }

.section-heading { display: flex; justify-content: space-between; gap: 70px; align-items: end; margin-bottom: 52px; }
.section-heading > p { max-width: 440px; color: var(--muted); margin: 0; }
.section-heading--dark > p { color: var(--muted-dark); }
.services::before { content: ""; position: absolute; inset: 0; opacity: .22; background: radial-gradient(circle at 20% 10%, rgba(28,106,206,.3), transparent 34%), linear-gradient(90deg, transparent 49.9%, rgba(255,255,255,.03) 50%, transparent 50.1%); background-size: auto, 90px 90px; pointer-events: none; }
.services-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; position: relative; }
.service-card { position: relative; min-height: 360px; padding: 29px 25px 25px; border: 1px solid rgba(80,158,246,.36); border-radius: 18px; background: linear-gradient(145deg, rgba(18,29,44,.93), rgba(7,11,17,.95)); overflow: hidden; transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease; }
.service-card::before { content: ""; position: absolute; width: 190px; height: 190px; left: -100px; top: -100px; border-radius: 50%; background: rgba(43,132,239,.24); filter: blur(46px); transition: transform .45s ease; }
.service-card::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(120deg, transparent 35%, rgba(121,208,255,.8), transparent 65%); -webkit-mask: linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .35s ease; }
.service-card:hover { transform: translateY(-8px); border-color: rgba(102,191,255,.72); box-shadow: 0 22px 48px rgba(0,34,88,.34); }
.service-card:hover::before { transform: translate(85px,85px); }
.service-card:hover::after { opacity: 1; }
.service-card__icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 16px; color: #a7e8f2; background: rgba(42,116,203,.18); border: 1px solid rgba(102,186,255,.3); }
.service-card__icon svg { width: 39px; height: 39px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.service-card__number { position: absolute; right: 22px; top: 20px; color: rgba(255,255,255,.22); font-family: var(--serif); font-size: 1.25rem; }
.service-card h3 { font-family: var(--serif); font-size: 1.65rem; line-height: 1.1; font-weight: 400; margin: 28px 0 13px; }
.service-card p { color: #aeb9c8; font-size: .93rem; }
.service-card a { position: absolute; left: 25px; bottom: 25px; color: #badaff; font-size: .83rem; font-weight: 750; }
.service-card a span { display: inline-block; margin-left: 5px; transition: transform .2s; }
.service-card a:hover span { transform: translateX(4px); }

.technology { background: #fff; color: var(--ink); overflow: hidden; }
.technology-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 86px; align-items: center; }
.technology-copy > p:not(.eyebrow) { color: var(--muted-dark); font-size: 1.04rem; }
.technology-list { display: grid; gap: 5px; margin-top: 34px; }
.technology-list article { display: grid; grid-template-columns: 56px 1fr; gap: 17px; align-items: center; padding: 19px 0; border-top: 1px solid var(--line-dark); }
.technology-list article:last-child { border-bottom: 1px solid var(--line-dark); }
.technology-list > article > span { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 50%; border: 1px solid rgba(40,117,204,.28); color: var(--blue-deep); font-size: .75rem; font-weight: 800; }
.technology-list strong, .technology-list small { display: block; }
.technology-list small { color: var(--muted-dark); }
.technology-visual { position: relative; }
.tech-badge { left: -36px; top: 42px; flex-direction: column; gap: 0; align-items: flex-start; }
.tech-badge strong { color: var(--cyan); font-family: var(--serif); font-size: 2rem; line-height: 1; }
.scan-line { position: absolute; z-index: 2; left: 0; right: 0; height: 2px; top: 0; background: linear-gradient(90deg,transparent,#7de7ff,transparent); box-shadow: 0 0 16px #4fb8ff; animation: scan 4.5s ease-in-out infinite; opacity: .65; }
@keyframes scan { 0%,100% { top: 5%; opacity: .15; } 50% { top: 90%; opacity: .75; } }

.gallery-grid { display: grid; grid-template-columns: 1.15fr .85fr .85fr; grid-auto-rows: 430px; gap: 18px; }
.gallery-item { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: #111; box-shadow: 0 18px 45px rgba(24,46,76,.13); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .75s cubic-bezier(.2,.75,.2,1); }
.gallery-item--wide img { object-position: center; }
.gallery-item:nth-child(2) img { object-position: 62% center; }
.gallery-item:nth-child(3) img { object-position: 58% center; }
.gallery-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 58%, rgba(4,8,15,.82)); }
.gallery-item figcaption { position: absolute; z-index: 2; left: 22px; bottom: 18px; color: #fff; font-weight: 650; }
.gallery-item:hover img { transform: scale(1.045); }

.process { overflow: hidden; }
.process::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 25%, rgba(31,115,218,.22), transparent 35%); }
.process-line { position: relative; display: grid; grid-template-columns: repeat(4,1fr); gap: 34px; }
.process-line::before { content: ""; position: absolute; left: 6%; right: 6%; top: 28px; height: 1px; background: linear-gradient(90deg, rgba(66,151,243,.1), rgba(94,181,255,.8), rgba(66,151,243,.1)); }
.process-line article { position: relative; padding-top: 78px; }
.process-line article > span { position: absolute; top: 0; width: 57px; height: 57px; display: grid; place-items: center; border-radius: 50%; background: var(--black-2); border: 1px solid rgba(98,186,255,.55); color: #bce6ff; box-shadow: 0 0 0 8px var(--black-2), 0 0 28px rgba(56,137,229,.22); }
.process-line h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 400; margin: 0 0 8px; }
.process-line p { color: var(--muted); margin: 0; font-size: .92rem; }

.contact { min-height: 700px; overflow: hidden; background: #0b1523; }
.contact-background { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,12,20,.95), rgba(7,12,20,.78)), url("../img/consultorio-sebastian-vallejo.webp") center/cover; opacity: .8; }
.contact-background::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 25% 25%, rgba(41,131,234,.3), transparent 38%), linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px); background-size: auto, 60px 60px, 60px 60px; }
.contact-grid { position: relative; z-index: 2; display: grid; grid-template-columns: .9fr 1.1fr; gap: 90px; align-items: center; }
.contact-copy > p:not(.eyebrow) { color: #bdc8d7; font-size: 1.05rem; }
.contact-note { display: flex; gap: 13px; align-items: flex-start; margin-top: 34px; padding: 17px; border: 1px solid rgba(127,190,255,.2); border-radius: 14px; background: rgba(16,31,51,.62); }
.contact-note > span { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--blue-bright); color: var(--cyan); font-family: var(--serif); }
.contact-note p { margin: 0; color: #b9c7d7; font-size: .84rem; }
.contact-form { padding: 34px; border-radius: 20px; background: rgba(8,15,26,.83); border: 1px solid rgba(120,183,255,.25); backdrop-filter: blur(18px); box-shadow: 0 30px 70px rgba(0,0,0,.3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: grid; gap: 7px; margin-bottom: 15px; color: #dce6f2; font-size: .79rem; font-weight: 700; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; color: #fff; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; outline: none; background: rgba(255,255,255,.055); padding: 13px 14px; transition: border-color .2s, box-shadow .2s, background .2s; }
.contact-form select { color-scheme: dark; }
.contact-form textarea { resize: vertical; min-height: 110px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { border-color: var(--blue-bright); box-shadow: 0 0 0 3px rgba(58,137,231,.16); background: rgba(255,255,255,.08); }
.contact-form .button { width: 100%; margin-top: 3px; }
.form-status { min-height: 22px; margin: 12px 0 0; font-size: .82rem; color: #bce9d0; }
.form-status.error { color: #ffb8b8; }

.site-footer { padding: 50px 0 30px; background: #05070a; border-top: 1px solid rgba(255,255,255,.08); }
.footer-grid { display: grid; grid-template-columns: 260px 1fr auto; gap: 35px; align-items: center; }
.brand--footer { width: 230px; }
.footer-grid > p { color: var(--muted); font-size: .88rem; }
.footer-grid nav { display: flex; gap: 20px; color: #d7e0ea; font-size: .84rem; }
.footer-grid small { grid-column: 1/-1; padding-top: 25px; border-top: 1px solid rgba(255,255,255,.08); color: #778392; }
.back-to-top { position: fixed; z-index: 80; right: 20px; bottom: 20px; width: 45px; height: 45px; border-radius: 50%; border: 1px solid rgba(118,194,255,.38); background: rgba(7,15,27,.8); color: #fff; backdrop-filter: blur(12px); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(12px); transition: .3s ease; }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

.reveal { opacity: 0; transform: translateY(32px); transition: opacity .8s cubic-bezier(.2,.75,.2,1), transform .8s cubic-bezier(.2,.75,.2,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.services-grid .reveal:nth-child(2), .process-line .reveal:nth-child(2) { transition-delay: .08s; }
.services-grid .reveal:nth-child(3), .process-line .reveal:nth-child(3) { transition-delay: .16s; }
.services-grid .reveal:nth-child(4), .process-line .reveal:nth-child(4) { transition-delay: .24s; }

@media (max-width: 1080px) {
  .header-shell { grid-template-columns: 225px 1fr auto; gap: 16px; }
  .main-nav { gap: 18px; font-size: .82rem; }
  .header-cta { display: none; }
  .hero-copy { width: min(620px,65vw); }
  .doctor-grid, .technology-grid { gap: 58px; }
  .services-grid { grid-template-columns: repeat(2,1fr); }
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 390px; }
  .gallery-item--wide { grid-column: 1/-1; }
}

@media (max-width: 820px) {
  :root { --header-h: 74px; }
  .section-shell, .header-shell, .hero-shell { width: min(100% - 32px, 680px); }
  .section { padding: 82px 0; }
  .header-shell { display: flex; justify-content: space-between; }
  .brand { width: 205px; }
  .menu-toggle { display: block; position: relative; z-index: 105; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .main-nav { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 20px; background: rgba(5,8,13,.97); backdrop-filter: blur(20px); transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); font-family: var(--serif); font-size: 1.8rem; }
  .main-nav.open { transform: translateX(0); }
  .hero { min-height: auto; padding-top: var(--header-h); display: block; }
  .hero-media { position: relative; height: 60vh; min-height: 520px; }
  .hero-photo { inset: -5%; background-position: 52% 42%; }
  .hero-gradient { background: linear-gradient(180deg, rgba(5,8,13,.06) 0%, rgba(5,8,13,.04) 50%, #070a0f 100%), linear-gradient(90deg, rgba(5,8,13,.16), transparent 50%); }
  .hero-grid { mask-image: linear-gradient(#000,transparent); }
  .hero-shell { padding: 0; }
  .hero-copy { width: 100%; padding: 18px 0 78px; }
  .hero h1 { font-size: clamp(2.85rem,11vw,4.5rem); }
  .hero-lead { font-size: 1rem; }
  .hero-points { grid-template-columns: 1fr 1fr; }
  .hero-proof { width: 100%; }
  .hero-proof div { flex: 1; padding-right: 14px; margin-right: 14px; }
  .scroll-hint { display: none; }
  .trust-grid { grid-template-columns: repeat(2,1fr); }
  .trust-grid p { border-bottom: 1px solid rgba(255,255,255,.08); padding-left: 18px; }
  .doctor-grid, .technology-grid, .contact-grid { grid-template-columns: 1fr; gap: 55px; }
  .doctor-visual { max-width: 540px; margin-inline: auto; }
  .credential-card { right: -10px; }
  .technology-visual { grid-row: 1; }
  .tech-badge { left: 16px; }
  .section-heading { display: grid; gap: 20px; margin-bottom: 38px; }
  .section-heading > p { max-width: 650px; }
  .process-line { grid-template-columns: repeat(2,1fr); }
  .process-line::before { display: none; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer-grid small { width: 100%; }
}

@media (max-width: 560px) {
  .section-shell, .header-shell, .hero-shell { width: min(100% - 24px, 520px); }
  .site-header, .site-header.scrolled { height: 66px; }
  .brand { width: 178px; }
  .hero { padding-top: 66px; }
  .hero-media { height: 52vh; min-height: 410px; }
  .hero-photo { background-size: cover; background-position: 53% 43%; }
  .hero-copy { padding-bottom: 62px; }
  .eyebrow { font-size: .66rem; }
  .hero h1 { font-size: clamp(2.6rem,13vw,3.7rem); }
  .hero-points { grid-template-columns: 1fr; gap: 8px; }
  .hero-actions { display: grid; }
  .hero-actions .button { width: 100%; }
  .hero-proof { display: grid; grid-template-columns: repeat(3,1fr); }
  .hero-proof div { margin: 0; padding: 16px 9px 0; text-align: center; }
  .hero-proof strong { font-size: 1.15rem; }
  .hero-proof span { font-size: .55rem; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid p { border-right: 0; padding: 18px 0; }
  .doctor-grid { gap: 45px; }
  .credential-card { position: relative; inset: auto; margin: -35px 12px 0; }
  .doctor-copy h2, .technology-copy h2, .section-heading h2, .contact-copy h2 { font-size: clamp(2.35rem,12vw,3.4rem); }
  .services-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 330px; }
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 390px; }
  .gallery-item--wide { grid-column: auto; }
  .process-line { grid-template-columns: 1fr; gap: 14px; }
  .process-line article { padding: 18px 0 18px 75px; min-height: 88px; }
  .process-line article > span { top: 15px; left: 0; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-form { padding: 22px 18px; }
}

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

/* ==========================================================
   SBv1 — corrección de hero y credenciales universitarias
   La fotografía principal se muestra completa, sin object-fit: cover.
   ========================================================== */
.hero {
  min-height: clamp(760px, 88svh, 900px);
}

.hero-photo-stage {
  position: absolute;
  z-index: 0;
  top: calc(var(--header-h) + 8px);
  right: 0;
  bottom: 0;
  width: min(61vw, 880px);
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
}

.hero-photo {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: right bottom;
  filter: saturate(1.01) contrast(1.01);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.52) 11%, #000 28%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.52) 11%, #000 28%);
}

.hero-gradient {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5,8,13,.995) 0%, rgba(5,8,13,.97) 30%, rgba(5,8,13,.82) 48%, rgba(5,8,13,.28) 68%, rgba(5,8,13,.05) 100%),
    linear-gradient(180deg, rgba(4,7,11,.14), rgba(4,7,11,.05) 68%, rgba(4,7,11,.76));
}

.hero-grid,
.orb,
.particles {
  z-index: 1;
}

.hero-shell,
.scroll-hint {
  z-index: 3;
}

.education-item {
  grid-template-columns: 58px minmax(0, 1fr) !important;
}

.education-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 43, 78, .12);
}

.education-logo--uam {
  border-radius: 50%;
}

@media (max-width: 1080px) {
  .hero-photo-stage {
    width: 58vw;
    right: -1vw;
  }

  .hero-copy {
    width: min(610px, 59vw);
  }
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
  }

  .hero-media {
    position: relative;
    height: min(72svh, 680px);
    min-height: 500px;
    background: #0a0e15;
  }

  .hero-photo-stage {
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
  }

  .hero-photo {
    object-position: center bottom;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
  }

  .hero-gradient {
    background:
      linear-gradient(180deg, rgba(5,8,13,.08) 0%, rgba(5,8,13,.03) 48%, #070a0f 100%),
      linear-gradient(90deg, rgba(5,8,13,.12), transparent 55%);
  }
}

@media (max-width: 560px) {
  .hero-media {
    height: 62svh;
    min-height: 430px;
  }

  .education-item {
    grid-template-columns: 52px minmax(0, 1fr) !important;
  }

  .education-logo {
    width: 46px;
    height: 46px;
  }
}

/* Resets específicos frente a las reglas originales de SBv1. */
.hero-photo {
  position: absolute;
  inset: 0;
  background: none;
  transform: none;
  will-change: auto;
}

.education-list .education-item {
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  gap: 15px;
}
