/* ============================================================
   TupiSec — design tokens (light / corporate)
   ============================================================ */
:root{
  --bg: #ffffff;
  --bg-soft: #f6f8f7;
  --surface: #ffffff;
  --border: rgba(16,32,26,0.09);
  --border-strong: rgba(16,32,26,0.16);

  --green: #17864c;
  --green-deep: #0d5c34;
  --green-tint: #e8f5ee;
  --gold: #a97c24;
  --gold-deep: #7c5a19;
  --gold-tint: #faf1de;

  --text: #142019;
  --muted: #55645c;
  --muted-2: #8b968f;

  --line: rgba(16,32,26,0.10);

  --font-display: 'Space Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --wrap: 1180px;
  --radius: 14px;
  --radius-sm: 8px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  color: var(--text);
}

p{ margin: 0 0 1em; color: var(--muted); }

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

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

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

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

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

/* ============================================================
   Scroll-linked environment layers — IT scenery dissolves into
   OT scenery as the page scrolls. Driven by script.js, which sets
   opacity + a light parallax offset on #envIt / #envOt.
   ============================================================ */
.env-layers{
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.env-layer{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  will-change: transform, opacity;
}
.env-it{ opacity: 1; }
.env-ot{ opacity: 0; }

.env-grid path{
  stroke: var(--line);
  stroke-width: 1;
}
.env-nodes rect,
.env-nodes circle{
  fill: none;
  stroke: rgba(23,134,76,0.16);
  stroke-width: 2;
}
.env-nodes line{
  stroke: rgba(23,134,76,0.14);
  stroke-width: 1.5;
}
.env-connector{
  fill: none;
  stroke: rgba(169,124,36,0.16);
  stroke-width: 1.5;
  stroke-dasharray: 3 7;
}
.env-ot .env-nodes rect,
.env-ot .env-nodes circle{
  stroke: rgba(169,124,36,0.18);
}
.env-ot .env-connector{
  stroke: rgba(23,134,76,0.16);
}

/* ============================================================
   Floating tags — small technical keywords that drift gently
   in place, scattered within specific sections.
   ============================================================ */
.floating-tags{
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.ftag{
  position: absolute;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--green-tint);
  color: var(--green-deep);
  border: 1px solid rgba(23,134,76,0.14);
  animation: float-bob 7s ease-in-out infinite;
  opacity: 0.9;
}
.ftag:nth-child(even){
  background: var(--gold-tint);
  color: var(--gold-deep);
  border-color: rgba(169,124,36,0.16);
}
.ft-1{ top: 14%; left: 6%;  animation-duration: 7.5s; }
.ft-2{ top: 68%; left: 10%; animation-duration: 8.5s; animation-delay: -2s; }
.ft-3{ top: 22%; left: 84%; animation-duration: 6.5s; animation-delay: -4s; }
.ft-4{ top: 78%; left: 80%; animation-duration: 9s;   animation-delay: -1s; }
.ft-5{ top: 46%; left: 4%;  animation-duration: 7s;   animation-delay: -3s; }
.ft-6{ top: 8%;  left: 46%; animation-duration: 8s;   animation-delay: -5s; }
.ft-7{ top: 60%; left: 90%; animation-duration: 7.8s; animation-delay: -2.5s; }

@keyframes float-bob{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-14px); }
}

@media (prefers-reduced-motion: reduce){
  .ftag{ animation: none; }
}

