/* ============================================================
   FERIA ENGINEERING v3 — style.css
   Aesthetic : Clean Tech SaaS  |  Light Mode + Dark Hero
   Palette   : #001a33 bookend · #002244 brand · #FFD700 gold · #E6F0F9 surface
   Fonts     : Space Grotesk (headers) · Inter (body)
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   DESIGN TOKENS
──────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --blue:       #002244;   /* ★ 3-stop brand — dark bento, headings             */
  --blue-dark:  #001a33;   /* ★ 3-stop bookend — navbar, footer, CTA, hero      */
  --blue-deep:  #001a33;   /*   alias → bookend (was #000d1f)                   */
  --blue-mid:   #002244;   /*   alias → brand   (was #00428a)                   */
  --blue-pale:  rgba(0,34,68,.07);  /* derived from --blue: #002244             */

  --gold:       #FFD700;
  --gold-h:     #e6c200;
  --gold-glow:  rgba(255,215,0,.35);

  /* Surfaces */
  --bg:         #E6F0F9;   /* ★ 3-stop surface — single light base for all sections */
  --bg-2:       #E6F0F9;   /*   alias → same as --bg (was #D6E8F6, now unified)   */
  --bg-card:    #FFFFFF;   /*   pure white — cards pop cleanly against --bg        */
  --border:     #B8D0E8;   /*   blue-tinted border (compatible with --bg surface)  */

  /* Text */
  --t1:         #002244;   /* Deep Navy — max contrast on light blue */
  --t2:         #1a3a5c;   /* medium navy secondary */
  --t3:         #4a6a8a;   /* muted blue-grey tertiary */

  /* Typography */
  --f-head: 'Space Grotesk', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;
  --f-mono: 'SF Mono','Consolas','Menlo', monospace;

  /* Layout */
  --max:   1200px;
  --px:    clamp(20px, 5vw, 60px);
  --sec-y: clamp(72px, 10vw, 120px);

  /* Shadows */
  --s1: 0 1px 3px  rgba(0,0,0,.06);
  --s2: 0 4px 16px rgba(0,0,0,.08);
  --s3: 0 12px 40px rgba(0,0,0,.13);

  /* Radius */
  --r: 12px;

  /* Motion */
  --ease: cubic-bezier(.22,1,.36,1);

  /* Z-index */
  --z-top: 1000;
  --z-nav:  900;
  --z-mob:  850;
}

/* ────────────────────────────────────────────────────────────
   RESET + BASE
──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 0; /* no fixed header — no anchor offset needed */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--t1);
  background: var(--bg);
  /* Engineering dot-grid — subtle industrial texture on celestial blue base */
  background-image: radial-gradient(circle, rgba(0,34,68,.055) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font: inherit; cursor: pointer; border: none; background: none; }
h1,h2,h3 { font-family: var(--f-head); line-height: 1.12; letter-spacing: -.022em; }

/* ────────────────────────────────────────────────────────────
   TOPBAR
──────────────────────────────────────────────────────────── */
.topbar {
  position: relative; /* scrolls with page — no more sticky topbar */
  height: 36px;
  background: var(--gold);
}
.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar__contact {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-body);
  font-size: .8rem;
  font-weight: 500;
  color: var(--blue-dark);
}
.topbar__item {
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity 160ms ease;
}
.topbar__item:hover { opacity: .72; }
.topbar__icon { width: 13px; height: 13px; flex-shrink: 0; }
.topbar__sep  { width: 1px; height: 14px; background: rgba(0,26,58,.22); }
.topbar__badge {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue-dark);
  background: rgba(0,26,58,.1);
  padding: 2px 9px;
  border-radius: 4px;
}

/* ────────────────────────────────────────────────────────────
   NAVBAR
──────────────────────────────────────────────────────────── */
.navbar {
  position: relative; /* scrolls with page — classic non-sticky header */
  background: #001a33;           /* matches footer — dark industrial bookend */
  border-bottom: 1px solid rgba(255,215,0,.18);  /* hairline gold rule */
  box-shadow: 0 2px 20px rgba(0,0,0,.28);
}
.navbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Scrolled state — intentional no-op (navbar no longer fixed) */
.navbar.is-scrolled { }
.navbar.is-scrolled .navbar__inner { }

/* Real navbar logo — full-colour PNG on white navbar */
.navbar__logo { display: flex; align-items: center; }
.navbar__logo-img {
  height: 50px;
  width: auto;
  display: block;
  /* Zero filter, background-color, or opacity — renders as printed */
}
.navbar.is-scrolled .navbar__logo-img { }

