/* ==========================================================================
   alanbuchanan.dev – site stylesheet
   One file, organised as: fonts → tokens → base → layout → components
   → page-specific blocks → utilities. Components use BEM-style names
   (.block, .block__element, .block--modifier). Keep selectors to a single
   class where possible so specificity never fights. Mobile first: base
   rules are for small screens, min-width queries add the wider layouts.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset, variable weights) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/dm-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  /* Colour */
  --c-bg: #F8F6F6;
  --c-surface: #FFFFFF;
  --c-ink: #1A1418;
  --c-ink-2: #2F2529;
  --c-muted: #5D5559;
  --c-line: #E8E1E4;
  --c-line-strong: #D9CFD4;
  --c-accent: #C8176F;
  --c-accent-deep: #961052;
  --c-accent-soft: #FBE1EE;
  --c-placeholder-a: #EFEAEC;
  --c-placeholder-b: #E8E1E4;
  --c-error: #B0183D;

  /* Colour on dark (ink) sections */
  --c-accent-on-dark: #FF8CC2;
  --c-muted-on-dark: #C9BFC4;
  --c-card-on-dark: #2A2126;
  --c-line-on-dark: #2F2529;

  /* Colour on the magenta CTA band */
  --c-on-accent-muted: #FFE3F0;

  /* Type */
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --fs-hero: clamp(40px, 5.4vw, 66px);
  --fs-h1: clamp(36px, 4.6vw, 58px);
  --fs-h2: clamp(28px, 3.6vw, 42px);
  --fs-h2-row: clamp(26px, 2.6vw, 30px);
  --fs-cta: clamp(26px, 3.4vw, 38px);
  --fs-quote: clamp(22px, 2.6vw, 30px);
  --fs-quote-lg: clamp(24px, 3vw, 36px);
  --fs-lead: clamp(17px, 1.5vw, 19px);
  --fs-body-lg: clamp(16px, 1.4vw, 18px);
  --fs-body: 16px;
  --fs-sm: 15px;
  --fs-xs: 14px;
  --fs-2xs: 13px;

  /* Layout */
  --max-width: 1280px;
  --gutter: clamp(20px, 4vw, 32px);
  --section-y: clamp(64px, 8vw, 88px);
  --hero-top: clamp(40px, 6vw, 72px);
  --header-height: 71px;

  /* Radii */
  --r-pill: 999px;
  --r-xl: 28px;
  --r-lg: 24px;
  --r-md: 20px;
  --r-card: 18px;
  --r-sm: 12px;
  --r-logo: 10px;

  /* Shadow (the hero badge only) */
  --shadow-float: 0 12px 32px rgba(26, 20, 24, 0.08);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, p { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
picture { display: block; }

a { color: var(--c-accent-deep); text-underline-offset: 3px; }
a:hover { color: var(--c-ink); }

input, textarea, button, select { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--c-accent-soft); color: var(--c-ink); }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

[id] { scroll-margin-top: calc(var(--header-height) + 16px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--hero { padding-block: var(--hero-top) var(--section-y); }
.section--page-head { padding-block: var(--hero-top) clamp(24px, 3vw, 40px); }
.section--flush-top { padding-top: 0; }
.section--tight-top { padding-top: clamp(32px, 4vw, 48px); }
.section--tight-bottom { padding-bottom: clamp(32px, 4vw, 48px); }

.section--dark { background: var(--c-ink); color: var(--c-bg); }
.section--dark :focus-visible { outline-color: var(--c-accent-on-dark); }

/* Responsive grid. Columns wrap when narrower than --grid-min. */
.grid {
  --grid-min: 260px;
  --grid-gap: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min)), 1fr));
  gap: var(--grid-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.grid--200 { --grid-min: 200px; }
.grid--240 { --grid-min: 240px; }
.grid--280 { --grid-min: 280px; }
.grid--300 { --grid-min: 300px; }
.grid--320 { --grid-min: 320px; }
.grid--380 { --grid-min: 380px; }
.grid--gap-xs { --grid-gap: 12px; }
.grid--gap-md { --grid-gap: 16px; }
.grid--gap-lg { --grid-gap: 24px; }
.grid--gap-xl { --grid-gap: 32px; }
/* auto-fill keeps empty tracks, so a lone last card doesn't stretch */
.grid--fill { grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min)), 1fr)); }

