/* ============ TOKENS ============ */
:root {
  /* Palette tech blue lunar (default) */
  --bg: #06080f;
  --bg-2: #0a0e1c;
  --bg-3: #0f1528;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ecf5;
  --text-dim: #9ba3b8;
  --text-faint: #5d6478;

  --accent: #5b8def;
  --accent-2: #8aafff;
  --accent-deep: #2a4fb8;
  --accent-glow: 91, 141, 239;

  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-2: #efece4;
  --bg-3: #e7e3d8;
  --surface: rgba(15, 21, 40, 0.03);
  --surface-2: rgba(15, 21, 40, 0.06);
  --border: rgba(15, 21, 40, 0.08);
  --border-strong: rgba(15, 21, 40, 0.16);
  --text: #14172a;
  --text-dim: #4a5066;
  --text-faint: #8a90a4;
}

/* ============ RESET ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

::selection { background: rgba(var(--accent-glow), 0.35); color: var(--text); }

/* ============ LAYOUT HELPERS ============ */
.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) { .wrap { padding: 0 20px; } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; }
h1 { font-size: clamp(56px, 9vw, 132px); line-height: 0.95; }
h2 { font-size: clamp(40px, 5.5vw, 76px); line-height: 1; }
h3 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; }
.italic { font-style: italic; color: var(--accent-2); }

p { color: var(--text-dim); }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px 32px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 14px 10px 22px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.nav-logo .dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-2), var(--accent-deep) 70%, #000);
  box-shadow: 0 0 18px rgba(var(--accent-glow), 0.55);
}
.nav-links { display: flex; gap: 22px; color: var(--text-dim); }
.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  font-size: 13px;
  transition: transform 0.2s var(--ease-out);
}
.nav-cta:hover { transform: scale(1.03); }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 0 0 0 rgba(var(--accent-glow), 0.5);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px -8px rgba(var(--accent-glow), 0.6);
}
.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--text-dim);
}
.btn .arrow { transition: transform 0.3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 140px 0 80px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-grad {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 75% 40%, rgba(var(--accent-glow), 0.16), transparent 60%),
    radial-gradient(ellipse 70% 50% at 15% 80%, rgba(var(--accent-glow), 0.08), transparent 55%);
  pointer-events: none;
}

.hero-grid-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 220px);
}
.hero-centered .hero-grid-inner {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
}
.hero-full .hero-grid-inner {
  grid-template-columns: 1fr;
}
.hero-full .hero-orbit { display: none; }
@media (max-width: 980px) {
  .hero-grid-inner { grid-template-columns: 1fr; gap: 60px; }
}

.hero-copy { max-width: 640px; }
.hero-centered .hero-copy { max-width: 920px; }
.hero-headline {
  margin: 24px 0 28px;
  text-wrap: balance;
}
.hero-headline .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: rise 0.9s var(--ease-out) forwards;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero-sub {
  font-size: clamp(16px, 1.4vw, 19px);
  max-width: 520px;
  color: var(--text-dim);
  line-height: 1.55;
  opacity: 0;
  animation: rise 0.9s 0.5s var(--ease-out) forwards;
}
.hero-centered .hero-sub { margin: 0 auto; }

.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: rise 0.9s 0.7s var(--ease-out) forwards;
}
.hero-centered .hero-actions { justify-content: center; }

.hero-meta {
  margin-top: 56px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  opacity: 0;
  animation: rise 0.9s 0.9s var(--ease-out) forwards;
}
.hero-meta .meta {
  display: flex; flex-direction: column; gap: 4px;
}
.hero-meta .meta b {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  color: var(--text);
}
.hero-meta .meta span {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* lunar orbit */
.hero-orbit {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 560px;
  justify-self: end;
  opacity: 0;
  animation: orbitIn 1.4s 0.3s var(--ease-out) forwards;
}
@keyframes orbitIn { to { opacity: 1; } }
@media (max-width: 980px) {
  .hero-orbit { justify-self: center; max-width: 420px; }
}

/* ============ SECTIONS ============ */
section { position: relative; padding: 140px 0; }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
  margin-bottom: 80px;
}
.section-head h2 { text-wrap: balance; }
.section-head .lead {
  font-size: 17px;
  max-width: 620px;
  line-height: 1.55;
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============ ABOUT ============ */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 880px) { .about { grid-template-columns: 1fr; gap: 48px; } }
.about-display {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text);
}
.about-display .italic { display: inline; }
.about-side { display: flex; flex-direction: column; gap: 32px; padding-top: 12px; }
.about-side p { font-size: 16px; line-height: 1.65; }

/* ============ DORES ============ */
.dores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 980px) { .dores-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dores-grid { grid-template-columns: 1fr; } }
.dor {
  background: var(--bg);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 240px;
  position: relative;
  transition: background 0.4s;
}
.dor:hover { background: var(--bg-2); }
.dor:hover .dor-icon { color: var(--accent-2); transform: scale(1.08) rotate(-4deg); }
.dor-icon {
  width: 36px; height: 36px;
  color: var(--text-dim);
  transition: all 0.4s var(--ease-out);
}
.dor-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  position: absolute;
  top: 24px; right: 28px;
}
.dor h3 { font-family: var(--font-body); font-weight: 500; font-size: 19px; color: var(--text); margin-top: auto; }
.dor p { font-size: 14px; line-height: 1.55; }

