/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:          #ffffff;
  --paper:       #f2f3f1;
  --ink:         #0e1b32;
  --ink-soft:    #1c2f4d;
  --ink-mute:    #5b6b82;
  --accent:      #0d72b8;
  --accent-2:    #094f80;
  --cream:       #ffffff;
  --line:        rgba(14, 27, 50, 0.16);
  --line-strong: #0e1b32;

  --display: "Barlow Semi Condensed", "Segoe UI", sans-serif;
  --sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", "Consolas", monospace;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft:   cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --nav-h: 76px;
}

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  text-wrap: balance;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
ul { list-style: none; padding: 0; }
::selection { background: var(--ink); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1.1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; font-weight: 600; font-family: var(--mono); font-size: .8rem;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 720px)  { .container { padding-inline: 2rem; } }
@media (min-width: 1280px) { .container { padding-inline: 2.5rem; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.kicker {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.kicker::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--accent);
}

.num {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}

/* Grid lines — the structural signature of this design */
.grid-lines {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.grid-12 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
@media (min-width: 720px)  { .grid-12 { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 1024px) { .grid-12 { grid-template-columns: repeat(12, 1fr); } }

/* =============================================================
   4. Components — buttons, links
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .95rem 1.6rem;
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color .35s var(--ease-out);
}
.btn::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform .4s var(--ease-out);
}
.btn:hover { color: var(--bg); }
.btn:hover::before { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary::before { background: var(--accent); }
.btn-primary:hover { color: var(--bg); }
.btn-arrow { transition: transform .35s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }

.link-invert {
  position: relative;
  transition: color .3s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .link-invert:hover { color: var(--accent); }
}

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(255,255,255,0.0);
  border-bottom: 1px solid transparent;
  transition: background-color .35s var(--ease-out), border-color .35s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.nav-logo {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav-logo img { height: 34px; width: auto; }
.nav-links {
  display: none;
  align-items: center;
  gap: 2.1rem;
}
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-links a {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
  padding-block: .3rem;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { display: none; }
@media (min-width: 960px) { .nav-cta { display: inline-flex; } }
.nav-cta.btn { padding: .7rem 1.2rem; }

.nav-burger {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 1.5px solid var(--ink);
}
@media (min-width: 960px) { .nav-burger { display: none; } }
.nav-burger-lines { position: relative; width: 18px; height: 12px; }
.nav-burger-lines span {
  position: absolute; left: 0; right: 0; height: 2px; background: var(--ink);
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out), top .3s var(--ease-out);
}
.nav-burger-lines span:nth-child(1) { top: 0; }
.nav-burger-lines span:nth-child(2) { top: 5px; }
.nav-burger-lines span:nth-child(3) { top: 10px; }
.nav-burger[aria-expanded="true"] .nav-burger-lines span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.nav-burger[aria-expanded="true"] .nav-burger-lines span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] .nav-burger-lines span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 90;
  background: var(--ink); color: var(--bg);
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .55s var(--ease-soft);
}
.nav-mobile[aria-hidden="false"] { clip-path: inset(0 0 0 0); }
.nav-mobile a {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 600;
  padding-block: .6rem;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
.nav-mobile .btn-primary { margin-top: 1.5rem; align-self: flex-start; border-color: var(--bg); }
.nav-mobile .btn-primary::before { background: var(--accent); }
@media (min-width: 960px) { .nav-mobile { display: none; } }

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-top: var(--nav-h);
  overflow: clip;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  /* The blue the clip fades to between loops — also the first paint
     while the video buffers, so the hero never flashes black. */
  background: var(--ink);
}
.hero-bg img,
.hero-bg video {
  width: 100%; height: 100%; object-fit: cover;
  filter: contrast(1.05) brightness(0.82);
}
.hero-video {
  opacity: 1;
  transition: opacity .9s var(--ease-soft);
}
/* main.js drives the loop: it fades the clip out to the blue underneath,
   rewinds, then fades the fresh first frame back in — no visible seam. */
.hero-video.is-cycling { opacity: 0; }
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,27,50,0.25) 0%, rgba(14,27,50,0.5) 55%, rgba(14,27,50,0.92) 100%);
}
.hero-blueprint {
  position: absolute; inset: 0; z-index: -1;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  width: 100%;
  padding-block: 3.5rem 3rem;
  color: var(--bg);
}
.hero-kicker { color: var(--accent); margin-bottom: 1.4rem; }
.hero-kicker::before { background: var(--accent); }
.hero-title {
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
  max-width: 15ch;
  color: var(--bg);
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
}
.hero-sub {
  margin-top: 1.5rem;
  max-width: 46ch;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: rgba(255,255,255,0.82);
}
.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-actions .btn-primary { border-color: var(--bg); }
.hero-actions .btn:not(.btn-primary) { border-color: rgba(255,255,255,0.5); color: var(--bg); }
.hero-actions .btn:not(.btn-primary)::before { background: var(--bg); }
.hero-actions .btn:not(.btn-primary):hover { color: var(--ink); }

