/* ─────────────────────────────────────────────────────────────────────────
   Lonetti — Precision Liquid Calibration Equipment
   Design tokens + global resets + shared utility classes
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Brand */
  --red: #C0392B;
  --red-dark: #96281B;
  --red-deep: #6E1810;
  --red-soft: rgba(192, 57, 43, 0.08);

  /* Dark surfaces */
  --navy: #1A2744;
  --navy-2: #131E36;
  --navy-3: #0E1628;
  --charcoal: #2C3E50;
  --ink: #0B0F1A;

  /* Neutrals */
  --steel: #7F8C8D;
  --steel-2: #A8B0B1;
  --line: #E4E7EB;
  --line-2: #D5DBE0;
  --bg: #FFFFFF;
  --bg-alt: #F6F7F9;
  --bg-mid: #EAECEE;
  --text: #1C1C1E;
  --text-2: #4A5563;
  --text-3: #6B7480;

  /* Type */
  --f-display: "Barlow", "Inter", system-ui, -apple-system, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale */
  --maxw: 1280px;
  --gutter: 32px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Density */
  --section-py: 112px;
}

[data-density="dense"] {
  --section-py: 80px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ─── Layout ─────────────────────────────────────────────────────────── */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { padding: var(--section-py) 0; }

/* ─── Type ───────────────────────────────────────────────────────────── */
.h1, h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
}
.h2, h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.h3 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--red);
}
.eyebrow.on-dark { color: #FF6B5A; }
.eyebrow.muted { color: var(--text-3); }
.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 60ch;
}
.mono {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

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

.btn-ghost-light {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.7); }

.btn-ghost-dark {
  border-color: var(--line-2);
  color: var(--text);
}
.btn-ghost-dark:hover { background: var(--bg-alt); border-color: var(--charcoal); }

.btn-sm {
  padding: 9px 14px;
  font-size: 13px;
}

.btn .ar { transition: transform 200ms ease; }
.btn:hover .ar { transform: translateX(3px); }

/* ─── Cards & motifs ─────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.card:hover {
  border-color: var(--charcoal);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -24px rgba(26,39,68,0.35);
}

.hr-line {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}
.hr-line-dark {
  height: 1px;
  background: rgba(255,255,255,0.12);
  border: 0;
  margin: 0;
}

/* corner ticks — small industrial detail used at the corners of feature cards */
.corner-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.corner-ticks::before, .corner-ticks::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--red);
}
.corner-ticks::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.corner-ticks::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ─── Tag / chip ─────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  background: #fff;
}
.chip.on-dark {
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.04);
}
.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--red);
}

/* ─── Dark mode surface ──────────────────────────────────────────────── */
.surface-dark {
  background: var(--navy);
  color: #fff;
}
.surface-dark .lede { color: rgba(255,255,255,0.7); }

[data-surface="charcoal"] .surface-dark { background: var(--charcoal); }
[data-surface="ink"]      .surface-dark { background: var(--ink); }

/* ─── Misc ───────────────────────────────────────────────────────────── */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
}

.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;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ═════════════════════════════════════════════════════════════════════
   MOBILE — comprehensive responsive layer
   Heavy use of inline-style attribute selectors + !important to override
   the React inline styles used throughout the JSX (grid templates, gaps,
   min-heights, fixed paddings, sticky positions, etc.).
   ═════════════════════════════════════════════════════════════════════ */

/* ─── Tablet ≤ 1024 ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --gutter: 28px;
    --section-py: 80px;
  }

  /* Big multi-col grids → 2-col on tablet */
  [style*="grid-template-columns: repeat(6, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* 2-fr split layouts compress */
  [style*="gap: 80px"] { gap: 48px !important; }
}

