:root {
  --paper: #F6F7F9;
  --white: #FFFFFF;
  --ink: #0E1116;
  --ink-2: #2A303A;
  --steel: #5B6472;
  --line: #E2E5EA;
  --accent: #2B59FF;
  --accent-2: #1E43D9;
  --live: #12B76A;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.025em; line-height: 1.05; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { display: block; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(246,247,249,.78); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid rgba(14,17,22,.06); }
.header-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
#primary-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
#primary-nav a:hover { color: var(--ink); }
#primary-nav .nav-cta { color: #fff; background: var(--ink); padding: 9px 16px; border-radius: 10px; }
#primary-nav .nav-cta:hover { background: #000; color: #fff; }
.menu-toggle { display: none; width: 40px; height: 40px; border: 0; background: transparent; padding: 0; cursor: pointer; position: relative; }
.menu-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease); }
.menu-toggle span:first-child { top: 15px; }
.menu-toggle span:last-child { top: 23px; }
.is-menu-open .menu-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.is-menu-open .menu-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border-radius: 12px; font-weight: 600; font-size: 16px; border: 1px solid transparent; cursor: pointer; transition: transform .2s var(--ease), background-color .2s, box-shadow .2s; font-family: var(--body); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 24px -10px rgba(43,89,255,.7); }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #C9CED6; transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 112px) var(--gutter) 40px;
  background:
    radial-gradient(900px 500px at 85% 20%, rgba(43,89,255,.10), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(18,183,106,.06), transparent 60%),
    var(--paper); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(14,17,22,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(14,17,22,.045) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(700px 420px at 70% 40%, #000, transparent 75%); mask-image: radial-gradient(700px 420px at 70% 40%, #000, transparent 75%); }
.hero-grid { position: relative; max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(42px, 6.4vw, 84px); font-weight: 700; letter-spacing: -.04em; line-height: .98; max-width: 11ch; }
.lede { margin-top: 26px; font-size: clamp(17px, 1.5vw, 20px); color: var(--steel); max-width: 44ch; }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }

/* 3D stage of production panes */
.stage { --px: 0; --py: 0; position: relative; height: 470px; perspective: 1400px; }
.pane { position: absolute; background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.95); border-radius: 18px;
  box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgba(14,17,22,.04), 0 30px 60px -24px rgba(14,17,22,.28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .5s var(--ease); }
.pane-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--steel); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pane-bar i { width: 9px; height: 9px; border-radius: 50%; background: #DDE1E7; }
.pane-bar span { margin-left: 8px; }
.pane-back { width: 78%; right: 0; top: 0; transform: rotateY(calc(-16deg + var(--px) * 10deg)) rotateX(calc(8deg - var(--py) * 8deg)) translateZ(-80px); }
.log { list-style: none; margin: 0; padding: 14px 16px 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--ink-2); display: grid; gap: 8px; }
.log b { display: inline-block; width: 54px; color: var(--steel); font-weight: 500; }
.log .ok { color: var(--live); }
.log .ok b { color: var(--live); }
.pane-mid { width: 64%; left: 0; top: 200px; transform: rotateY(calc(-12deg + var(--px) * 14deg)) rotateX(calc(6deg - var(--py) * 10deg)) translateZ(0); }
.rows { padding: 8px 14px 12px; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row em { margin-left: auto; font-style: normal; color: var(--steel); font-weight: 400; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pane-front { right: 4%; bottom: -6px; display: flex; align-items: center; gap: 14px; padding: 16px 20px 16px 16px; transform: rotateY(calc(-8deg + var(--px) * 18deg)) rotateX(calc(4deg - var(--py) * 12deg)) translateZ(90px); }
.pay-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--live); box-shadow: 0 10px 20px -8px rgba(18,183,106,.7); }
.pay-icon svg { width: 22px; height: 22px; }
.pay-title { font-weight: 600; font-size: 15px; }
.pay-sub { font-size: 13px; color: var(--steel); }

.live-strip { position: relative; max-width: var(--wrap); margin: clamp(48px, 7vw, 80px) auto 0; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; font-size: 15px; }
.live-label { color: var(--steel); }
.live-strip a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.live-strip a:hover { color: var(--accent); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--live); opacity: 0; }

/* Sections */
.section { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(72px, 9vw, 120px) var(--gutter); }
.section-alt { max-width: none; background: var(--white); border-block: 1px solid var(--line); }
.section-alt > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 700; letter-spacing: -.035em; }
.section-head p { color: var(--steel); font-size: 18px; max-width: 40ch; justify-self: end; }

