/* Landing de P.O. Clinic · «El trazo», versión noche.
   Un solo tema oscuro petróleo. El panel de reserva es una superficie clara elevada (.claro).
   Radios: píldora en botones, 28px en paneles con foto, 22px en el panel de reserva. */

body.web {
  --noche: #072326;
  --noche-2: #0C2F33;
  --hueso: #EEF4F2;
  --hueso-2: rgba(238, 244, 242, .72);
  --agua: #3CCBB8;
  --agua-claro: #A5E6DC;
  --linea-o: rgba(238, 244, 242, .14);
  --c-dental: #3CCBB8; --c-estetica: #A5E6DC; --c-piel: #6FB7AC;
  background: var(--noche); color: var(--hueso);
  color-scheme: dark;
}
body.web ::selection { background: var(--agua); color: var(--noche); }
body.web :focus-visible { outline-color: var(--agua); }
body.web .entrada { color: var(--hueso-2); }

/* Superficie clara para la reserva */
.claro {
  --porcelana: #F2F6F5; --porcelana-2: #E8F0EE; --bruma: #DCE9E7; --tinta: #0C2A2D; --tinta-2: #3D5A5C;
  --petroleo: #145A60; --agua: #2FB3A3; --agua-claro: #9EDCD2; --linea: rgba(12, 42, 45, .14); --superficie: #FBFDFC;
  --c-dental: #145A60; --c-estetica: #2FB3A3; --c-piel: #7FBFB3;
  color: var(--tinta); color-scheme: light;
}
.claro .boton--lleno { background: var(--tinta); color: #F2F6F5; }
.claro .boton--lleno:hover { background: var(--petroleo); }
.claro .chip[aria-pressed="true"], .claro .dia[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #F2F6F5; }
.claro .hora[aria-pressed="true"] { background: var(--agua); border-color: var(--agua); color: #06201F; }
.claro .campo .error { color: #B42318; }

/* Botones de la landing */
.boton--agua { background: var(--agua); color: #052022; }
.boton--agua:hover { background: #69DCCB; }
.boton--cristal { background: rgba(238, 244, 242, .08); border-color: rgba(238, 244, 242, .22); color: var(--hueso); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.boton--cristal:hover { border-color: var(--hueso); }
.boton--isla { padding-right: .45em; }
.boton__icono { width: 2.1em; height: 2.1em; border-radius: 50%; background: rgba(5, 32, 34, .12); display: grid; place-items: center; margin-left: .3em; transition: transform .5s var(--ease); }
.boton--isla:hover .boton__icono { transform: translate(2px, -2px) scale(1.06); }

/* Navegación en isla */
.isla {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 30;
  width: min(1180px, calc(100% - 24px)); height: 64px; padding: 0 10px 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-radius: 999px; background: rgba(7, 35, 38, .55); border: 1px solid var(--linea-o);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 40px -24px rgba(0, 0, 0, .6);
}
.isla .marca svg { width: 24px; height: 30px; }
.isla .marca__nombre { font-size: 1.4rem; }
.isla .menu a:not(.boton) { color: var(--hueso-2); }
.isla .menu a:not(.boton):hover { color: var(--hueso); }
.isla .menu .boton { padding: .65em 1.25em; }

/* Portada: la sonrisa a través del diente.
   Sin vibraciones: la foto está quieta debajo y encima hay una placa oscura con un hueco en forma de diente.
   Solo se escala la placa (una capa, transform en el compositor), así no hay escalas que compensar. */
.hero { position: relative; height: 100dvh; min-height: 620px; }
.hero__fijo {
  --h: min(76vh, 680px); --w: calc(var(--h) * .8); --nx: .74; --ny: .56;
  --l: calc((100cqw - var(--w)) * var(--nx)); --t: calc((100cqh - var(--h)) * var(--ny));
  position: relative; height: 100dvh; min-height: 620px; overflow: hidden; isolation: isolate; container-type: size;
  background: var(--noche);
}
.hero__foto { position: absolute; inset: 0; z-index: 0; background: url(../img/sonrisa.webp) 64% 34% / cover no-repeat; }
/* Placa de 7x7 dientes con el hueco en el centro: cubre la pantalla aunque esté a escala 1 */
.hero__placa {
  position: absolute; z-index: 1; pointer-events: none;
  left: calc(var(--l) - var(--w) * 3); top: calc(var(--t) - var(--h) * 3); width: calc(var(--w) * 7); height: calc(var(--h) * 7);
  background: radial-gradient(closest-side, #0E3B40 0%, var(--noche) 100%);
  -webkit-mask: url(../img/diente-mascara.svg) center / calc(100% / 7) calc(100% / 7) no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: url(../img/diente-mascara.svg) center / calc(100% / 7) calc(100% / 7) no-repeat exclude, linear-gradient(#000 0 0);
  transform-origin: 52.857% 50.714%;
  backface-visibility: hidden;
}
.hero__trazo {
  position: absolute; z-index: 2; left: var(--l); top: var(--t); height: var(--h); width: var(--w);
  overflow: visible; pointer-events: none; transform-origin: 70% 55%; backface-visibility: hidden;
}
.hero__velo { position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 35, 38, .1) 30%, rgba(7, 35, 38, .85) 100%), linear-gradient(90deg, rgba(7, 35, 38, .55), transparent 60%); }
.hero__trazo path { fill: none; stroke-linecap: round; }
.hero__trazo .t1 { stroke: var(--agua); stroke-width: 1.6; }
.hero__trazo .t2 { stroke: var(--agua-claro); stroke-width: 1.1; }
.hero__trazo .t3 { stroke: #2A8C81; stroke-width: .9; }
.hero__texto {
  position: absolute; z-index: 3; left: max(24px, calc((100% - 1180px) / 2 + 8px)); top: 50%; transform: translateY(-46%);
  width: min(620px, 52%); display: grid; gap: 26px;
}
.hero__texto h1 { font-size: clamp(3.2rem, 6.2vw, 5.8rem); line-height: .98; letter-spacing: -.02em; max-width: 10ch; }
.hero__texto p { font-size: clamp(1.05rem, 1.35vw, 1.22rem); color: var(--hueso-2); max-width: 34ch; }
.hero__acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero__lema {
  position: absolute; z-index: 3; left: max(24px, calc((100% - 1180px) / 2 + 8px)); bottom: 9vh; margin: 0;
  font-family: var(--serif); font-size: clamp(3rem, 7vw, 6.4rem); line-height: 1; letter-spacing: -.02em; opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__foto { animation: foto 1.6s var(--ease) .5s both; }
  .hero__trazo path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: trazar 2.4s var(--ease) forwards; }
  .hero__trazo .t2 { animation-delay: .2s; }
  .hero__trazo .t3 { animation-delay: .4s; }
}
@keyframes foto { from { opacity: 0; } }

/* El diente se abre con el scroll (navegadores con scroll-driven animations). Solo transform y opacity. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 861px) {
    .hero { height: 175vh; }
    .hero__fijo { position: sticky; top: 0; }
    .hero__placa, .hero__trazo { will-change: transform; }
    .hero__placa { animation: abrir linear both; animation-timeline: scroll(root); animation-range: 0vh 70vh; }
    .hero__trazo { animation: abrir linear both, apagar linear both; animation-timeline: scroll(root), scroll(root); animation-range: 0vh 70vh, 4vh 32vh; }
    .hero__texto { animation: salir linear both; animation-timeline: scroll(root); animation-range: 0vh 22vh; }
    .hero__velo { animation: velar linear both; animation-timeline: scroll(root); animation-range: 30vh 65vh; }
    .hero__lema { animation: lema linear both; animation-timeline: scroll(root); animation-range: 42vh 72vh; }
  }
}
@keyframes abrir {
  0% { transform: scale(1.0000); }
  5% { transform: scale(1.5297); }
  10% { transform: scale(1.9046); }
  15% { transform: scale(2.2745); }
  20% { transform: scale(2.6553); }
  25% { transform: scale(3.0540); }
  30% { transform: scale(3.4747); }
  35% { transform: scale(3.9205); }
  40% { transform: scale(4.3937); }
  45% { transform: scale(4.8967); }
  50% { transform: scale(5.4316); }
  55% { transform: scale(6.0004); }
  60% { transform: scale(6.6052); }
  65% { transform: scale(7.2481); }
  70% { transform: scale(7.9311); }
  75% { transform: scale(8.6566); }
  80% { transform: scale(9.4266); }
  85% { transform: scale(10.2435); }
  90% { transform: scale(11.1097); }
  95% { transform: scale(12.0277); }
  100% { transform: scale(13.0000); }
}
@keyframes salir { to { opacity: 0; transform: translateY(-62%); } }
@keyframes apagar { to { opacity: 0; } }
@keyframes velar { to { opacity: 1; } }
@keyframes lema { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .hero, .hero__fijo { height: 100svh; min-height: 640px; }
  .hero__fijo { --h: min(46svh, 400px); --nx: .5; --ny: .22; }
  .hero__foto { background-position: 62% 30%; }
  .hero__fijo { --w: calc(var(--h) * .8); }
  .hero__texto { top: auto; bottom: 28px; transform: none; width: auto; right: 20px; left: 20px; gap: 16px; }
  .hero__texto h1 { font-size: clamp(2.7rem, 12vw, 3.6rem); }
  .hero__lema { display: none; }
  .isla .menu a:not(.boton) { display: none; }
  .isla { height: 58px; }
}

/* Tres especialidades */
.tres { padding: clamp(110px, 14vw, 190px) 0 clamp(90px, 10vw, 140px); background: var(--noche); }
.tres__cabeza { display: grid; gap: 18px; margin-bottom: 52px; }
.tres__cabeza h2 { font-size: clamp(2.6rem, 5.6vw, 5rem); line-height: 1; max-width: 14ch; }
.acordeon {
  width: min(1380px, calc(100% - 40px)); margin-inline: auto; height: min(78vh, 720px); min-height: 560px;
  display: grid; gap: 12px; grid-template-columns: 2.6fr 1fr 1fr; transition: grid-template-columns .9s var(--ease);
}
.acordeon[data-activo="1"] { grid-template-columns: 1fr 2.6fr 1fr; }
.acordeon[data-activo="2"] { grid-template-columns: 1fr 1fr 2.6fr; }
.panel {
  position: relative; border-radius: 28px; overflow: hidden; cursor: pointer; isolation: isolate; min-width: 0;
  background: var(--noche-2); outline: 1px solid var(--linea-o); outline-offset: -1px;
}
.panel__foto { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 1.2s var(--ease), filter .8s var(--ease); filter: saturate(.85) brightness(.82); }
.panel::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 35, 38, 0) 30%, rgba(7, 35, 38, .55) 58%, rgba(7, 35, 38, .94) 100%); }
.panel.activo .panel__foto { transform: scale(1); filter: saturate(1) brightness(.95); }
.panel__cuerpo { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(22px, 2.6vw, 38px); display: grid; gap: 14px; }
.panel h3 { font-size: clamp(1.6rem, 2vw, 2.1rem); line-height: 1.05; transition: font-size .6s var(--ease); }
.panel.activo h3 { font-size: clamp(2.2rem, 3.2vw, 3.2rem); }
.panel__mas { display: grid; gap: 18px; max-width: 520px; opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .7s var(--ease); pointer-events: none; }
.panel.activo .panel__mas { opacity: 1; transform: none; pointer-events: auto; transition-delay: .25s; }
.panel__mas p { color: var(--hueso-2); }
.panel__lista { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.panel__lista li { font-size: .9rem; padding: .45em .95em; border-radius: 999px; background: rgba(238, 244, 242, .1); border: 1px solid rgba(238, 244, 242, .18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel__boton { position: absolute; inset: 0; z-index: 1; background: none; border: 0; cursor: pointer; border-radius: inherit; }
.panel__boton:focus-visible { outline: 2px solid var(--agua); outline-offset: -4px; }
.panel.activo .panel__boton { pointer-events: none; }
.panel__mas .boton { width: fit-content; position: relative; z-index: 2; }
@media (max-width: 860px) {
  .acordeon { grid-template-columns: 1fr !important; height: auto; min-height: 0; gap: 14px; }
  .panel { min-height: 0; display: grid; }
  .panel__foto { position: relative; z-index: 0; height: 260px; transform: none; filter: none; }
  .panel::after { display: none; }
  .panel__cuerpo { position: relative; padding: 22px 20px 26px; background: var(--noche-2); }
  .panel__mas { opacity: 1; transform: none; pointer-events: auto; }
  .panel h3, .panel.activo h3 { font-size: 2.1rem; }
  .panel__boton { display: none; }
}

/* Reserva */
body.web .cita { background: linear-gradient(180deg, var(--noche) 0%, var(--noche-2) 100%); border-top: 0; padding-top: clamp(80px, 9vw, 130px); }
body.web .cita__cabeza h2 { font-size: clamp(2.6rem, 5.6vw, 5rem); line-height: 1; }
.bisel { padding: 8px; border-radius: 30px; background: rgba(238, 244, 242, .05); border: 1px solid var(--linea-o); }
.bisel > .reserva { border-radius: 22px; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .6); border: 0; }
.bisel--foto { padding: 8px; }
.bisel--foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; aspect-ratio: 5 / 4; }

/* Clínica y pie */
body.web .clinica { background: var(--noche-2); padding: clamp(90px, 10vw, 150px) 0; }
body.web .clinica h2 { font-size: clamp(2.4rem, 4.4vw, 3.8rem); }
body.web .pie { background: var(--noche); border-top-color: var(--linea-o); color: var(--hueso-2); }
body.web .pie h4 { color: var(--hueso); }
body.web .pie a:hover { color: var(--hueso); }

/* Aparición al entrar en pantalla */
@media (prefers-reduced-motion: no-preference) {
  .js .revela { opacity: 0; transform: translateY(40px); filter: blur(8px); transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s var(--ease); }
  .js .revela.visto { opacity: 1; transform: none; filter: none; }
}