/* Two-up layout that stacks when a column would be narrower than --split-min */
.split {
  --split-min: 380px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--split-min)), 1fr));
  gap: 40px clamp(40px, 5vw, 56px);
}
.split--420 { --split-min: 420px; }
.split--start { align-items: start; }
.split--end { align-items: end; }
.split--tight { row-gap: 24px; }

/* Text beside an image. Stacked (below 900px) it reads heading → image → body,
   so the H1 stays near the top on phones. Markup order is __head, __media, __body.
   Side by side, the text is centred against the image. */
.media-split {
  display: grid;
  grid-template-areas: "head" "media" "body";
  gap: 28px;
}
.media-split__head { grid-area: head; }
.media-split__media { grid-area: media; min-width: 0; }
.media-split__body { grid-area: body; }

@media (min-width: 900px) {
  .media-split {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas: ". media" "head media" "body media" ". media";
    column-gap: clamp(40px, 5vw, 56px);
    row-gap: 24px;
  }
  .media-split--reverse { grid-template-areas: "media ." "media head" "media body" "media ."; }
}

/* Vertical rhythm */
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack--xs { gap: 6px; }
.stack--sm { gap: 12px; }
.stack--md { gap: 16px; }
.stack--lg { gap: 28px; }
.stack--center { align-items: center; text-align: center; }

.measure { max-width: 640px; }
.measure-lg { max-width: 860px; }

/* ---------- Typography components ---------- */
/* Section label above an H2 (mono, uppercase) */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.eyebrow--on-dark { color: var(--c-accent-on-dark); }

/* Label above a page's H1 */
.page-eyebrow { font-size: var(--fs-sm); font-weight: 600; color: var(--c-accent-deep); }

.heading {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.heading--hero { font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -0.03em; }
.heading--page { font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -0.03em; }
.heading--section { font-size: var(--fs-h2); line-height: 1.1; }
.heading--row { font-size: var(--fs-h2-row); line-height: 1.15; }
.heading--card-lg { font-size: clamp(22px, 2.2vw, 26px); line-height: 1.2; letter-spacing: -0.01em; }
.heading--card { font-size: clamp(19px, 1.8vw, 21px); line-height: 1.25; letter-spacing: -0.01em; }
.heading--sm { font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; }

.highlight { color: var(--c-accent); }

.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--c-muted); max-width: 640px; }
.body-lg { font-size: var(--fs-body-lg); line-height: 1.65; color: var(--c-muted); }
.text-on-dark { color: var(--c-muted-on-dark); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.btn--sm { padding: 10px 18px; font-size: var(--fs-sm); }
.btn--lg { padding: 16px 26px; font-size: 17px; }
.btn--block { width: 100%; }

.btn--primary { background: var(--c-accent); color: #FFFFFF; }
.btn--primary:hover { background: var(--c-ink); color: #FFFFFF; }

.btn--dark { background: var(--c-ink); color: var(--c-bg); }
.btn--dark:hover { background: var(--c-accent); color: #FFFFFF; }

/* White button on the magenta band */
.btn--light { background: #FFFFFF; color: var(--c-ink); }
.btn--light:hover { background: var(--c-ink); color: #FFFFFF; }
.btn--light:focus-visible { outline-color: #FFFFFF; }

/* "All services →" style links */
.text-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--c-accent);
  text-decoration: none;
}
.text-cta:hover { color: var(--c-ink); }
.text-cta--deep { color: var(--c-accent-deep); text-decoration: underline; }
.text-cta--sm { font-size: var(--fs-sm); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--c-ink);
  color: var(--c-bg);
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--c-bg); }

/* ---------- Wordmark & logo mark ---------- */
.wordmark {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--c-ink);
}
.wordmark__tld { color: var(--c-accent); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-logo);
  background: var(--c-ink);
  color: var(--c-bg);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 246, 246, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-block: 18px;
}

.nav__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__link {
  display: inline-block;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-muted);
  text-decoration: none;
}
.nav__link:hover { color: var(--c-ink); }
.nav__link[aria-current="page"] { color: var(--c-ink); border-bottom-color: var(--c-accent); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s;
}
.nav-toggle__icon { position: relative; }
.nav-toggle__icon::before,
.nav-toggle__icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle__icon::before { top: -5px; }
.nav-toggle__icon::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { transform: translateY(-5px) rotate(-45deg); }