/* Nav links */
.navbar__nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: .9375rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);  /* white on dark #001a33 — matches footer tone */
  padding: 8px 14px;
  border-radius: 7px;
  transition: color 160ms ease, background 160ms ease;
}
.nav-link:hover { color: var(--gold); background: rgba(255,255,255,.08); }
/* is-scrolled no-op — navbar is always dark */
.is-scrolled .nav-link { color: rgba(255,255,255,.85); }
.is-scrolled .nav-link:hover { color: var(--gold); background: rgba(255,255,255,.08); }

.nav-link--cta {
  background: var(--gold);
  color: var(--blue-dark) !important;
  font-weight: 600;
  padding: 9px 20px;
}
.nav-link--cta:hover {
  background: var(--gold-h);
  box-shadow: 0 0 0 3px var(--gold-glow);
  transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 7px;
  transition: background 160ms ease;
}
.hamburger:hover { background: rgba(255,255,255,.1); }  /* on dark navbar */
.is-scrolled .hamburger:hover { background: rgba(255,255,255,.1); }
.hamburger span {
  display: block;
  height: 2px;
  background: rgba(255,255,255,.85);  /* white on dark #001a33 navbar */
  border-radius: 2px;
  transform-origin: center;
  transition: transform 260ms var(--ease), opacity 160ms ease, width 260ms var(--ease), background 200ms ease;
}
.hamburger span:nth-child(3) { width: 65%; }
.is-scrolled .hamburger span { background: rgba(255,255,255,.85); } /* always white on dark */
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 100%; }

/* ────────────────────────────────────────────────────────────
   MOBILE MENU
──────────────────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: var(--z-mob);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 72px var(--px) 40px; /* reduced — no fixed header to clear */
  transform: translateY(-105%);
  visibility: hidden;
  transition: transform 320ms var(--ease), visibility 320ms;
}
.mobile-menu.is-open { transform: translateY(0); visibility: visible; }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 2px; }
.mobile-link {
  display: block;
  font-family: var(--f-head);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--blue);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color 160ms ease;
}
.mobile-link:hover { color: var(--gold-h); }
.mobile-link--cta {
  margin-top: 20px;
  text-align: center;
  background: var(--gold);
  color: var(--blue-dark) !important;
  padding: 16px;
  border: none;
  border-radius: var(--r);
  font-weight: 700;
  font-size: 1.1rem;
}
.mobile-link--cta:hover { background: var(--gold-h); }

/* ────────────────────────────────────────────────────────────
   HERO  (dark — only dark section on the page)
──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 80vh; /* was 100dvh — scaled down for human-scale pacing */
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--blue-deep);
  background-color: #001a33; /* fallback while video loads on slow connections */
}

/* Real video background — covers hero viewport edge-to-edge */
.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

/* Gold laser animation */
.hero__laser {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.laser-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 10%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,215,0,.18) 8%,
    var(--gold) 30%,
    #fffbe0 50%,
    var(--gold) 70%,
    rgba(255,215,0,.18) 92%,
    transparent 100%
  );
  box-shadow:
    0 0 6px  1px rgba(255,215,0,.9),
    0 0 20px 5px rgba(255,215,0,.45),
    0 0 50px 12px rgba(255,215,0,.18);
  animation: laser-sweep 7s ease-in-out infinite;
  opacity: 0;
}
@keyframes laser-sweep {
  0%   { top:  8%; opacity: 0; }
  5%   {           opacity: 1; }
  45%  { top: 92%; opacity: .85; }
  52%  { top: 92%; opacity: 0; }
  100% { top:  8%; opacity: 0; }
}
.laser-ambient {
  position: absolute;
  left: -80px;
  bottom: -80px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle,
    rgba(255,215,0,.10) 0%,
    rgba(255,215,0,.03) 45%,
    transparent 70%
  );
  animation: ambient-pulse 5s ease-in-out infinite alternate;
}
@keyframes ambient-pulse {
  from { opacity: .5; transform: scale(1); }
  to   { opacity: 1; transform: scale(1.2); }
}

/* Dark overlay for text legibility */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    110deg,
    rgba(0,10,26,.88) 0%,
    rgba(0,8,22,.70) 55%,
    rgba(0,6,18,.42) 100%
  );
}

/* Hero content */
.hero__content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  /* was 120–164px top — that offset was only to clear the fixed header stack */
  padding: clamp(48px, 6vw, 72px) var(--px) clamp(40px, 5vw, 56px);
}
.hero__eyebrow {
  display: block;
  font-family: var(--f-mono);
  font-size: clamp(.68rem,1.1vw,.78rem);
  letter-spacing: .14em;
  color: rgba(255,215,0,.65);
  text-transform: uppercase;
  margin-bottom: 22px;
  text-shadow: 0 1px 10px rgba(0,0,0,.75), 0 0 28px rgba(0,0,0,.55);
}
.hero__h1 {
  font-family: var(--f-head);
  font-size: clamp(2.8rem,6.5vw,5.6rem);
  font-weight: 500;
  color: #fff;
  letter-spacing: -.03em;
  margin-bottom: 26px;
  max-width: 700px;
}
.hero__h1 em { font-style: normal; color: var(--gold); }

