/* ConstructaByte — software blueprint identity
   Paper #F4F6F9, Ink #131A2A, Cobalt #2B50E8 (actions), Spark #FFC21A (the "byte" in the logo, small highlights) */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2-variations"),
       url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4f6f9;
  --sheet: #ffffff;
  --ink: #131a2a;
  --graphite: #4a5468;
  --line: #8a94a6;
  --rule: #d5dae3;
  --tint: #eaf0ff;
  --accent: #2b50e8;
  --accent-deep: #1f3bb3;
  --spark: #ffc21a;
  --focus: #1f4fd6;
  --max: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.1rem, 3.8vw, 3rem);
  --step-5: clamp(2.75rem, 7vw, 5.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; max-width: 68ch; }
ul, ol { padding-left: 1.2em; }

h1, h2, h3, .display {
  font-stretch: 125%;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: 1.1; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--graphite); max-width: 52ch; }
.note { font-stretch: 75%; font-weight: 600; font-size: var(--step--1); color: var(--graphite); letter-spacing: 0.01em; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 12px; top: 12px; background: var(--ink); color: var(--sheet); padding: 10px 14px; z-index: 100; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-stretch: 125%; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav a { text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--ink); padding: 8px 12px; font: inherit; font-weight: 600; border-radius: 4px; cursor: pointer; color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; min-height: 48px;
  font: inherit; font-weight: 700; font-stretch: 112%;
  text-decoration: none; border-radius: 4px; cursor: pointer;
  border: 2px solid var(--ink);
  transition: transform .12s ease, background-color .12s ease;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:hover { background: var(--accent-deep); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); text-decoration: none; }
.btn-primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-plain { background: transparent; color: var(--ink); }
.btn-plain:hover { background: var(--sheet); text-decoration: none; }
.nav .btn { padding: 9px 16px; min-height: 40px; box-shadow: 3px 3px 0 var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* Sections */
section { padding: clamp(64px, 9vw, 112px) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 32px; align-items: end; margin-bottom: 48px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--graphite); }
.ruled { border-top: 1px solid var(--rule); }

