
/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio.
   Put this @layer first; product CSS outside the layer always wins. */
@layer od-layout {
  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }
  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
/* /OD-LAYOUT-PRIMITIVES v1 */

:root {
  --bg: #07080a;
  --ink: #101114;
  --panel: #15171c;
  --panel-2: #1c1f26;
  --paper: #f8f8f6;
  --silver: #d7d8d5;
  --grey: #a8abb2;
  --red: #ff1616;
  --red-dark: #b90909;
  --wa: #1da851;
  --wa-dark: #159a45;
  --line: #262a32;
  --radius: 8px;
  --radius-lg: 12px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1160px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 76% 8%, rgba(255, 22, 22, 0.1), transparent 28%), linear-gradient(180deg, #050608 0%, #101114 45%, #08090b 100%);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: var(--paper); }
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(36px, 5.4vw, 68px); font-weight: 850; letter-spacing: -0.035em; line-height: 1.02; }
h2 { font-size: clamp(29px, 3.7vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
.skip {
  position: absolute; left: 16px; top: -64px; z-index: 200;
  background: var(--paper); color: #000; padding: 12px 18px; border-radius: var(--radius);
  font-weight: 700; text-decoration: none; transition: top 180ms ease-out;
}
.skip:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.overline {
  display: inline-block; font-size: 12px; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--red);
}

/* Cabecera: flota sobre la portada y se solidifica al salir de la imagen */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background 240ms ease-out, border-color 240ms ease-out;
}
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 8, 10, 0.62) 0%, rgba(7, 8, 10, 0) 100%);
  transition: opacity 240ms ease-out;
}
.site-header.is-solid { background: rgba(7, 8, 10, 0.88); border-bottom-color: var(--line); backdrop-filter: blur(18px); }
.site-header.is-solid::before { opacity: 0; }
.site-header:has(.main-nav.open) { background: var(--bg); border-bottom-color: var(--line); }
.site-header:has(.main-nav.open)::before { opacity: 0; }
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 56px; width: auto; display: block; }
.main-nav { margin-left: auto; }
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 2px;
}
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--silver); text-decoration: none; font-size: 15px; font-weight: 600;
}
.main-nav a:hover { color: #fff; background: var(--panel); }
.nav-cta-item { display: none; }
.nav-cta-link { color: #07080a !important; background: var(--red); font-weight: 700; }
.nav-cta-link:hover { background: #ff4040; color: #07080a !important; }
.menu-toggle {
  display: none; margin-left: auto; background: var(--panel); color: var(--paper);
  border: 1px solid var(--line); border-radius: 4px; min-width: 48px; min-height: 48px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: var(--radius);
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; font-family: inherit;
  border: 1px solid transparent; transition: background 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--red), var(--red-dark)); border-color: rgba(255,22,22,.55); box-shadow: 0 18px 50px rgba(255,22,22,.2); color: var(--paper); font-weight: 800; }
.btn-primary:hover { background: linear-gradient(135deg, #ff4040, var(--red)); }
.btn-ghost { border-color: rgba(215, 216, 213, 0.45); color: var(--paper); background: rgba(255,255,255,.04); }
.btn-ghost:hover { border-color: var(--paper); }
.header-cta { margin-left: 6px; min-height: 44px; padding: 10px 20px; font-size: 15px; white-space: nowrap; }

/* Portada */
.hero { margin-top: var(--hero-lift, -85px); border-bottom: 1px solid var(--line); }
.hero-carousel {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: clamp(640px, 100svh, 820px);
  padding-top: calc(var(--header-height, 85px) + 28px);
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 700ms ease-in-out;
}
.hero-slide.is-active { opacity: 1; }
.hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(7, 8, 10, 0.35) 0%, rgba(7, 8, 10, 0.55) 55%, rgba(7, 8, 10, 0.92) 100%);
}
.hero-content { position: relative; z-index: 2; width: 100%; display: grid; gap: 18px; justify-items: start; }
.hero-content h1 { max-width: 15em; }
.hero-content .overline { font-size: 14px; letter-spacing: 0.16em; }
.hero-content .lede { font-size: 19px; color: var(--silver); max-width: 34em; }
.hero-content .overline,
.hero-content h1,
.hero-content .lede {
  text-shadow: 0 1px 3px rgba(7, 8, 10, 0.45), 0 4px 16px rgba(7, 8, 10, 0.4);
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero-ui {
  position: relative; z-index: 2; width: 100%;
  margin-top: 46px; padding-bottom: 26px;
  display: flex; align-items: center; gap: 16px;
}
.hero-dots { display: flex; align-items: center; gap: 6px; }
.hero-dot { width: 34px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.hero-dot::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(248, 248, 246, 0.4);
  transition: background 180ms ease-out, transform 180ms ease-out;
}
.hero-dot:hover::before { background: rgba(248, 248, 246, 0.75); }
.hero-dot.is-active::before { background: var(--red); transform: scale(1.2); }

/* Video */
.video-frame {
  aspect-ratio: 16 / 9; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
}
.video-thumb {
  position: relative; display: block; width: 100%; height: 100%;
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--paper);
}
.video-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; inset: 0; display: grid; place-items: center; }
.video-play > span {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  background: rgba(7, 8, 10, 0.72); border: 1px solid rgba(248, 248, 246, 0.55);
  transition: background 180ms ease-out, border-color 180ms ease-out;
}
.video-thumb:hover .video-play > span { background: var(--red); border-color: var(--red); }
.video-play svg { width: 26px; height: 26px; fill: var(--paper); margin-left: 4px; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Secciones */
section.block { padding: 76px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.section-head { max-width: 52em; margin-bottom: 42px; display: grid; gap: 12px; justify-items: start; }
.section-head p { color: var(--silver); font-size: 17px; max-width: 54ch; }

/* Trabajos */
.work-grid { display: grid; gap: 26px 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.work-card { margin: 0; display: grid; gap: 12px; align-content: start; }
.work-card .thumb {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  text-align: inherit; color: inherit; font: inherit;
  overflow: hidden; border-radius: var(--radius-lg);
}
.work-card .thumb img {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  transition: transform 240ms ease-out;
}
.work-card .thumb:hover img { transform: scale(1.03); }
.work-card .body { display: grid; gap: 5px; padding: 0 2px; }
.work-card h3 { font-size: 16px; }

/* Servicios */
.svc-grid { display: grid; gap: 36px 48px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.svc {
  border-top: 1px solid var(--line); padding-top: 20px;
  display: grid; gap: 10px; align-content: start;
}
.svc h3 { font-size: 19px; }
.service-link { display: inline-block; margin-top: 14px; color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }
.service-link:focus-visible { outline: 2px solid var(--paper); outline-offset: 5px; }
.svc p { color: var(--silver); font-size: 15px; }
.svc ul {
  margin: 0; padding: 0; list-style: none; display: grid; gap: 7px;
  font-size: 15px; color: var(--grey);
}
.svc li { padding-left: 16px; position: relative; }
.svc li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 6px; height: 2px; background: var(--red);
}

/* Opiniones y clientes */
.review-shell { display: grid; gap: 18px; }
.review-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-inline: contain; }
.review-track::-webkit-scrollbar { display: none; }
.review-card { flex: 0 0 min(100%, 530px); min-height: 240px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); scroll-snap-align: start; display: grid; align-content: start; gap: 14px; }
.review-stars { color: #f5b300; letter-spacing: .16em; font-size: 18px; line-height: 1; }
.review-card blockquote { margin: 0; font-size: clamp(17px, 2vw, 21px); line-height: 1.45; font-weight: 600; }
.review-card cite { color: var(--grey); font-size: 14px; font-style: normal; }
.review-card a { color: var(--silver); font-size: 13px; text-underline-offset: 3px; }
.review-controls { display: flex; justify-content: flex-end; gap: 8px; }
.review-controls button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--paper); font: inherit; cursor: pointer; }
.review-controls button:hover { border-color: var(--grey); }
.brand-carousel { display: grid; gap: 12px; }
.brand-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-inline: contain; }
.brand-list::-webkit-scrollbar { display: none; }
.brand-list li { flex: 0 0 calc((100% - 24px) / 3); min-height: 140px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; padding: 18px; background: var(--panel); scroll-snap-align: start; }
.brand-list li.brand-light { background: #f8f8f6; }
.brand-list img { display: block; max-width: 100%; max-height: 76px; width: auto; height: auto; margin: auto; object-fit: contain; }
.brand-list img.uc-logo { max-height: 95px; }
.brand-controls { display: flex; justify-content: flex-end; gap: 8px; }
.brand-controls button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--paper); font: inherit; cursor: pointer; }
.brand-controls button:hover { border-color: var(--grey); }