.hero-meta {
  margin-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: rgba(255,255,255,0.65);
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 1.2rem;
}
.hero-meta strong { color: var(--bg); font-weight: 600; }

/* =============================================================
   7. Marquee ticker
   ============================================================= */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  padding-block: .9rem;
}
.marquee-track {
  display: inline-flex;
  gap: 2.5rem;
  white-space: nowrap;
  will-change: transform;
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.marquee-track span.dot { color: var(--accent); }

/* =============================================================
   8. Sections — generic
   ============================================================= */
.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section-head {
  max-width: 640px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head h2 {
  margin-top: 1rem;
  font-size: clamp(1.9rem, 4vw, 3rem);
}
.section-alt { background: var(--paper); }
.section-subhead {
  margin-top: 1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  color: var(--ink);
  max-width: 42ch;
}
.section-lead {
  margin-top: .9rem;
  color: var(--ink-mute);
  max-width: 62ch;
  font-size: 1.02rem;
}
.section-lead + .section-lead { margin-top: .6rem; }

/* =============================================================
   9. Servicios
   ============================================================= */
.services-grid > * {
  grid-column: span 4;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  padding: 2.2rem 1.8rem 2.6rem;
}
@media (min-width: 720px) {
  .services-grid > *:nth-child(1) { grid-column: span 4; }
  .services-grid > *:nth-child(2) { grid-column: span 4; }
  .services-grid > *:nth-child(3) { grid-column: span 4; }
  .services-grid > *:nth-child(4) { grid-column: span 4; }
}
@media (min-width: 1024px) {
  .services-grid > * { grid-column: span 6; }
}
.service-card { position: relative; transition: background-color .4s var(--ease-out); }
.service-card:hover { background: var(--ink); color: var(--bg); }
.service-card:hover .num { color: rgba(255,255,255,0.55); }
.service-card .num {
  display: block;
  margin-bottom: 1.3rem;
  font-size: .78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: .9rem;
}
.service-card p { color: var(--ink-mute); font-size: .95rem; margin-top: .8rem; }
.service-card p:first-of-type { margin-top: 0; }
.service-card:hover p { color: rgba(255,255,255,0.72); }

/* =============================================================
   9.5 Visual break — full-bleed render between sections
   ============================================================= */
.visual-break { position: relative; overflow: clip; background: var(--ink); }
.visual-break-figure { position: relative; margin: 0; aspect-ratio: 16 / 9; }
@media (min-width: 960px) { .visual-break-figure { aspect-ratio: 21 / 8; } }
.visual-break-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visual-break-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.4rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem;
  background: linear-gradient(0deg, rgba(14,27,50,0.9) 0%, transparent 100%);
}
.visual-break-caption .num {
  font-family: var(--mono); font-size: .78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}
.visual-break-caption span:last-child { font-size: .92rem; color: rgba(255,255,255,0.85); }

/* =============================================================
   10. Proceso
   ============================================================= */
.process-list { border-top: 1px solid var(--line); }
.process-item {
  display: grid;
  grid-template-columns: 3rem 1fr;
  column-gap: 1rem;
  row-gap: .6rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.process-item .num { font-size: 1.4rem; color: var(--accent); grid-column: 1; }
.process-item h3 { font-size: 1.3rem; grid-column: 2; }
.process-item p {
  color: var(--ink-mute);
  max-width: 44ch;
  grid-column: 2 / -1;
  overflow-wrap: break-word;
}
@media (min-width: 720px) {
  .process-item {
    grid-template-columns: 4.5rem 1fr 2fr;
    column-gap: 1.5rem;
  }
  .process-item h3 { font-size: 1.4rem; }
  .process-item p { grid-column: 3; }
}

/* =============================================================
   11. Nosotros / Values
   ============================================================= */
.about-layout {
  display: grid;
  gap: 3rem;
}
@media (min-width: 960px) {
  .about-layout { grid-template-columns: 1fr 1fr; gap: 4.5rem; align-items: start; }
}
.about-figure {
  position: relative;
  border: 1px solid var(--line-strong);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  /* Solid panel behind the clip: these videos load lazily (and not at all
     without JS), so the frame reads as intentional rather than broken. */
  background: var(--ink);
}
.normativa-intro { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.about-figure img,
.about-figure video { width: 100%; height: 100%; object-fit: cover; }
.about-figure::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.values-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.value-item {
  padding-block: 1.8rem;
  border-bottom: 1px solid var(--line);
}
.value-item h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: baseline;
  gap: .8rem;
}
.value-item h3::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--accent);
  flex: none;
}
.value-item .lead {
  margin-top: .8rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  max-width: 54ch;
}
.value-item p { margin-top: .6rem; color: var(--ink-mute); max-width: 54ch; }
.value-item p:first-of-type { margin-top: .8rem; }

