/* =========================================================
   Ópticas Luxentra — styles.css
   Design tokens
========================================================= */
:root {
  --blue-deep:  #101C6E;
  --blue-royal: #1C2CA0;
  --blue-ink:   #080D33;
  --gold:       #FFC72C;
  --gold-soft:  #FFE08A;
  --paper:      #F6F6F3;
  --paper-2:    #EDEEF6;
  --ink:        #10122A;
  --ink-soft:   #454869;
  --ink-mute:   #767a99;
  --line:       rgba(16, 18, 42, 0.1);
  --glass:      rgba(255, 255, 255, 0.6);
  --glass-line: rgba(255, 255, 255, 0.7);

  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --nav-h: 76px;
  --ease: cubic-bezier(.22,.9,.25,1);
}

/* =========================================================
   Reset / base
========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; color: var(--blue-ink); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
section { position: relative; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  width: min(1180px, 100% - 2.8rem);
  margin-inline: auto;
}

/* Snellen-style eyebrow label ("20/200" etc.) */
.acuity {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--blue-royal);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: .35rem .7rem;
  border-radius: 100px;
  margin-bottom: 1.1rem;
}
.acuity::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}
.section-head { max-width: 640px; margin-bottom: 2.8rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.12; letter-spacing: -.01em; }
.section-head p { margin-top: .9rem; color: var(--ink-soft); font-size: 1.05rem; max-width: 52ch; }

/* =========================================================
   Focus reveal — signature effect
   Headlines/labels start blurred + slightly scaled, sharpen
   into focus as they enter the viewport.
========================================================= */
.focus-in {
  opacity: 0;
  filter: blur(9px);
  transform: scale(1.015) translateY(10px);
  transition: opacity .85s var(--ease), filter .9s var(--ease), transform .9s var(--ease);
  will-change: filter, opacity, transform;
}
.focus-in.is-sharp {
  opacity: 1;
  filter: blur(0px);
  transform: scale(1) translateY(0);
}
/* defensive: never let content stay invisible if JS fails/late */
@media (prefers-reduced-motion: reduce) {
  .focus-in { transition-duration: .3s; }
}
.focus-in[data-delay="1"] { transition-delay: .08s; }
.focus-in[data-delay="2"] { transition-delay: .16s; }
.focus-in[data-delay="3"] { transition-delay: .24s; }
.focus-in[data-delay="4"] { transition-delay: .32s; }
.focus-in[data-delay="5"] { transition-delay: .40s; }