/* Dynamic title swap — smooth fade between video segments */
#heroTitle {
  transition: opacity 0.3s ease-in-out;
  min-height: 2.4em;   /* reserves 2 lines at current line-height — CTA never jumps */
}

/* Brand yellow accent used by JS innerHTML swaps */
.text-accent {
  color: var(--gold);          /* #FFD700 — brand yellow */
  font-style: normal;
}
.hero__sub {
  font-size: clamp(1rem,1.7vw,1.1rem);
  font-weight: 300;
  color: rgba(255,255,255,.6);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 40px;
  text-shadow: 0 1px 10px rgba(0,0,0,.75), 0 0 28px rgba(0,0,0,.55);
  transition: opacity 0.3s ease-in-out;
  min-height: 5rem;    /* 2–3 lines — CTA row anchored regardless of text length */
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}
.hero__scroll-hint span {
  display: block;
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, rgba(255,215,0,.6), transparent);
  animation: scroll-hint 2.6s ease-in-out infinite;
}
@keyframes scroll-hint {
  0%,100% { opacity: .25; transform: scaleY(1);   transform-origin: top; }
  50%     { opacity: 1;   transform: scaleY(.55); transform-origin: bottom; }
}

/* ────────────────────────────────────────────────────────────
   PLACEHOLDER COMPONENT  (shared base + variants)
──────────────────────────────────────────────────────────── */
.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  overflow: hidden;
  padding: 10px;
}
.ph__cam {
  width: 16px;
  height: 16px;
  margin-bottom: 4px;
}
.ph__label {
  font-family: var(--f-mono);
  font-size: .61rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
}
.ph__dim {
  font-family: var(--f-mono);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.ph__spec {
  font-family: var(--f-mono);
  font-size: .61rem;
  letter-spacing: .07em;
}
.ph__file {
  font-family: var(--f-mono);
  font-size: .58rem;
  margin-top: 2px;
}

/* Hero video placeholder — dark themed */
.ph--hero-video .ph__label { color: rgba(255,215,0,.46); }
.ph--hero-video .ph__dim   { color: rgba(255,215,0,.72); }
.ph--hero-video .ph__spec  { color: rgba(255,255,255,.28); }
.ph--hero-video .ph__file  { color: rgba(255,255,255,.18); }

/* Light service placeholders */
.ph--service,
.ph--service-sm {
  background:
    repeating-linear-gradient(-48deg, rgba(0,34,68,.022) 0, rgba(0,34,68,.022) 1px, transparent 1px, transparent 8px),
    linear-gradient(155deg, #ecf0f7 0%, #e2eaf5 100%);
}
.ph--service .ph__cam,    .ph--service-sm .ph__cam    { color: var(--t3); }
.ph--service .ph__label,  .ph--service-sm .ph__label  { color: var(--t3); }
.ph--service .ph__dim,    .ph--service-sm .ph__dim    { color: var(--t2); }
.ph--service .ph__spec,   .ph--service-sm .ph__spec   { color: var(--t3); }
.ph--service .ph__file,   .ph--service-sm .ph__file   { color: rgba(0,0,0,.22); }

/* Dark service placeholder (inside dark bento cell) */
.ph--service-dark {
  background:
    repeating-linear-gradient(-48deg, rgba(255,255,255,.026) 0, rgba(255,255,255,.026) 1px, transparent 1px, transparent 8px),
    rgba(255,255,255,.04);
  border-right: 1px solid rgba(255,255,255,.07);
}
.ph--service-dark .ph__cam   { color: rgba(255,255,255,.22); }
.ph--service-dark .ph__label { color: rgba(255,255,255,.30); }
.ph--service-dark .ph__dim   { color: rgba(255,255,255,.52); }
.ph--service-dark .ph__spec  { color: rgba(255,255,255,.25); }
.ph--service-dark .ph__file  { color: rgba(255,255,255,.15); }

/* Gallery placeholder — matches celestial blue card palette */
.ph--gallery {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(-48deg, rgba(0,34,68,.032) 0, rgba(0,34,68,.032) 1px, transparent 1px, transparent 9px),
    linear-gradient(160deg, #d8eaf7 0%, #c8ddf2 100%);
}
.ph--gallery .ph__label { color: var(--t3); }
.ph--gallery .ph__dim   { color: var(--t2); }
.ph--gallery .ph__spec  { color: var(--t3); }

/* ────────────────────────────────────────────────────────────
   BUTTONS
──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-body);
  font-size: .9375rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 160ms ease,
    box-shadow  200ms ease,
    transform   160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn__icon  { width: 17px; height: 17px; flex-shrink: 0; }

.btn--gold {
  background: var(--gold);
  color: var(--blue-dark);
  box-shadow: 0 4px 14px rgba(255,215,0,.32);
}
.btn--gold:hover { background: var(--gold-h); box-shadow: 0 8px 24px rgba(255,215,0,.52); }

.btn--ghost {
  background: transparent;
  color: rgba(255,255,255,.88);
  border: 1.5px solid rgba(255,255,255,.3);
}
.btn--ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.65); color: #fff; }

.btn--ghost-dark {
  background: transparent;
  color: rgba(255,255,255,.75);
  border: 1.5px solid rgba(255,255,255,.22);
}
.btn--ghost-dark:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.45); color: #fff; }

.btn--lg { font-size: 1.08rem; padding: 18px 38px; letter-spacing: .01em; }

/* ────────────────────────────────────────────────────────────
   STATS BAR
──────────────────────────────────────────────────────────── */
.stats-bar {
  position: relative;   /* anchor for the ::before transition gradient */
  background: var(--bg);
  border-top: 3px solid var(--gold);
  border-bottom: 1px solid var(--border);
}
/* ── Hero → white gradient bridge ─────────────────────────
   Paints ABOVE the stats-bar, over the hero's bottom edge.
   DOM order ensures this always renders on top of the hero.  */
.stats-bar::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 100%;   /* sits flush against the top of the stats-bar, goes up */
  height: 80px;
  background: linear-gradient(to top,
    transparent 0%,
    rgba(0, 8, 22, .52) 45%,
    var(--blue-deep) 100%
  );
  pointer-events: none;
}
.stats-bar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat-item {
  padding: 16px 20px;   /* tighter — dense industrial rhythm */
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-item__val {
  font-family: var(--f-head);
  font-size: clamp(1.6rem,2.4vw,2.2rem);   /* larger, dominant */
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  letter-spacing: -.03em;
}
.stat-item__val sub { font-size: .52em; letter-spacing: 0; color: var(--t3); vertical-align: baseline; }
.stat-item__val sup { font-size: .55em; letter-spacing: 0; color: var(--gold-h); vertical-align: super; }
.stat-item__lbl {
  font-size: .93rem;    /* was .8rem — no more timid subtext */
  font-weight: 500;
  color: var(--t2);     /* was var(--t3) — darker, more readable */
  line-height: 1.35;
}

/* ────────────────────────────────────────────────────────────
   SECTION BASE
──────────────────────────────────────────────────────────── */
.section       { padding-block: var(--sec-y); }
.section--alt  { background: var(--bg-2); }
.container     { max-width: var(--max); margin: 0 auto; padding-inline: var(--px); }
.section-head  { max-width: 600px; margin-bottom: clamp(44px,7vw,64px); }
.section-tag {
  display: block;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue-mid);   /* #002244 brand — sharp on --bg surface */
  margin-bottom: 12px;
}
.section-h2 {
  font-size: clamp(2rem,4vw,2.9rem);
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 14px;
}
.section-sub { font-size: 1.05rem; color: var(--t2); line-height: 1.72; }

/* ────────────────────────────────────────────────────────────
   BENTO GRID
──────────────────────────────────────────────────────────── */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 340px 240px 280px;   /* row 3 = full-width Maestranza */
  gap: 14px;
}
.bento-cell--1 { grid-column: 1;     grid-row: 1 / 3; }   /* tall portrait */
.bento-cell--2 { grid-column: 2 / 4; grid-row: 1; }        /* dark wide */
.bento-cell--3 { grid-column: 2;     grid-row: 2; }         /* compact portrait */
.bento-cell--4 { grid-column: 3;     grid-row: 2; }         /* compact portrait */
.bento-cell--5 { grid-column: 1 / 4; grid-row: 3; }         /* full-width — flex-direction set below */

/* Base cell */
.bento-cell {
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-card);            /* #FFFFFF — white cards pop against --bg surface */
  border: 1px solid rgba(0,34,68,.10);
  box-shadow: 0 2px 10px rgba(0,34,68,.07), 0 1px 3px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 260ms var(--ease), transform 260ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .bento-cell:hover {
    box-shadow: 0 8px 32px rgba(0,34,68,.14), 0 2px 8px rgba(0,0,0,.07);
    transform: translateY(-3px);
  }
}

