/* ───────────────────────────────────────────────────────────
   Tokens — ink-tinted neutral ramp, one accent
─────────────────────────────────────────────────────────── */
:root {
  --bg-deep: #071229;
  --bg:      #0b1a3a;
  --card:    #112450;
  --raised:  #1a3166;
  --line:    rgba(190, 215, 255, 0.14);

  --text:    #f0f5ff;
  --text-2:  #bccae8;
  --muted:   #93a7d2;

  --accent:  #6cb8ff;
  --accent-ink: #06142e;
  --ok:      #4cc38a;

  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 64px;
}

/* ───────────────────────────────────────────────────────────
   Base
─────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 24px;
  color: var(--text);
  background: var(--bg) linear-gradient(180deg, #12306f 0, #0b1a3a 760px) no-repeat;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }

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

[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

.mono, .num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ───────────────────────────────────────────────────────────
   Navigation
─────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 32px;
  transition: background-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.nav.scrolled {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line);
}

.nav-brand {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 24px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--raised); }

.nav-cta {
  display: block;
  margin-left: 8px;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  color: var(--accent-ink);
  background: var(--accent);
  text-decoration: none;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.nav-cta:hover { color: var(--accent-ink); background: #9bd0ff; }
.nav-cta:active { transform: scale(0.97); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 180ms var(--ease), opacity 180ms var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ───────────────────────────────────────────────────────────
   Page + sections
─────────────────────────────────────────────────────────── */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 64px) 32px 64px;
}

.section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}
.section-head { margin-bottom: 32px; }
.section-head h2 {
  font-size: 32px;
  line-height: 36px;
  letter-spacing: -0.02em;
}
.section-head p {
  margin-top: 8px;
  max-width: 36rem;
  color: var(--text-2);
}

/* ───────────────────────────────────────────────────────────
   Hero
─────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 64px;
  align-items: center;
  padding-bottom: 80px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-2);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.hero h1 {
  max-width: 14em;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.tagline {
  max-width: 36rem;
  margin-top: 24px;
  font-size: 18px;
  line-height: 28px;
  color: var(--text-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover { color: var(--accent-ink); background: #9bd0ff; }
.btn-secondary {
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--line);
}
.btn-secondary:hover { color: var(--text); border-color: var(--accent); }

.meta {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}
.meta a { color: var(--text-2); }
.meta a:hover { color: var(--text); }

.portrait {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.portrait-img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--raised);
}
.portrait-img img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.portrait-name {
  margin-top: 16px;
  font-weight: 500;
}
.portrait-meta {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}
.portrait-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.fact-num {
  display: block;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
}
.fact-label {
  display: block;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

/* ───────────────────────────────────────────────────────────
   Stats
─────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stat-num {
  font-size: 32px;
  font-weight: 500;
  line-height: 32px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  margin-top: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-2);
}
.stat-lead { grid-column: span 2; }
.stat-lead .stat-num { font-size: 32px; color: var(--accent); }

/* ───────────────────────────────────────────────────────────
   Services
─────────────────────────────────────────────────────────── */
.vp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.vp-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.vp-icon { width: 20px; height: 20px; color: var(--muted); }
.vp-icon svg {
  display: block;
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vp-title { font-size: 17px; line-height: 24px; }
.vp-desc { flex: 1; font-size: 14px; line-height: 22px; color: var(--text-2); }

/* ───────────────────────────────────────────────────────────
   Tags
─────────────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 20px;
  color: var(--text-2);
  white-space: nowrap;
}

/* ───────────────────────────────────────────────────────────
   Stack
─────────────────────────────────────────────────────────── */
.stack-list { border-top: 1px solid var(--line); }
.stack-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.stack-row h3 { font-size: 14px; line-height: 28px; color: var(--text-2); }

/* ───────────────────────────────────────────────────────────
   Case studies
─────────────────────────────────────────────────────────── */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.cs-wide { grid-column: 1 / -1; }

.cs-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.cs-name { font-size: 18px; font-weight: 500; line-height: 24px; }
.cs-client {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}
.cs-status {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-2);
}

.cs-body { display: grid; gap: 12px; }
.cs-wide .cs-body { grid-template-columns: 1fr 1fr; gap: 24px; }
.cs-body p { font-size: 14px; line-height: 22px; color: var(--text-2); }
.cs-body strong { font-weight: 500; color: var(--text); }

.cs-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cs-result-num {
  display: block;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 24px;
  color: var(--text);
}
.cs-result-label {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}
.cs-metric {
  font-size: 14px;
  line-height: 22px;
  color: var(--text);
}
.cs-link { font-size: 14px; width: fit-content; }