/* Collapsed navigation on small screens (only when JS is available;
   without JS the links simply wrap under the logo) */
@media (max-width: 859px) {
  .js .nav-toggle { display: inline-flex; }
  .js .nav { display: none; width: 100%; }
  .js .nav.is-open { display: block; }
  .js .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: 4px 8px;
  }
  .js .nav__link {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--c-line);
    font-size: 18px;
    color: var(--c-ink);
  }
  .js .nav__link[aria-current="page"] { color: var(--c-accent-deep); border-bottom-color: var(--c-line); }
  .js .nav__link[aria-current="page"]::before { content: "→ "; color: var(--c-accent); }
  .js .nav__item--cta { padding-top: 16px; }
  .js .nav__item--cta .btn { width: 100%; padding-block: 15px; font-size: 16px; }
}

/* ---------- Tags & chips ---------- */
.tags,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips { gap: 8px; }

.tag {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--c-accent-soft);
  color: var(--c-accent-deep);
  font-size: var(--fs-2xs);
  line-height: 1.4;
}
.tag--muted { background: var(--c-placeholder-a); color: var(--c-muted); }

.chip {
  padding: 6px 12px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.chip--dark { border-color: var(--c-card-on-dark); background: var(--c-card-on-dark); color: var(--c-bg); }

.price-pill {
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--c-accent-soft);
  color: var(--c-accent-deep);
  font-size: var(--fs-xs);
  font-weight: 600;
}

/* ---------- Section heading row ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 36px;
}
.section-head__text { display: flex; flex-direction: column; gap: 12px; max-width: 680px; }
.section-head--split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  align-items: end;
  gap: 20px 56px;
  margin-bottom: 48px;
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero { display: flex; flex-direction: column; gap: 20px; }
.page-hero__title { max-width: 860px; }

/* ---------- Cards ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: var(--c-surface);
  color: var(--c-ink);
}
.card--link { text-decoration: none; transition: border-color 0.2s; }
.card--link:hover { border-color: var(--c-accent); color: var(--c-ink); }
.card--soft { justify-content: space-between; border-color: var(--c-accent-soft); background: var(--c-accent-soft); }
.card--md { border-radius: var(--r-md); gap: 6px; }
.card--lg { gap: 12px; padding: clamp(28px, 3vw, 36px); border-radius: var(--r-lg); }
.card__title { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.card__text { flex: 1; font-size: var(--fs-sm); line-height: 1.5; color: var(--c-muted); }
.card__text--lg { font-size: var(--fs-body-lg); line-height: 1.6; color: var(--c-ink-2); }
.card__price { font-size: var(--fs-xs); font-weight: 600; color: var(--c-accent); }
@media (max-width: 599px) {
  .card { padding: 20px; }
}

/* ---------- Screenshot frame (4:3) ---------- */
.shot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--c-placeholder-a);
}
/* Desktop screenshot (4:3, top of the page), filling the frame */
.shot--cover { border: 1px solid var(--c-line); }
.shot--cover picture { width: 100%; height: 100%; }
.shot--cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* Striped stand-in until a screenshot is added */
.shot--placeholder {
  background: repeating-linear-gradient(135deg, var(--c-placeholder-a) 0 12px, var(--c-placeholder-b) 12px 24px);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--c-muted);
}

/* ---------- Project card ---------- */
.project { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.project__title { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.project__text { color: var(--c-muted); }
.project__link { margin-top: auto; }

/* ---------- Home: hero ---------- */
.hero {
  display: grid;
  gap: 40px;
  align-items: center;
}
.hero__content { display: flex; flex-direction: column; gap: 24px; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.hero__note { font-size: var(--fs-sm); color: var(--c-muted); }
.hero__media { position: relative; min-width: 0; }
.hero__photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 480px;
  border-radius: var(--r-lg);
  object-fit: cover;
  object-position: 50% 25%;
}
@media (min-width: 950px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; gap: 56px; }
  .hero__content { gap: 28px; }
  .hero__photo img { aspect-ratio: auto; height: 540px; max-height: none; }
}

.hero-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--c-line);
  border-radius: 16px;
  background: var(--c-surface);
  box-shadow: var(--shadow-float);
}
.hero-badge__label { font-size: var(--fs-2xs); color: var(--c-muted); }
.hero-badge__value { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.2; }
@media (min-width: 950px) {
  .hero-badge { left: -20px; bottom: 32px; padding: 16px 18px; }
  .hero-badge__value { font-size: 18px; }
}

