/* Página blanca con los colores del logo de Constructora Ancar: azul marino y amarillo maquinaria.
   Las líneas de demarcación de una cancha siguen como recurso gráfico, muy suaves. */
:root {
  --navy: #011B3C;        /* azul marino del logo: textos, títulos, visor */
  --navy-2: #0A2B57;
  --court: #011B3C;
  --orange: #F9B911;      /* amarillo del logo: llamados a cotizar, franjas, rayas */
  --orange-dark: #E0A100;
  --concrete: #F3F5F7;
  --paper: #FFFFFF;
  --ink: #011B3C;
  --steel: #5A6676;
  --rule: #E3E6EA;
  --wa: #25D366;

  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;

  --gutter: 16px;
  --maxw: 1200px;
  --radius: 10px;
  --header-h: 96px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.02; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

.ico { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Tipografía base ---------- */
h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  text-transform: uppercase;
  letter-spacing: 0.005em;
}
/* Contraste tipográfico: palabra en cursiva liviana dentro de un título condensado y pesado */
h2 em {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 300;
  text-transform: none;
  letter-spacing: -0.03em;
  font-size: 0.86em;
  color: var(--steel);
}
h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; text-transform: uppercase; letter-spacing: 0.01em; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 56ch; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border-radius: 999px; border: 2px solid transparent;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--orange); color: var(--navy); }
.btn-accent:hover { background: #FFC93D; }
.btn-ghost { border-color: var(--navy); color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: .95rem; }
.btn-lg { min-height: 60px; padding: 0 30px; font-size: 1.1rem; }

/* ---------- Cabecera ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  background: #fff; z-index: 60;
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  color: var(--navy);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; flex: none; text-decoration: none; }
.brand-logo { height: 78px; width: auto; }

.main-nav { display: flex; gap: 28px; margin-left: auto; }
.main-nav a { text-decoration: none; font-weight: 600; font-size: .98rem; opacity: .85; padding-block: 6px; border-bottom: 2px solid transparent; }
.main-nav a:hover { opacity: 1; border-bottom-color: var(--orange); }
.header-cta { flex: none; }

.menu-toggle { display: none; }

@media (max-width: 880px) {
  .header-row { gap: 12px; }
  .header-cta { margin-left: auto; }
  .menu-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 11px;
    background: transparent; border: 1px solid var(--rule); border-radius: 10px; cursor: pointer;
  }
  .menu-toggle span { display: block; height: 2px; background: var(--navy); border-radius: 2px; transition: transform .25s, opacity .2s; }
  .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: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; margin: 0;
    background: #fff;
    padding: 8px max(var(--gutter), env(safe-area-inset-right, 0px)) 20px max(var(--gutter), env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 20px 30px -10px rgba(1,27,60,.18);
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 14px 0; font-size: 1.15rem; border-bottom: 1px solid var(--rule); opacity: 1; }
  .main-nav a:hover { border-bottom-color: var(--orange); }
}
@media (max-width: 880px) {
  :root { --header-h: 72px; }
  .brand-logo { height: 56px; }
}
@media (max-width: 400px) {
  .brand-logo { height: 50px; }
  .header-cta { padding: 0 14px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: #fff;
  color: var(--navy);
}
.court-lines {
  position: absolute; pointer-events: none;
  fill: none; stroke: rgba(1,27,60,.07); stroke-width: 2.5;
}
.hero .court-lines { right: -6%; top: -4%; width: min(780px, 70vw); height: 115%; }

.hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: clamp(32px, 6vw, 96px);
  padding-block: clamp(48px, 7vw, 96px);
}
.hero-copy { min-width: 0; container-type: inline-size; }

/* Titular: cuatro voces tipográficas (cursiva liviana, condensada gigante, sans pesada, cursiva grande) */
.headline { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 28px; line-height: 1; }
.hl-a {
  font-family: var(--font-body); font-style: italic; font-weight: 300;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem); letter-spacing: -.02em;
  color: var(--steel);
}
.hl-a em, .hl-d em { font-style: italic; }
.hl-rotator {
  display: grid; overflow: hidden;
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  /* tamaño según el ancho de la columna, para que "Estacionamientos" quepa en una línea */
  font-size: clamp(2.2rem, 10vw, 6.4rem);
  font-size: clamp(2.2rem, 12.2cqi, 7rem);
  line-height: .9; letter-spacing: -.005em;
  color: var(--navy);
  padding-block: .04em .02em;
  margin-block: .02em .06em;
}
.hl-rotator span { grid-area: 1 / 1; justify-self: start; transform-origin: 0 50%; white-space: nowrap; }
.hl-c {
  font-family: var(--font-body); font-weight: 800;
  font-size: clamp(1.45rem, 3.4vw, 2.9rem); letter-spacing: -.035em; line-height: 1.05;
}
.hl-d {
  position: relative;
  font-family: var(--font-body); font-style: italic; font-weight: 300;
  font-size: clamp(2.3rem, 5.2vw, 4.4rem); letter-spacing: -.04em; line-height: 1.1;
  padding-bottom: .18em;
}
.hl-arc {
  position: absolute; left: 0; bottom: 0; width: 100%; height: .3em; overflow: visible;
  fill: none; stroke: var(--orange); stroke-width: 3.5; stroke-linecap: round;
}
.hl-arc path { stroke-dasharray: 320; stroke-dashoffset: 0; }

