/* ========== RBO CNC — Design tokens ========== */
:root {
  --black: #060606;
  --black-2: #0e0e0e;
  --steel: #1a1a1a;
  --steel-2: #2b2b2b;
  --gray: #8c8c8c;
  --gray-light: #c8c8c8;
  --white: #f4f4f4;
  --red: #e11d2e;
  --red-deep: #9e0f1c;
  --red-glow: rgba(225, 29, 46, 0.45);

  --font-display: "Bebas Neue", sans-serif;
  --font-body: "Barlow", sans-serif;

  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1180px;
  --header-h: 4.25rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--white);
  background: var(--black);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Subtle industrial grain + scanline atmosphere */
.scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0.035;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.06) 2px,
    rgba(255, 255, 255, 0.06) 3px
  );
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ========== Header ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--pad);
  background: linear-gradient(180deg, rgba(6, 6, 6, 0.92) 0%, rgba(6, 6, 6, 0.55) 70%, transparent 100%);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(6, 6, 6, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.nav-open {
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10060;
}

.logo-img {
  height: 2.65rem;
  width: auto;
  display: block;
}

.nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  height: var(--header-h);
  padding: 0 var(--pad);
}

.nav a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-light);
  transition: color 0.25s;
}

.nav a:hover {
  color: var(--white);
}

.nav-cta {
  color: var(--white) !important;
  padding: 0.55rem 1rem;
  border: 1px solid var(--red);
  transition: background 0.25s, color 0.25s !important;
}

.nav-cta:hover {
  background: var(--red);
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 10060;
  width: 2.25rem;
  height: 2.25rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  border: 1px solid var(--red);
}

.btn-primary:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  border-color: var(--white);
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 2rem) var(--pad) 5rem;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: contrast(1.08) saturate(0.85);
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 6, 6, 0.92) 0%, rgba(6, 6, 6, 0.55) 48%, rgba(6, 6, 6, 0.35) 100%),
    linear-gradient(0deg, rgba(6, 6, 6, 0.95) 0%, transparent 42%),
    radial-gradient(ellipse 60% 50% at 70% 40%, var(--red-glow), transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-logo {
  width: min(420px, 78vw);
  height: auto;
  margin-bottom: 1.1rem;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55));
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 6vw, 4.25rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.02;
  color: var(--white);
  max-width: 14ch;
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 300;
  color: var(--gray-light);
  max-width: 38ch;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-scroll {
  position: absolute;
  bottom: 1.75rem;
  right: var(--pad);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray);
}

.hero-scroll-line {
  width: 1px;
  height: 3.25rem;
  background: linear-gradient(180deg, var(--red), transparent);
  animation: scrollPulse 2.2s var(--ease) infinite;
}

@keyframes scrollPulse {
  0%,
  100% {
    transform: scaleY(0.55);
    transform-origin: top;
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 1;
  }
}

/* Intro animations */
.animate-in {
  opacity: 0;
  transform: translateY(28px);
  animation: riseIn 1s var(--ease) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.55s; }
.delay-5 { animation-delay: 0.65s; }

@keyframes riseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Sections shared ========== */
.section {
  position: relative;
  padding: clamp(4.5rem, 10vw, 8rem) var(--pad);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.85rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.02;
  color: var(--white);
  margin-bottom: 1.15rem;
  max-width: 16ch;
}

.section-text {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--gray-light);
  max-width: 52ch;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.delay-1.is-visible { transition-delay: 0.1s; }
.reveal.delay-2.is-visible { transition-delay: 0.2s; }
.reveal.delay-3.is-visible { transition-delay: 0.3s; }
.reveal.delay-4.is-visible { transition-delay: 0.4s; }
.reveal.delay-5.is-visible { transition-delay: 0.5s; }

/* ========== About ========== */
.about {
  background:
    linear-gradient(180deg, var(--black) 0%, var(--black-2) 100%);
}

.about .section-inner {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.about-visual {
  position: relative;
  overflow: hidden;
}

.about-visual::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--red);
  z-index: 1;
}

.about-visual img {
  width: 100%;
  height: min(52vh, 480px);
  object-fit: cover;
  filter: grayscale(0.25) contrast(1.05);
  transition: filter 0.6s var(--ease), transform 1.2s var(--ease);
}

.about-visual:hover img {
  filter: grayscale(0) contrast(1.08);
  transform: scale(1.03);
}

/* ========== Mission ========== */
.mission {
  background:
    radial-gradient(ellipse 80% 60% at 0% 50%, rgba(225, 29, 46, 0.12), transparent 55%),
    var(--steel);
  border-block: 1px solid rgba(255, 255, 255, 0.06);
}

.mission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.mission-block .section-title {
  max-width: 14ch;
}

.mission-block + .mission-block {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: clamp(2rem, 4vw, 3.5rem);
}

/* ========== Product ========== */
.product {
  background: var(--black);
}

.product-intro {
  margin-bottom: 2.5rem;
}