/* ───────────────────────────────────────────────────────────
   Timeline
─────────────────────────────────────────────────────────── */
.timeline-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.timeline-item:first-child { border-top: 0; padding-top: 0; }
.timeline-item:last-child { padding-bottom: 0; }

.timepill {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 24px;
  color: var(--muted);
}
.tl-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.tl-header h3 { font-size: 18px; line-height: 24px; }
.tl-badge {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.timeline-body .meta { margin-top: 4px; }
.desc { margin-top: 12px; max-width: 40rem; color: var(--text-2); }

.tl-bullets { display: grid; gap: 8px; margin-top: 16px; }
.tl-bullet {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 22px;
  color: var(--text-2);
}
.tl-bullet::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted);
}
.tl-bullet strong { font-weight: 500; color: var(--text); }
.timeline-body .tags { margin-top: 16px; }

/* ───────────────────────────────────────────────────────────
   Principles
─────────────────────────────────────────────────────────── */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.why-card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.why-title { font-size: 17px; line-height: 24px; }
.why-desc { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--text-2); }

/* ───────────────────────────────────────────────────────────
   Contact
─────────────────────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.split h2 { font-size: 32px; line-height: 36px; letter-spacing: -0.02em; }
.list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.list li {
  font-size: 14px;
  line-height: 22px;
  color: var(--text-2);
}
.list strong { font-weight: 500; color: var(--text); }

.cta-block p { max-width: 32rem; margin-top: 16px; color: var(--text-2); }
.cta-block .cta-sub { font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--muted); }

.footer {
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .anim:not(.in) { opacity: 1; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ───────────────────────────────────────────────────────────
   Responsive
─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 48px; }
  .portrait { max-width: 320px; }
  .vp-grid, .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-lead { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; gap: 48px; }
  .cs-wide .cs-body { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 700px) {
  .nav { padding: 0 16px; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-link, .nav-cta { padding: 12px 16px; margin-left: 0; text-align: center; }

  .page { padding: calc(var(--nav-h) + 48px) 16px 48px; }
  .section { padding: 48px 0; }
  .hero { padding-bottom: 48px; }
  .tagline { font-size: 16px; line-height: 26px; }

  .vp-grid, .stat-grid, .cs-grid, .why-grid { grid-template-columns: 1fr; }
  .cs-wide { grid-column: auto; }
  .stack-row { grid-template-columns: 1fr; gap: 8px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .cs-results { grid-template-columns: 1fr; }
}

/* ───────────────────────────────────────────────────────────
   Motion — entrances and hover
─────────────────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes wordup {
  from { transform: translateY(105%); }
  to   { transform: none; }
}

/* Hero loads in a sequence */
.hero-copy > * { animation: rise 700ms var(--ease) backwards; }
.hero-copy > :nth-child(1) { animation-delay: 60ms; }
.hero-copy > :nth-child(3) { animation-delay: 420ms; }
.hero-copy > :nth-child(4) { animation-delay: 520ms; }
.hero-copy > :nth-child(5) { animation-delay: 600ms; }
.portrait { animation: rise 800ms var(--ease) 300ms backwards; }

.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; }
.hero h1 .w > span {
  display: inline-block;
  animation: wordup 800ms var(--ease) backwards;
  animation-delay: calc(140ms + var(--i) * 70ms);
}

/* Cards and rows rise as they enter the viewport */
.js .anim:not(.in) { opacity: 0; }
.anim.in {
  animation: rise 600ms var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}

.stat, .vp-card, .cs-card, .why-card, .portrait {
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), background-color 220ms var(--ease), box-shadow 220ms var(--ease);
}
.stat:hover, .vp-card:hover, .cs-card:hover, .why-card:hover {
  transform: translateY(-4px);
  background: #152b5e;
  border-color: rgba(108, 184, 255, 0.5);
  box-shadow: 0 12px 32px rgba(3, 10, 28, 0.45);
}
.tag { transition: color 150ms var(--ease), border-color 150ms var(--ease); }
.cs-card:hover .tag, .vp-card:hover .tag { color: var(--text); border-color: rgba(108, 184, 255, 0.35); }
.vp-card:hover .vp-icon { color: var(--accent); }
.vp-icon { transition: color 220ms var(--ease); }
.stack-row { transition: background-color 180ms var(--ease); }
.stack-row:hover { background: rgba(108, 184, 255, 0.06); }
.timeline-item .timepill { transition: color 180ms var(--ease); }
.timeline-item:hover .timepill { color: var(--accent); }