@media (max-width: 720px){
  .floating-tags{ display: none; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn-primary{
  background: var(--green);
  color: #fff;
}
.btn-primary:hover{
  background: var(--green-deep);
  box-shadow: 0 8px 24px rgba(23,134,76,0.22);
  transform: translateY(-1px);
}
.btn-ghost{
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover{
  border-color: var(--green);
  color: var(--green-deep);
  background: var(--green-tint);
}
.btn-small{ padding: 10px 18px; font-size: 13px; }

/* ============================================================
   Header
   ============================================================ */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand-mark{ height: 40px; width: auto; }
.brand-mark.small{ height: 32px; }
.main-nav{
  display: flex;
  gap: 32px;
  margin-left: auto;
  margin-right: 32px;
}
.main-nav a{
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.15s ease;
}
.main-nav a:hover{ color: var(--green); }
.header-cta{ flex-shrink: 0; }
.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span{
  display: block;
  height: 1.5px;
  margin: 0 8px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ============================================================
   Hero
   ============================================================ */
.hero{
  position: relative;
  padding: 96px 0 72px;
  overflow: hidden;
}
.hero-inner{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.eyebrow-dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(23,134,76,0.35); }
  50%{ box-shadow: 0 0 0 6px rgba(23,134,76,0); }
}
.hero h1{
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin-bottom: 24px;
}
.text-accent{ color: var(--green); font-style: italic; }
.hero-sub{
  font-size: 17px;
  max-width: 46ch;
  margin-bottom: 32px;
}
.hero-actions{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.hero-tags{
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-tags span{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted-2);
  padding-left: 14px;
  position: relative;
}
.hero-tags span::before{
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 1px;
}

/* --- Hero visual: IT/OT convergence diagram (signature element) --- */
.hero-visual{
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.converge-diagram{ width: 100%; max-width: 420px; overflow: visible; }
.converge-path{
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
}
.converge-packet{
  fill: var(--gold);
  filter: drop-shadow(0 0 5px rgba(169,124,36,0.45));
}
.node rect,
.node circle.node-body{
  fill: var(--bg);
  stroke: var(--green);
  stroke-width: 1.6;
}
.node line{ stroke: var(--green); stroke-width: 1.4; stroke-linecap: round; }
.node .node-dot{ fill: var(--green); stroke: none; }
.node text{
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--muted);
  letter-spacing: 0.08em;
}
.node-pulse{
  fill: none;
  stroke: var(--green);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: node-pulse 3.2s ease-out infinite;
}
.node-ot .node-pulse{ animation-delay: 1.6s; }
@keyframes node-pulse{
  0%{ opacity: 0.45; transform: scale(0.7); }
  70%{ opacity: 0; transform: scale(1.25); }
  100%{ opacity: 0; transform: scale(1.25); }
}
.visual-label{
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-2);
  padding: 0 12px;
}
@media (prefers-reduced-motion: reduce){ .node-pulse{ animation: none; } }

/* ============================================================
   Ticker
   ============================================================ */
.ticker{
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-soft);
  padding: 14px 0;
}
.ticker-track{
  display: flex;
  gap: 18px;
  width: max-content;
  animation: ticker-scroll 28s linear infinite;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.ticker-track span:nth-child(odd){ color: var(--green); }
@keyframes ticker-scroll{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce){ .ticker-track{ animation: none; } }

/* ============================================================
   Section shared
   ============================================================ */
section{ position: relative; padding: 96px 0; z-index: 1; }
.section-eyebrow{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold-deep);
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}
section h2{
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  max-width: 18ch;
  margin-bottom: 48px;
}

/* ============================================================
   Serviços — cards
   ============================================================ */
.cards-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: 0 1px 2px rgba(16,32,26,0.03);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover{
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(16,32,26,0.07);
}
.card-tag{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  border: 1px solid rgba(23,134,76,0.22);
  background: var(--green-tint);
  padding: 4px 9px;
  border-radius: 5px;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.card h3{ font-size: 1.15rem; margin-bottom: 10px; }
.card p{ font-size: 14.5px; margin-bottom: 0; }

/* ============================================================
   Método — timeline
   ============================================================ */
.metodo{ background: var(--bg-soft); }
.timeline{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}
.timeline::before{
  content: '';
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}
.timeline-step{ position: relative; padding: 0 20px 0 0; }
.step-index{
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #fff;
  background: var(--gold);
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.timeline-step h3{ font-size: 1.1rem; }
.timeline-step p{ font-size: 14px; }

/* ============================================================
   Sobre
   ============================================================ */
.sobre-inner{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 56px;
  align-items: center;
}
.sobre-copy p{ font-size: 15.5px; max-width: 52ch; }
.sobre-visual{
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.sobre-visual::before{
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--green-tint) 0%, transparent 72%);
}
.sobre-mark{
  width: 220px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   Contato
   ============================================================ */
.contato{ background: var(--bg-soft); }
.contato-inner{
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
}
.contato-copy h2{ max-width: 16ch; }
.contato-copy p{ max-width: 40ch; }

.contact-form{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 1px 2px rgba(16,32,26,0.03);
}
.form-row{ display: flex; flex-direction: column; gap: 8px; }
.form-row-full{ grid-column: 1 / -1; }
.form-row label{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.form-row input,
.form-row select,
.form-row textarea{
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  resize: vertical;
  transition: border-color 0.15s ease;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus{
  border-color: var(--green);
  outline: none;
}
.form-row select{ cursor: pointer; }
.form-submit{ grid-column: 1 / -1; margin-top: 4px; width: fit-content; }
.form-status{
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green-deep);
  min-height: 1.2em;
  margin: 0;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer{
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg);
}
.footer-inner{
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-tag{ font-size: 13.5px; color: var(--muted-2); margin: 0; }
.footer-nav{ display: flex; gap: 22px; margin-left: auto; }
.footer-nav a{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.footer-nav a:hover{ color: var(--green); }
.footer-copy{
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-2);
  margin: 12px 0 0;
}

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px){
  .hero-inner{ grid-template-columns: 1fr; }
  .hero-visual{ height: 300px; order: -1; }
  .sobre-inner{ grid-template-columns: 1fr; }
  .contato-inner{ grid-template-columns: 1fr; }
  .timeline{ grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
  .timeline::before{ display: none; }
}

@media (max-width: 720px){
  .main-nav{ display: none; }
  .header-cta{ display: none; }
  .nav-toggle{ display: flex; }
  .contact-form{ grid-template-columns: 1fr; padding: 24px; }
  section{ padding: 64px 0; }
  .hero{ padding: 64px 0 48px; }

  .main-nav.is-open{
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid var(--border);
    padding: 20px 28px;
    gap: 18px;
  }
}
