:root {
  --accent: #2563eb;
  --accent-600: #1d4ed8;
  --accent-50: #eff6ff;
  --accent-100: #dbeafe;

  /* Light */
  --bg: #ffffff;
  --bg-elev: #f7f8fa;
  --bg-muted: #f2f4f8;
  --text: #0b1220;
  --text-muted: #5b6778;
  --text-soft: #8b95a5;
  --border: #e6e9ef;
  --border-strong: #d4d9e3;
  --chip: #ffffff;
  --shadow-sm: 0 1px 2px rgba(10, 22, 48, 0.04), 0 1px 1px rgba(10, 22, 48, 0.03);
  --shadow-md: 0 10px 30px -12px rgba(10, 22, 48, 0.12), 0 2px 6px rgba(10, 22, 48, 0.04);
  --shadow-lg: 0 30px 60px -20px rgba(10, 22, 48, 0.18), 0 10px 20px -10px rgba(10, 22, 48, 0.08);
  --grid: rgba(10, 22, 48, 0.06);
  color-scheme: light;
}

html[data-mode="dark"] {
  --bg: #07090f;
  --bg-elev: #0d1220;
  --bg-muted: #111831;
  --text: #eef2fb;
  --text-muted: #9aa6bd;
  --text-soft: #6a7490;
  --border: #1a2238;
  --border-strong: #263154;
  --chip: #0d1220;
  --accent-50: #0f1e3d;
  --accent-100: #14285a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,0.7), 0 10px 20px -10px rgba(0,0,0,0.4);
  --grid: rgba(255,255,255,0.05);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv11","ss01","ss03";
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, .display, .mono-tag {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}
h1 { font-weight: 600; }
h2, h3, h4 { font-weight: 600; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

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

::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); color: var(--text); }

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}
@media (max-width: 720px) { .container { padding: 0 20px; } }

.section {
  padding: 120px 0;
  position: relative;
}
.section.compact { padding: 72px 0; }
@media (max-width: 720px) {
  .section { padding: 72px 0; }
  .section.compact { padding: 48px 0; }
}

/* Eyebrow */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 10px;
  background: var(--accent-50);
  border: 1px solid color-mix(in oklab, var(--accent) 20%, transparent);
  border-radius: 999px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 8px 20px -8px color-mix(in oklab, var(--accent) 50%, transparent);
}
.btn-primary:hover { background: var(--accent-600); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--text); background: var(--bg-elev); }
.btn-arrow { transition: transform .2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* Navbar */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.nav-logo img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.nav-links {
  display: flex; gap: 4px; align-items: center;
}
.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-elev); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.mode-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  color: var(--text-muted);
  transition: color .15s, border-color .15s, background .15s;
}
.mode-toggle:hover { color: var(--text); border-color: var(--border-strong); }

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

/* Hero */
.hero {
  position: relative;
  padding: 88px 0 40px;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 40%, transparent 75%);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 60px;
  align-items: center;
  min-height: 560px;
}
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
}