/* =============================================================
   11.4 Ambient video backdrop for a light section
   ============================================================= */
/* This section inverts to a dark treatment so the clip can actually be seen.
   Dark copy on a light veil caps the video at roughly 8% visibility before body
   text drops under 4.5:1 — light copy over a darkened clip carries far more
   contrast headroom, so the veil can sit near 50% and the footage reads clearly.
   The palette tokens are redefined locally, so every rule in the section (lists,
   rules, kickers, callout) follows without needing its own override. */
.section--media {
  position: relative;
  isolation: isolate;
  overflow: clip;

  --media-ground: #0b1526;
  --ink: #ffffff;
  --ink-mute: rgba(255,255,255,0.86);
  --line: rgba(255,255,255,0.18);
  --line-strong: rgba(255,255,255,0.40);
  /* Lighter than the brand blue: the standard accent lands mid-luminance and
     only reaches ~3:1 against the mid-tones of the footage. */
  --accent: #a8d5f7;

  color: #fff;
  background: var(--media-ground);
}
.section-media-bg {
  position: absolute; inset: 0; z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background: var(--media-ground);
}
.section-media-bg video {
  width: 100%; height: 100%; object-fit: cover;
  /* Darkened rather than washed out, so the tonal structure of the shot survives. */
  filter: saturate(0.95) contrast(1.02) brightness(0.6);
}
.section-media-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    rgba(11,21,38,0.72) 0%,
    rgba(11,21,38,0.60) 46%,
    rgba(11,21,38,0.46) 100%);
}
/* Below the two-column breakpoint the copy spans the full width, so the veil
   stops opening up on one side. */
@media (max-width: 959px) {
  .section-media-bg::after { background: rgba(11,21,38,0.68); }
}
/* The figure keeps a dark plate rather than inheriting the flipped --ink. */
.section--media .about-figure { background: var(--media-ground); }

/* =============================================================
   11.5 Normativa y estándares
   ============================================================= */
.norms-layout {
  display: grid;
  gap: 2.5rem;
  margin-top: 2.5rem;
}
@media (min-width: 720px) {
  .norms-layout { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
}
/* =============================================================
   11.6 Fabricación y ejecución
   ============================================================= */
.fabrication-layout {
  display: grid;
  gap: 0;
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 720px) {
  .fabrication-layout {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 3.5rem;
  }
}
.fabrication-item {
  padding-block: 2rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) {
  .fabrication-item:nth-child(n+3) {
    border-bottom: none;
  }
  .fabrication-item:nth-child(2n) {
    border-bottom: none;
  }
}
.fabrication-item h3 {
  font-size: 1.15rem;
  margin-bottom: .8rem;
  display: flex;
  align-items: baseline;
  gap: .8rem;
}
.fabrication-item h3::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  flex: none;
  border-radius: 50%;
}
.fabrication-item p {
  color: var(--ink-mute);
  max-width: 54ch;
  line-height: 1.65;
}