/* ---------- Client strip (Home, About) ---------- */
.client-strip { border-block: 1px solid var(--c-line); }
.client-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 40px;
  padding-block: 22px;
}
.client-strip__label,
.client-strip__more { font-size: var(--fs-xs); color: var(--c-muted); }
.client-strip__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 600;
  color: var(--c-ink-2);
}
@media (max-width: 699px) {
  .client-strip__label,
  .client-strip__list,
  .client-strip__more { flex-basis: 100%; }
}
@media (min-width: 700px) {
  .client-strip__list { gap: 4px 40px; }
  .client-strip__more { margin-left: auto; }
}

/* ---------- Home: reasons (numbered rows on dark) ---------- */
.reasons { margin: 0; padding: 0; list-style: none; }
.reason {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding-block: 22px;
  border-top: 1px solid var(--c-line-on-dark);
}
.reason__num { font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.8; color: var(--c-accent-on-dark); }
.reason__body { display: flex; flex-direction: column; gap: 6px; }
.reason__text { color: var(--c-muted-on-dark); }

/* ---------- Testimonial (centred quote) ---------- */
.testimonial { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.testimonial__quote {
  max-width: 820px;
  font-family: var(--font-display);
  font-size: var(--fs-quote);
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}
.testimonial__cite { font-size: var(--fs-sm); color: var(--c-muted); }
.testimonial__cite strong { color: var(--c-ink); }

/* ---------- Photo frame ---------- */
.photo img {
  width: 100%;
  border-radius: var(--r-lg);
  object-fit: cover;
}
.photo--about img { aspect-ratio: 1 / 1; max-height: 460px; object-position: 50% 30%; }
@media (min-width: 900px) {
  .photo--about img { aspect-ratio: auto; height: 560px; max-height: none; }
}

/* ---------- About: toolkit & values ---------- */
.tool-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--c-line-on-dark);
}

.value {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 2px solid var(--c-accent);
}
.value__text { color: var(--c-muted); }

/* ---------- Services: service rows ---------- */
.service-list { display: flex; flex-direction: column; }
.service {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px 48px;
  padding-block: 36px;
  border-top: 1px solid var(--c-line);
}
.service__head { display: flex; flex-direction: column; gap: 10px; }
.service__num { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--c-accent); }
.service__body { display: flex; flex-direction: column; gap: 16px; }
.service__text { font-size: var(--fs-body-lg); line-height: 1.6; color: var(--c-ink-2); }
.service-list__note {
  padding-top: 28px;
  border-top: 1px solid var(--c-line);
  font-size: var(--fs-sm);
  color: var(--c-muted);
}

/* ---------- Services: process steps (on dark) ---------- */
.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 28px;
  border-radius: var(--r-md);
  background: var(--c-card-on-dark);
}
.step__num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #FFFFFF;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.step__text { font-size: var(--fs-sm); color: var(--c-muted-on-dark); }

/* ---------- Portfolio: filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.filter {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.filter:hover { border-color: var(--c-ink); }
.filter[aria-pressed="true"] { border-color: var(--c-ink); background: var(--c-ink); color: var(--c-bg); }

.project-grid { --grid-min: 340px; row-gap: 48px; }

/* Closing note under the grid, so the list reads as a selection */
.portfolio-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: clamp(56px, 7vw, 80px);
  padding-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--c-line);
  text-align: center;
}
.portfolio-more .lead { max-width: 620px; }