/* Clients */
.clients { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.client { display: flex; flex-direction: column; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.client:hover { transform: translateY(-4px); border-color: #CDD3DC; box-shadow: 0 30px 60px -30px rgba(14,17,22,.3); }
.client-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.client-top img { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #087443; background: #E7F8EF; padding: 5px 11px; border-radius: 999px; }
.client h3 { font-size: 22px; font-weight: 700; }
.client > p { margin-top: 6px; color: var(--steel); font-size: 15px; }
.tags { list-style: none; padding: 0; margin: 18px 0 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; }
.client-link { margin-top: auto; font-weight: 600; font-size: 15px; color: var(--accent); }
.client-link span { display: inline-block; transition: transform .2s var(--ease); }
.client:hover .client-link span { transform: translate(3px, -3px); }

/* What we build */
.build { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.build article { padding: 30px 28px 34px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color .25s; }
.build article:hover { background: var(--paper); }
.build svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 20px; }
.build h3 { font-size: 21px; font-weight: 600; }
.build p { margin-top: 8px; color: var(--steel); font-size: 15px; }

/* Process (a real sequence) */
.process { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: none; }
.process li { position: relative; padding-top: 22px; border-top: 2px solid var(--ink); }
.process li:last-child { border-top-color: var(--live); }
.step { font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--steel); }
.process h3 { margin-top: 10px; font-size: 26px; font-weight: 700; }
.process p { margin-top: 8px; color: var(--steel); font-size: 15px; }

/* Contact */
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact h2 { font-size: clamp(38px, 5vw, 64px); font-weight: 700; letter-spacing: -.04em; }
.contact-copy > p { margin-top: 18px; color: var(--steel); font-size: 18px; max-width: 36ch; }
.email { display: inline-block; margin-top: 28px; font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--accent); border-bottom: 2px solid rgba(43,89,255,.25); }
.email:hover { border-bottom-color: var(--accent); }
.contact address { margin-top: 28px; font-style: normal; color: var(--steel); font-size: 15px; line-height: 1.7; }
.contact address strong { color: var(--ink); font-weight: 600; }
.form { display: grid; gap: 16px; padding: clamp(22px, 3vw, 34px); background: var(--white); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 60px -36px rgba(14,17,22,.3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.form input, .form select, .form textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(43,89,255,.12); }
.form textarea { resize: vertical; }
.form .btn { justify-self: start; }
.form-status { font-size: 14px; min-height: 1.4em; }
.form-status[data-status="success"] { color: #087443; }
.form-status[data-status="error"] { color: #B42318; }

/* Footer */
.site-footer { background: var(--ink); color: #A9B0BB; font-size: 14px; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gutter); display: grid; grid-template-columns: 1fr auto; gap: 18px 32px; align-items: start; }
.footer-inner strong { color: #fff; font-weight: 600; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-inner nav a:hover { color: #fff; }
.copy { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid #262B33; }

/* Motion: one load sequence for the hero, reveal on scroll, a breathing live dot */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease) forwards; }
  .hero-copy > :nth-child(2) { animation-delay: .1s; }
  .hero-copy > :nth-child(3) { animation-delay: .2s; }
  .pane { opacity: 0; animation: pane-in 1.1s var(--ease) forwards; }
  .pane-back { animation-delay: .15s; }
  .pane-mid { animation-delay: .35s; }
  .pane-front { animation-delay: .6s; }
  .pulse::after { animation: ping 2.4s ease-out infinite; }
  [data-reveal] { opacity: 0; translate: 0 22px; transition: opacity .8s var(--ease), translate .8s var(--ease); }
  [data-reveal].is-visible { opacity: 1; translate: 0 0; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes pane-in { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }
@keyframes ping { 0% { opacity: .7; transform: scale(.6); } 80%, 100% { opacity: 0; transform: scale(1.8); } }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .contact, .section-head { grid-template-columns: 1fr; }
  .section-head p { justify-self: start; }
  .stage { height: 380px; max-width: 560px; }
  .clients, .build { grid-template-columns: 1fr 1fr; }
  .process { grid-template-columns: 1fr 1fr; row-gap: 32px; }
}
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  #primary-nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; background: var(--paper); border-bottom: 1px solid var(--line); display: none; }
  #primary-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  #primary-nav .nav-cta { margin-top: 14px; text-align: center; border: 0; }
  .is-menu-open #primary-nav { display: flex; }
}
@media (max-width: 620px) {
  .clients, .build, .process, .form-row { grid-template-columns: 1fr; }
  .stage { height: 340px; }
  .pane-back { width: 92%; }
  .pane-mid { width: 82%; top: 130px; }
  .pane-front { right: 0; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* Inner page head + clients page */
.page-head { padding: clamp(56px, 8vw, 104px) var(--gutter) clamp(8px, 2vw, 16px);
  background: radial-gradient(800px 400px at 85% 0%, rgba(43,89,255,.10), transparent 60%), var(--paper); }
.page-head-inner { max-width: var(--wrap); margin: 0 auto; }
.page-head h1 { font-size: clamp(44px, 6vw, 80px); font-weight: 700; letter-spacing: -.04em; }
.page-head .lede { max-width: 52ch; }
.clients-page { padding-top: clamp(36px, 5vw, 56px); }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 0; }
.cta-band h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 700; max-width: 22ch; }
#primary-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