/* ── Cell 1: tall portrait ── */
.bento-cell--1 .bento-cell__ph  { flex: 1; min-height: 0; }
.bento-cell--1 .bento-cell__body { padding: 20px 22px 22px; }

/* ── Cell 2: wide horizontal dark ── */
.bento-cell--dark {
  background: var(--blue);
  border-color: transparent;
  flex-direction: row;
}
.bento-cell--dark .bento-cell__ph {
  width: 42%;
  flex-shrink: 0;
  border-radius: 0;
}
.bento-cell--dark .bento-cell__body {
  flex: 1;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Cells 3 & 4: compact portrait — shared body padding ── */
.bento-cell--3 .bento-cell__body,
.bento-cell--4 .bento-cell__body { padding: 16px 18px 18px; }

/* ── Cell 5: full-width horizontal — declared AFTER base .bento-cell rule so it wins ── */
.bento-cell--5 { flex-direction: row; }
.bento-cell--5 .bento-cell__body {
  flex: 1;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Real bento images ────────────────────────────────── */
.bento-cell__img {
  display: block;
  object-fit: cover;
  object-position: center;
}
/* Cell 1 — img-stack sizing + object-position handled above in hover block */
/* ── Hover cross-fade: machine → finished part (all 3 cards) ───────────── */
/* Base: absolute positioning context — sizing is per-card below */
.bento-cell--hover-fx .bento-cell__img-stack {
  position: relative;
  overflow: hidden;
}
/* Portrait cells (1, 3, 4) — stack fills the top flex area */
.bento-cell--1.bento-cell--hover-fx .bento-cell__img-stack,
.bento-cell--3.bento-cell--hover-fx .bento-cell__img-stack,
.bento-cell--4.bento-cell--hover-fx .bento-cell__img-stack {
  flex: 1;
  min-height: 0;
  width: 100%;
}
/* Horizontal cells (2, 5) — stack is the left image panel */
.bento-cell--2.bento-cell--hover-fx .bento-cell__img-stack,
.bento-cell--5.bento-cell--hover-fx .bento-cell__img-stack {
  width: 42%;
  height: 100%;
  flex-shrink: 0;
}
.bento-cell--hover-fx .bento-cell__img--a,
.bento-cell--hover-fx .bento-cell__img--b {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transition: opacity 0.5s ease;
}
/* Cell 1 — top-down CNC shot: anchor upper zone */
.bento-cell--1.bento-cell--hover-fx .bento-cell__img--a,
.bento-cell--1.bento-cell--hover-fx .bento-cell__img--b {
  object-position: center 20%;
}
/* Cells 3 & 4 — compact portrait: center crop */
.bento-cell--3.bento-cell--hover-fx .bento-cell__img--a,
.bento-cell--3.bento-cell--hover-fx .bento-cell__img--b,
.bento-cell--4.bento-cell--hover-fx .bento-cell__img--a,
.bento-cell--4.bento-cell--hover-fx .bento-cell__img--b {
  object-position: center center;
}
/* Cell 5 — fresadora: centered works well for both images */
.bento-cell--5.bento-cell--hover-fx .bento-cell__img--a,
.bento-cell--5.bento-cell--hover-fx .bento-cell__img--b {
  object-position: center center;
}
/* Hover B (finished parts) starts hidden */
.bento-cell--hover-fx .bento-cell__img--b { opacity: 0; }
/* On hover: machine fades out, parts fade in */
.bento-cell--hover-fx:hover .bento-cell__img--a { opacity: 0; }
.bento-cell--hover-fx:hover .bento-cell__img--b { opacity: 1; }

/* Hover-hint pill — invites interaction, disappears on hover */
.bento-cell__hover-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: .6rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255,255,255,.92);
  background: rgba(0,10,28,.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.18);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.bento-cell--hover-fx:hover .bento-cell__hover-hint { opacity: 0; }

/* Cell body typography — un-timid hierarchy */
.bento-cell__num {
  font-family: var(--f-mono);
  font-size: .74rem;         /* was .66rem */
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-mid);
  margin-bottom: 8px;
}
.bento-cell--dark .bento-cell__num { color: rgba(255,255,255,.4); }