.hero .lead { color: var(--steel); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-contact { margin-top: 22px; color: var(--steel); font-size: 1rem; }
.hero-contact strong { color: var(--navy); font-weight: 600; }
.hero-contact a { color: var(--navy); text-decoration: none; border-bottom: 2px solid var(--orange); white-space: nowrap; }
.hero-contact a:hover { border-bottom-color: var(--orange); }

.hero-video { margin: 0; justify-self: end; position: relative; }
.video-frame {
  width: clamp(260px, 25vw, 340px);
  max-width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  overflow: hidden;
  background: var(--concrete);
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--rule), 0 40px 80px -30px rgba(1,27,60,.45);
  transform: rotate(2deg);
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; }

/* Por defecto (sin animación) solo se ve la primera palabra del rotador */
.hl-rotator span + span { visibility: hidden; }

@media (prefers-reduced-motion: no-preference) {
  /* Entrada: cada línea del titular sube desde una máscara */
  .headline > span { animation: line-in .9s cubic-bezier(.2,.75,.15,1) both; }
  .headline > .hl-rotator { animation-delay: .12s; }
  .headline > .hl-c { animation-delay: .26s; }
  .headline > .hl-d { animation-delay: .38s; }
  .hl-arc path { stroke-dashoffset: 320; animation: draw 1s .9s cubic-bezier(.6,0,.2,1) forwards; }
  .hero-copy > .lead { animation: rise .7s .55s cubic-bezier(.2,.7,.2,1) both; }
  .hero-copy > .hero-actions { animation: rise .7s .65s cubic-bezier(.2,.7,.2,1) both; }
  .hero-copy > .hero-contact { animation: rise .7s .75s cubic-bezier(.2,.7,.2,1) both; }
  .hero-video { animation: video-in 1.1s .3s cubic-bezier(.2,.7,.2,1) both; }

  /* Rotador: 5 palabras, 2,5 s cada una (ciclo de 12,5 s) */
  .hl-rotator span, .hl-rotator span + span { visibility: visible; animation: word 12.5s cubic-bezier(.75,0,.2,1) infinite both; }
  .hl-rotator span:nth-child(1) { animation-delay: .4s; }
  .hl-rotator span:nth-child(2) { animation-delay: 2.9s; }
  .hl-rotator span:nth-child(3) { animation-delay: 5.4s; }
  .hl-rotator span:nth-child(4) { animation-delay: 7.9s; }
  .hl-rotator span:nth-child(5) { animation-delay: 10.4s; }
}
@keyframes line-in { from { opacity: 0; transform: translateY(40%); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(-20% -5% -30% -5%); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes video-in { from { opacity: 0; transform: translateY(40px) rotate(6deg); } to { opacity: 1; transform: none; } }
@keyframes word {
  0%   { transform: translateY(110%) skewY(6deg); }
  4%   { transform: translateY(0) skewY(0); }
  20%  { transform: translateY(0) skewY(0); }
  24%  { transform: translateY(-110%) skewY(-6deg); }
  100% { transform: translateY(-110%) skewY(-6deg); }
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-video { justify-self: center; }
  .video-frame { width: min(78vw, 340px); transform: none; }
  .hero .court-lines { width: 120vw; right: -40vw; opacity: .7; }
}
@media (max-width: 520px) {
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Franja de comunas ---------- */
.comunas { background: var(--orange); color: var(--navy); overflow: hidden; }
.comunas-track { display: flex; width: max-content; }
.comunas ul { display: flex; list-style: none; margin: 0; padding: 0; }
.comunas li {
  display: flex; align-items: center; gap: 28px; padding: 16px 0 16px 28px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.comunas li::after { content: ""; width: 10px; height: 10px; border: 2px solid var(--navy); border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) {
  .comunas-track { animation: marquee 40s linear infinite; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-alt { background: #fff; border-top: 1px solid var(--rule); }
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end;
  gap: 24px 48px; margin-bottom: 40px;
}
.section-intro { color: var(--steel); max-width: 52ch; justify-self: end; }
@media (max-width: 760px) {
  .section-head { grid-template-columns: minmax(0, 1fr); }
  .section-intro { justify-self: start; }
}

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--rule); border-radius: 999px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.chip:hover { border-color: var(--navy); }
.chip .count { font-size: .8rem; font-weight: 500; color: var(--steel); font-variant-numeric: tabular-nums; }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.is-active .count { color: var(--orange); }

/* ---------- Grilla de proyectos ---------- */
.project-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense; gap: 20px;
}
.project-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  font: inherit; color: inherit;
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.project-card:hover { box-shadow: 0 24px 48px -24px rgba(11,37,64,.45); transform: translateY(-3px); border-color: transparent; }
.project-card.is-wide { grid-column: span 2; }
.project-media { position: relative; height: clamp(220px, 21vw, 290px); overflow: hidden; background: var(--concrete); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.project-card:hover .project-media img { transform: scale(1.05); }
.project-tag {
  position: absolute; left: 14px; top: 14px;
  background: var(--navy); color: #fff;
  font-size: .8rem; font-weight: 600;
  padding: 5px 11px; border-radius: 999px;
}
.project-tag.is-cierre { background: var(--orange); color: var(--navy); }
.project-photos {
  position: absolute; right: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(14,26,38,.72); color: #fff; backdrop-filter: blur(6px);
  font-size: .8rem; font-weight: 500; padding: 5px 10px; border-radius: 999px;
}
.project-photos svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.project-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.project-place { font-style: italic; font-size: .95rem; color: var(--steel); }
.project-body h3 { font-size: 1.55rem; }
.project-work { color: var(--steel); font-size: .95rem; }

@media (max-width: 980px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-media { height: clamp(200px, 32vw, 280px); }
}
@media (max-width: 620px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .project-card.is-wide { grid-column: auto; }
  .project-media { height: 58vw; max-height: 300px; }
}

/* ---------- Servicios ---------- */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.service {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
}
.service img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; }
.service-body { display: flex; flex-direction: column; gap: 10px; padding: 26px 26px 24px; min-width: 0; }
.service-body > p { color: var(--steel); font-size: .98rem; }
.service ul { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 8px; font-size: .95rem; }
.service li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.service li::before { content: ""; width: 9px; height: 9px; background: var(--orange); border-radius: 50%; transform: translateY(-1px); }
.link-wa {
  margin-top: auto; align-self: flex-start;
  font-weight: 700; text-decoration: none; color: var(--navy);
  border-bottom: 2px solid var(--orange); padding-bottom: 2px;
}
.link-wa:hover { color: var(--steel); }
/* Asfalto: la maquinaria en dos fotos chicas */
.maquinas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 2px 0 10px; }
.maquinas figure { margin: 0; display: grid; gap: 6px; }
.service .maquinas img { width: 100%; height: 150px; min-height: 0; object-fit: cover; border-radius: 6px; }
.maquinas figcaption { font-size: .85rem; color: var(--steel); }
/* Quinto servicio: ocupa toda la fila para no quedar solo en la grilla de dos columnas */
.service-wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.service-wide img { min-height: 320px; }
.service-wide .service-body { padding: 32px 36px 30px; justify-content: center; }
.service-wide ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.service-asfalto ul { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1060px) {
  .services { grid-template-columns: minmax(0, 1fr); }
  .service-wide { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .service-wide img { min-height: 260px; }
  .service-wide .service-body { padding: 26px 26px 24px; }
  .service-wide ul { grid-template-columns: minmax(0, 1fr); }
  .service .maquinas img { height: 130px; }
}
@media (max-width: 560px) {
  .service { grid-template-columns: minmax(0, 1fr); }
  .service img { height: 200px; min-height: 0; }
  .service .maquinas img { height: 120px; }
}

/* ---------- Pasos ---------- */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  border-top: 2px solid var(--navy);
}
.steps li { padding: 28px 28px 8px 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.steps li + li { padding-left: 28px; border-left: 1px solid var(--rule); }
.step-n {
  font-family: var(--font-display); font-weight: 900; font-size: 4rem; line-height: .8;
  color: transparent; -webkit-text-stroke: 2px var(--navy);
}
.steps h3 { font-size: 1.5rem; }
.steps p { color: var(--steel); font-size: .98rem; }
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .steps li:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li, .steps li + li { padding: 22px 0 18px; border-left: 0; }
  .steps li + li { border-top: 1px solid var(--rule); }
  .steps li { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 14px; }
  .step-n { grid-row: span 2; font-size: 3.2rem; }
}

/* ---------- Contacto ---------- */
.contact {
  position: relative; overflow: hidden;
  background: #fff; color: var(--navy);
  border-top: 1px solid var(--rule);
  padding-block: clamp(64px, 9vw, 112px);
}
.contact .court-lines-contact { inset: 0; width: 100%; height: 100%; stroke: rgba(1,27,60,.04); }
.contact-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; align-items: center;
}
.contact h2 { margin-bottom: 18px; max-width: 18ch; }
.contact h2 em { color: var(--steel); }
.contact .lead { color: var(--steel); margin-bottom: 30px; }
.contact-list {
  margin: 0; display: grid; gap: 0;
  border-top: 2px solid var(--navy);
  padding: 0;
}
.contact-list div { padding: 16px 0; display: grid; gap: 2px; }
.contact-list div + div { border-top: 1px solid var(--rule); }
.contact-list dt { font-style: italic; font-size: .92rem; color: var(--steel); }
.contact-list dd { margin: 0; font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; text-decoration-color: var(--orange); }
@media (max-width: 820px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .contact .btn-lg { width: 100%; }
}

/* ---------- Pie ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--rule); color: var(--steel); padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px)); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-note { font-size: .9rem; max-width: 60ch; }
.site-footer .brand-logo { height: 72px; }
@media (min-width: 621px) { .footer-row { padding-right: max(96px, env(safe-area-inset-right, 0px)); } }
@media (max-width: 620px) { .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed; z-index: 40;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wa); color: #fff;
  box-shadow: 0 12px 30px -6px rgba(0,0,0,.35);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 32px; height: 32px; }

/* ---------- Visor de fotos ---------- */
.viewer {
  width: min(1100px, 100vw); max-width: 100vw; max-height: 100dvh;
  padding: 0; border: 0; border-radius: 14px; overflow: hidden;
  background: var(--navy); color: #fff;
}
.viewer::backdrop { background: rgba(1,12,28,.85); backdrop-filter: blur(4px); }
.viewer-inner { display: flex; flex-direction: column; max-height: 100dvh; }
.viewer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; }
.viewer-head h3 { font-size: clamp(1.4rem, 3vw, 2rem); }
.viewer-meta { font-style: italic; font-size: .95rem; color: var(--orange); margin-bottom: 4px; }
.viewer-close, .viewer-nav {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 0; color: #fff; cursor: pointer;
}
.viewer-close:hover, .viewer-nav:hover { background: rgba(255,255,255,.2); }
.viewer-close svg, .viewer-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-stage {
  position: relative; background: #000A18; height: min(62vh, 640px); overflow: hidden;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
  perspective: 1400px;
}
.viewer-stage.is-dragging { cursor: grabbing; }
.viewer-track { position: absolute; inset: 0; transform-style: preserve-3d; }
.slide { position: absolute; inset: 0; will-change: transform, opacity; backface-visibility: hidden; }
.slide img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.viewer-track.is-animating .slide { transition: transform .6s cubic-bezier(.22,.9,.24,1), opacity .6s ease; }
.viewer-nav[disabled] { opacity: 0; pointer-events: none; }
.viewer-nav { transition: opacity .2s, background-color .2s; }
.viewer-nav { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); background: rgba(1,27,60,.7); }
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }
.viewer-count { position: absolute; z-index: 1; right: 14px; bottom: 12px; font-size: .85rem; font-weight: 600; background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.viewer-thumbs { display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto; scrollbar-width: thin; }
.viewer-thumbs button { flex: none; width: 72px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: none; opacity: .6; }
.viewer-thumbs button.is-active { border-color: var(--orange); opacity: 1; }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 6px 20px 20px; flex-wrap: wrap; }
.viewer-foot p { color: rgba(255,255,255,.8); max-width: 62ch; font-size: .98rem; flex: 1 1 320px; }
@media (max-width: 620px) {
  .viewer { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .viewer-inner { height: 100%; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .viewer-stage { flex: 1; height: auto; min-height: 0; }
  .viewer-nav { width: 40px; height: 40px; }
  .viewer-foot .btn { width: 100%; }
  .viewer-foot p { flex-basis: 100%; font-size: .92rem; }
}
