/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0b0d0e;
  --bg-raised: #121517;
  --bg-card: #171b1d;
  --line: #242a2d;
  --line-strong: #343c40;
  --text: #e9eeee;
  --text-muted: #a3adb0;
  --text-faint: #869195;
  --accent: #5ce0c6;
  --accent-strong: #86ecd8;
  --accent-ink: #04201a;
  --accent-soft: rgba(92, 224, 198, 0.1);
  --warn: #f3c969;

  --radius: 14px;
  --radius-sm: 8px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img { max-width: 100%; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.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; }
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: 760px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 14, 0.82);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark {
  font-family: var(--mono); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu a {
  display: block; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; color: var(--text-muted); font-size: .95rem; font-weight: 500;
  transition: color .15s ease, background-color .15s ease;
}
.nav-menu a:hover { color: var(--text); background: var(--bg-card); }
.nav-menu a[aria-current="true"] { color: var(--accent); }
.nav-menu .nav-cta { color: var(--accent-ink); background: var(--accent); margin-left: 8px; font-weight: 600; }
.nav-menu .nav-cta:hover { color: var(--accent-ink); background: var(--accent-strong); }
.nav-menu .nav-cta[aria-current="true"] { color: var(--accent-ink); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--text);
  cursor: pointer; position: relative;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px;
  background: currentColor; border-radius: 2px; content: ""; transition: transform .2s ease;
}
.nav-toggle-bar { top: 50%; margin-top: -1px; }
.nav-toggle-bar::before { top: -6px; left: 0; margin-left: 0; }
.nav-toggle-bar::after { top: 6px; left: 0; margin-left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--bg-raised); border-bottom: 1px solid var(--line); display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 14px 12px; border-radius: var(--radius-sm); font-size: 1rem; }
  .nav-menu .nav-cta { margin: 8px 0 0; text-align: center; border-radius: 999px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-faint); background: var(--bg-card); }
.btn-lg { font-size: 1.05rem; padding: 14px 26px; word-break: break-all; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; text-decoration: none; }
.link-arrow::after { content: "→"; transition: transform .15s ease; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(72px, 13vw, 140px) 0 clamp(96px, 14vw, 168px);
  background: radial-gradient(120% 70% at 50% 100%, rgba(92, 224, 198, 0.10), transparent 60%), var(--bg);
}
/* 3D floor: a grid tilted back in perspective, fading toward a glowing horizon */
.hero-grid {
  position: absolute; left: -50%; right: -50%; bottom: 0; height: 70%;
  z-index: -1; pointer-events: none;
  perspective: 420px; perspective-origin: 50% 0%;
}
.hero-grid::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, rgba(92, 224, 198, 0.34) 1px, transparent 1px),
    linear-gradient(rgba(92, 224, 198, 0.34) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: rotateX(62deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 25%, transparent 92%);
          mask-image: linear-gradient(to top, #000 25%, transparent 92%);
  animation: grid-drift 5s linear infinite;
}
@keyframes grid-drift { to { background-position: 0 72px; } }
.hero .container { position: relative; z-index: 1; }
.kicker, .label {
  font-family: var(--mono); font-size: .88rem; font-weight: 500; color: var(--accent);
  letter-spacing: .02em; margin-bottom: 18px;
}
.kicker span { color: var(--text-faint); }
.hero h1 {
  font-size: clamp(2.3rem, 6.4vw, 4.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04;
  max-width: 15ch;
}
.hero h1 .hl { color: var(--text-faint); }
.pitch { max-width: 620px; margin: 24px 0 32px; font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--text-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.facts {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: clamp(40px, 7vw, 64px);
  font-family: var(--mono); font-size: .88rem; color: var(--text-muted);
}
.facts li { display: flex; align-items: baseline; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); align-self: center; }
.facts strong { color: var(--text); font-weight: 700; }
@media (max-width: 560px) {
  .hero-actions .btn { width: 100%; }
  .facts { flex-direction: column; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 112px) 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(1.8rem, 4.2vw, 2.6rem); font-weight: 800; margin-bottom: 32px; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.25rem); color: var(--text-muted); }

/* Services */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .services { grid-template-columns: 1fr; } }
.service {
  padding: 26px; border-radius: var(--radius);
  background: var(--bg-raised); border: 1px solid var(--line);
  transition: border-color .2s ease;
}
.service:hover { border-color: var(--line-strong); }
.service h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.service p { color: var(--text-muted); margin-bottom: 14px; }
.service .seen-in { font-family: var(--mono); font-size: .8rem; color: var(--text-faint); margin: 0; }
.pricing-note {
  margin: 24px 0 0; padding: 16px 20px; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); color: var(--text-muted);
}

/* Work */
.work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 700px) { .work { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card picture { display: block; border-bottom: 1px solid var(--line); background: var(--bg-card); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.card h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 10px; }
.card .what { color: var(--text); font-size: .98rem; }
.card .built { color: var(--text-muted); font-size: .95rem; }
.card .built span { color: var(--text); font-weight: 600; }
.card .tags { margin: 4px 0 20px; }
.card .link-arrow { margin-top: auto; }
.status {
  align-self: flex-start; margin-bottom: 12px;
  font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px;
}
.status.live { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(92, 224, 198, 0.3); }
.status.progress { color: var(--warn); background: rgba(243, 201, 105, 0.08); border: 1px solid rgba(243, 201, 105, 0.3); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 4px 11px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--line);
  font-size: .82rem; color: var(--text); line-height: 1.4;
}

/* Process */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.steps li {
  position: relative; padding: 24px; border-radius: var(--radius);
  background: var(--bg-raised); border: 1px solid var(--line);
}
.step-num { display: block; font-family: var(--mono); font-size: .85rem; color: var(--accent); margin-bottom: 14px; }
.steps h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.steps p { color: var(--text-muted); font-size: .96rem; margin: 0; }

/* Contact */
.contact .lead { margin-bottom: 28px; }
.contact-alt { margin: 20px 0 0; color: var(--text-faint); font-size: .95rem; }
.contact-alt a { color: var(--text-muted); }
.contact-alt a:hover { color: var(--accent); }
@media (max-width: 560px) { .btn-lg { width: 100%; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .9rem; color: var(--text-faint); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* Fifth card spans the row so the grid has no empty slot */
@media (min-width: 701px) {
  .card-wide { grid-column: 1 / -1; flex-direction: row; }
  .card-wide picture { flex: 0 0 50%; border-bottom: 0; border-right: 1px solid var(--line); }
  .card-wide picture { display: flex; align-items: center; background: #0a0a0a; }
  .card-wide img { object-fit: contain; }
  .card-wide .card-body { justify-content: center; }
}