/* =========================================================
   Nav
========================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  background: rgba(246, 246, 243, 0.55);
  border-bottom: 1px solid transparent;
  transition: background .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.nav.is-solid {
  background: rgba(246, 246, 243, 0.88);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -20px rgba(8,13,51,.35);
}
@supports (backdrop-filter: blur(14px)) {
  .nav { backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); }
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--blue-ink); }
.brand img { height: 34px; width: 34px; border-radius: 8px; }
.brand .b-x { color: var(--blue-royal); }
.brand .b-x em { font-style: normal; color: var(--gold); }

.nav-links { display: flex; align-items: center; gap: 2.1rem; }
.nav-links a {
  font-size: .92rem; font-weight: 500; color: var(--ink-soft);
  position: relative; padding-block: .3rem;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--gold); transition: right .32s var(--ease);
}
@media (hover: hover) {
  .nav-links a:hover { color: var(--blue-ink); }
  .nav-links a:hover::after { right: 0; }
}
.nav-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--blue-deep); color: #fff;
  padding: .62rem 1.15rem; border-radius: 100px;
  font-size: .88rem; font-weight: 600;
  transition: transform .25s var(--ease), background .25s var(--ease);
}
@media (hover: hover) {
  .nav-cta:hover { background: var(--blue-royal); transform: translateY(-2px); }
}
.nav-burger { display: none; }

/* =========================================================
   Buttons
========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .95rem 1.7rem; border-radius: 100px;
  font-weight: 600; font-size: .95rem; border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.btn-gold { background: var(--gold); color: var(--blue-ink); }
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -12px rgba(255,199,44,.55); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.8); transform: translateY(-3px); }
.btn-outline-dark { background: transparent; color: var(--blue-ink); border-color: var(--line); }
.btn-outline-dark:hover { border-color: var(--blue-royal); background: var(--paper-2); transform: translateY(-3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; }

/* =========================================================
   Hero
========================================================= */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-top: var(--nav-h);
  position: relative;
  isolation: isolate;
  overflow: clip;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 30%;
  transform: scale(1.06);
}
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(8,13,51,.72) 0%, rgba(8,13,51,.42) 32%, rgba(8,13,51,.58) 68%, rgba(8,13,51,.94) 100%),
    linear-gradient(100deg, rgba(16,28,110,.55) 0%, rgba(16,28,110,0) 55%);
}
.hero-content { color: #fff; padding-block: 4.5rem 4.2rem; max-width: 760px; }
.hero .acuity { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); color: var(--gold-soft); }
.hero .acuity::before { background: var(--gold); }
.hero h1 {
  color: #fff;
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: -.02em;
  font-weight: 700;
}
.hero h1 .accent { color: var(--gold); }
.hero-sub {
  margin-top: 1.4rem;
  font-size: 1.15rem;
  color: rgba(255,255,255,.86);
  max-width: 46ch;
  line-height: 1.6;
}
.hero .btn-row { margin-top: 2.3rem; }
.hero-scroll {
  position: absolute; right: 2.8rem; bottom: 2.4rem;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  color: rgba(255,255,255,.7); font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .08em;
}
.hero-scroll .line { width: 1px; height: 46px; background: linear-gradient(180deg, rgba(255,255,255,.9), transparent); animation: scrollLine 2.2s ease-in-out infinite; }
@keyframes scrollLine { 0%,100% { transform: scaleY(1); opacity: .9; } 50% { transform: scaleY(.55); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .hero-scroll .line { animation: none; } }
@media (max-width: 720px) { .hero-scroll { display: none; } }

/* =========================================================
   Stats strip
========================================================= */
.stats {
  background: var(--blue-ink);
  color: #fff;
  padding-block: 2.6rem;
}
.stats .wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--gold); }
.stat span { display: block; margin-top: .35rem; font-size: .88rem; color: rgba(255,255,255,.72); }
@media (max-width: 720px) { .stats .wrap { grid-template-columns: 1fr; gap: 1.4rem; text-align: left; } }

/* =========================================================
   Glass card base (used across sections)
========================================================= */
.glass-card {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  box-shadow: 0 30px 60px -40px rgba(16,28,110,.35);
}
@supports (backdrop-filter: blur(16px)) {
  .glass-card { background: var(--glass); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); }
}

/* =========================================================
   Nosotros
========================================================= */
.nosotros { padding-block: 7rem 5rem; position: relative; overflow: clip; }
.nosotros-mesh {
  position: absolute; inset: -20% -10% auto -10%; height: 70%; z-index: -1;
  background:
    radial-gradient(45% 45% at 20% 20%, rgba(28,44,160,.16), transparent 70%),
    radial-gradient(40% 40% at 85% 10%, rgba(255,199,44,.16), transparent 70%);
  filter: blur(40px);
}
.nosotros-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3.2rem; align-items: start; }
.nosotros-copy p { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 1.4rem; }
.nosotros-copy p:last-child { margin-bottom: 0; }
.pillars { margin-top: 2.2rem; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.pillar { display: flex; gap: .7rem; align-items: flex-start; padding: .2rem 0; }
.pillar .dot { flex: none; width: 8px; height: 8px; margin-top: .5rem; border-radius: 50%; background: var(--gold); }
.pillar span { font-size: .92rem; color: var(--ink-soft); line-height: 1.45; }

.mv-cards { display: flex; flex-direction: column; gap: 1.2rem; }
.mv-card { padding: 1.8rem 1.9rem; }
.mv-card .tag { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; color: var(--blue-royal); text-transform: uppercase; }
.mv-card h3 { margin-top: .5rem; font-size: 1.25rem; }
.mv-card p { margin-top: .7rem; color: var(--ink-soft); font-size: .96rem; }

/* =========================================================
   Servicios
========================================================= */
.servicios { padding-block: 5rem; background: var(--paper-2); }
.serv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.serv-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 1.9rem 1.7rem;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
@media (hover: hover) {
  .serv-card:hover { transform: translateY(-6px); box-shadow: 0 24px 46px -28px rgba(16,28,110,.4); border-color: rgba(28,44,160,.25); }
}
.serv-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-royal));
  color: var(--gold); margin-bottom: 1.1rem;
}
.serv-icon svg { width: 22px; height: 22px; }
.serv-card h3 { font-size: 1.08rem; }
.serv-card p { margin-top: .55rem; color: var(--ink-soft); font-size: .92rem; }
.serv-card.wide { grid-column: span 1; }
@media (max-width: 960px) { .serv-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .serv-grid { grid-template-columns: 1fr; } }

