/* Synth and Scale. Look follows the original site: Inter, deep navy, indigo-to-cyan gradient,
   photo-backed dark hero and band, light sections with rounded white cards.
   Images are self-hosted (Unsplash license) so the site makes no third-party requests. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #06b6d4;
  --dark: #0f172a;
  --dark-mid: #1e293b;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --line: #e2e8f0;
  --light: #f8fafc;
  --white: #ffffff;
  --error: #dc2626;
  --gradient: linear-gradient(135deg, var(--primary), var(--accent));
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 12px 40px rgba(15, 23, 42, 0.14);

  --face: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --measure: 64ch;
  --frame: 75rem;
  --gutter: clamp(1.25rem, 4vw, 1.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--face);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
h3 { font-weight: 700; letter-spacing: -0.01em; }

a { color: var(--primary-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--primary); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; z-index: 50; background: var(--white); color: var(--dark); padding: 0.6rem 1rem; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

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

/* ---------- Header (sits on the dark hero) ---------- */

.site-header { position: absolute; inset: 0 0 auto 0; z-index: 20; padding: 1.1rem 0; }
.site-header .frame { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; }

.wordmark { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--white); text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark:hover { color: var(--white); }
.wordmark .mark {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px;
  background: var(--gradient); color: var(--white); font-size: 0.78rem; font-weight: 800; letter-spacing: -0.02em;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.25rem 1.75rem; flex-wrap: wrap; }
.site-nav a { color: rgba(255, 255, 255, 0.82); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.site-nav a:hover { color: var(--white); }

/* ---------- Buttons ---------- */

.button {
  display: inline-block; font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  padding: 0.95rem 1.6rem; border-radius: 8px; border: 1.5px solid transparent;
  background: var(--primary-dark); color: var(--white); text-decoration: none; cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.button:hover { background: #4338ca; color: var(--white); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35); }
.button[disabled] { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }
.button-outline { background: transparent; border-color: rgba(255, 255, 255, 0.55); }
.button-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--white); box-shadow: none; }
.site-nav .button { padding: 0.6rem 1.15rem; font-size: 0.92rem; color: var(--white); }
@media (prefers-reduced-motion: reduce) { .button, .card { transition: none; } .button:hover, .card:hover { transform: none; } }

/* ---------- Dark hero (home) and dark intro (inner pages) ---------- */

.hero, .page-intro {
  position: relative; color: var(--white); overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.93) 0%, rgba(30, 41, 59, 0.80) 50%, rgba(15, 23, 42, 0.92) 100%),
    url("/img/hero.webp") center / cover no-repeat,
    var(--dark);
}
.hero { padding: clamp(8rem, 14vw, 10rem) 0 clamp(4.5rem, 9vw, 7rem); }
.page-intro { padding: clamp(7.5rem, 12vw, 9rem) 0 clamp(3.5rem, 7vw, 5rem); }

.hero-grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }

.hero h1, .page-intro h1 { font-size: clamp(2.4rem, 1.5rem + 3.4vw, 3.9rem); color: var(--white); max-width: 16ch; }
.page-intro h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.2rem); max-width: 20ch; }
.hero h1 .grad, .page-intro h1 .grad {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.25rem); line-height: 1.6; color: rgba(255, 255, 255, 0.78); max-width: 34rem; margin-top: 1.4rem; }
.hero-actions { margin-top: 2.25rem; display: flex; gap: 0.9rem; flex-wrap: wrap; }

.crumb { font-size: 0.92rem; margin-bottom: 1rem; }
.crumb a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.crumb a:hover { color: var(--white); text-decoration: underline; }

/* ---------- Sections ---------- */

.section { padding: clamp(4.5rem, 9vw, 6.5rem) 0; }
.section-light { background: var(--light); }
.section-head { text-align: center; max-width: 40rem; margin: 0 auto clamp(2.5rem, 5vw, 3.5rem); }
.section-head h2 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); }
.section-head p { color: var(--gray); margin-top: 0.9rem; font-size: 1.08rem; }

/* ---------- Cards ---------- */

.card-grid { display: grid; gap: 1.5rem; }
@media (min-width: 46rem) { .card-grid.two { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .card-grid.three { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; height: 100%; transition: transform 0.25s, box-shadow 0.25s;
}
.card-link { color: inherit; text-decoration: none; display: block; }
.card-link:hover { color: inherit; }
.card-link:hover .card { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card-img { aspect-ratio: 16 / 8; overflow: hidden; background: var(--dark-mid); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.6rem 1.6rem 1.75rem; display: grid; gap: 0.55rem; align-content: start; }
.card-body h3 { font-size: 1.2rem; }
.card-body p { color: var(--gray); font-size: 0.98rem; }
.card-more { color: var(--primary-dark); font-weight: 600; font-size: 0.95rem; margin-top: 0.35rem; }
.card-link:hover .card-more { color: var(--primary); text-decoration: underline; }

.note-box {
  max-width: 46rem; margin: 2.5rem auto 0; text-align: center;
  background: var(--white); border: 1px dashed #c7d2fe; border-radius: var(--radius); padding: 1.75rem 1.75rem 1.9rem;
}
.note-box h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.note-box p { color: var(--gray); }

/* Steps: a real sequence, so numbered */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; }
.steps .card-body { padding-top: 1.9rem; }
.steps .num {
  width: 2.6rem; height: 2.6rem; border-radius: 10px; background: var(--gradient); color: var(--white);
  display: grid; place-items: center; font-weight: 800; margin-bottom: 0.6rem;
}
.steps .num::before { content: counter(step); }

/* ---------- Dark band (examples) ---------- */

.band {
  color: var(--white); position: relative;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.90)),
    url("/img/band.webp") center / cover no-repeat,
    var(--dark);
}
.band .section-head h2 { color: var(--white); }
.band .section-head p { color: rgba(255, 255, 255, 0.72); }
.band .card { background: rgba(255, 255, 255, 0.06); box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.12); }
.band .card-body p { color: rgba(255, 255, 255, 0.75); }
.band .card-body h3 { color: var(--white); }
.band .tag { justify-self: start; font-size: 0.78rem; font-weight: 600; color: #67e8f9; background: rgba(6, 182, 212, 0.14); border-radius: 999px; padding: 0.2rem 0.7rem; }
.band a { color: #a5b4fc; font-weight: 600; }
.band a:hover { color: var(--white); }

/* ---------- Who we work with ---------- */

.who { max-width: 44rem; margin: 0 auto; text-align: center; }
.who h2 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); }
.who p { color: var(--gray); margin-top: 1rem; font-size: 1.1rem; }