.bento-cell__title {
  font-family: var(--f-head);
  font-size: clamp(1.25rem,1.75vw,1.55rem);  /* was 1.2–1.45rem */
  font-weight: 700;                           /* was 600 */
  color: var(--blue);
  margin-bottom: 10px;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.bento-cell--dark .bento-cell__title { color: #fff; }

.bento-cell__desc {
  font-size: .96rem;         /* was .9rem */
  color: var(--t1);          /* was var(--t2) — one step darker, more assertive */
  line-height: 1.65;
  margin-bottom: 14px;
  flex: 1;
}
.bento-cell--dark .bento-cell__desc { color: rgba(255,255,255,.65); }

.bento-cell__tag {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: .67rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--blue-pale);
  color: var(--blue-mid);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(0,34,68,.14);
}
.bento-cell__tag--gold {
  background: rgba(255,215,0,.12);
  color: var(--gold-h);
  border-color: rgba(255,215,0,.28);
}

/* ────────────────────────────────────────────────────────────
   GALLERY  (4 items — asymmetric CSS Grid, Z-pattern)
──────────────────────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 360px 320px;
  gap: 14px;
}
/* Row 1: wide left + narrow right */
.g-item--1 { grid-column: 1 / 3; grid-row: 1; }
.g-item--2 { grid-column: 3;     grid-row: 1; }
/* Row 2: narrow left + wide right */
.g-item--3 { grid-column: 1;     grid-row: 2; }
.g-item--4 { grid-column: 2 / 4; grid-row: 2; }

.g-item {
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-card);            /* #FFFFFF — white cards pop against --bg surface */
  border: 1px solid rgba(0,34,68,.10);
  box-shadow: 0 2px 10px rgba(0,34,68,.07), 0 1px 3px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  margin: 0;
  cursor: pointer;
  transition: box-shadow 260ms var(--ease), transform 260ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .g-item:hover {
    box-shadow: 0 8px 32px rgba(0,34,68,.14), 0 2px 8px rgba(0,0,0,.07);
    transform: translateY(-2px);
  }
}
.g-item .ph--gallery { flex: 1; min-height: 0; }
/* Real gallery images — fixed height prevents deformation regardless of source resolution */
.g-item__img {
  display: block;
  width: 100%;
  height: 250px;
  flex-shrink: 0;      /* never squash below 250px */
  object-fit: cover;
  object-position: center;
}

