:root {
  --n-50: #fafafa;
  --n-100: #f5f5f5;
  --n-200: #e5e5e5;
  --n-300: #d4d4d4;
  --n-400: #a3a3a3;
  --n-600: #525252;
  --n-700: #404040;
  --n-900: #171717;
  --n-950: #0a0a0a;
  --container: 1152px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-height: 100vh;
  background: #ffffff;
  color: var(--n-900);
  font-family: "DM Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

::selection {
  background: var(--n-950);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--n-950);
  outline-offset: 2px;
  border-radius: 4px;
}

.bg-grid {
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
}

.bg-grid--invert {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

.bg-hero-glow {
  background: radial-gradient(60% 50% at 50% 0%, rgba(0, 0, 0, 0.06), transparent 70%);
}

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

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

/* ---- layout ---- */

.shell {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
}

.shell--md {
  width: min(100% - 48px, 720px);
}

.shell--lg {
  width: min(100% - 48px, 920px);
}

.shell--xl {
  width: min(100% - 48px, 1480px);
}

.section {
  padding: 96px 0;
}

.section--alt {
  background: var(--n-50);
}

.section--border {
  border-top: 1px solid var(--n-100);
}

/* ---- navbar ---- */

.navbar {
  position: fixed;
  inset: 16px 16px auto;
  z-index: 50;
  display: flex;
  justify-content: center;
}

.navbar-inner {
  width: min(100%, 880px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px 10px 20px;
  border: 1px solid var(--n-200);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  transition: box-shadow 250ms ease, background 250ms ease, border-color 250ms ease;
}

.navbar.is-scrolled .navbar-inner {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--n-200);
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.18);
}

.nav-brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--n-950);
}

.nav-brand img {
  height: 26px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--n-600);
  transition: color 180ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1.5px;
  background: var(--n-950);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--n-950);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--n-200);
  border-radius: 0.75rem;
  background: #ffffff;
  cursor: pointer;
}

.nav-toggle span {
  position: relative;
  width: 16px;
  height: 1.5px;
  background: var(--n-950);
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: var(--n-950);
  transition: transform 200ms ease;
}

.nav-toggle span::before {
  top: -5px;
}

.nav-toggle span::after {
  top: 5px;
}

.nav-panel {
  display: none;
  width: min(100%, 880px);
  margin: 8px auto 0;
  padding: 10px;
  border: 1px solid var(--n-200);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.18);
}

body.nav-open .nav-panel {
  display: grid;
  gap: 4px;
}

.nav-panel a {
  padding: 12px 14px;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--n-700);
}

.nav-panel a:hover {
  background: var(--n-50);
  color: var(--n-950);
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 46px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 220ms ease;
}

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

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

.btn-primary {
  background: var(--n-950);
  color: #ffffff;
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
  background: var(--n-700);
}

.btn-secondary {
  border: 1px solid var(--n-200);
  background: #ffffff;
  color: var(--n-900);
}

.btn-secondary:hover {
  background: var(--n-50);
  border-color: var(--n-300);
}

.btn-arrow {
  width: 16px;
  height: 16px;
  transition: transform 220ms ease;
}

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

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- text helpers ---- */

.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--n-400);
}

.text-gradient {
  background: linear-gradient(110deg, var(--n-900), var(--n-400), var(--n-700), var(--n-900));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

h1,
h2,
h3 {
  color: var(--n-950);
  letter-spacing: -0.02em;
}

p {
  color: var(--n-600);
}

.section-heading {
  width: min(100%, 640px);
  margin: 0 auto 56px;
  text-align: center;
}

.section-heading--left {
  margin: 0 0 48px;
  text-align: left;
}

.section-heading h2 {
  margin-top: 12px;
  font-size: clamp(1.85rem, 3.4vw, 2.4rem);
  font-weight: 700;
}

.section-heading p {
  margin-top: 16px;
  font-size: 1.05rem;
  line-height: 1.7;
}

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

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 140px 24px 80px;
}