.norms-col-title {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line-strong);
}
.norms-list { border-top: 1px solid var(--line); margin-top: -1px; }
.norms-list li {
  padding-block: .9rem;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  color: var(--ink-mute);
}
.norms-list li strong { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.norms-note {
  margin-top: 2.2rem;
  max-width: 68ch;
  color: var(--ink-mute);
  font-size: .95rem;
}
.norms-note strong { color: var(--ink); }
.norms-callout {
  margin-top: 2.5rem;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border: 1.5px solid var(--ink);
  /* Plate so the closing statement stays crisp over the video behind it.
     Opaque fallback first — see the glass note in the gotchas. */
  background: rgba(11,21,38,0.72);
}
@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .norms-callout {
    background: rgba(11,21,38,0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
.norms-callout-lead {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.25;
}
.norms-callout-tag {
  margin-top: 1.2rem;
  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* =============================================================
   12. Galería
   ============================================================= */
.gallery-block + .gallery-block { margin-top: clamp(3rem, 6vw, 5rem); }
.gallery-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .4rem 2rem;
  padding-bottom: 1rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--line-strong);
}
.gallery-block-head h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  display: flex;
  align-items: baseline;
  gap: .7rem;
}
.gallery-block-head h3 .num { color: var(--accent); font-size: .85rem; }
.gallery-hint { font-size: .88rem; color: var(--ink-mute); }

/* Six-column mosaic. Row height and spans are chosen so a default card lands on
   16:9 and a --tall card on ~9:16, matching the two source aspect ratios without
   cropping them into a single uniform shape. */
.media-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 120px;
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}
.media-card {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  grid-column: span 3;
  grid-row: span 3;
  margin: 0;
}
.media-card--tall    { grid-column: span 2; grid-row: span 6; }
.media-card--compact { grid-column: span 2; grid-row: span 3; }

@media (max-width: 1023px) and (min-width: 720px) {
  .media-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 92px; }
  .media-card { grid-column: span 4; grid-row: span 4; }
  .media-card--tall { grid-column: span 2; grid-row: span 6; }
  .media-card--compact { grid-column: span 2; grid-row: span 3; }
}
/* Mobile: one card per row, each keeping its own natural shape. */
@media (max-width: 719px) {
  .media-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .media-card { grid-column: auto; grid-row: auto; aspect-ratio: 16 / 9; }
  .media-card--tall { aspect-ratio: 9 / 16; }
  .media-card--compact { aspect-ratio: 4 / 3; }
}

/* The renders block carries four vertical clips, which will not divide evenly into
   six columns. On desktop it switches to eight so the four sit in a single band,
   led by one full-width feature card. */
@media (min-width: 1024px) {
  .media-grid--renders { grid-template-columns: repeat(8, 1fr); }
  .media-grid--renders .media-card { grid-column: span 4; grid-row: span 3; }
  .media-grid--renders .media-card--feature { grid-column: span 8; grid-row: span 6; }
  .media-grid--renders .media-card--tall { grid-column: span 2; grid-row: span 5; }
}

/* --- Fabrication drawings ---------------------------------------------------
   A-series landscape sheets packed with fine linework. They differ from every
   other card here: nothing may be cropped (so `contain`, not `cover`), they sit
   on paper rather than ink, and since the detail is unreadable at card scale each
   one links out to the full-resolution file. Two per row keeps them as large as
   the grid allows. */