.hero h1 {
  margin: 0 0 20px;
  font-size: inherit;
  font-weight: inherit;
}
.hero-display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(36px, 5.5vw, 62px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--text);
}
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 32px;
  line-height: 1.55;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-proof {
  display: flex; align-items: center; gap: 14px;
  margin-top: 36px;
  font-size: 13px;
  color: var(--text-muted);
}
.hero-proof .avatars { display: flex; }
.hero-proof .avatars span {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -8px;
  background: linear-gradient(135deg, #93c5fd, #2563eb);
}
.hero-proof .avatars span:nth-child(1) { background: linear-gradient(135deg, #fbcfe8, #be185d); margin-left: 0; }
.hero-proof .avatars span:nth-child(2) { background: linear-gradient(135deg, #bbf7d0, #15803d); }
.hero-proof .avatars span:nth-child(3) { background: linear-gradient(135deg, #fde68a, #a16207); }
.hero-proof .avatars span:nth-child(4) { background: linear-gradient(135deg, #bae6fd, #0369a1); }

/* Hero visual */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 560px;
  justify-self: end;
  width: 100%;
}
@media (max-width: 960px) {
  .hero-visual { justify-self: center; max-width: 480px; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* Cards */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* Section heading */
.sec-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  margin-bottom: 56px;
}
.sec-head h2 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  margin: 14px 0 0;
  max-width: 640px;
}
.sec-head p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 380px;
  margin: 0;
}
@media (max-width: 720px) {
  .sec-head { grid-template-columns: 1fr; }
}

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 960px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

.service-card {
  position: relative;
  padding: 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease;
}
.service-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.service-card .svc-icon {
  width: 44px; height: 44px;
  background: var(--accent-50);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 25%, transparent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.service-card h3 {
  font-size: 19px;
  margin: 0 0 8px;
}
.service-card p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin: 0 0 18px;
  line-height: 1.55;
}
.service-card .tags {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.service-card .tags span {
  font-size: 11.5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg);
  font-family: 'JetBrains Mono', monospace;
}

/* Process / steps */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
@media (max-width: 960px) { .process { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .process { grid-template-columns: 1fr; } }
.step {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elev);
  counter-increment: step;
}
.step .num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 42px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 20px;
  display: block;
}
.step h4 { margin: 0 0 8px; font-size: 17px; }
.step p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.step-connector {
  position: absolute;
  top: 44px; right: -10px;
  width: 20px; height: 1px;
  background: var(--border-strong);
  z-index: 1;
}
.step:last-child .step-connector { display: none; }
@media (max-width: 960px) { .step-connector { display: none; } }

/* Case studies */
.cases {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}
@media (max-width: 960px) { .cases { grid-template-columns: 1fr 1fr; } .case-big { grid-column: span 2; } }
@media (max-width: 600px) { .cases { grid-template-columns: 1fr; } .case-big { grid-column: span 1; } }
@media (max-width: 960px) { .portfolio-grid { grid-template-columns: 1fr !important; } }
@media (min-width: 601px) and (max-width: 960px) { .portfolio-grid { grid-template-columns: 1fr 1fr !important; } }

.case {
  padding: 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 240px;
  transition: transform .25s ease, border-color .25s ease;
  position: relative; overflow: hidden;
}
.case:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.case-big {
  grid-row: span 2;
  background: linear-gradient(180deg, var(--accent) 0%, #1e3fb8 100%);
  color: white;
  border-color: transparent;
  min-height: auto;
}
.case-big .case-label, .case-big .case-metric-label { color: rgba(255,255,255,0.7); }
.case-big .case-metric { color: white; }
.case-big .case-meta { color: rgba(255,255,255,0.75); }
.case-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.case-metric {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 18px 0 4px;
  color: var(--text);
}
.case-metric-label { font-size: 14px; color: var(--text-muted); }
.case-meta {
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.case-meta strong { color: var(--text); font-weight: 600; }
.case-big .case-meta strong { color: white; }

/* Logos */
.logos-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  align-items: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 860px) { .logos-strip { grid-template-columns: repeat(3, 1fr); gap: 32px 24px; } }
.logo-cell {
  display: flex; align-items: center; justify-content: center;
  height: 28px;
  color: var(--text-soft);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  opacity: 0.75;
  transition: opacity .2s, color .2s;
}
.logo-cell:hover { opacity: 1; color: var(--text); }

/* Team */
.team {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 860px) { .team { grid-template-columns: repeat(2, 1fr); } }
.tm {
  padding: 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
}
.tm-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  margin-bottom: 16px;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 56px;
  color: var(--accent);
  letter-spacing: -0.03em;
  position: relative;
  overflow: hidden;
}
.tm-avatar::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, color-mix(in oklab, var(--accent) 20%, transparent), transparent 60%);
}
.tm h4 { margin: 0 0 2px; font-size: 16px; font-family: 'Inter', sans-serif; font-weight: 600; letter-spacing: 0; }
.tm p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* About */
.about {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: start;
}
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}
.stat {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elev);
}
.stat .val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat .lbl { font-size: 13px; color: var(--text-muted); }

/* Contact */
.contact {
  background: linear-gradient(180deg, var(--accent) 0%, #1d3fb0 100%);
  border-radius: 28px;
  padding: 64px;
  color: white;
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.18), transparent 40%),
                    radial-gradient(circle at 100% 100%, rgba(255,255,255,0.12), transparent 40%);
  pointer-events: none;
}
.contact > * { position: relative; }
.contact h2 {
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.05;
  margin: 12px 0 16px;
}
.contact p {
  color: rgba(255,255,255,0.85);
  max-width: 520px;
  margin: 0 0 32px;
  font-size: 17px;
}
.contact .btn-primary { background: white; color: var(--accent); }
.contact .btn-primary:hover { background: #f1f5ff; }
.contact .btn-ghost { border-color: rgba(255,255,255,0.35); color: white; }
.contact .btn-ghost:hover { border-color: white; background: rgba(255,255,255,0.08); }
.contact .eyebrow { background: rgba(255,255,255,0.15); color: white; border-color: rgba(255,255,255,0.25); }
.contact .eyebrow .dot { background: white; box-shadow: 0 0 0 3px rgba(255,255,255,0.2); }
@media (max-width: 720px) { .contact { padding: 40px 28px; } }

/* Footer */
footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 720px) { .foot { grid-template-columns: 1fr 1fr; } }
.foot h5 { font-size: 13px; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 16px; font-weight: 500; }
.foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.foot a { font-size: 14px; color: var(--text-muted); }
.foot a:hover { color: var(--text); }
.foot-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-muted);
  flex-wrap: wrap; gap: 16px;
}

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 260px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  font-size: 13px;
}
.tweaks-panel h6 {
  margin: 0 0 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.tweak-row { margin-bottom: 14px; }
.tweak-row:last-child { margin-bottom: 0; }
.tweak-row > label { display: block; margin-bottom: 6px; color: var(--text); font-weight: 500; font-size: 12px; }
.tweak-seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-elev); }
.tweak-seg button {
  flex: 1;
  padding: 7px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.tweak-seg button.active { background: var(--accent); color: white; }
.tweak-seg button:hover:not(.active) { color: var(--text); }
.tweak-swatches { display: flex; gap: 8px; }
.tweak-swatch {
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.tweak-swatch:hover { transform: scale(1.05); }
.tweak-swatch.active { border-color: var(--text); transform: scale(1.08); }

/* SVG hero animation helpers */
@keyframes pulse { 0%,100% { opacity: 0.4; r: 3; } 50% { opacity: 1; r: 4.5; } }
@keyframes orbit-rot { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes dash-flow { to { stroke-dashoffset: -40; } }
@keyframes float-y {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Visible in both modes, used for hero flow */
.node-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  fill: var(--text-muted);
}
