:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --bg-rgb: 247, 249, 252;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #08111f;
  --muted: #516178;
  --line: rgba(18, 65, 168, 0.12);
  --line-strong: rgba(18, 65, 168, 0.22);
  --primary: #2234ef;
  --secondary: #22a5e8;
  --shadow: 0 24px 80px rgba(8, 17, 31, 0.12);
  --grid-glow: rgba(34, 52, 239, 0.18);
  --cursor-x: 50vw;
  --cursor-y: 50vh;
  --section-gap: clamp(5rem, 7vw, 8rem);
  --radius: 28px;
  --font-weight-display: 640;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060b13;
  --bg-rgb: 6, 11, 19;
  --panel: rgba(10, 18, 32, 0.72);
  --panel-strong: rgba(11, 21, 38, 0.92);
  --text: #eef4ff;
  --muted: #9fb1ca;
  --line: rgba(82, 124, 255, 0.12);
  --line-strong: rgba(82, 124, 255, 0.22);
  --primary: #5a6cff;
  --secondary: #40c7ff;
  --shadow: 0 24px 100px rgba(0, 0, 0, 0.35);
  --grid-glow: rgba(64, 199, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  background:
    radial-gradient(circle at var(--cursor-x) var(--cursor-y), var(--grid-glow), transparent 180px),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.98), rgba(var(--bg-rgb), 1)),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 300ms ease, color 300ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(34, 52, 239, 0.14), transparent 40%),
    radial-gradient(circle at bottom right, rgba(34, 165, 232, 0.12), transparent 34%);
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
  background:
    linear-gradient(var(--line-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-strong) 1px, transparent 1px);
  background-size: 140px 140px;
  mask-image: radial-gradient(circle at var(--cursor-x) var(--cursor-y), black 0, transparent 240px);
}