/* Hero */
.hero { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(56px, 8vw, 104px);
  background-image: linear-gradient(rgba(43,80,232,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(43,80,232,.07) 1px, transparent 1px);
  background-size: 32px 32px; background-position: center top; border-bottom: 1px solid var(--rule); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: 24px; font-size: clamp(2.6rem, 4.6vw, 4.1rem); font-stretch: 118%; }
.drawing svg { width: 100%; }
.hero .where { margin-top: 28px; }
.drawing { position: relative; margin: 0; }
.drawing figcaption { margin-top: 10px; }

/* Hero drawing — one orchestrated moment */
.dw .stroke { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dw .thin { fill: none; stroke: var(--line); stroke-width: 1.25; }
.dw .dim { fill: none; stroke: var(--graphite); stroke-width: 1.25; }
.dw .fill-sheet { fill: var(--sheet); }
.dw .fill-ink { fill: var(--ink); }
.dw .fill-accent { fill: var(--accent); }
.dw .fill-accent-soft { fill: #d7e1ff; }
.dw .fill-spark { fill: var(--spark); }
.dw .fill-spark-soft { fill: #ffeab0; }
.dw .fill-tint { fill: var(--tint); }
.dw .accent-line { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.dw .ui-inv { font-stretch: 110%; font-weight: 800; fill: #fff; }
.dw .fill-rule { fill: var(--rule); }
.dw text { font-family: "Archivo", sans-serif; }
.dw .call { font-stretch: 75%; font-weight: 650; font-size: 17.5px; fill: var(--ink); }
.dw .ui { font-stretch: 110%; font-weight: 800; fill: var(--ink); }
.dw .ui-sm { font-weight: 500; fill: var(--graphite); }


@media (prefers-reduced-motion: no-preference) {
  .dw .draw { stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200); animation: draw 1.1s cubic-bezier(.6,.1,.2,1) forwards; animation-delay: var(--d, 0s); }
  .dw .fade { opacity: 0; animation: fade .5s ease forwards; animation-delay: var(--d, 1s); }
  .dw .grow { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); animation: grow .45s ease-out forwards; animation-delay: var(--d, 1.4s); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes grow { to { transform: scaleX(1); } }

/* Services list (rows, not cards) */
.svc { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr); gap: 32px; padding: 36px 0; border-top: 1px solid var(--rule); }
.svc:last-child { border-bottom: 1px solid var(--rule); }
.svc h3 { margin-bottom: 8px; }
.svc .from { font-stretch: 75%; font-weight: 650; color: var(--graphite); margin: 0; }
.svc ul { margin: 0; padding-left: 1.1em; }
.svc li { margin-bottom: 4px; }
.svc .more { display: inline-block; margin-top: 12px; font-weight: 700; }
.svc-icon { width: 44px; height: 44px; margin-bottom: 14px; }

/* Ink band (case study) */
.band { background: var(--ink); color: var(--sheet); }
.band a { color: var(--sheet); }
.band .note { color: #b9c4c0; }
.band .btn-primary { color: #fff; border-color: #fff; box-shadow: 4px 4px 0 #fff; }
.band .btn-primary:hover { box-shadow: 5px 5px 0 #fff; }
.case { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.case h2 { color: var(--sheet); }
.case p { color: #d6dedb; }
.modules { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #3a474d; }
.modules li { padding: 14px 0; border-bottom: 1px solid #3a474d; font-weight: 600; }
.modules li:nth-child(odd) { padding-right: 16px; }
.stack { margin-top: 24px; }
.case .fact { font-stretch: 125%; font-weight: 800; font-size: var(--step-3); line-height: 1.05; color: var(--spark); margin: 0 0 6px; }

/* Process — a real sequence, so numbered */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.steps li { counter-increment: step; padding: 0 24px 0 0; position: relative; }
.steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%;
  font-stretch: 125%; font-weight: 800; background: var(--sheet); position: relative; z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 22px; left: 44px; right: 0; border-top: 2px dashed var(--accent); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: var(--step-1); margin: 18px 0 6px; }
.steps p { color: var(--graphite); font-size: 0.98rem; }

/* Build-up animation: JS adds .anim, then .built when the list scrolls into view.
   Each step: number pops in, text rises, then the dashed line draws to the next step.
   The last number fills cobalt once everything before it is in place. */
.steps li { --t: 0s; }
.steps li:nth-child(2) { --t: .6s; }
.steps li:nth-child(3) { --t: 1.2s; }
.steps li:nth-child(4) { --t: 1.8s; }
.steps.anim li::before { opacity: 0; transform: scale(.4); transition: opacity .3s ease var(--t), transform .45s cubic-bezier(.2,1.6,.4,1) var(--t), background-color .4s ease, color .4s ease, border-color .4s ease; }
.steps.anim h3, .steps.anim p { opacity: 0; transform: translateY(12px); transition: opacity .45s ease calc(var(--t) + .15s), transform .45s ease calc(var(--t) + .15s); }
.steps.anim p { transition-delay: calc(var(--t) + .25s); }
.steps.anim li::after { transform: scaleX(0); transform-origin: left center; transition: transform .45s ease-out calc(var(--t) + .3s); }
.steps.anim.built li::before { opacity: 1; transform: none; }
.steps.anim.built h3, .steps.anim.built p { opacity: 1; transform: none; }
.steps.anim.built li::after { transform: scaleX(1); }
.steps.anim.built li:last-child::before { background: var(--accent); border-color: var(--accent); color: #fff; transition-delay: var(--t), var(--t), 2.4s, 2.4s, 2.4s; }
@media (prefers-reduced-motion: reduce) {
  .steps.anim li::before, .steps.anim h3, .steps.anim p, .steps.anim li::after { transition: none !important; opacity: 1 !important; transform: none !important; }
}

/* Pricing table */
.price-table { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--sheet); border: 2px solid var(--ink); }
.price-table th, .price-table td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.price-table thead th { background: var(--ink); color: var(--sheet); font-stretch: 112%; font-weight: 700; }
.price-table td:first-child { font-weight: 700; }
.price-table .num { font-stretch: 112%; font-weight: 800; white-space: nowrap; }
.price-table tr.pick td { background: var(--tint); }
.price-table .tag { display: inline-block; margin-left: 8px; padding: 2px 8px; background: var(--spark); border: 1px solid var(--ink); border-radius: 3px; font-stretch: 75%; font-weight: 700; font-size: 0.8rem; vertical-align: 2px; }
.table-scroll { overflow-x: auto; }

/* Areas */
.areas { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.areas li { border: 1px solid var(--ink); border-radius: 999px; padding: 6px 14px; background: var(--sheet); font-weight: 500; }

/* FAQ */
.faq { border-top: 1px solid var(--rule); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 22px 40px 22px 0; position: relative; font-weight: 700; font-size: var(--step-1); line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-size: 1.6rem; font-weight: 400; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 22px; color: var(--graphite); }

/* CTA band */
.cta { background: var(--accent); color: #fff; }
.cta h2 { color: #fff; }
.cta .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: center; }
.cta h2 { margin: 0 0 12px; }
.cta p { margin: 0; }
.cta .btn-primary { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.cta .btn-primary:hover { background: var(--tint); box-shadow: 5px 5px 0 var(--ink); }

/* Page header (inner pages) */
.page-head { padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: var(--step-4); max-width: 18ch; }
.crumbs { margin-bottom: 18px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--graphite); }

/* Prose blocks on inner pages */
.two-col { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.spec { background: var(--sheet); border: 2px solid var(--ink); border-radius: 4px; padding: 28px; position: sticky; top: 96px; }
.spec h2, .spec h3 { font-size: var(--step-1); margin-bottom: 12px; }
.spec .num { font-stretch: 125%; font-weight: 800; font-size: var(--step-3); line-height: 1; margin: 0 0 4px; }
.spec ul { margin: 16px 0 0; padding-left: 1.1em; }
.checks { list-style: none; padding: 0; margin: 0 0 1.5em; }
.checks li { padding: 10px 0 10px 32px; border-bottom: 1px solid var(--rule); position: relative; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 14px; height: 8px; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }
.prose h2 { font-size: var(--step-3); margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-1); margin-top: 1.4em; }

/* Forms */
.form { display: grid; gap: 18px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.field .hint { font-size: var(--step--1); color: var(--graphite); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--sheet);
  border: 2px solid var(--ink); border-radius: 4px; padding: 12px 14px; width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; }
.hp { position: absolute; left: -9999px; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 56px 0 40px; font-size: 0.98rem; }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr)); gap: 32px; }
.site-footer h2 { font-size: 1rem; font-stretch: 112%; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.legal { max-width: none; grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 20px; color: var(--graphite); font-size: var(--step--1); }

/* Responsive */
@media (max-width: 960px) {
  .hero .wrap, .case, .two-col, .cta .wrap, .section-head { grid-template-columns: 1fr; }
  .svc { grid-template-columns: 1fr; gap: 14px; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .steps li:nth-child(2)::after { display: none; }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .spec { position: static; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 8px var(--gutter) 20px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; width: 100%; }
  .nav .btn { margin-top: 8px; width: auto; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
  .modules { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .price-table th, .price-table td { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Product screenshots and screen recordings */
.shot, .clip { margin: 0; }
.shot a { display: block; }
.shot img, .clip video { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); }
.shot figcaption, .clip figcaption { font-size: 0.9rem; color: var(--graphite); margin-top: 10px; }
.shot.lead img { border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--accent); }
.shot.on-dark img { border: 2px solid var(--sheet); box-shadow: 6px 6px 0 var(--accent); }
.shot.on-dark figcaption { color: #b9c4c0; }
.lead-shot { padding-top: 0; }
.lead-shot .wrap { max-width: 1100px; }
.clips { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 36px); margin-bottom: clamp(32px, 5vw, 56px); }
.clip video { border: 2px solid var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }
.gallery.two { grid-template-columns: 1fr 1fr; }
.shot a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 820px) {
  .clips, .gallery, .gallery.two { grid-template-columns: 1fr; }
}

/* Work page projects */
.project-sec { padding-top: clamp(24px, 4vw, 48px); }
.project { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.project + .project { margin-top: clamp(56px, 8vw, 104px); }
.project.flip .shot { order: 2; }
.project h2 { margin: 6px 0 12px; }
.kicker { font-stretch: 75%; font-weight: 650; color: var(--accent-deep); margin: 0; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 22px 0 26px; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts dt { font-stretch: 125%; font-weight: 800; font-size: var(--step-1); line-height: 1.1; }
.facts dd { margin: 4px 0 0; font-size: 0.9rem; color: var(--graphite); }
.build-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 28px); }
.build-card { display: block; padding: 26px; background: var(--sheet); border: 2px solid var(--ink); border-radius: 6px; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.build-card:hover, .build-card:focus-visible { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
.build-card h3 { margin: 0 0 6px; }
.build-card p { margin: 0; color: var(--graphite); }
@media (max-width: 820px) {
  .project, .build-grid { grid-template-columns: 1fr; }
  .project.flip .shot { order: 0; }
  .facts { grid-template-columns: 1fr 1fr 1fr; }
}
