/* ============================================================
   TEVOX — Design tokens
   Neutral family: Slate (blue undertone, matches tech aesthetic)
   Accent: single desaturated cyan-blue, echoing the brand mark
   ============================================================ */

:root {
  --bg: oklch(0.15 0.014 258);
  --bg-elevated: oklch(0.19 0.017 258);
  --bg-elevated-2: oklch(0.235 0.02 258);
  --fg: oklch(0.96 0.006 258);
  --muted: oklch(0.74 0.02 258);
  --muted-2: oklch(0.56 0.018 258);
  --accent: oklch(0.78 0.13 205);
  --accent-strong: oklch(0.87 0.15 198);
  --accent-dim: oklch(0.5 0.09 205);
  --border: oklch(0.3 0.02 258);
  --border-soft: oklch(0.25 0.018 258 / 0.7);

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter Tight", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  --container: 1280px;
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --z-sticky-nav: 30;
  --z-overlay: 50;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

/* Subtle circuit-grid texture on the base background, matched to the brand art */
body {
  background-image:
    radial-gradient(oklch(0.3 0.02 258 / 0.5) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -14px -14px;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg);
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

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

@media (min-width: 768px) {
  .wrap {
    padding: 0 40px;
  }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Focus states — always visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  min-height: 44px;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.35s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: oklch(0.16 0.02 205);
  box-shadow: 0 10px 30px -12px oklch(0.78 0.13 205 / 0.55);
}

.btn-primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 14px 34px -12px oklch(0.78 0.13 205 / 0.7);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent-dim);
  background: var(--bg-elevated);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.85rem;
  min-height: 38px;
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky-nav);
  background: oklch(0.15 0.014 258 / 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border-soft);
  background: oklch(0.15 0.014 258 / 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 76px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: none;
  align-items: center;
  gap: 32px;
  font-size: 0.94rem;
  color: var(--muted);
}

.nav a {
  position: relative;
  padding: 4px 0;
  transition: color 0.3s var(--ease);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}

.nav a:hover {
  color: var(--fg);
}

.nav a:hover::after {
  width: 100%;
}

.header-cta {
  display: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  cursor: pointer;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.mobile-nav {
  position: fixed;
  inset: 76px 0 0 0;
  z-index: var(--z-overlay);
  background: oklch(0.13 0.014 258 / 0.98);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  gap: 4px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.mobile-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-size: 1.6rem;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-soft);
}

.mobile-nav .btn {
  margin-top: 24px;
  justify-content: center;
}

@media (min-width: 900px) {
  .nav {
    display: flex;
  }
  .header-cta {
    display: inline-flex;
  }
  .nav-toggle {
    display: none;
  }
}

/* ============================================================
   Hero — split layout, left copy / right visual
   ============================================================ */

.hero {
  padding: 72px 0 96px;
  position: relative;
  overflow: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero {
    padding: 96px 0 128px;
  }
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
  }
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5.4vw, 3.6rem);
  line-height: 1.05;
  max-width: 16ch;
}

.hero-copy .lead {
  margin-top: 22px;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-meta-item strong {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.95rem;
}

.hero-meta-item span {
  font-size: 0.85rem;
  color: var(--muted-2);
}

.hero-visual {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 460px;
}

.hero-visual-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 40px 80px -30px oklch(0.1 0.02 258 / 0.7);
}

.hero-visual-frame img {
  width: 100%;
  height: auto;
}

.hero-visual-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(closest-side, oklch(0.78 0.13 205 / 0.28), transparent 70%);
  filter: blur(10px);
  z-index: -1;
}

.hero-visual-tag {
  position: absolute;
  bottom: -18px;
  left: -18px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  box-shadow: 0 20px 40px -20px oklch(0.1 0.02 258 / 0.8);
}

.hero-visual-tag strong {
  color: var(--accent);
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

/* ============================================================
   Section scaffolding
   ============================================================ */

section {
  padding: 88px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  line-height: 1.12;
}

.section-head .lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 58ch;
}

/* ============================================================
   About — asymmetric two-column + divide-y principles
   ============================================================ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 64px;
    align-items: start;
  }
}

.about-copy .lead {
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 60ch;
}

.about-copy .lead + .lead {
  margin-top: 18px;
}

.principles {
  border-top: 1px solid var(--border-soft);
}

.principle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border-soft);
}

.principle-index {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  padding-top: 3px;
}

.principle h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.principle p {
  color: var(--muted);
  font-size: 0.96rem;
  max-width: 52ch;
}

/* ============================================================
   Services — asymmetric bento (4 pillars, never equal cards)
   ============================================================ */

.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  grid-template-areas:
    "ia"
    "seguranca"
    "cloud"
    "software";
}

@media (min-width: 860px) {
  .bento {
    grid-template-columns: 1.4fr 1fr;
    grid-template-areas:
      "ia seguranca"
      "ia cloud"
      "software software";
    gap: 22px;
  }
}

.bento-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
  background: var(--bg-elevated-2);
}

