/* ============================================================
   TECNOLOGÍAS BIOENERGÉTICAS — Design Tokens
   Híbrida editorial + tech sutil
   ============================================================ */

:root {
  /* ---------- COLOR ---------- */
  /* Primario — azul petróleo profundo, refinado del logo */
  --tb-ink:        #0E1B26;   /* texto principal, casi negro azulado */
  --tb-deep:       #143049;   /* azul firma de marca */
  --tb-blue:       #1D4A68;   /* azul medio (del logo original) */
  --tb-blue-soft:  #3D6B89;   /* azul descansado */

  /* Acento — dorado mostaza afinado (menos saturado, más lujo) */
  --tb-gold:       #C9A646;
  --tb-gold-soft:  #D9BD6A;
  --tb-gold-deep:  #9A7F2E;

  /* Neutros cálidos — papel editorial */
  --tb-paper:      #FAF7F1;   /* fondo principal */
  --tb-paper-2:    #F4EFE6;   /* sección alternativa */
  --tb-paper-3:    #ECE6D8;   /* divider tones */
  --tb-line:       #D9D2C2;
  --tb-line-soft:  #E8E2D3;
  --tb-mute:       #6B6558;
  --tb-mute-2:     #93897A;

  /* Estados / utility */
  --tb-white:      #FFFFFF;
  --tb-black:      #000000;

  /* ---------- TYPOGRAPHY ---------- */
  --tb-serif:  "Newsreader", "Source Serif Pro", Georgia, serif;
  --tb-sans:   "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --tb-mono:   "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Fluid display sizes */
  --fs-display:   clamp(56px, 7.6vw, 132px);
  --fs-h1:        clamp(40px, 4.8vw, 76px);
  --fs-h2:        clamp(28px, 3.2vw, 48px);
  --fs-h3:        clamp(22px, 2.2vw, 32px);
  --fs-lead:      clamp(18px, 1.4vw, 22px);
  --fs-body:      16px;
  --fs-small:     14px;
  --fs-eyebrow:   11px;
  --fs-cap:       12px;

  /* ---------- SPACING & RADII ---------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 144px;

  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
  --r-pill: 999px;

  /* ---------- GRID ---------- */
  --container: 1320px;
  --gutter: 24px;

  /* ---------- MOTION ---------- */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--tb-paper);
  color: var(--tb-ink);
  font-family: var(--tb-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--tb-deep); color: var(--tb-paper); }

/* ============================================================
   TYPE SYSTEM
   ============================================================ */
.tb-serif { font-family: var(--tb-serif); font-optical-sizing: auto; }
.tb-sans  { font-family: var(--tb-sans); }
.tb-mono  { font-family: var(--tb-mono); }

.tb-display {
  font-family: var(--tb-serif);
  font-weight: 380;
  font-size: var(--fs-display);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-style: normal;
}
.tb-display em {
  font-style: italic;
  font-weight: 320;
  color: var(--tb-deep);
}