.media-grid--planos .media-card { grid-column: span 3; grid-row: span 4; }
@media (max-width: 1023px) and (min-width: 720px) {
  .media-grid--planos .media-card { grid-column: span 4; grid-row: span 5; }
}
@media (max-width: 719px) {
  .media-card--plano { aspect-ratio: 1.414 / 1; }
}
.media-card--plano { background: #f2f3f4; }
/* Doubled class deliberately: the generic `.media-card img { object-fit: cover }`
   is declared later in this file, so matching its specificity would lose. */
.media-card.media-card--plano img {
  object-fit: contain;
  padding: 0.4rem;
}
@media (hover: hover) and (pointer: fine) {
  .media-card.media-card--plano:hover img { transform: scale(1.02); }
}
.media-card-link {
  position: absolute; inset: 0; z-index: 3;
  display: block;
}
.media-card-link:focus-visible { outline-offset: -4px; }
/* Always-on affordance: unlike the render cards, this cue is the only signal
   that the sheet opens full size. */
.media-card--plano .media-card-cue { opacity: 1; }
.media-card-cue.media-card-cue--zoom::before {
  width: 9px; height: 9px;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
@media (hover: hover) and (pointer: fine) {
  .media-card--plano:hover .media-card-cue { background: var(--ink); }
}

.media-card img,
.media-card video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.media-card img { transition: transform .9s var(--ease-soft); }
@media (hover: hover) and (pointer: fine) {
  .media-card:hover img { transform: scale(1.05); }
}

/* Video sits on top of its poster and cross-fades in once playback starts. */
.media-card-video {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .5s var(--ease-out);
  pointer-events: none;
}
.media-card.is-playing .media-card-video { opacity: 1; }
.media-card.is-playing img { transform: none; }

/* Small affordance so it reads as playable before the pointer arrives. */
.media-card-cue {
  position: absolute; top: .9rem; right: .9rem;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .6rem;
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  background: rgba(14,27,50,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity .35s var(--ease-out);
}
.media-card-cue::before {
  content: "";
  width: 0; height: 0;
  border-left: 6px solid var(--accent);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.media-card.is-playing .media-card-cue { opacity: 0; }

.media-card-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.5rem 1.2rem .95rem;
  background: linear-gradient(0deg, rgba(14,27,50,0.94) 0%, rgba(14,27,50,0.6) 55%, transparent 100%);
  color: var(--bg);
  pointer-events: none;
}
.media-card-label .num { color: var(--accent); font-size: .7rem; }
.media-card-label h4 {
  font-size: clamp(.95rem, 1.5vw, 1.1rem);
  margin-top: .15rem;
  color: var(--bg);
}

/* =============================================================
   12.5 Simulador (iframe aislado)
   ============================================================= */
/* Matches the simulator's own background so there is no seam while the frame
   loads or before it reports its height. */
.section-sim { background: #0a1220; }
.sim-frame {
  display: block;
  width: 100%;
  border: 0;
  /* Starting height only — main.js replaces it with the height the frame reports.
     Set near the desktop resting height so the correction is not a visible jump. */
  height: 1400px;
  min-height: 560px;
}

/* =============================================================
   13. Contacto
   ============================================================= */
.contact-layout {
  display: grid;
  gap: 3rem;
}
@media (min-width: 960px) {
  .contact-layout { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; }
}

.field { margin-bottom: 1.4rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: .5rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: .85rem .9rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  transition: border-color .25s var(--ease-out);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.field textarea { resize: vertical; min-height: 120px; }
.field-row { display: grid; gap: 1.4rem; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }

.cta-form { position: relative; }
.cta-form.is-sent { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.cta-form { transition: opacity .5s var(--ease-out), transform .5s var(--ease-soft); }
.form-submit { width: 100%; justify-content: center; position: relative; }
.form-submit .form-submit-spinner {
  position: absolute; inset: 0; display: none; place-items: center;
}
.cta-form.is-sending .form-submit-label { opacity: 0; }
.cta-form.is-sending .form-submit-spinner { display: grid; }
.form-submit-spinner::after {
  content: "";
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-note {
  margin-top: .9rem;
  font-size: .82rem;
  color: var(--ink-mute);
}
.form-error {
  margin-top: .9rem;
  font-size: .88rem;
  color: #a3241a;
  display: none;
}
.form-error.is-visible { display: block; }

.cta-success {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  border: 1.5px solid var(--ink);
  padding: 2.5rem;
  background: var(--bg);
}
.cta-success.is-visible { display: flex; }
.cta-success h3 { font-size: 1.6rem; margin-bottom: .7rem; }
.cta-success p { color: var(--ink-mute); }

.contact-side {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.contact-people { display: grid; gap: 0; }
.contact-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.3rem;
  border-bottom: 1px solid var(--line);
}
.contact-person-name { font-family: var(--display); font-size: 1.2rem; font-weight: 600; }
.contact-wa-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1.5px solid var(--ink);
  padding: .55rem 1rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: 0.06em; text-transform: uppercase;
  flex: none;
}
.contact-wa-btn svg { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) {
  .contact-wa-btn:hover { background: var(--ink); color: var(--bg); }
}

/* =============================================================
   14. Footer
   ============================================================= */
.footer {
  background: var(--ink);
  color: var(--bg);
  padding-block: 3.5rem 2rem;
}
.footer-top {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
@media (min-width: 720px) {
  .footer-top { grid-template-columns: 1.3fr 1fr 1fr; }
}
.footer-brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-size: 1.2rem; font-weight: 700; }
.footer-brand img { height: 30px; filter: brightness(0) invert(1); }
.footer-tagline { margin-top: .8rem; color: rgba(255,255,255,0.6); max-width: 36ch; }
.footer-col h4 { font-family: var(--mono); font-size: .75rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 1rem; }
.footer-col a, .footer-col p { display: block; color: rgba(255,255,255,0.82); margin-bottom: .6rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding-top: 1.6rem;
  font-family: var(--mono); font-size: .76rem; color: rgba(255,255,255,0.45);
}
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: var(--accent); }

/* =============================================================
   15. WhatsApp floating button
   ============================================================= */
.wa-float {
  position: fixed; right: 1.3rem; bottom: 1.3rem; z-index: 95;
  display: inline-flex; align-items: center; gap: .6rem;
  background: #1c2f4d;
  color: var(--bg);
  padding: .85rem 1.1rem;
  border: 1.5px solid var(--ink);
  box-shadow: 0 12px 30px rgba(14,27,50,0.28);
  transition: transform .3s var(--ease-out), background-color .3s var(--ease-out);
}
.wa-float:hover { background: var(--accent); transform: translateY(-3px); }
.wa-float svg { width: 20px; height: 20px; flex: none; }
.wa-float-label { font-family: var(--mono); font-size: .78rem; letter-spacing: 0.04em; display: none; }
@media (min-width: 640px) { .wa-float-label { display: inline; } }

/* =============================================================
   16. Cursor coordinates (fine-pointer only, decorative)
   ============================================================= */
.cursor-coord {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--ink);
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line-strong);
  padding: 2px 7px;
  transform: translate(16px, 16px);
  opacity: 0;
  transition: opacity .2s var(--ease-out);
  white-space: nowrap;
}
.cursor-coord.is-active { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor-coord { display: none; } }

/* =============================================================
   17. Reveal on scroll (universal, non-intrusive)
   ============================================================= */
[data-reveal]:not(.reveal-media) {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease-soft), transform .7s var(--ease-soft);
}
[data-reveal]:not(.reveal-media).is-revealed { opacity: 1; transform: none; }
[data-reveal][data-split] { opacity: 1; transform: none; }

/* Richer entrance for photographic/video content — fades in while the
   image settles from a slight zoom + soft crop, distinct from the plain
   text fade so images feel like a deliberate reveal, not just a fade. */
.reveal-media[data-reveal] {
  opacity: 0;
  transform: scale(1.045);
  clip-path: inset(5%);
  transition: opacity 1s var(--ease-soft), transform 1.1s var(--ease-soft), clip-path 1.1s var(--ease-soft);
}
.reveal-media[data-reveal].is-revealed {
  opacity: 1;
  transform: scale(1);
  clip-path: inset(0%);
}

/* =============================================================
   18. Reduced motion — only intrusive effects
   ============================================================= */
/* Marquee, reveals, hovers and transitions keep running per gotcha A.2 —
   Windows ships prefers-reduced-motion:reduce by default and disabling
   functional motion here would make the site look dead for most visitors.
   The one exception is the looping background video in "Nosotros": main.js
   pauses it on first frame for reduced-motion users (see initReducedMotionVideo). */