.hero-center {
  width: min(100%, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border: 1px solid var(--n-200);
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.85rem;
  color: var(--n-600);
  animation: kickerFloat 4s ease-in-out infinite;
}

@keyframes kickerFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.hero-kicker strong {
  margin-left: 4px;
  color: var(--n-950);
  font-weight: 700;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(1.5rem, 7.4vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.hero-description {
  width: min(100%, 600px);
  margin-top: 20px;
  font-size: clamp(0.95rem, 1.3vw, 1.08rem);
  line-height: 1.75;
}

.hero .btn-row {
  margin-top: 32px;
  justify-content: center;
}

.hero-tech {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(100%, 720px);
  margin-top: 40px;
}

.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--n-200);
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--n-700);
  transition: border-color 180ms ease, transform 180ms ease;
  opacity: 0;
  animation: pillIn 0.6s var(--ease) both;
  animation-delay: calc(0.5s + var(--pill-i, 0) * 60ms);
}

.tech-pill:nth-child(1) { --pill-i: 1; }
.tech-pill:nth-child(2) { --pill-i: 2; }
.tech-pill:nth-child(3) { --pill-i: 3; }
.tech-pill:nth-child(4) { --pill-i: 4; }
.tech-pill:nth-child(5) { --pill-i: 5; }
.tech-pill:nth-child(6) { --pill-i: 6; }
.tech-pill:nth-child(7) { --pill-i: 7; }
.tech-pill:nth-child(8) { --pill-i: 8; }
.tech-pill:nth-child(9) { --pill-i: 9; }
.tech-pill:nth-child(10) { --pill-i: 10; }

@keyframes pillIn {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tech-pill:hover {
  border-color: var(--n-300);
  transform: translateY(-2px);
}

.tech-pill svg {
  width: 16px;
  height: 16px;
  fill: var(--n-700);
}

.tech-pill strong {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  font-size: 0.68rem;
}

.scroll-down {
  position: absolute;
  bottom: 36px;
  display: grid;
  gap: 2px;
  justify-items: center;
  opacity: 0.6;
  animation: arrowFloat 1.8s ease-in-out infinite;
}

.scroll-down span {
  width: 16px;
  height: 16px;
  border-right: 2px solid var(--n-950);
  border-bottom: 2px solid var(--n-950);
  transform: rotate(45deg);
}

.scroll-down span:last-child {
  margin-top: -9px;
}

@keyframes arrowFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

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

.card-grid {
  display: grid;
  gap: 32px;
}

.card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid--spacious { gap: 48px; }

.card {
  display: flex;
  flex-direction: column;
  padding: 44px;
  border: 1px solid var(--n-300);
  border-radius: 1.5rem;
  background: var(--n-100);
  transition: all 300ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--n-400);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.22);
}

.card--full {
  grid-column: 1 / -1;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  border-radius: 1rem;
  background: var(--n-950);
  color: #ffffff;
  transition: transform 300ms ease;
}

.card:hover .card-icon {
  transform: scale(1.08) rotate(-6deg);
}

.card-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.card h3 {
  font-size: 1.4rem;
  font-weight: 700;
}

.card .eyebrow {
  margin-bottom: 10px;
}

.card p {
  margin-top: 12px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.card ul {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.card li {
  position: relative;
  padding-left: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--n-600);
}

.card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--n-300);
}

/* ---- project cards ---- */

.project-card {
  align-items: center;
  padding: 64px 48px 68px;
  border-radius: 1.75rem;
  text-align: center;
}

.project-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 36px;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--n-300);
}

.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}

.card:hover .project-thumb img {
  transform: scale(1.05);
}

.browser-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
}

.browser-bar span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
}

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

.project-card p {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.7;
}

.project-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 44px;
}

.project-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--n-700);
  transition: color 180ms ease;
}

.project-links a:hover {
  color: var(--n-950);
}

/* ---- pills / flow steps ---- */

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--n-200);
  border-radius: 999px;
  background: var(--n-50);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--n-700);
}

.flow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 6px;
}

.flow-steps span {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid var(--n-200);
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--n-900);
}