.g-item__cap {
  padding: 13px 16px;
  border-top: 1px solid rgba(0,34,68,.10);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.g-item__cap strong {
  font-family: var(--f-head);
  font-size: .9rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -.01em;
}
.g-item__cap span { font-size: .78rem; color: var(--t3); }

/* ────────────────────────────────────────────────────────────
   RAW PRODUCTION  — 2-column split (light section)
   text left · constrained video right
   Smaller video = sharper perceived quality
──────────────────────────────────────────────────────────── */

/* 2-col grid — aligns items on the vertical centre */
.raw-prod__grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

/* Heading */
.raw-prod__h2 {
  font-family: var(--f-head);
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  font-weight: 700;
  color: var(--blue);
  line-height: 1.1;
  letter-spacing: -.025em;
  margin-bottom: 20px;
}

/* "Sin Filtros." — gold underline accent on the punchy tagline */
.raw-prod__accent {
  border-bottom: 3px solid var(--gold);
  padding-bottom: 3px;
}

/* Supporting paragraph */
.raw-prod__body {
  font-size: 1.05rem;
  color: var(--t2);
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 460px;
}

/* Video column — centres the constrained element */
.raw-prod__vid-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Constrained video — smaller physical size = sharper perceived resolution.
   No object-fit tricks — the video renders at its native aspect ratio.     */
.raw-prod__vid {
  display: block;
  width: 100%;
  max-width: 680px;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(0,34,68,.10),
    0 8px 32px rgba(0,34,68,.16),
    0 28px 72px rgba(0,0,0,.18);
}

/* ────────────────────────────────────────────────────────────
   CTA  (dark blue section)
──────────────────────────────────────────────────────────── */
.section--cta {
  background: #001a33;   /* ★ bookend — unified with navbar / footer */
  text-align: center;
  padding-block: clamp(100px,13vw,140px);  /* more commanding height */
  position: relative;
  overflow: hidden;
}
/* Subtle radial glow behind the CTA content */
.section--cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 50%,
    rgba(0,34,68,.55) 0%, transparent 70%);
  pointer-events: none;
}
.cta-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding-inline: var(--px);
  position: relative;   /* above ::before glow */
  z-index: 1;
}
.cta-eyebrow {
  display: block;
  font-family: var(--f-mono);
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);    /* full gold — was at 55% opacity */
  margin-bottom: 20px;
}
.cta-h2 {
  font-family: var(--f-head);
  font-size: clamp(2.3rem,4.5vw,3.4rem);  /* was 2–2.9rem */
  font-weight: 700;                        /* was 600 */
  color: #fff;
  margin-bottom: 22px;
  line-height: 1.12;
  letter-spacing: -.02em;
}
.cta-sub {
  font-size: 1.12rem;
  color: rgba(255,255,255,.72);  /* was .62 — more readable */
  line-height: 1.75;
  margin-bottom: 44px;
  max-width: 620px;
  margin-inline: auto;
}
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ────────────────────────────────────────────────────────────
   FOOTER  —  3-column premium layout
──────────────────────────────────────────────────────────── */
.footer {
  background: #001a33;   /* deep industrial navy — sharp contrast vs celestial blue */
  color: rgba(255,255,255,.65);
}

