/* ===== Tokens ===== */
:root {
  --bg: #fbfaf8;
  --bg-alt: #f2f0ec;
  --surface: #ffffff;
  --text: #16151a;
  --muted: #5e5b66;
  --line: #e4e1db;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #eceafd;
  --hl: #ffd166;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 18, 30, .06), 0 8px 24px rgba(20, 18, 30, .08);
  --shadow-lg: 0 2px 4px rgba(20, 18, 30, .06), 0 24px 60px rgba(20, 18, 30, .16);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111016;
    --bg-alt: #18171f;
    --surface: #1e1d26;
    --text: #f2f1f5;
    --muted: #a3a0ad;
    --line: #2d2b36;
    --accent: #8b84ff;
    --accent-ink: #0d0c14;
    --accent-soft: #25233a;
    --hl: #f4b942;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
iframe { display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.2rem; }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); }
.eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75em;
}

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .85em 1.4em; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn-small { padding: .6em 1.1em; font-size: .92rem; }
.btn-block { width: 100%; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: .6em; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.logo-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 1.05rem;
}
.logo-sub { font-weight: 500; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a:not(.btn) { text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--muted); }
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-links .btn { margin-top: 12px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ===== Hero ===== */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: .08em; height: .38em;
  background: var(--hl); z-index: -1; border-radius: 4px; transform: rotate(-1.5deg);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .95rem; }
.hero-points li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: .45em; }

/* Site previews: a laptop-style browser with a phone overlapping its corner.
   main.js scales each .fit-frame iframe so the whole page width fits its box. */
.hero-visual { position: relative; padding-bottom: 40px; }
.browser {
  position: relative; width: 88%; border-radius: 12px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.browser-bar { height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.screen { position: relative; overflow: hidden; }
.browser .screen { aspect-ratio: 16 / 10; }
.phone {
  position: absolute; right: 0; bottom: 0; width: 27%; min-width: 96px; max-width: 160px; aspect-ratio: 9 / 19;
  border-radius: 24px; border: 6px solid #16151a; background: #16151a; overflow: hidden; box-shadow: var(--shadow-lg);
}
.phone .screen { height: 100%; border-radius: 18px; }
.fit-frame iframe {
  position: absolute; top: 0; left: 0; border: 0; pointer-events: none; transform-origin: 0 0;
  width: 1280px; height: 960px;
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; }
}
@media (max-width: 560px) {
  .phone { border-width: 4px; border-radius: 18px; }
  .phone .screen { border-radius: 14px; }
}

/* ===== Strip ===== */
.strip { border-block: 1px solid var(--line); background: var(--surface); }
.strip-inner { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.strip-inner > div { padding: 22px 8px; display: flex; flex-direction: column; }
.strip-inner > div + div { border-left: 1px solid var(--line); }
.strip strong { font-family: var(--font-display); font-size: 1.5rem; }
.strip span { color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) {
  .strip-inner { grid-template-columns: repeat(2, 1fr); }
  .strip-inner > div:nth-child(3) { border-left: 0; }
  .strip-inner > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ===== Sections ===== */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: 48px; }

/* ===== Work ===== */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.work-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.work-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.work-thumb { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.work-thumb::after {
  content: "View live site ↗"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(15, 14, 20, .55); color: #fff; font-weight: 600; opacity: 0; transition: opacity .2s;
}
.work-thumb:hover::after, .work-thumb:focus-visible::after { opacity: 1; }
.work-body { padding: 22px 24px 26px; }
.work-body p { color: var(--muted); font-size: .97rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tags span { font-size: .75rem; font-weight: 600; padding: .3em .7em; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tags span + span { background: var(--bg-alt); color: var(--muted); }
.work-wins { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.work-wins li { padding: 4px 0; }
.work-wins li::before { content: "→"; color: var(--accent); margin-right: .5em; }

@media (max-width: 960px) { .work-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .work-grid { grid-template-columns: 1fr; } }

/* ===== Services ===== */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.service p { color: var(--muted); margin: 0; font-size: .97rem; }
.icon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 18px; }
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 960px) { .services-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

/* ===== Steps ===== */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: s; }
.steps li { position: relative; }
.steps li p { color: var(--muted); font-size: .97rem; }
.step-num {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--text); color: var(--bg); font-family: var(--font-display); font-weight: 700; margin-bottom: 18px;
}
@media (min-width: 961px) {
  .steps li:not(:last-child)::after {
    content: ""; position: absolute; top: 22px; left: 60px; right: -16px; height: 2px;
    background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px);
  }
}
@media (max-width: 960px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ===== Quote CTA ===== */
.quote-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(28px, 5vw, 56px); box-shadow: var(--shadow);
}
.quote-cta h2 { max-width: 24ch; }
.quote-cta .lead { max-width: 56ch; }
.quote-points { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: .95rem; }
.quote-points li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: .45em; }
.quote-cta .btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 860px) { .quote-cta { flex-direction: column; align-items: flex-start; } }

/* ===== About ===== */
.about { display: grid; grid-template-columns: 360px 1fr; gap: 64px; align-items: center; }
.about-photo {
  aspect-ratio: 4 / 5; border-radius: 22px;
  background: linear-gradient(135deg, var(--accent) 0%, #a855f7 55%, var(--hl) 130%);
  display: grid; place-items: center; box-shadow: var(--shadow-lg);
}
.about-photo { overflow: hidden; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.about p:not(.lead):not(.eyebrow) { color: var(--muted); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 32px; } .about-photo { max-width: 280px; } }

/* ===== FAQ ===== */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 24px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); transition: transform .2s; flex-shrink: 0; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 24px 20px; margin: 0; color: var(--muted); }

/* ===== Contact ===== */
.contact { --on: #f4f3f7; background: #16151a; color: var(--on); }
@media (prefers-color-scheme: dark) { .contact { background: #0a090e; border-top: 1px solid var(--line); } }
.contact .lead, .contact .muted { color: color-mix(in srgb, var(--on) 70%, transparent); }
.contact .eyebrow { color: #ffd166; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 32px 0 0; }
.contact-list li { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--on) 18%, transparent); }
.contact-list span { width: 70px; flex-shrink: 0; color: color-mix(in srgb, var(--on) 60%, transparent); font-size: .9rem; padding-top: 2px; }
.contact-grid > * { min-width: 0; }
.contact-list a { text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; }

.contact-form {
  background: var(--surface); color: var(--text); border-radius: 18px; padding: 32px;
  display: grid; gap: 16px; box-shadow: var(--shadow-lg);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.contact-form textarea { resize: vertical; }
.contact-form .btn { margin-top: 4px; }
.form-note { margin: 0; font-size: .92rem; text-align: center; min-height: 1.4em; }
.form-note.ok { color: #16a34a; }
.form-note.err { color: #dc2626; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } .contact-form { padding: 22px; } }

/* ===== Footer ===== */
.footer { padding: 40px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; }
.footer p { margin: 0; font-size: .92rem; }

/* ===== Reveal animation ===== */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .work-card { transition: none; }
}