/* ─── Mobile ≤ 768 ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --gutter: 18px;
    --section-py: 56px;
  }

  html, body { font-size: 15px; }

  /* Type scale tighten */
  .h1, h1 { font-size: clamp(34px, 9vw, 44px) !important; letter-spacing: -0.022em; }
  .h2, h2 { font-size: clamp(26px, 7vw, 34px) !important; }
  .h3       { font-size: 18px !important; }
  .lede     { font-size: 16px !important; line-height: 1.55 !important; }

  /* Section padding */
  section { padding: var(--section-py) 0 !important; }

  /* ─── GRIDS: collapse to single column ───────────────────────── */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Compact stat strips & 4-up rows stay 2-col on mobile (looks better) */
  [style*="grid-template-columns: repeat(4, 1fr)"].keep-2col,
  .stat-strip [style*="grid-template-columns"],
  [data-mobile-cols="2"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ─── BIG GAPS: reduce ─────────────────────────────────────────── */
  [style*="gap: 80px"]  { gap: 32px !important; }
  [style*="gap: 64px"]  { gap: 28px !important; }
  [style*="gap: 56px"]  { gap: 24px !important; }
  [style*="gap: 48px"]  { gap: 24px !important; }
  [style*="gap: 40px"]  { gap: 20px !important; }
  [style*="gap: 36px"]  { gap: 20px !important; }
  [style*="gap: 32px"]  { gap: 18px !important; }
  [style*="gap: 28px"]  { gap: 16px !important; }
  [style*="gap: 24px"]  { gap: 14px !important; }

  /* ─── MIN-HEIGHTS: scale down (preserve room for absolute-positioned images) ─── */
  [style*="min-height: 560px"] { min-height: 280px !important; }
  [style*="min-height: 520px"] { min-height: 280px !important; }
  [style*="min-height: 480px"] { min-height: 260px !important; }
  [style*="min-height: 460px"] { min-height: 240px !important; }
  [style*="min-height: 280px"] { min-height: 200px !important; }

  /* ─── PADDINGS: scale down ─────────────────────────────────────── */
  [style*="padding: 120px"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  [style*="padding: 96px 0"], [style*="padding: 80px 0"] {
    padding-top: 56px !important; padding-bottom: 56px !important;
  }
  [style*="padding: 36px 0"] { padding-top: 28px !important; padding-bottom: 28px !important; }
  [style*="padding-top: 80px"]  { padding-top: 48px !important; }
  [style*="padding-top: 96px"]  { padding-top: 56px !important; }
  [style*="padding-top: 100px"] { padding-top: 56px !important; }
  [style*="padding-top: 120px"] { padding-top: 64px !important; }
  [style*="padding-top: 64px"]  { padding-top: 40px !important; }
  [style*="padding-bottom: 80px"]  { padding-bottom: 48px !important; }
  [style*="padding-bottom: 96px"]  { padding-bottom: 56px !important; }
  [style*="padding-bottom: 100px"] { padding-bottom: 56px !important; }
  [style*="padding-bottom: 120px"] { padding-bottom: 64px !important; }

  /* Inner-cell padding tightening */
  [style*="padding: 40px 28px"],
  [style*="padding: 36px 32px"],
  [style*="padding: 32px 28px"],
  [style*="padding: 32px 24px"],
  [style*="padding: 28px 32px"] { padding: 24px 20px !important; }

  /* Form / card padding */
  [style*="padding: 40px"] { padding: 24px !important; }
  [style*="padding: 36px"] { padding: 22px !important; }

  /* Margin-top reductions for stacked rhythm */
  [style*="margin-top: 96px"] { margin-top: 48px !important; }
  [style*="margin-top: 64px"] { margin-top: 36px !important; }
  [style*="margin-top: 56px"] { margin-top: 32px !important; }
  [style*="margin-top: 40px"] { margin-top: 24px !important; }

  /* ─── DIVIDER FLIP: right/left borders → bottom borders ────────── */
  [style*="border-right: 1px solid"],
  [style*="border-left: 1px solid"] {
    border-right: 0 !important;
    border-left: 0 !important;
  }
  /* Add bottom divider between stacked cells in inline grids */
  [style*="grid-template-columns"] > *:not(:last-child) {
    /* default — works for light surfaces */
  }
  /* Light surface dividers */
  section:not(.surface-dark) [style*="grid-template-columns"] > * + * {
    /* relying on cards' own borders; no global divider to avoid double-lines */
  }
  /* Dark surface — add top divider between stacked cells */
  .surface-dark [style*="grid-template-columns"] > * + * {
    border-top: 1px solid rgba(255,255,255,0.1) !important;
  }
  /* But not for the flat trust-bar style grids; we use border-bottom instead */
  .surface-dark [style*="border-top: 1px solid rgba(255,255,255"] > * + * {
    border-top: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  }

  /* ─── STICKY: disable on mobile (collapsed layout) ─────────────── */
  [style*="position: sticky"] {
    position: static !important;
    top: auto !important;
  }

  /* ─── ASPECT RATIOS that hurt mobile ──────────────────────────── */
  [style*="aspect-ratio: 4/5"]  { aspect-ratio: 4/3 !important; }
  [style*="aspect-ratio: 3/4"]  { aspect-ratio: 4/3 !important; }
  [style*="aspect-ratio: 5/4"]  { aspect-ratio: 4/3 !important; }
  [style*="aspect-ratio: 16/10"]{ aspect-ratio: 16/9 !important; }

  /* ─── ABSOLUTE-POSITIONED CALLOUTS / decorations: hide ─────────── */
  /* Engineering diagram callouts in HeroDiagram + product photo callouts */
  .hide-on-mobile { display: none !important; }

  /* The big asymmetric LONETTI wordmark — keep but smaller */
  [style*="font-size: clamp(120px"] {
    font-size: clamp(72px, 18vw, 120px) !important;
  }

  /* ─── HERO ADJUSTMENTS ─────────────────────────────────────────── */
  /* Hero trust bar — keep 4 stats but tighter */
  .hero-trust-bar { margin-top: 40px !important; }
  .hero-trust-bar [style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
  }
  .hero-trust-bar [style*="grid-template-columns"] > * {
    padding: 18px 14px !important;
  }
  .hero-trust-bar [style*="grid-template-columns"] > *:nth-child(2) {
    border-left: 1px solid rgba(255,255,255,0.1) !important;
  }
  .hero-trust-bar [style*="grid-template-columns"] > *:nth-child(3),
  .hero-trust-bar [style*="grid-template-columns"] > *:nth-child(4) {
    border-top: 1px solid rgba(255,255,255,0.1) !important;
  }
  .hero-trust-bar [style*="grid-template-columns"] > *:nth-child(4) {
    border-left: 1px solid rgba(255,255,255,0.1) !important;
  }
  .hero-trust-bar [style*="font-size: 32px"],
  .hero-trust-bar [style*="font-size: 28px"] {
    font-size: 24px !important;
  }

  /* Product-page hero quick-specs strip → 2-col grid */
  .product-quickspecs [style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
  }
  .product-quickspecs > * {
    padding: 14px 10px !important;
  }
  .product-quickspecs [style*="font-size: 22px"] {
    font-size: 18px !important;
  }

  /* About-page big number stats */
  .about-numbers [style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
  }
  .about-numbers [style*="font-size: 80px"] {
    font-size: 48px !important;
  }
  .about-numbers > * { padding: 28px 18px !important; }
  .about-numbers > *:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); }

  /* ─── BUTTONS: full width on mobile ─────────────────────────────── */
  /* Make button rows wrap and primary CTAs expand */
  .btn { padding: 13px 18px; font-size: 13.5px; }

  /* ─── FORMS ───────────────────────────────────────────────────── */
  form { padding: 22px !important; }
  form input, form textarea, form select {
    font-size: 16px !important; /* prevent iOS zoom */
  }

  /* ─── TABLES: scroll horizontally ──────────────────────────────── */
  table { font-size: 13px !important; }
  table td { padding: 14px 16px !important; }

  /* ─── LIGHTBOX ─────────────────────────────────────────────────── */
  [style*="width: min(80vw"] {
    width: calc(100vw - 32px) !important;
  }

  /* ─── TIMELINE (About) ──────────────────────────────────────────── */
  .timeline-row {
    grid-template-columns: 70px 1fr !important;
    gap: 14px !important;
    padding-bottom: 28px !important;
  }
  .timeline-row > .timeline-dot { display: none !important; }
  .timeline-row > :first-child { font-size: 22px !important; }
  .timeline-line { left: 0 !important; }

  /* ─── NAVIGATION (mobile drawer handled in JSX) ─────────────────── */
  .nav-bar { height: 60px !important; }

  /* ─── FOOTER ───────────────────────────────────────────────────── */
  .footer-cols { grid-template-columns: 1fr 1fr !important; gap: 28px 20px !important; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start !important; gap: 16px !important; }
  .footer-certs { flex-wrap: wrap; gap: 12px 16px !important; row-gap: 8px; }

  /* ─── FLOATING WHATSAPP: smaller on mobile ──────────────────────── */
  .float-whatsapp {
    width: 48px !important; height: 48px !important;
    right: 14px !important; bottom: 14px !important;
  }

  /* ─── World map: shorter on mobile ──────────────────────────────── */
  .world-map { aspect-ratio: 4/3 !important; }

  /* ─── SectionHead: when 2-col, the CTA stacks below the title ──── */
  .section-head [style*="align-items: end"] {
    align-items: stretch !important;
  }

  /* Hide cosmetic overflow-y "Cat. 2026" marker etc when crowded — keep visible but small */
  /* (leave as-is; chips are small enough) */

  /* ─── Container left/right safety padding ─────────────────────── */
  .container { padding-left: var(--gutter); padding-right: var(--gutter); }
}

/* ─── Small mobile ≤ 420 ────────────────────────────────────────── */
@media (max-width: 420px) {
  :root { --gutter: 16px; }
  .h1, h1 { font-size: clamp(28px, 8.5vw, 38px) !important; }
  .h2, h2 { font-size: clamp(22px, 6.5vw, 30px) !important; }

  .hero-trust-bar [style*="font-size: 32px"],
  .hero-trust-bar [style*="font-size: 28px"] {
    font-size: 20px !important;
  }
  .hero-trust-bar [style*="grid-template-columns"] > * {
    padding: 14px 10px !important;
  }
  .hero-trust-bar [style*="margin-top"] { margin-top: 8px !important; }

  /* Tighten chip rows */
  .chip { padding: 4px 8px; font-size: 10px; }
}