/* Main body */
.footer__body {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(52px,8vw,80px) var(--px) clamp(44px,6vw,64px);
}
.footer__cols {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: clamp(32px,5vw,60px);
  align-items: start;
}

/* Column shared */
.footer__col { display: flex; flex-direction: column; }

/* Col 1 — brand */
.footer__col--brand { gap: 14px; }
.footer__logo-img {
  height: 48px;
  width: auto;
  max-width: 220px;       /* prevents stretching in narrow flex/grid cells */
  display: block;
  object-fit: contain;   /* preserves aspect ratio if container constrains it */
  flex-shrink: 0;        /* never let flexbox squash it */
}
.footer__slogan {
  font-size: .85rem;
  font-style: italic;
  color: var(--gold);
  letter-spacing: .02em;
}
.footer__about {
  font-size: .82rem;
  line-height: 1.75;
  color: rgba(255,255,255,.44);
  max-width: 320px;
}

/* Col title (services + contact) */
.footer__col-title {
  font-family: var(--f-head);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,215,0,.18);
}

/* Col 2 — services list */
.footer__svc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer__svc-list li {
  font-size: .82rem;
  color: rgba(255,255,255,.50);
  padding-left: 16px;
  position: relative;
  transition: color 160ms ease;
}
.footer__svc-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold-h);
  font-size: .7rem;
  opacity: .7;
}
.footer__svc-list li:hover { color: rgba(255,255,255,.85); }

/* Col 3 — contact info */
.footer__cinfo {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer__citem {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: .82rem;
  color: rgba(255,255,255,.50);
  text-decoration: none;
  transition: color 160ms ease;
  line-height: 1.55;
}
.footer__citem:hover { color: var(--gold); }
a.footer__citem:hover .footer__cicon { color: var(--gold); }
.footer__cicon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--gold-h);
  margin-top: 2px;
  transition: color 160ms ease;
}

/* Bottom bar */
.footer__bar {
  border-top: 1px solid rgba(255,255,255,.07);
}
.footer__bar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.footer__copy {
  font-size: .74rem;
  color: rgba(255,255,255,.22);
}
.footer__dev {
  font-size: .7rem;
  color: rgba(255,255,255,.16);
}
.footer__dev strong {
  font-weight: 600;
  color: rgba(255,255,255,.28);
  letter-spacing: .03em;
}

/* ────────────────────────────────────────────────────────────
   FLOATING WHATSAPP  (fixed bottom-right)
──────────────────────────────────────────────────────────── */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: calc(var(--z-top) + 10);
  width: 58px;
  height: 58px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 18px rgba(37,211,102,.48),
    0 0 0 0 rgba(37,211,102,.38);
  transition: transform 200ms var(--ease), box-shadow 200ms ease;
  animation: wa-pulse 2.8s ease-out infinite;
}
.wa-float svg {
  width: 31px;
  height: 31px;
  color: #fff;
  flex-shrink: 0;
}
.wa-float:hover {
  transform: scale(1.11) translateY(-3px);
  box-shadow: 0 8px 30px rgba(37,211,102,.65);
  animation: none;
}
@keyframes wa-pulse {
  0%  { box-shadow: 0 4px 18px rgba(37,211,102,.48), 0 0 0 0    rgba(37,211,102,.38); }
  65% { box-shadow: 0 4px 18px rgba(37,211,102,.48), 0 0 0 20px rgba(37,211,102, 0); }
  100%{ box-shadow: 0 4px 18px rgba(37,211,102,.48), 0 0 0 0    rgba(37,211,102, 0); }
}

/* ────────────────────────────────────────────────────────────
   SCROLL REVEAL
──────────────────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity   .65s var(--ease),
    transform .65s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ────────────────────────────────────────────────────────────
   RESPONSIVE — 1024px
──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {

  /* Bento → 2-column (5 cards: tall left, 2×2 right, full-width bottom) */
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .bento-cell--1 { grid-column: 1; grid-row: 1 / 3; min-height: 520px; }
  .bento-cell--2 { grid-column: 2; grid-row: 1; flex-direction: column; }
  .bento-cell--3 { grid-column: 2; grid-row: 2; }
  .bento-cell--4 { grid-column: 1; grid-row: 3; }
  .bento-cell--5 { grid-column: 2; grid-row: 3; flex-direction: column; }
  .bento-cell--dark .bento-cell__ph { width: 100%; height: 200px; flex-shrink: 0; }
  .bento-cell--dark .bento-cell__img { width: 100%; height: 200px; flex-shrink: 0; }
  .bento-cell--hover-fx .bento-cell__img-stack { width: 100%; height: 200px; flex: none; }

  /* Gallery → 2-column (4 items, 2×2 grid) */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 300px 300px;
  }
  .g-item--1 { grid-column: 1; grid-row: 1; }
  .g-item--2 { grid-column: 2; grid-row: 1; }
  .g-item--3 { grid-column: 1; grid-row: 2; }
  .g-item--4 { grid-column: 2; grid-row: 2; }

  /* Stats bar → 2-column */
  .stats-bar__inner { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2)  { border-right: none; }
  .stat-item:nth-child(n+3){ border-top: 1px solid var(--border); }
  .stat-item:nth-child(4)  { border-right: none; }
}

