/* ==========================================================================
   MADUCE — Design System
   ========================================================================== */

:root {
  --red: #e30613;
  --red-bright: #ff2436;
  --red-dim: #9c0710;
  --silver: #c9c9c9;
  --black: #0a0a0a;

  --bg: #0a0a0a;
  --bg-alt: #101012;
  --surface: #17171a;
  --surface-2: #1e1e22;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f3f2ef;
  --text-dim: #a9a8a4;
  --text-faint: #6f6e6b;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-industrial: 'Big Shoulders Display', 'Inter', sans-serif;

  --wrap: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);

  --header-h: 84px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, li, figure, table { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
input, textarea { font: inherit; color: inherit; }

::selection { background: var(--red); color: #fff; }

:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--red);
  color: #fff;
  padding: 12px 20px;
  z-index: 999;
  font-weight: 600;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--red-dim), var(--red-bright));
  z-index: 300;
  transition: width 0.1s linear;
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 160;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: height 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  height: 68px;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { width: 38px; height: auto; flex-shrink: 0; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.main-nav ul { display: flex; gap: 36px; }
.nav-link {
  position: relative;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 0;
  transition: color 0.25s var(--ease);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--red);
  transition: width 0.3s var(--ease);
}
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-link:hover::after, .nav-link.is-active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 18px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 3px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.35s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
  will-change: transform;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
}
.btn-primary:hover { background: var(--red-bright); border-color: var(--red-bright); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--red); color: var(--text); background: rgba(227, 6, 19, 0.08); }
.btn-block { width: 100%; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
}
.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border-radius: 4px;
  opacity: 0.55;
  filter: grayscale(0.55);
  transition: opacity 0.25s var(--ease), filter 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}
.lang-btn:hover { opacity: 0.9; filter: grayscale(0.1); transform: translateY(-1px); }
.lang-btn.is-active {
  opacity: 1;
  filter: grayscale(0);
  background: rgba(227, 6, 19, 0.14);
  box-shadow: inset 0 0 0 1px rgba(227, 6, 19, 0.5);
}
.flag-icon {
  width: 20px;
  height: auto;
  border-radius: 2px;
  display: block;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  margin: 0 auto;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  top: 0; right: 0;
  width: min(360px, 86vw);
  height: 100vh;
  background: #0d0d0f;
  border-left: 1px solid var(--border);
  z-index: 150;
  padding: 110px 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav ul { display: flex; flex-direction: column; gap: 26px; }
.mobile-link { font-family: var(--font-display); font-size: 26px; font-weight: 600; }

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.mobile-nav-backdrop.is-visible { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 500px at 78% 30%, rgba(227, 6, 19, 0.14), transparent 60%),
    radial-gradient(ellipse 700px 700px at 10% 90%, rgba(255,255,255,0.04), transparent 60%),
    var(--bg);
}
.spark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.hero-hexline {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, transparent, black 20%, black 75%, transparent);
}

.hero-inner { position: relative; z-index: 3; max-width: 880px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title em { font-style: normal; color: var(--red); }

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text-dim);
  max-width: 620px;
  margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 18px; flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 32px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.scroll-cue span {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--text-faint), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-cue span::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--red-bright), transparent);
  animation: cueMove 2.2s ease-in-out infinite;
}
@keyframes cueMove {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}
@media (max-width: 780px) { .scroll-cue { display: none; } }

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  overflow: hidden;
  padding: 18px 0;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: marqueeScroll 32s linear infinite;
}
.marquee-track span {
  font-family: var(--font-industrial);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  white-space: nowrap;
}
.marquee-track .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section { padding: 130px 0; position: relative; }
.section-dark { background: var(--bg-alt); }

.section-head { max-width: 640px; margin-bottom: 72px; }
.section-head--left { margin-bottom: 56px; }
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.section-lead {
  margin-top: 20px;
  font-size: 17px;
  color: var(--text-dim);
  max-width: 560px;
}

@media (max-width: 780px) {
  .section { padding: 90px 0; }
  .section-head { margin-bottom: 48px; }
}

/* ==========================================================================
   Pilares
   ========================================================================== */
.pillars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.pillar {
  background: var(--bg);
  padding: 34px 26px 40px;
  position: relative;
  transition: background 0.35s var(--ease);
}
.pillar:hover { background: var(--surface); }
.pillar-index {
  display: block;
  font-family: var(--font-industrial);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-faint);
  margin-bottom: 26px;
}
.pillar-icon { width: 36px; height: 36px; color: var(--red-bright); margin-bottom: 22px; }
.pillar h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.pillar p { font-size: 14.5px; color: var(--text-dim); line-height: 1.55; }

