/* ==========================================================================
   Island Engenharia — estilos de assinatura e base
   Complementa o Tailwind (CDN): tudo que é essencial ao tema vive aqui,
   para que o site continue escuro e legível mesmo se o CDN falhar.
   ========================================================================== */

/* ── Tokens (espelham o tailwind.config inline) ─────────────────────────── */
:root {
  --ink: #0A0A0A;
  --surface: #141414;
  --card: #1F1F1F;
  --gold: #D4AF37;
  --gold-hover: #C5A059;
  --body: #D1D5DB;
  --meta: #9CA3AF;
  --err: #F87171;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Archivo, system-ui, "Segoe UI", sans-serif;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html { background: var(--ink); }
body { background: var(--ink); color: var(--body); }

::selection { background: rgba(212, 175, 55, 0.32); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--card); border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-hover); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.skip-link {
  position: fixed; top: -64px; left: 16px; z-index: 100;
  background: var(--gold); color: var(--ink);
  padding: 0.65rem 1rem; font: 600 0.875rem/1 var(--sans);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* Âncoras vs. header fixo — com e sem JS */
section[id], header[id] { scroll-margin-top: 6.5rem; }

/* ── Botões (independentes do CDN) ──────────────────────────────────────── */
.btn-gold,
.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font: 700 0.875rem/1 var(--sans); letter-spacing: 0.03em;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
              transform 0.25s var(--ease);
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-hover); box-shadow: 0 0 20px rgba(212, 175, 55, 0.25); transform: translateY(-1px); }
.btn-outline { border-color: rgba(212, 175, 55, 0.45); color: var(--gold); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-hover); box-shadow: 0 0 20px rgba(212, 175, 55, 0.15); }
button.btn-gold[disabled] { opacity: 0.55; cursor: wait; transform: none; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header { transition: background 0.3s var(--ease), border-color 0.3s var(--ease); }
.site-header.is-scrolled { background: rgba(10, 10, 10, 0.96); border-color: rgba(212, 175, 55, 0.22); }

.nav-link.is-current { color: var(--gold); }

/* ── Reveals (gate .js: sem JavaScript, tudo visível) ───────────────────── */
.js [data-animate] {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js [data-animate].in-view { opacity: 1; transform: none; }

/* ── Assinatura: prancha de desenho técnico ─────────────────────────────── */
.dim-rule {
  position: relative; width: 100%; height: 9px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.45);
}
.dim-rule::before,
.dim-rule::after {
  content: ""; position: absolute; bottom: 0;
  width: 1px; height: 9px; background: rgba(212, 175, 55, 0.45);
}
.dim-rule::before { left: 0; }
.dim-rule::after { right: 0; }

/* ── Assinatura: grid topográfico do hero ───────────────────────────────── */
.hero-grid {
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(640px 320px at 82% 18%, rgba(212, 175, 55, 0.12), transparent 70%),
    radial-gradient(520px 280px at 8% 85%, rgba(212, 175, 55, 0.07), transparent 70%);
}

/* Traçado do alinhamento (polilinha dourada do hero) */
.align-draw {
  stroke-dasharray: 2600; stroke-dashoffset: 2600;
  animation: draw 2.4s var(--ease) 0.3s forwards;
}
.align-draw--echo { stroke-dasharray: 5 9; stroke-dashoffset: 0; animation: none; }
.align-dot { opacity: 0; animation: dot-in 0.5s ease 0.9s forwards; }
.align-dot--d2 { animation-delay: 1.5s; }
.align-dot--d3 { animation-delay: 2.1s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot-in { to { opacity: 1; } }

/* ── Placeholders de imagem ─────────────────────────────────────────────── */
.img-ph {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.6rem; min-height: 120px;
  background-color: var(--surface);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 45%, rgba(212, 175, 55, 0.04));
  border: 1px dashed rgba(212, 175, 55, 0.45);
  color: var(--meta);
}
.img-ph::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
}
.img-ph-tag {
  position: relative;
  font: 500 11px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(212, 175, 55, 0.78); text-align: center; padding: 0 1rem;
}
.img-ph svg { position: relative; color: rgba(212, 175, 55, 0.5); }

/* ── Assinatura: rail de eixo (marcos quilométricos) ────────────────────── */
.k-rail {
  position: fixed; left: 18px; top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; align-items: stretch; gap: 10px; height: 230px;
}
.k-rail-track { position: relative; width: 1px; background: var(--card); }
.k-rail-fill { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: var(--gold); }
.k-rail-marks { list-style: none; display: flex; flex-direction: column; justify-content: space-between; margin: 0; padding: 0; }
.k-rail-marks a {
  display: flex; align-items: center; gap: 8px;
  font: 500 10px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--meta); text-decoration: none; opacity: 0.6;
  transition: opacity 0.25s, color 0.25s;
}
.k-rail-marks a::before { content: ""; width: 14px; height: 1px; background: var(--card); transition: width 0.25s, background 0.25s; }
.k-rail-marks a:hover { opacity: 1; color: var(--body); }
.k-rail-marks a[aria-current="true"] { color: var(--gold); opacity: 1; }
.k-rail-marks a[aria-current="true"]::before { width: 24px; background: var(--gold); }
@media (max-width: 1279.98px) { .k-rail { display: none !important; } }

/* ── Faixa CTA ───────────────────────────────────────────────────────────── */
.cta-band { background-color: rgba(212, 175, 55, 0.04); }
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
}
.cta-band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(460px 220px at 50% 0%, rgba(212, 175, 55, 0.13), transparent 70%);
}
.cta-band > * { position: relative; z-index: 1; }

/* ── Botão flutuante do WhatsApp ────────────────────────────────────────── */
.whats-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
.whats-fab:hover {
  background: #1FBE5A;
  transform: translateY(-3px);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25), 0 10px 28px rgba(0, 0, 0, 0.5);
}
.whats-fab svg { display: block; }

/* ── Rodapé ──────────────────────────────────────────────────────────────── */
.footer-label {
  font: 500 11px/1 var(--mono); letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold);
}

/* ── Formulário ──────────────────────────────────────────────────────────── */
.field-label {
  display: block; margin-bottom: 0.5rem;
  font: 500 11px/1 var(--mono); letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--meta);
}
.field-input {
  width: 100%;
  background: var(--ink); border: 1px solid var(--card); border-radius: 2px;
  color: #fff; padding: 0.75rem 1rem;
  font: 400 0.9rem/1.45 var(--sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input::placeholder { color: rgba(156, 163, 175, 0.5); }
.field-input:focus { outline: none; border-color: rgba(212, 175, 55, 0.6); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35); }
.field-input[aria-invalid="true"] { border-color: rgba(248, 113, 113, 0.55); }

select.field-input {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.5rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23D4AF37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 14px;
}

.field-err { display: block; margin-top: 0.45rem; font-size: 12px; line-height: 1.45; color: var(--err); }
.form-msg { margin-bottom: 1rem; border: 1px solid; padding: 0.8rem 1rem; font-size: 13px; line-height: 1.55; }
.form-msg--err { border-color: rgba(248, 113, 113, 0.4); color: #FCA5A5; background: rgba(248, 113, 113, 0.06); }
.form-msg a { text-underline-offset: 3px; }

/* Honeypot: fora da tela e do fluxo */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ── Movimento reduzido ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .align-draw, .align-dot { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .js [data-animate] { opacity: 1; transform: none; transition: none; }
  .btn-gold, .btn-outline, .k-rail-fill, .site-header, .whats-fab { transition: none; }
}