.page-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 1rem;
  background: var(--bg);
  z-index: 30;
  transition: opacity 600ms ease, visibility 600ms ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.page-loader p {
  margin: 0;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

.loader-grid {
  width: min(56vw, 380px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.loader-grid span {
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(34, 52, 239, 0.1), rgba(34, 165, 232, 0.04));
  animation: drawCell 0.8s ease both;
}

.loader-grid span:nth-child(2) { animation-delay: 0.08s; }
.loader-grid span:nth-child(3) { animation-delay: 0.16s; }
.loader-grid span:nth-child(4) { animation-delay: 0.24s; }
.loader-grid span:nth-child(5) { animation-delay: 0.32s; }
.loader-grid span:nth-child(6) { animation-delay: 0.4s; }

@keyframes drawCell {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.custom-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 40;
  mix-blend-mode: difference;
  transition: width 180ms ease, height 180ms ease, opacity 180ms ease;
}

.cursor-ring,
.cursor-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.cursor-ring {
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.cursor-core {
  inset: 9px;
  background: rgba(255, 255, 255, 0.92);
}

.custom-cursor.is-target .cursor-ring {
  border-radius: 6px;
  transform: rotate(45deg);
}

.custom-cursor.is-grid {
  width: 38px;
  height: 38px;
}

.custom-cursor.is-grid .cursor-ring {
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 8px 8px;
}

.theme-transition {
  position: fixed;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--panel-strong);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  z-index: 25;
}

.theme-transition.is-active {
  animation: themePulse 700ms ease forwards;
}

@keyframes themePulse {
  0% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(140);
  }
}

.section-shell {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-shell {
  padding-bottom: 4rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  backdrop-filter: blur(18px);
}

.brand img {
  width: clamp(170px, 22vw, 240px);
  display: block;
}

.topbar-nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  justify-self: end;
}

.topbar-nav a,
.theme-toggle {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.theme-toggle-track {
  width: 48px;
  height: 28px;
  background: rgba(34, 52, 239, 0.16);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  align-items: center;
}

.theme-toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transform: translateX(0);
  transition: transform 220ms ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(20px);
}

section {
  padding-top: var(--section-gap);
}

.hero {
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow,
.logic-caption {
  margin: 0 0 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

.hero-title,
.section-heading h2,
.contact-panel h2 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  line-height: 0.94;
  font-variation-settings: "wght" var(--font-weight-display);
}

.hero-title span {
  display: block;
  color: var(--primary);
}

.hero-body,
.section-intro,
.about-copy p,
.service-card p,
.contact-panel p,
.logic-visual p,
.manifesto-step p {
  font-size: clamp(1rem, 1.2vw, 1.14rem);
  line-height: 1.75;
  color: var(--muted);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

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

.button-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.button-wa {
  background: linear-gradient(135deg, #17c964, #0ea85a);
  color: white;
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
}

.hero-metrics li,
.service-card,
.glass-card {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-metrics li {
  padding: 1.2rem;
}

.hero-metrics strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.hero-metrics span {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.hero-panel {
  position: relative;
}

.hero-blueprint {
  min-height: 620px;
  border-radius: calc(var(--radius) + 10px);
  border: 1px solid var(--line-strong);
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(34, 52, 239, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 52, 239, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.08));
  background-size: 26px 26px, 26px 26px, auto;
}

html[data-theme="dark"] .hero-blueprint {
  background:
    linear-gradient(rgba(82, 124, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 124, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 28, 48, 0.82), rgba(12, 17, 28, 0.3));
}

.hero-blueprint::before,
.hero-blueprint::after {
  content: "";
  position: absolute;
  inset: auto auto 10% -10%;
  width: 240px;
  height: 240px;
  background: linear-gradient(135deg, rgba(34, 52, 239, 0.22), transparent);
  filter: blur(20px);
  transform: rotate(45deg);
}

.hero-blueprint::after {
  inset: 8% -8% auto auto;
  background: linear-gradient(135deg, rgba(34, 165, 232, 0.2), transparent);
}

.hero-card {
  width: min(420px, 100%);
  padding: 1.6rem;
  position: relative;
  z-index: 1;
}

.card-label {
  display: inline-block;
  margin-bottom: 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--secondary);
}

.hero-card h2,
.logic-visual h3,
.stack-details h3,
.service-card h3 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.hero-card-lines {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-card-lines span {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--secondary), transparent);
}

.logo-block {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  width: min(48%, 320px);
  padding: 1.4rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
}

.logo-block img {
  width: 100%;
  display: block;
}

.section-heading {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-heading.split {
  grid-template-columns: 1fr minmax(260px, 340px);
  align-items: end;
}

.manifesto-track {
  display: grid;
  gap: 1.25rem;
}

.manifesto-step {
  position: sticky;
  top: 6.5rem;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 1.2rem;
  align-items: start;
  padding: 1.5rem;
  min-height: 180px;
  border-top: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.12));
  opacity: 0.4;
  transform: translateY(24px);
  transition: opacity 320ms ease, transform 320ms ease;
}

html[data-theme="dark"] .manifesto-step {
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.72), rgba(10, 18, 32, 0.2));
}

.manifesto-step.is-active {
  opacity: 1;
  transform: translateY(0);
}

.manifesto-step span,
.service-card span {
  font-size: 0.9rem;
  color: var(--secondary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.logic-tree,
.about-grid,
.service-grid {
  display: grid;
  gap: 1.5rem;
}

.logic-tree {
  grid-template-columns: minmax(220px, 300px) 1fr;
}

.logic-problems {
  display: grid;
  gap: 0.9rem;
}

.logic-node,
.stack-layer {
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  padding: 1rem 1.1rem;
  border-radius: 20px;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.logic-node:hover,
.stack-layer:hover,
.logic-node.is-selected {
  transform: translateX(8px);
  border-color: rgba(34, 165, 232, 0.55);
  background: rgba(34, 165, 232, 0.08);
}

.logic-visual {
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
}

.logic-wire {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.logic-wire span {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.logic-visual ul {
  margin: 1.5rem 0 0;
  padding-left: 1rem;
  color: var(--text);
}

.logic-visual li {
  margin: 0.6rem 0;
}

.about-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
}

.about-copy {
  padding: 1.8rem;
}

.team-signals,
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.team-signals span,
.stack-tags span {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.stack-reveal {
  position: relative;
  min-height: 460px;
  padding: 1rem 0;
}

.stack-layer {
  position: absolute;
  left: 50%;
  width: min(86%, 520px);
  padding: 1.2rem 1.4rem;
  border-radius: 24px;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.stack-layer span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--secondary);
}

.layer-top { top: 1rem; z-index: 3; }
.layer-middle { top: 7.5rem; z-index: 2; }
.layer-base { top: 14rem; z-index: 1; }

.stack-reveal:hover .layer-top,
.stack-reveal:focus-within .layer-top {
  transform: translateX(-50%) translateY(-10px) rotate(-2deg);
}

.stack-reveal:hover .layer-middle,
.stack-reveal:focus-within .layer-middle {
  transform: translateX(-50%) translateY(6px) rotate(1deg);
}

.stack-reveal:hover .layer-base,
.stack-reveal:focus-within .layer-base {
  transform: translateX(-50%) translateY(18px) rotate(2deg);
}

.stack-details {
  position: absolute;
  inset: auto 0 0;
  padding: 1.5rem;
}

.service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
  padding: 1.5rem;
}

.contact-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, rgba(34, 52, 239, 0.1), rgba(34, 165, 232, 0.04));
}

.contact-note {
  margin-top: 1rem;
  font-weight: 500;
}

.footer {
  display: grid;
  gap: 1.1rem;
  padding-top: 2.4rem;
}

.footer-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 0 0.8rem;
  border-top: 1px solid var(--line-strong);
}

