/* ============================================================
   Code Zero — Custom Styles
   Complementa Tailwind CSS CDN com tokens, animações e utilitários
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  --bg: #0a0a0b;
  --surface: rgba(255, 255, 255, 0.02);
  --border: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.10);
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #4ade80;
}

/* ---- Base ---- */
html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', system-ui, sans-serif;
  font-feature-settings: 'ss01' on, 'ss02' on, 'cv11' on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(74, 222, 128, 0.35);
  color: #fff;
}

/* ---- Background effects (fixed — zero scroll repaint) ---- */

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Ambient mesh gradient */
.mesh {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 30% at 18% 12%, rgba(74, 222, 128, 0.08), transparent 60%),
    radial-gradient(35% 30% at 82% 22%, rgba(56, 189, 248, 0.05), transparent 60%),
    radial-gradient(45% 35% at 50% 95%, rgba(74, 222, 128, 0.06), transparent 70%);
  filter: blur(30px);
}

/* ---- Scroll reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0ms);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Keyframe animations ---- */

/* Marquee kinetic band */
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
.marquee-track {
  animation: marquee 38s linear infinite;
  will-change: transform;
}

/* Status dot pulse */
@keyframes pulseSoft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(0.9); }
}
.pulse-dot {
  animation: pulseSoft 1.6s ease-in-out infinite;
}

/* Floating card */
@keyframes floatY {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%       { transform: translate3d(0, -6px, 0); }
}
.float-y {
  animation: floatY 4.5s ease-in-out infinite;
}

/* Shimmer accent line */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer-line {
  background: linear-gradient(
    90deg,
    rgba(74, 222, 128, 0) 0%,
    rgba(74, 222, 128, 0.7) 50%,
    rgba(74, 222, 128, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

/* Terminal cursor blink */
@keyframes blink {
  0%, 45%  { opacity: 1; }
  50%, 95% { opacity: 0; }
  100%     { opacity: 1; }
}
.blink {
  animation: blink 1.05s steps(1) infinite;
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--accent);
  color: #052e1a;
  transition:
    transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 200ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 0 0 rgba(74, 222, 128, 0);
}
.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 8px 24px -8px rgba(74, 222, 128, 0.45);
}
.btn-primary:active {
  transform: translateY(1px) scale(0.985);
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  transition:
    transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
    background 200ms ease,
    border-color 200ms ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.22);
}
.btn-ghost:active {
  transform: translateY(1px) scale(0.985);
}

/* ---- Card / surface ---- */
.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 1px 0 rgba(0, 0, 0, 0.4);
  border-radius: 18px;
}

/* ---- Spotlight hover effect on cards ---- */
.spotlight {
  position: relative;
  overflow: hidden;
}
.spotlight::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    rgba(74, 222, 128, 0.18),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 250ms ease;
  pointer-events: none;
  z-index: 0;
}
.spotlight:hover::before {
  opacity: 1;
}
.spotlight > * {
  position: relative;
  z-index: 1;
}

/* ---- FAQ accordion ---- */
details > summary {
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker {
  display: none;
}
details[open] .chev {
  transform: rotate(45deg);
}
.chev {
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
details > .answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 380ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 280ms ease;
}
details[open] > .answer {
  max-height: 600px;
  opacity: 1;
}

/* ---- Scrollbar hide (marquee) ---- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---- Typography utilities ---- */

/* Display headline — tight tracking, strong weight */
.display {
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

/* Mono eyebrow label */
.eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Process step counter */
.step-num {
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* ---- Navigation ---- */
.nav-blur {
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: rgba(10, 10, 11, 0.7);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.nav-blur.scrolled {
  border-bottom-color: var(--border);
}

/* ---- Back to top button ---- */
.back-to-top-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.9);
  transition:
    opacity 250ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 250ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 200ms ease;
}
.back-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  .pulse-dot,
  .float-y,
  .shimmer-line,
  .blink {
    animation: none !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Chat typing indicator */
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-2px); }
}
.typing-dot {
  animation: typingDot 1.2s ease-in-out infinite;
}