.product-stage {
  margin-bottom: 3rem;
  overflow: hidden;
  position: relative;
}

.product-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  background: linear-gradient(transparent, var(--black));
  pointer-events: none;
}

.product-hero-img {
  width: 100%;
  height: clamp(280px, 55vh, 560px);
  object-fit: cover;
  object-position: center;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.spec-list li {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.35rem 1.25rem 1.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.spec-list li:nth-child(3n) {
  border-right: none;
  padding-right: 0;
}

.spec-list span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
}

.spec-list strong {
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.35;
}

/* ========== Capacity ========== */
.capacity {
  background:
    linear-gradient(160deg, var(--black-2) 0%, #121212 40%, #1a0a0c 100%);
}

.capacity-layout {
  display: grid;
  gap: 2.5rem;
}

.capacity-media {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.capacity-fig {
  position: relative;
  overflow: hidden;
  min-height: 280px;
}

.capacity-fig:first-child {
  min-height: 420px;
}

.capacity-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05);
  transition: transform 1s var(--ease);
}

.capacity-fig:hover img {
  transform: scale(1.05);
}

.capacity-fig figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: var(--white);
}

/* ========== Gallery ========== */
.gallery {
  background: var(--black);
}

.gallery-intro {
  margin-bottom: 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  padding: 0;
}

.gallery-item.span-2 {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 9;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.5s;
  filter: brightness(0.88);
}

.gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(1);
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0 solid var(--red);
  transition: border-width 0.3s var(--ease);
  pointer-events: none;
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  border-width: 3px;
}

.gallery-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 1.1rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: var(--white);
}

.machine-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.machine-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: contrast(1.05);
}

.trabajos {
  background: var(--black-2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.trabajos .section-text {
  margin-bottom: 0.5rem;
}

.trabajos-grid {
  margin-top: 2rem;
}

.videos {
  background: var(--black);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.video-card {
  overflow: hidden;
  background: var(--steel);
}

.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.video-card figcaption {
  padding: 0.9rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-light);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ========== Contact ========== */
.contact {
  background:
    radial-gradient(ellipse 70% 80% at 50% 100%, rgba(225, 29, 46, 0.22), transparent 55%),
    var(--black-2);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact .section-title {
  max-width: 18ch;
}

.contact .section-text {
  margin-inline: auto;
}

.contact-location {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--white);
}

.contact-pin {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(225, 29, 46, 0.25);
  animation: pinPulse 2s ease infinite;
}

@keyframes pinPulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(225, 29, 46, 0.25);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(225, 29, 46, 0);
  }
}

.contact-actions {
  margin-top: 2rem;
}

.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 120;
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s var(--ease), background 0.25s;
}

.wa-float svg {
  width: 1.7rem;
  height: 1.7rem;
}

.wa-float:hover {
  transform: translateY(-3px) scale(1.05);
  background: var(--red-deep);
}

body.nav-open .wa-float {
  visibility: hidden;
  pointer-events: none;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.socials-contact {
  margin-top: 2.25rem;
  width: 100%;
}

.socials-contact a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-light);
  transition: color 0.25s;
}

.socials-contact a:hover {
  color: var(--red);
}

.social-link {
  display: none;
}

/* ========== Footer ========== */
.site-footer {
  padding: 2rem var(--pad) 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--black);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  font-size: 0.8rem;
  color: var(--gray);
}

/* ========== Lightbox ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open[hidden] {
  display: grid;
}

.lightbox-img {
  max-width: min(1100px, 100%);
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--white);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .about .section-inner {
    grid-template-columns: 1fr;
  }

  .about-visual img {
    height: 42vh;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .mission-block + .mission-block {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2.5rem;
  }

  .spec-list {
    grid-template-columns: 1fr 1fr;
  }

  .spec-list li:nth-child(3n) {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding-right: 1.25rem;
  }

  .spec-list li:nth-child(2n) {
    border-right: none;
    padding-right: 0;
  }

  .machine-strip {
    grid-template-columns: 1fr 1fr;
  }

  .videos-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item.span-2 {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    inset: 0;
    height: 100%;
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: calc(var(--header-h) + 1rem) var(--pad) 2rem;
    background: var(--black);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav a {
    font-size: 1.15rem;
  }

  .hero {
    align-items: flex-end;
    padding-bottom: 6rem;
  }

  .hero-scroll {
    left: var(--pad);
    right: auto;
    flex-direction: row;
    gap: 0.75rem;
  }

  .hero-scroll-line {
    width: 2.5rem;
    height: 1px;
    background: linear-gradient(90deg, var(--red), transparent);
  }

  .spec-list {
    grid-template-columns: 1fr;
  }

  .spec-list li,
  .spec-list li:nth-child(3n),
  .spec-list li:nth-child(2n) {
    border-right: none;
    padding-right: 0;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item.span-2 {
    grid-column: auto;
  }

  .machine-strip {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-in,
  .reveal,
  .hero-scroll-line,
  .contact-pin {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