/* =========================================================
   Detalle del examen (precisión clínica)
========================================================= */
.detalle { padding-block: 6.5rem; }
.detalle-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 3.2rem; align-items: center; }
.detalle-intro h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 1rem; }
.detalle-intro p { color: var(--ink-soft); font-size: 1.02rem; max-width: 46ch; }
.detalle-badge {
  margin-top: 1.6rem; display: inline-flex; align-items: center; gap: .7rem;
  padding: .75rem 1.1rem; border-radius: 100px;
  background: var(--paper-2); border: 1px solid var(--line);
  font-size: .88rem; font-weight: 600; color: var(--blue-ink);
}
.detalle-badge .ic { display: flex; color: var(--blue-royal); }
.detalle-badge .ic svg { width: 20px; height: 20px; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.2rem; }
.check-item {
  display: flex; align-items: center; gap: .8rem;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: .95rem 1.1rem; font-size: .92rem; color: var(--ink-soft); font-weight: 500;
}
.check-ic {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-deep); color: var(--gold);
  font-size: .78rem; font-weight: 700;
}
@media (max-width: 860px) { .detalle-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .check-grid { grid-template-columns: 1fr; } }

/* =========================================================
   Galeria
========================================================= */
.galeria { padding-block: 6rem; }
.gal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.gal-item {
  position: relative; overflow: hidden; border-radius: 18px;
  aspect-ratio: 941 / 1672;
  background: linear-gradient(160deg, var(--blue-deep), var(--blue-ink));
}
.gal-item img {
  width: 100%; height: 100%; object-fit: contain; object-position: center;
  transition: transform .6s var(--ease);
}
@media (hover: hover) { .gal-item:hover img { transform: scale(1.045); } }
.gal-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.1rem 1.1rem;
  background: linear-gradient(0deg, rgba(8,13,51,.85), transparent 70%);
  color: #fff; font-size: .82rem; letter-spacing: .01em;
}
@media (max-width: 900px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .gal-grid { grid-template-columns: 1fr; }
  .gal-item { aspect-ratio: 941 / 1200; }
}

/* =========================================================
   Mensaje / pull quote
========================================================= */
.mensaje { padding-block: 7rem; background: var(--blue-ink); color: #fff; position: relative; overflow: clip; }
.mensaje-mesh {
  position: absolute; inset: -30% -10%; z-index: 0;
  background: radial-gradient(45% 45% at 75% 30%, rgba(255,199,44,.14), transparent 70%),
              radial-gradient(40% 50% at 15% 70%, rgba(28,44,160,.5), transparent 70%);
  filter: blur(50px);
}
.mensaje .wrap { position: relative; z-index: 1; max-width: 880px; }
.mensaje blockquote {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 2.35rem); line-height: 1.32; letter-spacing: -.01em;
}
.mensaje blockquote .hl { color: var(--gold); }
.mensaje cite { display: block; margin-top: 1.6rem; font-style: normal; color: rgba(255,255,255,.6); font-family: var(--font-mono); font-size: .82rem; letter-spacing: .05em; }