.bento-card--ia { grid-area: ia; justify-content: center; }
.bento-card--seguranca { grid-area: seguranca; }
.bento-card--cloud { grid-area: cloud; }
.bento-card--software {
  grid-area: software;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.bento-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: oklch(0.78 0.13 205 / 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bento-icon svg {
  width: 26px;
  height: 26px;
}

.bento-card--ia .bento-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
}

.bento-card--ia .bento-icon svg {
  width: 30px;
  height: 30px;
}

.bento-card h3 {
  font-size: 1.18rem;
}

.bento-card--ia h3 {
  font-size: 1.5rem;
}

.bento-card p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.bento-card--software .bento-copy {
  max-width: 60ch;
}

.bento-card--software .bento-icon {
  order: -1;
}

.bento-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ============================================================
   Projects — in-house products, no public link yet
   ============================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 700px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
}

.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
  background: var(--bg-elevated-2);
}

.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-card-head h3 {
  font-size: 1.18rem;
}

.project-card p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.project-card-link {
  align-self: flex-start;
}

.project-card-link:hover svg {
  transform: translateX(3px);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-badge--dev {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.status-badge--dev::before {
  background: var(--accent);
}

/* ============================================================
   Contact
   ============================================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 40px;
  }
}

.contact-info .lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin-bottom: 32px;
}

.contact-channel {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--border-soft);
}

.contact-channel:last-child {
  border-bottom: 1px solid var(--border-soft);
}

.contact-channel .bento-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.contact-channel .bento-icon svg {
  width: 22px;
  height: 22px;
}

.contact-channel-body strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 3px;
}

.contact-channel-body span {
  color: var(--muted-2);
  font-size: 0.9rem;
}

.contact-channel-body a {
  color: var(--accent);
  font-weight: 600;
}

.contact-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 560px) {
  .form-row--split {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  font-family: var(--font-body);
  font-size: 0.98rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--fg);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-2);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent-dim);
  background: var(--bg-elevated-2);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-success {
  background: oklch(0.6 0.14 150 / 0.12);
  color: oklch(0.75 0.13 150);
  border: 1px solid oklch(0.6 0.14 150 / 0.35);
}

.form-status.is-error {
  background: oklch(0.55 0.18 10 / 0.12);
  color: oklch(0.78 0.13 10);
  border: 1px solid oklch(0.55 0.18 10 / 0.35);
}

/* Field-level error state — toggled via .field.is-invalid on submit */
.field-error {
  display: none;
  font-size: 0.82rem;
  color: oklch(0.78 0.13 10);
  margin-top: 2px;
}

.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-color: oklch(0.55 0.18 10 / 0.7);
  background: oklch(0.55 0.18 10 / 0.06);
}

.field.is-invalid .field-error {
  display: block;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 48px 0 40px;
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

@media (min-width: 720px) {
  .footer-grid {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--fg);
}

.footer-meta {
  font-size: 0.82rem;
  color: var(--muted-2);
}

/* ============================================================
   Scroll-reveal utility (JS toggles .is-visible)
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Legal page (Política de Privacidade)
   ============================================================ */

.legal {
  padding: 140px 0 96px;
}

.legal-wrap {
  max-width: 760px;
}

.legal h1 {
  font-size: clamp(2rem, 4.4vw, 2.8rem);
  margin-top: 8px;
}

.legal > .wrap > .lead {
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 0.95rem;
}

.legal-body {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.legal-body h2 {
  font-size: 1.2rem;
  margin-top: 28px;
}

.legal-body p,
.legal-body li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.legal-body ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-back {
  margin-top: 56px;
}

/* ============================================================
   404 page
   ============================================================ */

.error-404 {
  padding: 160px 0;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.error-404-wrap {
  max-width: 620px;
}

.error-404-code {
  font-family: var(--font-mono);
  font-size: clamp(3.5rem, 12vw, 6rem);
  color: var(--accent);
  line-height: 1;
  margin: 8px 0 20px;
}

.error-404 h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  line-height: 1.15;
  margin-bottom: 16px;
}

.error-404 .lead {
  color: var(--muted);
  max-width: 52ch;
}

.error-404-actions {
  margin-top: 36px;
}

/* ============================================================
   Constelação — fixed particle field behind the page
   (added by scene.js only on desktop + WebGL; mobile and
   reduced-data browsers keep the static hero image)
   ============================================================ */

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s var(--ease);
}

html.scene-on #scene {
  opacity: 0.78;
}

/* soft edge darkening so copy keeps contrast over the field */
html.scene-on body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(125% 80% at 50% 32%, transparent 42%, oklch(0.11 0.014 258 / 0.55) 100%),
    linear-gradient(180deg, oklch(0.11 0.014 258 / 0.4) 0%, transparent 20%, transparent 80%, oklch(0.11 0.014 258 / 0.55) 100%);
}

@media (prefers-reduced-motion: reduce) {
  #scene { transition: none; }
}

/* on desktop the constellation is the hero visual, so drop the
   static picture (it stays in the DOM as the mobile / fallback) */
@media (min-width: 721px) {
  html.scene-on .hero-visual { display: none; }
  html.scene-on .hero-grid { grid-template-columns: 1fr; }
  html.scene-on .hero-copy { max-width: 60ch; }
}