/* Contacto */
.contact-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 42px; align-items: start; }
.contact-intro { display: grid; gap: 18px; }
.contact-intro p { color: var(--silver); }
.contact-form { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); display: grid; gap: 0; }
.contact-form label { margin-bottom: 7px; font-weight: 700; font-size: 15px; }
.contact-form input, .contact-form textarea { width: 100%; min-height: 48px; margin-bottom: 18px; padding: 11px 14px; border: 1px solid #3b404b; border-radius: var(--radius); background: var(--ink); color: var(--paper); font: inherit; }
.contact-form textarea { min-height: 132px; resize: vertical; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--grey); }
.contact-form .btn { justify-self: start; }
.form-note { margin-top: 12px; color: var(--grey); font-size: 13px; line-height: 1.4; }

/* Footer */
footer.site { background: #000; border-top: 1px solid var(--line); }
.footer-inner { padding: 48px 20px 42px; display: grid; gap: 26px; }
.footer-top { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: start; }
.footer-top img { height: 56px; width: auto; display: block; }
.footer-nav { display: flex; gap: 6px 20px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.footer-nav a { color: var(--grey); text-decoration: none; font-size: 14px; padding: 8px 2px; display: inline-block; }
.footer-nav a:hover { color: #fff; }

/* Visor */
dialog#lightbox {
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 0; max-width: min(880px, 94vw);
}
dialog#lightbox::backdrop { background: rgba(0, 0, 0, 0.82); }
.lb-inner { padding: 20px; display: grid; gap: 14px; }
.lb-inner img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.lb-bar { display: flex; gap: 8px; align-items: center; }
.lb-bar .cap { flex: 1 1 0; min-width: 0; font-size: 14px; color: var(--silver); }
.lb-btn {
  min-width: 44px; min-height: 44px; border-radius: var(--radius); cursor: pointer;
  background: var(--panel-2); color: var(--paper); border: 1px solid var(--line);
  font-size: 15px; font-weight: 700; padding: 8px 14px; font-family: inherit;
}
.lb-btn:hover { border-color: var(--silver); }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--wa); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transition: background 180ms ease-out, transform 180ms ease-out;
}
.wa-float:hover { background: var(--wa-dark); transform: translateY(-2px); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* Responsive */
@media (max-width: 1040px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-carousel { min-height: max(680px, 100svh); }
  .hero-scrim { background: linear-gradient(180deg, rgba(7, 8, 10, 0.5) 0%, rgba(7, 8, 10, 0.72) 55%, rgba(7, 8, 10, 0.94) 100%); }
  section.block { padding: 60px 0; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav { display: none; width: 100%; flex-basis: 100%; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 8px 0 4px; }
  .main-nav a { padding: 14px 8px; border-top: 1px solid var(--line); }
  .header-cta { display: none; }
  .header-inner { flex-wrap: wrap; }
  .nav-cta-item { display: block; }
  .nav-cta-link { justify-content: center; margin-top: 10px; }
  .hero { --hero-lift: -85px; }
  .hero-carousel {
    justify-content: space-between;
    padding-top: calc(var(--header-height, 85px) + 48px);
  }
}
@media (max-width: 768px) {
  .svc-grid { grid-template-columns: 1fr; }
  .brand-list li { flex-basis: calc((100% - 12px) / 2); }
  .contact-layout { grid-template-columns: 1fr; gap: 28px; }
  section.block { padding: 52px 0; }
}
@media (max-width: 480px) {
  .work-grid { grid-template-columns: 1fr; }
  .brand-list li { min-height: 142px; padding: 14px; }
  .brand-list img { max-height: 70px; }
  .contact-form { padding: 20px; }
  .review-card { min-height: 270px; padding: 20px; }
  .footer-inner { padding-bottom: 92px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; border-top: 1px solid var(--line); padding-top: 20px; }
  .footer-nav a { display: flex; align-items: center; min-height: 44px; }
  .hero-dot { width: 28px; }
  .wa-float { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