/* ────────────────────────────────────────────────────────────
   RESPONSIVE — 768px  (mobile)
──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger  { display: flex; }
  .navbar__nav { display: none; }

  /* Hide address in topbar on small screens */
  .topbar__addr,
  .topbar__sep { display: none; }

  /* ── BENTO: single full-width column ─────────────────────────── */
  .bento { grid-template-columns: 1fr; grid-template-rows: auto; }
  .bento-cell--1,
  .bento-cell--2,
  .bento-cell--3,
  .bento-cell--4,
  .bento-cell--5 { grid-column: 1 !important; grid-row: auto !important; }

  /* All cards: text on top, image block on the bottom.
     HTML order is img-stack → body, so column-reverse floats body
     to the visual top and drops img-stack to the visual bottom.
     Applies to all 5 cells — overrides the row/column desktop rules. */
  .bento-cell          { flex-direction: column-reverse !important; min-height: 0; }
  /* Cell 5 body had flex:1 for desktop centring — reset it */
  .bento-cell--5 .bento-cell__body { flex: none; }

  /* ── IMAGE CONTAINER ──────────────────────────────────────────
     Root cause of the collapse: desktop rule
       .bento-cell--X.bento-cell--hover-fx .bento-cell__img-stack
       { flex:1; min-height:0 }
     has 3-class specificity and was winning over our flex:none.
     With min-height:0 on a flex child whose parent has no fixed
     height the container shrinks to 0 px; the absolutely-positioned
     images inherit that 0×0 box and disappear.
     Fix: convert to normal-flow flex column so images take real space.
     Every property carries !important to beat the higher-specificity
     desktop rules regardless of source order.                       */
  .bento-cell__img-stack {
    display:        flex     !important;
    flex-direction: column   !important;
    gap:            12px     !important;
    width:          100%     !important;
    height:         auto     !important;   /* sized by children, not parent */
    flex:           none     !important;   /* no grow/shrink from flex parent */
    flex-shrink:    0        !important;
    overflow:       visible  !important;   /* don't clip the images */
  }

  /* ── BOTH IMAGES: out of absolute positioning, into normal flow ─
     Desktop cross-fade uses position:absolute;inset:0 to stack the
     two images on top of each other.  On mobile we undo that and
     render them as a 2-photo gallery side by side inside each card.
     Selector specificity (0,2,0) matches the old touch-fix rules so
     !important here reliably beats every conflicting desktop rule.  */
  .bento-cell--hover-fx .bento-cell__img--a,
  .bento-cell--hover-fx .bento-cell__img--b {
    position:      relative  !important;
    opacity:       1         !important;
    visibility:    visible   !important;
    transform:     none      !important;
    transition:    none      !important;
    inset:         auto      !important;
    z-index:       auto      !important;
    width:        100%   !important;
    aspect-ratio: 4 / 3  !important;   /* ~270 px tall at 360 px width — matches Showcase's height:250px */
    height:       auto   !important;   /* driven by aspect-ratio, not a fixed value */
    object-fit:   cover  !important;
    border-radius: 8px   !important;
    flex-shrink:  0      !important;
  }

  /* Suppress "Hover · Ver resultado" hint — meaningless on touch */
  .bento-cell__hover-hint { display: none; }

  /* Gallery → single column (4 items) */
  .gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .g-item--1,
  .g-item--2,
  .g-item--3,
  .g-item--4 { grid-column: 1 !important; grid-row: auto !important; min-height: 240px; }

  /* Raw production — stack to single column on mobile */
  .raw-prod__grid { grid-template-columns: 1fr; gap: 32px; }
  .raw-prod__vid  { max-width: 100%; }

  /* Footer → single column stack */
  .footer__cols { grid-template-columns: 1fr; gap: 36px; }
  .footer__bar-inner { flex-direction: column; gap: 4px; text-align: center; }
  .footer__about { max-width: none; }
}

/* ────────────────────────────────────────────────────────────
   RESPONSIVE — 480px
──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero__actions  { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
  .cta-actions    { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { justify-content: center; }
  .stats-bar__inner { grid-template-columns: 1fr; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }
  .topbar__right { display: none; }
}

/* ────────────────────────────────────────────────────────────
   ACCESSIBILITY
──────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; }
}
