/* ==========================================================================
   AlgoritmoTech — tema tech corporate escuro
   ========================================================================== */

:root {
  --bg: #05070d;
  --bg-alt: #090c16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --text-dim: #a3abc2;
  --text-dimmer: #6d7690;

  --blue: #4d7cff;
  --purple: #9b5cff;
  --cyan: #34e2e2;
  --grad: linear-gradient(135deg, var(--blue) 0%, var(--purple) 55%, var(--cyan) 100%);

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1180px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { 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(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--text-dim); }
a { color: inherit; text-decoration: none; }

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

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- background fx ---------- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 40%, transparent 100%);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  z-index: 0;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  pointer-events: none;
}
.bg-glow--1 {
  top: -220px;
  left: -160px;
  background: radial-gradient(circle, var(--blue), transparent 70%);
  animation: drift1 22s ease-in-out infinite;
}
.bg-glow--2 {
  top: 30%;
  right: -220px;
  background: radial-gradient(circle, var(--purple), transparent 70%);
  animation: drift2 26s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(60px, 80px); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-70px, -50px); }
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background var(--ease) .3s, padding var(--ease) .3s, border-color var(--ease) .3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  padding: 12px 0;
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  gap: 30px;
}
.main-nav a {
  font-size: 0.94rem;
  color: var(--text-dim);
  transition: color .2s;
  position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--grad);
  transition: width .25s var(--ease);
}
.main-nav a:hover::after { width: 100%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s, background .25s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--grad);
  color: #04050a;
  box-shadow: 0 0 0 rgba(77, 124, 255, 0);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(77, 124, 255, 0.55);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 18px;
}
.btn-ghost:hover { border-color: var(--border-strong); }

/* mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 190px 0 130px;
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.65;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin-bottom: 22px;
  color: #f6f8ff;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--text-dim);
  max-width: 620px;
  margin-bottom: 34px;
}
.hero-sub strong { color: var(--text); }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

.hero-meta {
  font-size: 0.9rem;
  color: var(--text-dimmer);
}
.hero-meta strong { color: var(--text-dim); }

/* ---------- sections ---------- */

.section {
  position: relative;
  z-index: 1;
  padding: 110px 0;
}
.section-alt {
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015) 12%, rgba(255,255,255,0.015) 88%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  color: #f6f8ff;
}
.section-sub {
  font-size: 1.02rem;
}

/* ---------- grids / cards ---------- */

.grid {
  display: grid;
  gap: 22px;
}
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card, .service-card, .project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(6px);
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.card:hover, .service-card:hover, .project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-strong);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.card h3 { font-size: 1.05rem; color: var(--text); }
.card p { font-size: 0.92rem; margin-bottom: 0; }

.service-card {
  position: relative;
  padding: 34px 30px;
}
.service-num {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  color: var(--text-dimmer);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}
.service-card h3 {
  font-size: 1.25rem;
  color: #f6f8ff;
  margin-bottom: 10px;
}
.service-card p { margin-bottom: 0; }

.project-card {
  display: flex;
  flex-direction: column;
}
.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.project-top h3 {
  font-size: 1.2rem;
  color: #f6f8ff;
  margin: 0;
}
.project-tag {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 10px;
}
.project-card p { margin-bottom: 0; font-size: 0.95rem; }
.project-card--new {
  border-style: dashed;
  border-color: rgba(155, 92, 255, 0.4);
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-live {
  background: rgba(52, 226, 226, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(52, 226, 226, 0.3);
}
.badge-new {
  background: rgba(155, 92, 255, 0.14);
  color: #c6a6ff;
  border: 1px solid rgba(155, 92, 255, 0.35);
}

/* ---------- process ---------- */

.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  position: relative;
}
.process-step {
  padding: 30px 24px;
  border-left: 1px solid var(--border);
  position: relative;
}
.process-index {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.process-step h3 { font-size: 1.05rem; color: var(--text); }
.process-step p { font-size: 0.9rem; margin-bottom: 0; }

/* ---------- contact ---------- */

.contact {
  text-align: center;
}
.contact-inner {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact .eyebrow { justify-content: center; }
.contact h2 { color: #f6f8ff; }
.contact .hero-cta { justify-content: center; }

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  padding: 46px 0 28px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.footer-nav, .footer-contact {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.footer-nav a, .footer-contact a {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color .2s;
}
.footer-nav a:hover, .footer-contact a:hover { color: var(--cyan); }
.footer-copy {
  font-size: 0.8rem;
  color: var(--text-dimmer);
  margin: 0;
}

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    top: 68px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    gap: 4px;
    background: rgba(9, 12, 22, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    backdrop-filter: blur(14px);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .main-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .main-nav a {
    padding: 12px 14px;
    border-radius: 8px;
  }
  .main-nav a:hover { background: var(--surface); }
  .nav-toggle { display: flex; }
  .header-actions .btn-ghost { display: none; }
}

@media (max-width: 720px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .hero { padding: 150px 0 90px; }
}
