/* ============================================================================
   AZAPPX — Design System
   Estética: dark refined enterprise (Stripe/Linear/Vercel-grade)
   Coerência total com o cartão de visita (mesma paleta + tipografia + acentos).
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces (dark, layered) */
  --bg-base:        #0a0e1a;
  --bg-elevated:    #0d1424;
  --bg-card:        #111a2e;
  --bg-card-hover:  #142039;

  /* Borders & dividers (translucent for depth) */
  --border-subtle:  rgba(56, 189, 248, 0.10);
  --border-default: rgba(56, 189, 248, 0.18);
  --border-strong:  rgba(56, 189, 248, 0.32);

  /* Text */
  --text-primary:   #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary:  #7c8aa5;
  --text-faint:     #5a6b87;

  /* Brand / accent */
  --accent:         #38bdf8;
  --accent-bright:  #7dd3fc;
  --accent-deep:    #2563eb;
  --accent-glow:    rgba(56, 189, 248, 0.35);

  /* Gradients */
  --gradient-hero:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(56, 189, 248, 0.10), transparent);
  --gradient-card:
    linear-gradient(160deg, var(--bg-card) 0%, var(--bg-elevated) 100%);

  /* Spacing scale (4px base) */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 96px;  --s-10: 128px;

  /* Radii */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-2xl: 32px;

  /* Shadows */
  --shadow-card:  0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --shadow-glow:  0 0 40px -10px var(--accent-glow);

  /* Type scale */
  --fs-xs:   13px;
  --fs-sm:   14px;
  --fs-base: 16px;
  --fs-lg:   18px;
  --fs-xl:   22px;
  --fs-2xl:  28px;
  --fs-3xl:  36px;
  --fs-4xl:  48px;
  --fs-5xl:  64px;
  --fs-6xl:  80px;

  /* Easings */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --content-max: 1200px;
  --content-narrow: 880px;
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.65;
  font-feature-settings: 'cv02', 'cv03', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* Subtle grid pattern that gives the dark surface texture (very faint) */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: clamp(40px, 5.5vw, var(--fs-6xl)); font-weight: 800; letter-spacing: -0.04em; }
h2 { font-size: clamp(32px, 4vw, var(--fs-4xl)); font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
p  { margin: 0; }

.eyebrow {
  font-family: 'Sora', sans-serif;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-4);
}

/* ---------- Layout helpers ---------- */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--s-5); position: relative; z-index: 1; }
.container-narrow { max-width: var(--content-narrow); margin: 0 auto; padding: 0 var(--s-5); position: relative; z-index: 1; }
section { padding: var(--s-9) 0; position: relative; }
@media (max-width: 768px) { section { padding: var(--s-8) 0; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: var(--s-4) var(--s-5);
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s var(--ease-out);
}
.nav-inner {
  max-width: var(--content-max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 22px;
  letter-spacing: -0.02em; color: var(--text-primary);
}
.nav-brand .x { color: var(--accent); }
.nav-links { display: flex; gap: var(--s-6); align-items: center; }
.nav-links a {
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary);
  transition: color 0.2s var(--ease-out);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-cta {
  padding: 10px 18px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--bg-base) !important;
  font-weight: 600; font-size: var(--fs-sm);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.nav-toggle { display: none; }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; flex-direction: column; gap: 5px; padding: 8px; }
  .nav-toggle span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-elevated); padding: var(--s-5);
    border-bottom: 1px solid var(--border-default);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 14px 24px; border-radius: var(--r-md);
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: var(--bg-base);
  box-shadow: 0 4px 20px -4px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-bright); transform: translateY(-2px);
  box-shadow: 0 8px 30px -4px var(--accent-glow);
}
.btn-ghost {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-ghost:hover { background: var(--bg-card); border-color: var(--border-strong); }
.btn .arrow { transition: transform 0.2s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 180px 0 var(--s-9); overflow: hidden;
  background: var(--gradient-hero);
}
.hero-content { position: relative; z-index: 2; }
.hero h1 {
  margin-bottom: var(--s-5);
  background: linear-gradient(180deg, var(--text-primary) 0%, #a5b4d4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  font-size: clamp(17px, 1.7vw, 20px); color: var(--text-secondary);
  max-width: 640px; margin-bottom: var(--s-7); line-height: 1.55;
}
.hero-ctas { display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* Circuit decoration that floats in the hero */
.hero-circuit {
  position: absolute; top: 120px; right: -80px;
  width: 600px; height: 600px; opacity: 0.5;
  pointer-events: none; z-index: 1;
}
.hero-circuit path, .hero-circuit line { stroke: var(--accent); stroke-width: 1; fill: none; }
.hero-circuit circle.dot, .hero-circuit rect.dot { fill: var(--accent); stroke: none; }
.hero-circuit .pulse { animation: circuit-pulse 3s ease-in-out infinite; }
@keyframes circuit-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@media (max-width: 900px) {
  .hero-circuit { right: -200px; opacity: 0.3; }
}

/* ---------- Section header ---------- */
.section-header { margin-bottom: var(--s-8); max-width: 640px; }
.section-header h2 { margin-bottom: var(--s-3); }
.section-header p { color: var(--text-secondary); font-size: var(--fs-lg); }

/* ---------- Pillars (3-col) ---------- */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5);
}
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: all 0.3s var(--ease-out);
}
.pillar:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.pillar-icon {
  width: 44px; height: 44px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--s-4);
}
.pillar-icon svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.pillar h3 { font-size: var(--fs-xl); margin-bottom: var(--s-3); }
.pillar p { color: var(--text-secondary); font-size: var(--fs-base); }