/* =========================================================
   Contacto
========================================================= */
.contacto { padding-block: 6.5rem; }
.contacto-grid { display: grid; grid-template-columns: 1fr .9fr; gap: 1.4rem; align-items: stretch; }
.contact-card { padding: 2.4rem; display: flex; flex-direction: column; gap: 1.6rem; }
.contact-row { display: flex; gap: 1rem; align-items: flex-start; }
.contact-row .ic {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-2); color: var(--blue-royal);
}
.contact-row .ic svg { width: 20px; height: 20px; }
.contact-row h4 { font-size: .98rem; color: var(--blue-ink); }
.contact-row p, .contact-row a { font-size: .92rem; color: var(--ink-soft); margin-top: .2rem; display: block; }
.contact-row a:hover { color: var(--blue-royal); }
.social-row { display: flex; gap: .7rem; margin-top: .3rem; }
.social-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--paper-2); color: var(--blue-royal);
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.social-pill svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .social-pill:hover { background: var(--blue-deep); color: var(--gold); transform: translateY(-3px); }
}
.contact-visual { position: relative; border-radius: 20px; overflow: hidden; min-height: 260px; }
.contact-visual img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.contact-visual .cv-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,13,51,.1), rgba(8,13,51,.85)); }
.contact-visual .cv-copy { position: absolute; left: 1.6rem; right: 1.6rem; bottom: 1.6rem; color: #fff; }
.contact-visual .cv-copy .acuity { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: var(--gold-soft); margin-bottom: .7rem; }
.contact-visual .cv-copy p { font-size: .95rem; color: rgba(255,255,255,.85); }
@media (max-width: 860px) { .contacto-grid { grid-template-columns: 1fr; } }

/* =========================================================
   Footer
========================================================= */
footer { background: var(--blue-ink); color: rgba(255,255,255,.7); padding-block: 3rem 2.2rem; border-top: 1px solid rgba(255,255,255,.08); }
.foot-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.6rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.foot-brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-family: var(--font-display); font-weight: 700; }
.foot-brand img { height: 30px; width: 30px; border-radius: 7px; }
.foot-links { display: flex; gap: 1.8rem; flex-wrap: wrap; }
.foot-links a { font-size: .88rem; }
@media (hover: hover) { .foot-links a:hover { color: #fff; } }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-top: 1.6rem; font-size: .8rem; }
.foot-bottom .social-row .social-pill { background: rgba(255,255,255,.08); color: #fff; width: 36px; height: 36px; }
.foot-bottom .social-row .social-pill svg { width: 16px; height: 16px; }
@media (hover: hover) { .foot-bottom .social-row .social-pill:hover { background: var(--gold); color: var(--blue-ink); } }

/* =========================================================
   Reveal (generic scroll reveal for non-heading elements)
========================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal[data-split] { opacity: 1; transform: none; } /* defensive per gotcha A.4.5 */

/* =========================================================
   Mobile nav
========================================================= */
@media (max-width: 880px) {
  .nav-links { position: fixed; inset: var(--nav-h) 0 0 0; background: rgba(246,246,243,.98); flex-direction: column; justify-content: flex-start; padding: 2.4rem 1.6rem; gap: 1.6rem; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
  .nav-links.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .nav-links a { font-size: 1.15rem; }
  .nav-cta { display: none; }
  .nav-links .nav-cta-mobile { display: inline-flex; margin-top: .6rem; }
  .nav-burger {
    display: flex; flex-direction: column; gap: 5px; width: 26px; padding: .4rem;
    background: none; border: none;
  }
  .nav-burger span { display: block; height: 2px; background: var(--blue-ink); border-radius: 2px; transition: transform .25s var(--ease), opacity .25s var(--ease); }
  .nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.is-open span:nth-child(2) { opacity: 0; }
  .nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
@media (min-width: 881px) { .nav-cta-mobile { display: none; } }

/* =========================================================
   Responsive — big breakpoints
========================================================= */
@media (max-width: 980px) {
  .nosotros-grid { grid-template-columns: 1fr; }
  .contacto-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero-content { padding-block: 3rem 3rem; }
  .pillars { grid-template-columns: 1fr; }
  .stats .wrap { text-align: left; }
}
