/* Clínica Veterinaria Villén. Diseño web: PM */
:root {
  --tinta: #0F2A3D;       /* navy: all text, dark panels */
  --suave: #47607A;       /* secondary text, 6.3:1 on white */
  --azul: #0092CA;        /* brand blue: colour fields (navy text only at 24 px+) */
  --naranja: #F17E00;     /* brand orange: colour fields, navy text on it 4.9:1 */
  --lima: #BBD700;        /* the logo bird's green: colour fields, navy text on it 9:1 */
  --cielo: #E1F3FA;       /* pale tint of the brand blue */
  --linea: #D6E4EC;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: 48px;
  --header-h: 76px;
  --r: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.6 var(--font);
  color: var(--tinta);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lima); color: var(--tinta); }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2 { font-weight: 500; letter-spacing: -0.04em; line-height: 0.96; text-wrap: balance; }
h1 { font-size: clamp(46px, 8.2vw, 116px); text-align: center; }
h2 { font-size: clamp(38px, 5vw, 68px); }
h3 { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }
section[id], #contenido { scroll-margin-top: calc(var(--header-h) + 8px); }

:focus-visible { outline: 3px solid var(--tinta); outline-offset: 3px; border-radius: 6px; }
.hp-navy :focus-visible, .tp-navy :focus-visible, .servicios > .wrap > .serv-head :focus-visible, .footer-base :focus-visible { outline-color: #fff; }
.btn:focus-visible { border-radius: 999px; }

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  background: var(--tinta); color: #fff; font-weight: 600; padding: 12px 18px; border-radius: 999px;
}
.skip:focus { top: 12px; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }

/* Buttons: pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  font: 600 16px/1 var(--font); text-decoration: none; white-space: nowrap;
  border-radius: 999px; border: 2px solid transparent; cursor: pointer;
}
.btn-navy { background: var(--tinta); color: #fff; }
.btn-orange { background: var(--naranja); color: var(--tinta); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-line { background: #fff; color: var(--tinta); border-color: var(--tinta); }
.btn:active { transform: scale(0.97); }
.ico { width: 17px; height: 17px; fill: currentColor; flex: none; }

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: #fff; }
.header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--linea); opacity: 0; }
.header.stuck::after { opacity: 1; }
.header-in { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { flex: none; display: block; border-radius: 6px; }
.logo img { width: 224px; }
.menu { display: flex; align-items: center; gap: 24px; }
.menu nav { display: flex; gap: 4px; }
.menu nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; font-weight: 500; text-decoration: none; border-radius: 999px; }
.menu .btn { min-height: 46px; padding: 0 22px; }
.burger { display: none; }

/* Hero: huge centred headline, the beagle resting on three colour panels */
.hero { background: var(--cielo); padding: 36px 0 44px; overflow: hidden; }
.hero-stage { position: relative; }
.hero-pet { position: relative; z-index: 2; display: block; width: min(660px, 54%); aspect-ratio: 16 / 10; margin: 4px auto 18px; border-radius: 400px 400px 32px 32px; overflow: hidden; border: 8px solid #fff; box-shadow: 0 28px 50px -26px rgba(15, 42, 61, .55); pointer-events: none; }
.hero-pet img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hp { position: relative; border-radius: var(--r); padding: 32px 36px 30px; min-height: 190px; display: flex; flex-direction: column; justify-content: flex-end; }
.hp-lime { background: var(--lima); }
.hp-navy { background: var(--tinta); color: #fff; justify-content: space-between; gap: 20px; padding-top: 44px; }
.hp-orange { background: var(--naranja); }
.hp-big { font-size: clamp(32px, 3.5vw, 48px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.hp-small { font-size: 18px; margin-top: 8px; }
.hp-dir { font-size: 19px; line-height: 1.4; max-width: 24ch; }
.hp-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.hp-btns .btn { min-height: 48px; padding: 0 20px; }

/* Logo animals peeking over the colour blocks */
.peek { position: absolute; bottom: calc(100% - 1px); overflow: hidden; pointer-events: none; }
.peek img { width: 100%; }
.peek-gato { left: 36px; width: 78px; }
.peek-pajaro { right: 44px; width: 84px; bottom: calc(100% - 10px); }
.peek-perro { left: max(var(--pad), calc((100vw - 1240px) / 2 + 84px)); width: 88px; }

/* About */
.about { padding: 128px 0 112px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 80px; align-items: center; }
.about-block { position: relative; aspect-ratio: 1 / 0.62; clip-path: inset(-40% 0 0 0 round 36px); margin-top: 12%; }
.about-block::before { content: ""; position: absolute; inset: 0; background: var(--azul); border-radius: 36px; }
.about-block img { position: absolute; left: 0; bottom: 0; width: 100%; }
.about-text h2 { margin-bottom: 32px; }
.about-text p { max-width: 62ch; color: #29445A; }
.about-text p + p { margin-top: 16px; }
.about-text .lead { font-size: 21px; line-height: 1.5; color: var(--tinta); }
.about-text .lead + p { margin-top: 24px; }
.about-text .firma { margin-top: 28px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--tinta); display: flex; align-items: center; gap: 14px; }
.about-text .firma::before { content: ""; width: 36px; height: 4px; border-radius: 4px; background: var(--naranja); flex: none; }

/* Three colour panels: portrait, Urgencias, PROMOS */
.trio { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 96px; }
.tp { border-radius: var(--r); padding: 34px 36px; min-height: 208px; }
.tp-navy { background: var(--tinta); color: #fff; display: flex; align-items: center; gap: 28px; }
.tp-orange { background: var(--naranja); }
.tp-lime { background: var(--lima); }
.tp-big { font-size: clamp(32px, 3.5vw, 48px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.tp-small { font-size: 18px; margin-top: 8px; color: #C9DCE8; }
.retrato { flex: none; width: 128px; height: 128px; border-radius: 50%; overflow: hidden; position: relative; box-shadow: 0 0 0 5px var(--lima); }
/* image set larger than the circle: the baked shadow of the original file falls outside */
.retrato img { position: absolute; width: 154px; max-width: none; left: -14px; top: -14px; }
.urgencias { display: grid; align-content: center; }
.urg-label { font-size: 20px; font-weight: 600; }
.urg-num { font-size: clamp(38px, 4.2vw, 56px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.urg-num a { text-decoration: none; display: inline-block; min-height: 48px; }
.urg-horas { font-size: 20px; font-weight: 600; }
.urg-nota { font-size: 15px; margin-top: 12px; }
.promos { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: 0.08em; }
.promos img { width: 128px; }

/* Servicios: navy field, white tiles */
.servicios { position: relative; background: var(--tinta); padding: 112px 0 96px; }
.serv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; color: #fff; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--lima); color: var(--tinta); font-weight: 600; font-size: 18px; }
.serv-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.serv-grid li { background: #fff; border-radius: 24px; padding: 28px 28px 30px; }
.serv-chip { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; margin-bottom: 28px; }
.c-blue { background: var(--cielo); } .c-lime { background: #EEF5B8; } .c-orange { background: #FCE2C4; }
.serv-ico { width: 32px; height: 32px; fill: none; stroke: var(--tinta); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.serv-ico .dot { fill: var(--tinta); stroke: none; }
.serv-grid h3 { margin-bottom: 10px; }
.serv-grid p { font-size: 16px; line-height: 1.5; color: var(--suave); }
.royal { display: inline-block; margin-top: 44px; }
.royal img { width: 225px; height: auto; }

/* Contacto: one blue band, three white cards */
.contacto { background: var(--azul); padding: 104px 0 112px; }
.visita { margin-top: 44px; display: grid; grid-template-columns: 1.35fr 1.3fr 0.95fr; gap: 16px; align-items: center; }
.vc { background: #fff; border-radius: var(--r); padding: 34px 36px; }
.vc-foto { background: none; padding: 0; display: grid; place-items: center; }
/* the storefront file is 326 px wide: shown at its real size, never enlarged */
.vc-foto img { width: 100%; max-width: 440px; border-radius: 14px; box-shadow: 0 16px 28px -14px rgba(15, 42, 61, .55); }
.vc h3 { font-size: 18px; margin-bottom: 10px; }
.vc .dir { margin-top: 14px; font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.vc .frente { margin-top: 12px; color: var(--suave); font-size: 16px; }
.vc-btns { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.vc-btns .btn { min-height: 48px; padding: 0 22px; }
.datos { display: grid; gap: 18px; align-content: center; height: 100%; }
.datos dt { font-size: 15px; color: var(--suave); }
.datos a { display: inline-flex; align-items: center; min-height: 44px; font-size: clamp(26px, 2.6vw, 34px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; text-decoration: none; }
.datos a.mail { font-size: 19px; letter-spacing: -0.01em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--naranja); }
.mapa { margin-top: 16px; height: 420px; border-radius: var(--r); overflow: hidden; background: var(--cielo); }
.mapa iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Footer: their logo large, three filled columns */
.footer-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; align-items: start; padding-block: 80px 72px; }
.footer-logo { display: block; border-radius: 8px; }
.footer-logo img { width: 100%; max-width: 540px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1.05fr 1.5fr; column-gap: 40px; font-size: 16px; }
.fh { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.fh a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.footer-cols li { color: var(--suave); line-height: 1.45; padding: 5px 0; }
.footer-cols li a { color: var(--tinta); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; min-height: 34px; }
.footer-cols .two { columns: 2; column-gap: 24px; }
.footer-cols .two li { break-inside: avoid; }
.footer-base { background: var(--tinta); }
.footer-base .wrap { display: flex; justify-content: flex-end; }
.credit { font-size: 14px; color: #C9DCE8; text-decoration: none; display: inline-flex; align-items: center; min-height: 48px; }

/* Sticky bottom bar: mobile only */
.bar { display: none; }

@media (hover: hover) and (pointer: fine) {
  .btn-navy:hover { background: #1B4563; }
  .btn-orange:hover { background: #FF9420; }
  .btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .1); }
  .btn-line:hover { background: var(--cielo); }
  .menu nav a:hover { background: var(--cielo); }
  .footer-cols a:hover, .credit:hover, .urg-num a:hover, .datos a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
}

/* Motion. All of it sits here: under prefers-reduced-motion the page is in its final state from first paint. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn { transition: transform 180ms var(--ease), background-color 180ms ease, border-color 180ms ease; }
  .header::after { transition: opacity 200ms ease; }
  .menu nav a { transition: background-color 160ms ease; }
  .hp, .tp, .serv-grid li, .vc { transition: transform 320ms var(--ease), box-shadow 320ms var(--ease); }
  @media (hover: hover) and (pointer: fine) {
    .btn:hover { transform: translateY(-2px); }
    .btn:active { transform: scale(0.97); }
    .hp:hover, .tp:hover, .vc:hover { transform: translateY(-4px); }
    .serv-grid li:hover { transform: translateY(-6px); box-shadow: 0 18px 30px -16px rgba(0, 0, 0, .5); }
  }

  /* Hero entrance: headline, then the panels deal in, the beagle settles on them, the logo animals pop up */
  .js .hero h1 { animation: rise 700ms var(--ease) both; }
  .js .hp { animation: rise 700ms var(--ease) both; }
  .js .hp-lime { animation-delay: 120ms; } .js .hp-navy { animation-delay: 200ms; } .js .hp-orange { animation-delay: 280ms; }
  .js .hero-pet { animation: pet 900ms var(--ease) 260ms both; }
  .js .hero .peek img { animation: peek 620ms var(--spring) both; }
  .js .peek-gato img { animation-delay: 900ms; } .js .peek-pajaro img { animation-delay: 1050ms; }

  /* Scroll reveals, once, staggered */
  .js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease) var(--d, 0ms), transform 700ms var(--ease) var(--d, 0ms); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .about-visual.reveal { opacity: 1; transform: none; }
  .js .about-visual.reveal img { transform: translateY(22%); transition: transform 1000ms var(--ease) 80ms; }
  .js .about-visual.reveal.in img { transform: none; }
  .js .peek-perro img { transform: translateY(101%); transition: transform 700ms var(--spring) 200ms; }
  .js .peek-perro.in img { transform: none; }
  .serv-grid li:nth-child(4n + 2) { --d: 70ms; } .serv-grid li:nth-child(4n + 3) { --d: 140ms; } .serv-grid li:nth-child(4n + 4) { --d: 210ms; }
  .js .serv-grid li.reveal.in { transition: opacity 700ms var(--ease) var(--d, 0ms), transform 320ms var(--ease), box-shadow 320ms var(--ease); }
}
@keyframes rise { from { opacity: 0; transform: translateY(36px); } }
@keyframes pet { from { opacity: 0; transform: translateY(70px); } }
@keyframes peek { from { transform: translateY(101%); } }

/* Narrow desktop and tablet */
@media (max-width: 1100px) {
  .hp { padding: 28px 26px; }
  .hp-btns .btn { padding: 0 16px; font-size: 15px; }
  .about-grid { column-gap: 48px; }
  .trio { grid-template-columns: 1fr 1fr; }
  .tp-lime { grid-column: 1 / -1; min-height: 0; flex-direction: row; gap: 24px; padding-block: 22px; }
  .tp-lime img { width: 92px; }
  .serv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .serv-grid li:nth-child(n) { --d: 0ms; } .serv-grid li:nth-child(2n) { --d: 70ms; }
  .visita { grid-template-columns: 1fr 1fr; }
  .vc-foto { grid-row: span 2; }
  .footer-in { grid-template-columns: 1fr; row-gap: 48px; }
  .footer-logo img { max-width: 480px; }
}

/* Mobile */
@media (max-width: 860px) {
  :root { --pad: 20px; --header-h: 68px; --r: 24px; }
  body { font-size: 16px; }
  .logo img { width: 180px; }

  /* Without JS the nav simply wraps under the logo. With JS it becomes a panel. */
  .header-in { flex-wrap: wrap; height: auto; min-height: var(--header-h); }
  .menu { flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
  .js .burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 0 9px; margin-right: -9px;
    background: none; border: 0; border-radius: 12px; cursor: pointer;
  }
  .burger span { display: block; height: 2.5px; border-radius: 3px; background: var(--tinta); }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }
  .js .menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 20px;
    padding: 8px var(--pad) 28px; background: #fff; border-bottom: 1px solid var(--linea);
    box-shadow: 0 24px 40px -24px rgba(15, 42, 61, .3);
    opacity: 0; visibility: hidden;
  }
  .js .menu nav { flex-direction: column; gap: 0; }
  .js .menu nav a { min-height: 58px; padding: 0; font-size: 28px; font-weight: 500; letter-spacing: -0.03em; border-bottom: 1px solid var(--linea); border-radius: 0; }
  .js .menu .btn { min-height: 52px; }
  .js .menu.open { opacity: 1; visibility: visible; }

  .hero { padding: 28px 0 24px; }
  .hero-pet { width: 100%; margin: 6px 0 14px; border-width: 6px; border-radius: 220px 220px 24px 24px; }
  .hero-panels { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hp { min-height: 0; padding: 22px 20px; }
  .hp-navy { grid-column: 1 / -1; order: -1; padding-top: 30px; }
  .hp-dir { font-size: 18px; max-width: none; }
  .hp-btns .btn { flex: 1 1 100%; min-height: 52px; font-size: 16px; }
  .hp-big { font-size: 27px; }
  .hp-small { font-size: 15px; margin-top: 6px; }
  .hero .peek { display: none; }

  .about { padding: 96px 0 72px; }
  .about-grid { display: block; }
  .about-text { margin-top: 44px; }
  .about-text h2 { margin-bottom: 24px; }
  .about-text .lead { font-size: 19px; }
  .about-text .firma { font-size: 19px; }
  .trio { grid-template-columns: 1fr; gap: 10px; margin-top: 56px; }
  .tp { min-height: 0; padding: 26px 24px; }
  .tp-navy { gap: 20px; }
  .retrato { width: 96px; height: 96px; }
  .retrato img { width: 116px; left: -10px; top: -10px; }
  .tp-big { font-size: 34px; }
  .urg-num { font-size: 44px; }

  .servicios { padding: 88px 0 72px; }
  .peek-perro { width: 64px; left: auto; right: 28px; }
  .serv-grid { margin-top: 32px; gap: 10px; }
  .serv-grid li { padding: 20px 18px 22px; border-radius: 20px; }
  .serv-chip { width: 48px; height: 48px; margin-bottom: 18px; }
  .serv-ico { width: 26px; height: 26px; }
  .serv-grid h3 { font-size: 17px; }
  .serv-grid p { font-size: 14.5px; }
  .chip { font-size: 16px; min-height: 40px; padding: 0 16px; }

  .contacto { padding: 72px 0 80px; }
  .visita { grid-template-columns: 1fr; gap: 10px; margin-top: 28px; }
  .vc { padding: 26px 24px; }
  .vc .dir { font-size: 21px; }
  .vc-foto { grid-row: auto; padding: 0; }
  .vc-btns .btn { flex: 1 1 100%; min-height: 52px; }
  .datos a { font-size: 30px; }
  .datos a.mail { font-size: 18px; }
  .mapa { height: 380px; margin-top: 10px; }

  .footer-in { padding-block: 56px 40px; row-gap: 36px; }
  .footer-logo img { max-width: 100%; }
  .footer-cols { grid-template-columns: 1fr; row-gap: 28px; }
  .footer-cols li a { min-height: 44px; }
  .footer-base .wrap { justify-content: flex-start; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

  .js .bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--linea);
    visibility: hidden; opacity: 0;
  }
  .bar .btn { min-height: 48px; padding: 0 8px; font-size: 15px; }
  .js .bar.show { visibility: visible; opacity: 1; }
}
@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  .burger span { transition: transform 220ms var(--ease), opacity 140ms ease; }
  /* closes faster than it opens */
  .js .menu { transform: translateY(-8px); transition: opacity 160ms ease, transform 160ms var(--ease), visibility 0s 160ms; }
  .js .menu.open { transform: none; transition: opacity 240ms ease, transform 240ms var(--ease); }
  .js .bar { transform: translateY(100%); transition: opacity 200ms ease, transform 200ms var(--ease), visibility 0s 200ms; }
  .js .bar.show { transform: none; transition: opacity 280ms ease, transform 280ms var(--ease); }
}
@media (max-width: 359px) {
  .serv-grid, .hero-panels { grid-template-columns: 1fr; }
}