/* ============ CASES ============ */
.cases { display: flex; flex-direction: column; gap: 32px; }
.case {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-2);
  position: relative;
  transition: border-color 0.4s;
}
.case:hover { border-color: var(--border-strong); }
.case-alt { grid-template-columns: 1.2fr 1fr; }
.case-alt .case-info { order: 2; }
.case-alt .case-mock { order: 1; }
@media (max-width: 980px) {
  .case, .case-alt { grid-template-columns: 1fr; }
  .case-alt .case-info { order: 1; }
  .case-alt .case-mock { order: 2; }
}
.case-info {
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: center;
}
.case-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.case-tag .pulse {
  width: 7px; height: 7px;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(var(--accent-glow), 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-glow), 0.7); }
  50% { box-shadow: 0 0 0 8px rgba(var(--accent-glow), 0); }
}
.case-name {
  font-family: var(--font-display);
  font-size: clamp(38px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.case-info p { font-size: 15px; line-height: 1.6; max-width: 480px; }
.case-feats {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.case-feat {
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.case-mock {
  background: var(--bg-3);
  position: relative;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  overflow: hidden;
}
.case-mock::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 50% 0%, rgba(var(--accent-glow), 0.15), transparent 70%);
  pointer-events: none;
}

/* ============ PROCESSO ============ */
.process { position: relative; }
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
@media (max-width: 980px) { .process-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .process-steps { grid-template-columns: 1fr; } }
.step {
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.step::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 1.2s var(--ease-out);
}
.step.in::before { width: 100%; }
.step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 0.1em;
}
.step h3 { font-family: var(--font-body); font-weight: 500; font-size: 22px; }
.step p { font-size: 14px; line-height: 1.6; }

/* ============ TIPOS ============ */
.tipos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .tipos-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .tipos-grid { grid-template-columns: 1fr; } }
.tipo {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.4s var(--ease-out);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.tipo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-glow), 0.12), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.tipo:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.tipo:hover::after { opacity: 1; }
.tipo-icon { width: 28px; height: 28px; color: var(--accent-2); }
.tipo h3 { font-family: var(--font-body); font-weight: 500; font-size: 18px; }
.tipo p { font-size: 14px; line-height: 1.55; }

/* ============ STACK ============ */
.stack-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
@media (max-width: 880px) { .stack-display { grid-template-columns: 1fr; gap: 60px; } }
.stack-list {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.stack-chip {
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  transition: all 0.3s var(--ease-out);
}
.stack-chip:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(var(--accent-glow), 0.5);
}

.stack-vis {
  aspect-ratio: 1;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* ============ FAQ ============ */
.faq-list { display: flex; flex-direction: column; }
.faq-item {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  cursor: pointer;
  transition: padding 0.3s;
}
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.01em;
  color: var(--text);
}
.faq-q .plus {
  width: 24px; height: 24px;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-out);
}
.faq-q .plus::before, .faq-q .plus::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.faq-q .plus::before { left: 0; right: 0; top: 50%; height: 1px; transform: translateY(-0.5px); }
.faq-q .plus::after { top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-0.5px); transition: transform 0.4s var(--ease-out); }
.faq-item.open .faq-q .plus::after { transform: translateX(-0.5px) rotate(90deg); }
.faq-item.open .faq-q .plus { transform: rotate(180deg); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out), margin-top 0.5s var(--ease-out);
}
.faq-item.open .faq-a { max-height: 240px; margin-top: 18px; }
.faq-a p { max-width: 720px; line-height: 1.65; font-size: 15px; }

/* ============ CONTATO ============ */
.contato {
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(var(--accent-glow), 0.14), transparent 70%),
    var(--bg);
}
.contato-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 880px) { .contato-inner { grid-template-columns: 1fr; gap: 48px; } }
.contato-info { display: flex; flex-direction: column; gap: 32px; }
.contato-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.contato-points { display: flex; flex-direction: column; gap: 20px; padding-top: 12px; }
.contato-point {
  display: flex; gap: 16px; align-items: flex-start;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.contato-point svg { width: 18px; height: 18px; color: var(--accent-2); margin-top: 3px; flex-shrink: 0; }
.contato-point .label { font-size: 11px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); display: block; margin-bottom: 4px; }
.contato-point .val { font-size: 16px; color: var(--text); }

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  backdrop-filter: blur(20px);
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.field input, .field textarea, .field select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 0;
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s, padding 0.3s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field textarea { resize: vertical; min-height: 100px; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 14px) center, calc(100% - 9px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 24px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.form-submit {
  margin-top: 14px;
  padding: 16px 24px;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: all 0.3s var(--ease-out);
}
.form-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -8px rgba(var(--accent-glow), 0.6); }
.form-submit.sent { background: var(--accent); color: white; }

/* ============ FOOTER ============ */
footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 60px;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; flex-direction: column; gap: 16px; max-width: 320px; }
.footer-brand p { font-size: 14px; line-height: 1.6; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); font-weight: 400; margin-bottom: 4px; }
.footer-col a { font-size: 14px; color: var(--text-dim); transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  flex-wrap: wrap;
}
.footer-mega {
  font-family: var(--font-display);
  font-size: clamp(80px, 18vw, 280px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 40px 0;
  background: linear-gradient(180deg, var(--text) 0%, var(--text) 50%, transparent 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.85;
}

/* ============ Scroll-driven star drift ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