.footer-main img {
  width: clamp(180px, 22vw, 240px);
  display: block;
}

.footer-legal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  width: min(920px, 100%);
  margin: 0 auto;
}

.footer-legal span,
.footer-love {
  color: var(--muted);
}

.footer-legal-item {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
}

.footer-legal-item strong {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--secondary);
}

.footer-legal-item span {
  font-size: 0.94rem;
  line-height: 1.7;
}

.footer-legal-item-wide {
  grid-column: 1 / -1;
}

.footer-love {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  text-align: center;
}

.floating-wa {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(34, 165, 232, 0.42);
  background:
    linear-gradient(135deg, rgba(34, 52, 239, 0.24), rgba(34, 165, 232, 0.14)),
    rgba(255, 255, 255, 0.12);
  color: var(--text);
  backdrop-filter: blur(18px);
  box-shadow:
    0 18px 44px rgba(8, 17, 31, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.floating-wa::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(34, 165, 232, 0.18);
  pointer-events: none;
}

.floating-wa:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(34, 165, 232, 0.72);
  box-shadow:
    0 22px 54px rgba(8, 17, 31, 0.22),
    0 0 0 8px rgba(34, 165, 232, 0.08);
}

.floating-wa-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(23, 201, 100, 0.18), rgba(34, 165, 232, 0.14));
  color: #14b866;
  font-size: 1.25rem;
}

.floating-wa-icon i {
  display: inline-block;
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-theme="dark"] .floating-wa {
  background:
    linear-gradient(135deg, rgba(34, 52, 239, 0.28), rgba(34, 165, 232, 0.16)),
    rgba(9, 17, 31, 0.74);
  color: #eef4ff;
}

html[data-theme="dark"] .floating-wa-icon {
  background: linear-gradient(135deg, rgba(23, 201, 100, 0.16), rgba(34, 165, 232, 0.18));
  color: #38d27d;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms ease, transform 700ms ease;
}

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

.animate-on-reveal {
  --animate-duration: 0.9s;
}

.hero-metrics li:nth-child(2),
.service-card:nth-child(2) {
  --animate-delay: 0.12s;
}

.hero-metrics li:nth-child(3),
.service-card:nth-child(3) {
  --animate-delay: 0.22s;
}

.hero-card,
.logic-visual,
.about-copy,
.contact-panel {
  --animate-duration: 1s;
}

.muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .topbar-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-self: start;
  }

  .hero,
  .section-heading.split,
  .logic-tree,
  .about-grid,
  .contact-panel,
  .service-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-blueprint {
    min-height: 500px;
  }

  .stack-reveal {
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  .section-shell {
    width: min(100% - 1.25rem, 1160px);
  }

  .hero-title,
  .section-heading h2,
  .contact-panel h2 {
    line-height: 1;
  }

  .manifesto-step {
    grid-template-columns: 1fr;
    top: 5.5rem;
  }

  .stack-layer {
    width: 100%;
  }

  .footer-legal {
    grid-template-columns: 1fr;
  }

  .footer-legal-item-wide {
    grid-column: auto;
  }

  .layer-top { top: 0; }
  .layer-middle { top: 7rem; }
  .layer-base { top: 14rem; }
}

@media (pointer: coarse) {
  .custom-cursor {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .page-loader {
    display: none;
  }

  .manifesto-step,
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