/* ---------- Portfolio ---------- */
.portfolio {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-5);
}
@media (max-width: 1000px) { .portfolio { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .portfolio { grid-template-columns: 1fr; } }

.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--gradient-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
  min-height: 280px;
}
.product-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-bright));
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.product-card:hover {
  transform: translateY(-4px); border-color: var(--border-strong);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.product-card:hover::before { opacity: 1; }
.product-card.featured {
  background:
    radial-gradient(ellipse at top right, rgba(37, 99, 235, 0.20), transparent 60%),
    var(--gradient-card);
}
.product-card.featured::before { opacity: 0.5; }

.product-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--s-3);
}
.product-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.product-name {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 28px;
  letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: var(--s-2);
}
.product-name .ai { color: var(--accent); }
.product-name.small { font-size: 22px; }
.product-tagline {
  font-size: var(--fs-sm); color: var(--text-tertiary);
  font-weight: 500; margin-bottom: var(--s-4);
}
.product-desc {
  color: var(--text-secondary); font-size: var(--fs-base);
  line-height: 1.55; flex-grow: 1; margin-bottom: var(--s-4);
}
.product-link {
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: var(--accent); font-weight: 600; font-size: var(--fs-sm);
  transition: gap 0.2s var(--ease-out);
}
.product-link:hover { gap: 12px; }

/* ---------- CTA section ---------- */
.cta-section {
  text-align: center;
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(56, 189, 248, 0.08), transparent),
    var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.cta-section h2 { max-width: 700px; margin: 0 auto var(--s-4); }
.cta-section p { color: var(--text-secondary); font-size: var(--fs-lg); max-width: 560px; margin: 0 auto var(--s-6); }
.cta-row { display: inline-flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; }

/* ---------- Footer ---------- */
.footer {
  padding: var(--s-8) 0 var(--s-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-base);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-6);
  margin-bottom: var(--s-7);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-tertiary);
  margin-bottom: var(--s-4); font-family: 'Sora', sans-serif;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.footer-col a { color: var(--text-secondary); font-size: var(--fs-sm); transition: color 0.2s; }
.footer-col a:hover { color: var(--text-primary); }
.footer-brand {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 24px;
  color: var(--text-primary); margin-bottom: var(--s-3); display: block;
}
.footer-brand .x { color: var(--accent); }
.footer-tagline { color: var(--text-tertiary); font-size: var(--fs-sm); max-width: 320px; line-height: 1.6; }
.footer-bottom {
  padding-top: var(--s-5); border-top: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3);
  font-size: var(--fs-xs); color: var(--text-faint);
}
.footer-address { font-size: var(--fs-xs); color: var(--text-tertiary); line-height: 1.6; }

/* ---------- Scroll reveal (JS opt-in — safe fallback if JS fails) ---------- */
.js-loaded .reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js-loaded .reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Selection ---------- */
::selection { background: var(--accent); color: var(--bg-base); }