.flow-steps span:not(:last-child)::after {
  content: "→";
  margin-left: 12px;
  color: var(--n-300);
  font-weight: 400;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--n-100);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--n-700);
}

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

.case-hero {
  padding: 64px 0 56px;
}

.case-hero--split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  gap: 40px;
  align-items: center;
}

.back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--n-600);
  transition: color 180ms ease;
}

.case-hero .pill {
  display: flex;
  width: fit-content;
  margin-bottom: 16px;
}

.back-link:hover {
  color: var(--n-950);
}

.case-hero h1 {
  margin-top: 14px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
}

.case-hero p {
  width: min(100%, 680px);
  margin-top: 18px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.case-hero .btn-row {
  margin-top: 26px;
}

/* ---- dashboard preview (Farol) ---- */

.dashboard-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--n-200);
  border-radius: 1.25rem;
  background: var(--n-50);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.15);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-panel {
  padding: 18px;
  border: 1px solid var(--n-200);
  border-radius: 1rem;
  background: #ffffff;
}

.metric-panel strong {
  display: block;
  font-size: 1.6rem;
}

.metric-panel span {
  font-size: 0.85rem;
  color: var(--n-600);
}

.chart-panel {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 140px;
  padding: 20px;
  border: 1px solid var(--n-200);
  border-radius: 1rem;
}

.chart-panel i {
  flex: 1;
  display: block;
  border-radius: 6px 6px 0 0;
  background: var(--n-900);
  opacity: 0.85;
}

.chart-panel i:nth-child(1) { height: 38%; }
.chart-panel i:nth-child(2) { height: 62%; }
.chart-panel i:nth-child(3) { height: 46%; }
.chart-panel i:nth-child(4) { height: 78%; }
.chart-panel i:nth-child(5) { height: 54%; }
.chart-panel i:nth-child(6) { height: 88%; }

/* ---- CTA (contact) ---- */

.cta {
  position: relative;
  overflow: hidden;
  background-color: var(--n-950);
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.cta .eyebrow {
  color: var(--n-400);
}

.cta h2 {
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3rem);
}

.cta p {
  color: var(--n-300);
}

.cta-links {
  display: grid;
  gap: 14px;
  margin-top: 40px;
}

.cta-links a {
  display: grid;
  grid-template-columns: 38px 1fr 24px;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  text-align: left;
  transition: all 220ms ease;
}

.cta-links a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.cta-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transition: transform 280ms var(--ease);
}

.cta-links a:hover .cta-icon {
  transform: rotate(8deg) scale(1.08);
}

.cta-links a:hover .cta-arrow {
  transform: translate(2px, -2px);
}

.cta-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.cta-links strong {
  font-size: 1rem;
  font-weight: 700;
}

.cta-arrow {
  display: inline-block;
  justify-self: end;
  color: var(--n-400);
  font-size: 1.3rem;
  transition: transform 220ms ease;
}

.cta .btn-secondary {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.cta .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.case-close {
  text-align: center;
}

.case-close .btn-row {
  justify-content: center;
}

.case-close p {
  width: min(100%, 680px);
  margin: 0 auto 28px;
  color: var(--n-300);
  font-size: 1.1rem;
  line-height: 1.7;
}

.case-close h2 + p {
  margin-top: 16px;
}

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

.site-footer {
  background: var(--n-950);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
}

.footer-row p {
  color: #ffffff;
  font-weight: 700;
}

.footer-row span {
  color: var(--n-400);
  font-size: 0.9rem;
}

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

@media (min-width: 640px) {
  .section {
    padding: 128px 0;
  }
}

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

  .card-grid--spacious {
    gap: 24px;
  }

  .project-card {
    padding: 36px 28px 40px;
  }

  .case-hero--split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 72px 0;
  }

  .hero {
    padding: 120px 20px 64px;
  }

  .card-grid--2,
  .card-grid--3,
  .card-grid--4,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .card-grid {
    gap: 20px;
  }

  .card {
    padding: 26px;
  }

  .project-card {
    padding: 32px 24px 36px;
  }

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

  .case-hero--split {
    gap: 28px;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