@media (max-width: 1000px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pillars { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Produtos
   ========================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.product-card--wide { grid-column: span 2; }

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); border-color: var(--red-dim); background: var(--surface-2); }

/* Media tile */
.product-media {
  position: relative;
  overflow: hidden;
  background: #0c0c0d;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease);
}
.product-card:hover .product-media img { transform: scale(1.045); }

.product-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10,10,10,0.75), transparent 30%);
  pointer-events: none;
}

.product-index {
  position: absolute;
  top: 20px;
  left: 22px;
  z-index: 2;
  font-family: var(--font-industrial);
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

.product-card-body { padding: 26px 30px 32px; flex: 1 1 auto; display: flex; flex-direction: column; }
.product-card h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin-bottom: 12px; }
.product-card p { font-size: 14.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 22px; }
.product-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 3px;
  margin-top: auto;
  align-self: flex-start;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), gap 0.25s var(--ease);
}
.product-link:hover { color: var(--red-bright); border-color: var(--red-bright); gap: 12px; }

@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .product-card--wide { grid-column: span 2; }
}
@media (max-width: 600px) {
  .products-grid { grid-template-columns: 1fr; }
  .product-card--wide { grid-column: span 1; }
}

/* ==========================================================================
   Qualidade / Specs
   ========================================================================== */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.spec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px;
}
.spec-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 10px;
}
.spec-card-head h3 {
  font-family: var(--font-industrial);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  margin-bottom: 12px;
}
.spec-card-head p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 26px; max-width: 46ch; }

.spec-table { margin-bottom: 20px; }
.spec-table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-strong);
}
.spec-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-industrial);
  font-weight: 700;
  font-size: 18px;
}
.spec-table td:first-child { color: var(--text-dim); font-family: var(--font-body); font-weight: 500; font-size: 14.5px; }

.spec-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 20px; }
.spec-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.spec-list li span { font-size: 14.5px; color: var(--text-dim); }
.spec-list li strong { font-family: var(--font-industrial); font-weight: 700; font-size: 19px; }

.spec-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
}

@media (max-width: 780px) {
  .specs-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Sobre
   ========================================================================== */
.about-wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 60px; }
.about-body p { font-size: 17px; color: var(--text-dim); line-height: 1.7; margin-bottom: 20px; max-width: 60ch; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--red);
  padding-bottom: 3px;
  transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}
.text-link:hover { gap: 12px; color: var(--red-bright); }

@media (max-width: 900px) {
  .about-wrap { grid-template-columns: 1fr; gap: 24px; }
}

/* ==========================================================================
   Contato
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 50px; align-items: stretch; }
.contact-info { display: flex; flex-direction: column; }
.contact-list { display: flex; flex-direction: column; margin-bottom: 30px; }
.contact-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.contact-value { font-family: var(--font-display); font-size: 19px; font-weight: 500; }
a.contact-value:hover { color: var(--red-bright); }
.contact-info .btn { align-self: flex-start; }

.map-frame {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  min-height: 340px;
  filter: grayscale(0.25) contrast(1.05) brightness(0.92);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .map-frame { aspect-ratio: 16/11; min-height: 0; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-top: 80px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 60px;
}
.footer-brand .brand { margin-bottom: 16px; }
.footer-brand p { color: var(--text-faint); font-size: 14px; max-width: 30ch; }
.footer-col h4 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 18px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 14.5px; color: var(--text-dim); transition: color 0.25s var(--ease); }
.footer-col a:hover { color: var(--red-bright); }
.footer-col li { font-size: 14.5px; color: var(--text-dim); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 22px 32px;
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
}
.credit-link { color: var(--text-faint); transition: color 0.25s var(--ease); }
.credit-link:hover { color: var(--red-bright); }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-soft), transform 0.8s var(--ease-soft);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

.pillars .reveal, .products-grid .reveal, .compliance-list .reveal {
  transition-delay: calc(var(--stagger, 0) * 80ms);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Magnetic buttons — JS toggles data attr, base transition here */
.btn-magnetic { transform: translate(var(--mx, 0), var(--my, 0)); }

/* Responsive nav collapse */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .header-actions .btn-primary { display: none; }
}
@media (min-width: 961px) {
  .mobile-nav { display: none; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 20px; }
  .brand-word { font-size: 17px; }
  .brand-mark { width: 32px; }
}