.tb-h1 {
  font-family: var(--tb-serif);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.tb-h2 {
  font-family: var(--tb-serif);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.tb-h3 {
  font-family: var(--tb-serif);
  font-weight: 460;
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.tb-lead {
  font-family: var(--tb-sans);
  font-size: var(--fs-lead);
  line-height: 1.45;
  font-weight: 380;
  letter-spacing: -0.005em;
  color: var(--tb-ink);
}
.tb-body {
  font-family: var(--tb-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  color: var(--tb-ink);
}
.tb-small {
  font-family: var(--tb-sans);
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--tb-mute);
}
.tb-eyebrow {
  font-family: var(--tb-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tb-mute);
}
.tb-cap {
  font-family: var(--tb-mono);
  font-size: var(--fs-cap);
  letter-spacing: 0.04em;
  color: var(--tb-mute);
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.tb-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.tb-divider {
  height: 1px;
  background: var(--tb-line);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  font-family: var(--tb-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--r-md);
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.tb-btn--primary {
  background: var(--tb-deep);
  color: var(--tb-paper);
}
.tb-btn--primary:hover {
  background: var(--tb-ink);
}
.tb-btn--gold {
  background: var(--tb-gold);
  color: var(--tb-deep);
}
.tb-btn--gold:hover {
  background: var(--tb-gold-soft);
}
.tb-btn--ghost {
  background: transparent;
  color: var(--tb-deep);
  border: 1px solid var(--tb-line);
}
.tb-btn--ghost:hover {
  border-color: var(--tb-deep);
}
.tb-btn .arrow {
  width: 14px; height: 10px;
  display: inline-block;
  transition: transform .25s var(--ease);
}
.tb-btn:hover .arrow { transform: translateX(4px); }

/* ============================================================
   SCIENTIFIC PLACEHOLDER (rayado + label)
   ============================================================ */
.tb-placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 6px,
      rgba(20, 48, 73, 0.04) 6px 7px
    ),
    var(--tb-paper-2);
  border: 1px solid var(--tb-line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tb-placeholder--dark {
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 6px,
      rgba(255,255,255,0.05) 6px 7px
    ),
    var(--tb-deep);
  border-color: rgba(255,255,255,.1);
  color: var(--tb-paper);
}
.tb-placeholder__label {
  position: absolute;
  top: 12px; left: 12px;
  font-family: var(--tb-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tb-mute);
  background: var(--tb-paper);
  padding: 4px 8px;
  border: 1px solid var(--tb-line);
}
.tb-placeholder--dark .tb-placeholder__label {
  background: var(--tb-deep);
  color: var(--tb-gold-soft);
  border-color: rgba(255,255,255,.15);
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--tb-paper-2); }
::-webkit-scrollbar-thumb { background: var(--tb-line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--tb-mute-2); }

/* ============================================================
   RESPONSIVE — Mobile + tablet
   ============================================================ */

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

/* Default — hide burger on desktop */
.tb-nav-burger { display: none !important; }

/* TABLET — 1024px y menos */
@media (max-width: 1024px) {
  :root {
    --gutter: 20px;
  }
  .tb-nav-brand span:first-child { font-size: 15px !important; }
  .tb-nav-brand span:last-child { font-size: 8.5px !important; }
}

/* MOBILE LARGE — 900px y menos */
@media (max-width: 900px) {
  :root {
    --gutter: 18px;
  }

  /* Hamburger menu visible, links/CTA del nav ocultos */
  .tb-nav-links, .tb-nav-cta { display: none !important; }
  .tb-nav-burger { display: inline-flex !important; }
  .tb-nav-brand span:last-child { display: none !important; }
  .tb-nav-brand span:first-child { font-size: 14px !important; }

  /* Nuke todas las grillas multi-columna a 1 columna */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Padding vertical de secciones reducido */
  section[style*="120px 0"],
  section[style*="100px 0"] {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
  }
  section[style*="80px 0 120px"],
  section[style*="80px 0 100px"],
  section[style*="80px 0 60px"] {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  /* Cards interiores con menos padding */
  [style*="padding: 56px"] { padding: 32px !important; }
  [style*="padding: 48px"] { padding: 28px !important; }
  [style*="padding: 40px 32px"] { padding: 28px 24px !important; }
  [style*="padding: \"48px\""] { padding: 28px !important; }

  /* Heros: alturas mínimas reducidas */
  [style*="minHeight: 480"],
  [style*="min-height: 480"] { min-height: 0 !important; }
  [style*="minHeight: 360"],
  [style*="min-height: 360"] { min-height: 0 !important; }
  [style*="minHeight: 340"],
  [style*="min-height: 340"] { min-height: 0 !important; }

  /* Tipografía display / h1 / h2 más chica */
  .tb-display { font-size: clamp(40px, 11vw, 64px) !important; line-height: 1.02 !important; }
  .tb-h1 { font-size: clamp(32px, 8vw, 44px) !important; }
  .tb-h2 { font-size: clamp(24px, 6vw, 32px) !important; }

  /* Nav: ocultar items en móvil, dejar solo logo + CTA */
  nav[role="navigation"], nav { gap: 12px !important; }
  nav .tb-nav-links { display: none !important; }

  /* Imágenes hero más bajas */
  .tb-placeholder { min-height: 280px !important; }

  /* Stats grid (4 columnas) → 2 columnas */
  [style*="grid-template-columns: \"1fr 1fr 1fr 1fr\""],
  [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Botones y CTAs en móvil ocupan ancho disponible o se apilan */
  .tb-btn { padding: 14px 20px !important; font-size: 14px !important; }

  /* Footer: stack columnas */
  footer [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  footer > div > div:last-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
}

/* MOBILE SMALL — 540px y menos */
@media (max-width: 540px) {
  :root {
    --gutter: 16px;
  }

  /* La grilla de áreas (8 cards) en home pasa a 1 columna */
  [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Form fields email + telefono apilados */
  form [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Botones del formulario apilados a ancho completo */
  form .tb-btn { width: 100%; justify-content: center; }

  .tb-display { font-size: clamp(36px, 12vw, 52px) !important; }
  .tb-h1 { font-size: clamp(28px, 8vw, 38px) !important; }

  /* Eyebrow + section number alineados */
  [style*="grid-template-columns: \"180px 1fr\""],
  [style*="grid-template-columns: \"auto 1fr auto\""] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}