/* ─── Hero software mockup animations ─────────────────────────── */
.software-mockup {
  animation: swFloat 7s ease-in-out infinite;
  animation-delay: 1.5s;
}
@keyframes swFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.sw-pulse {
  animation: swPulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(74,222,128,0.7);
}
@keyframes swPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Chart line draws itself in */
.sw-chart-line {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: swDraw 2.6s 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards,
             swPulseStroke 4s 3.4s ease-in-out infinite;
}
@keyframes swDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes swPulseStroke {
  0%, 100% { stroke: #4ade80; filter: drop-shadow(0 0 0 transparent); }
  50%      { stroke: #86efac; filter: drop-shadow(0 0 4px rgba(74,222,128,0.5)); }
}

.sw-chart-area {
  animation: swFadeIn 1.2s 2.4s ease-out forwards;
}
@keyframes swFadeIn {
  to { opacity: 1; }
}

.sw-end-dot {
  opacity: 0;
  animation: swDotIn 0.4s 3s ease-out forwards,
             swDotPulse 1.6s 3.4s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes swDotIn {
  from { opacity: 0; r: 0; }
  to   { opacity: 1; r: 2.5; }
}
@keyframes swDotPulse {
  0%, 100% { r: 2.5; filter: drop-shadow(0 0 0 transparent); }
  50%      { r: 3.2; filter: drop-shadow(0 0 6px rgba(74,222,128,0.7)); }
}

/* ─── FAQ — Editorial numbered design ─────────────────────────── */
.faq-list { display: flex; flex-direction: column; }

.faq-item {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  padding: 28px 0;
  transition: padding 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-item:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}
.faq-item[open] { padding: 32px 0 36px; }

.faq-summary {
  display: grid;
  grid-template-columns: 56px 1fr 32px;
  gap: 20px;
  align-items: start;
  cursor: pointer;
  list-style: none;
  transition: opacity 200ms ease;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::marker { display: none; }
.faq-summary:hover { opacity: 0.85; }

.faq-num {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #52525b;
  padding-top: 6px;
  transition: color 240ms ease;
}
.faq-item:hover .faq-num,
.faq-item[open] .faq-num { color: #4ade80; }

.faq-q {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #fafafa;
  max-width: 52ch;
  margin: 0;
  transition: color 240ms ease;
}
.faq-item[open] .faq-q { color: #ffffff; }

/* Plus → cross toggle (two bars) */
.faq-toggle {
  position: relative;
  width: 22px; height: 22px;
  margin-top: 4px;
  justify-self: end;
}
.faq-toggle-bar {
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 1.5px;
  background: #71717a;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), background 240ms ease;
}
.faq-toggle-bar-2 { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item:hover .faq-toggle-bar { background: #d4d4d8; }
.faq-item[open] .faq-toggle-bar { background: #4ade80; transform: translate(-50%, -50%) rotate(45deg); }
.faq-item[open] .faq-toggle-bar-2 { transform: translate(-50%, -50%) rotate(-45deg); }

/* Answer reveal */
.faq-item .answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 480ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 320ms ease;
  opacity: 0;
  margin-left: 76px;
  margin-right: 52px;
  max-width: 62ch;
}
.faq-item[open] .answer {
  grid-template-rows: 1fr;
  opacity: 1;
}
.faq-a {
  overflow: hidden;
  min-height: 0;
}
.faq-a p {
  padding-top: 18px;
  color: #a1a1aa;
  line-height: 1.7;
  font-size: 0.95rem;
  border-left: 1px solid rgba(74, 222, 128, 0.25);
  padding-left: 22px;
  margin-left: -22px;
}
.faq-a p .font-mono {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.88em;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .faq-summary { grid-template-columns: 36px 1fr 28px; gap: 14px; }
  .faq-q { font-size: 1.1rem; }
  .faq-item .answer { margin-left: 50px; margin-right: 0; }
}

/* ─── Language toggle (PT / EN) ───────────────────────────── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.02);
  font-family: 'Geist Mono', ui-monospace, monospace;
}
.lang-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #71717a;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 9px;
  border-radius: 9999px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
  line-height: 1;
}
.lang-toggle button:hover { color: #d4d4d8; }
.lang-toggle button.is-active {
  background: var(--accent);
  color: #052e1a;
  font-weight: 600;
}
@media (max-width: 480px) {
  .lang-toggle button { padding: 5px 7px; font-size: 10px; }
}