/* ---------- Closing call to action ---------- */

.closing { text-align: center; padding: clamp(4.5rem, 9vw, 6.5rem) 0; background: var(--light); border-top: 1px solid var(--line); }
.closing h2 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); max-width: 22ch; margin: 0 auto; }
.closing p { color: var(--gray); margin: 0.9rem auto 2rem; max-width: 36rem; font-size: 1.08rem; }

/* ---------- Before / after diagram ---------- */

.flow { background: var(--white); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45); padding: clamp(1rem, 3vw, 1.6rem); margin: 0; color: var(--dark); }
.page-body .flow { box-shadow: var(--shadow); }
.flow svg { width: 100%; height: auto; }
.flow figcaption { font-size: 0.9rem; color: var(--gray); margin-top: 0.8rem; }
.flow text { font-family: var(--face); }
.flow .t-label { font-size: 12.5px; fill: var(--dark); font-weight: 500; }
.flow .t-head { font-size: 11.5px; fill: var(--gray); font-weight: 700; letter-spacing: 0.02em; }
.flow .t-note { font-size: 11.5px; fill: var(--gray); }
.flow .t-note-accent { font-size: 11.5px; fill: var(--primary-dark); font-weight: 700; }
.flow .box { fill: var(--light); stroke: var(--line); stroke-width: 1.5; }
.flow .manual { fill: none; stroke: var(--gray-light); stroke-width: 1.5; stroke-dasharray: 4 5; }
.flow .auto { fill: none; stroke: var(--primary); stroke-width: 2.4; }
.flow .hand { fill: var(--gray-light); }
.flow .node { fill: var(--primary); }
.flow .divider { stroke: var(--line); stroke-width: 1; }
.flow .flow-tall { display: none; max-width: 22rem; margin: 0 auto; }
@media (max-width: 40rem) { .flow .flow-wide { display: none; } .flow .flow-tall { display: block; } }

/* The one orchestrated motion: manual paths appear one by one, then the automated one draws. */
@media (prefers-reduced-motion: no-preference) {
  .flow.animate .m1, .flow.animate .m2, .flow.animate .m3 { opacity: 0; animation: fade-in 0.5s ease-out forwards; }
  .flow.animate .m2 { animation-delay: 0.25s; }
  .flow.animate .m3 { animation-delay: 0.5s; }
  .flow.animate .auto { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 0.9s ease-out 1.1s forwards; }
  .flow.animate .t-note-accent { opacity: 0; animation: fade-in 0.4s ease-out 1.9s forwards; }
}
@keyframes fade-in { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Problem pages ---------- */

.page-body { display: grid; gap: 3rem; align-items: start; }
@media (min-width: 62rem) { .page-body { grid-template-columns: 1fr 1.1fr; gap: 4rem; } .page-body .flow { position: sticky; top: 2rem; } }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.05rem; }
.prose h2 { font-size: 1.55rem; margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 1.6rem; color: var(--dark-mid); }
.prose li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.55rem; height: 0.55rem; border-radius: 3px; background: var(--gradient); }
.prose li + li { margin-top: 0.6rem; }
.prose p { color: var(--dark-mid); }

/* ---------- Contact form ---------- */

.form-wrap { max-width: 40rem; margin: 0 auto; }
.form-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.5rem, 4vw, 2.5rem); }
.contact-form { display: grid; gap: 1.3rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { font-weight: 400; color: var(--gray); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--dark); background: var(--white);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 0.75rem 0.9rem; width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); outline: 3px solid rgba(99, 102, 241, 0.25); outline-offset: 0; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5rem; font-weight: 500; }
.form-status.ok { color: var(--primary-dark); }
.form-status.error { color: var(--error); }
.form-done { text-align: center; padding: 1rem 0; }
.form-done h2 { font-size: 1.8rem; }
.form-done p { color: var(--gray); margin-top: 0.75rem; }

/* ---------- Footer ---------- */

.site-footer { background: var(--dark); color: var(--gray-light); padding: 3rem 0; font-size: 0.92rem; }
.site-footer .frame { display: grid; gap: 1.75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--gray-light); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer .wordmark .mark { width: 2.1rem; height: 2.1rem; font-size: 0.72rem; }
.footer-line { margin-top: 0.9rem; }
.footer-copy { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 1.5rem; }
@media (min-width: 52rem) {
  .site-footer .frame { grid-template-columns: minmax(16rem, 1fr) 2fr; align-items: start; }
  .site-footer nav ul { justify-content: flex-end; }
  .footer-copy { grid-column: 1 / -1; }
}

/* Phones: keep the header on one line (in-page links are a scroll away anyway) */
@media (max-width: 40rem) {
  .site-nav li:not(:last-child) { display: none; }
  .site-header .frame { flex-wrap: nowrap; }
}