/* ---------- Reviews ---------- */
.feature-quote {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 4.5vw, 48px);
  border-radius: var(--r-xl);
  background: var(--c-ink);
  color: var(--c-bg);
}
.feature-quote__mark {
  height: 40px;
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 0.9;
  color: var(--c-accent-on-dark);
}
.feature-quote__text {
  max-width: 900px;
  font-family: var(--font-display);
  font-size: var(--fs-quote-lg);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.feature-quote__cite { color: var(--c-muted-on-dark); }
.feature-quote__cite strong { color: var(--c-bg); }

.reviews { columns: 3 320px; column-gap: 16px; }
.review {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 0 16px;
  padding: 28px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface);
  break-inside: avoid;
}
.review__text { font-size: 17px; line-height: 1.6; color: var(--c-ink-2); }
.review__cite { font-size: var(--fs-xs); color: var(--c-muted); }
.review__cite strong { color: var(--c-ink); }

/* ---------- Contact ---------- */
.reach {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding: clamp(24px, 3vw, 32px);
  border-radius: var(--r-lg);
  background: var(--c-accent);
  color: #FFFFFF;
}
.reach__label { font-size: var(--fs-sm); color: var(--c-on-accent-muted); }
.reach__link {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  color: #FFFFFF;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.reach__link:hover { color: #FFFFFF; text-decoration: underline; }
.reach__link:focus-visible { outline-color: #FFFFFF; }

.form-panel {
  align-self: start;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: var(--c-surface);
}
/* On small phones the panel runs edge to edge, so the Turnstile widget
   (300px minimum) always fits */
@media (max-width: 419px) {
  .form-panel {
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: 16px;
    border-inline: 0;
    border-radius: 0;
  }
}
@media (max-width: 339px) {
  .form-panel { padding-inline: 10px; }
}

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 20px; }
.form__title { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 20px 16px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.field__hint { font-weight: 400; color: var(--c-muted); }
.field__legend { margin-bottom: 10px; padding: 0; }

.input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  color: var(--c-ink);
  font-size: 16px;
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: var(--c-muted); opacity: 1; }
.input:focus { border-color: var(--c-accent); outline: none; box-shadow: 0 0 0 3px var(--c-accent-soft); }
.input--textarea { min-height: 132px; resize: vertical; }

/* Multi-select chips: real checkboxes, styled as toggle pills */
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.choice { position: relative; }
.choice__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice__label {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  background: var(--c-bg);
  font-size: var(--fs-xs);
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.choice__label:hover { border-color: var(--c-ink); }
.choice__input:checked + .choice__label { border-color: var(--c-ink); background: var(--c-ink); color: var(--c-bg); }
.choice__input:checked + .choice__label::before { content: "✓ "; }
.choice__input:focus-visible + .choice__label { outline: 2px solid var(--c-accent); outline-offset: 3px; }

.form__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form__note { font-size: var(--fs-2xs); color: var(--c-muted); }
.form__error { font-size: var(--fs-xs); font-weight: 600; color: var(--c-error); }
.form__error:empty { display: none; }
.form [aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.success {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  min-height: 380px;
}
.success__tick {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-accent-soft);
  color: var(--c-accent-deep);
  font-size: 22px;
}
.success__title { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.success__title:focus { outline: none; }
.success__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-accent-deep);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.success__link:hover { color: var(--c-ink); }

/* ---------- Call-to-action band ---------- */
.cta-band { padding-bottom: clamp(56px, 7vw, 80px); }
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px 32px;
  padding: clamp(32px, 5vw, 52px) clamp(24px, 4vw, 44px);
  border-radius: var(--r-xl);
  background: var(--c-accent);
  color: #FFFFFF;
}
.cta__text { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.cta__title { font-family: var(--font-display); font-size: var(--fs-cta); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.cta__body { font-size: 17px; line-height: 1.5; color: var(--c-on-accent-muted); }
@media (max-width: 539px) {
  .cta .btn { width: 100%; }
}

/* ---------- Plain content pages (privacy, 404) ---------- */
.prose { max-width: 720px; color: var(--c-ink-2); font-size: var(--fs-body-lg); line-height: 1.65; }
.prose > * + * { margin-top: 1em; }
.prose h2 {
  margin-top: 1.8em;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: var(--fs-xs); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-block: 40px;
}
.site-footer__brand { display: flex; flex-direction: column; gap: 6px; }
.site-footer__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
.footer-links a { display: inline-block; padding-block: 6px; color: var(--c-muted); text-decoration: none; }
.footer-links a:hover { color: var(--c-ink); }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.center { text-align: center; }
.mt-lg { margin-top: 28px; }
[hidden] { display: none !important; }
