/* Fonts: Bricolage Grotesque, self-hosted (OFL, see fonts/OFL.txt) */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #121212;
  --text: #EDEAE4;
  --muted: #9A968F;
  --card: #232323;
  --card-border: #333333;
  --rule: #2E2E2E;
  --problem: #FF8A4C;
  --action: #3D5BFF;
  --band: #141A3A; /* navy from the brand blue, How we work / How it works band */

  --radius-card: 22px;
  --gutter: 20px;
  --max: 1200px;
  --section-gap: 88px;
}

/* Base */
*,
*::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;
  background: var(--bg);
  color: var(--text);
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul { margin: 0; }
h1, h2, h3 { font-weight: 500; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.problem { color: var(--problem); }
.muted { color: var(--muted); }

/* Header */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.logo {
  font-weight: 500;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* SVG wordmark (images/logo.svg), same height as the old text logo's letters */
.logo svg {
  display: block;
  height: 0.7376em;
  width: auto;
  color: var(--text);
}

/* Section label next to the logo (pages under /independent/), after a thin divider */
.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-section {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1;
}

.header-section::before {
  content: "";
  width: 1px;
  height: 18px;
  background: var(--card-border);
}

.site-header .logo,
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav-link {
  padding-inline: 4px;
  text-decoration: underline;
  text-decoration-color: var(--action);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* Shared type */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Hero */
.hero {
  padding-top: 64px;
  padding-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 9vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 14ch;
}

/* Phone only: independent hero headline, no one-word last line */
@media (max-width: 743.98px) {
  .hero-wide h1 { text-wrap: balance; }
}

.subline {
  margin-top: 24px;
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  line-height: 1.35;
  max-width: 30ch;
}

.hero-action {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--action);
  color: #FFFFFF;
  font-weight: 500;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.button:hover { filter: brightness(1.12); }

/* Sections */
.section { padding-top: var(--section-gap); }

/* Steps */
.steps {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.step {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}

.step-number {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.step p { color: var(--muted); max-width: 36ch; }

/* How we work (home) and How it works (independent): full-width navy band, section spacing kept inside it;
   border-image paints past the content width without adding scroll */
.section:has(> .steps) {
  margin-top: var(--section-gap);
  padding-bottom: var(--section-gap);
  border-image: conic-gradient(var(--band) 0 0) fill 0 / / 0 100vmax;
}

/* Step markers in brand blue: numbers and step divider lines */
.step-number { color: var(--action); }

.steps,
.step { border-color: var(--action); }

/* Phone only (both pages): navy band 40px inside at top and bottom, 58px black gap before it,
   40px black gap after it (About on both pages) */
@media (max-width: 743.98px) {
  .section:has(> .steps) {
    margin-top: 58px;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .section:has(> .steps) + .section { padding-top: 40px; }
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
}

/* What we've built: example cards (copy one <article class="card example"> to add more) */
.examples-head {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.examples-head .label { margin-bottom: 0; }

/* Carousel dots (phone only), filled by js/carousel.js */
.examples-dots {
  justify-self: center;
  display: flex;
  gap: 6px;
}

.examples-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.examples-dots span.is-current { background: var(--text); opacity: 1; }

/* Phone: horizontal swipe row, each card ~85% of the screen so the next one peeks in */
.examples {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85vw;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  scrollbar-width: none;
}

.examples::-webkit-scrollbar { display: none; }

.example {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  scroll-snap-align: start;
}

.example .phone {
  max-width: 240px;
  margin-bottom: 28px;
  border-color: #444444; /* thin metal rim so the black frame stands out from the card */
}

.example h3 {
  font-size: 1.625rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.example > p { color: var(--muted); }

.example .price {
  color: var(--text);
  font-weight: 500;
  margin-top: 20px;
  margin-bottom: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  align-self: stretch;
}

/* Independent: smaller grey second line under a price (same grey as the card descriptions) */
.example .price-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.45;
}

.example .text-link { margin-top: auto; }

/* Phone only: smaller text and tighter spacing so the cards stay short */
@media (max-width: 743.98px) {
  .example .phone { margin-bottom: 18px; }

  .example h3 { font-size: 1.375rem; margin-bottom: 8px; }

  .example > p { font-size: 0.9375rem; line-height: 1.45; }

  .example .price {
    font-size: 1rem;
    margin-top: 14px;
    margin-bottom: 8px;
    padding-top: 14px;
  }

  .example .text-link { font-size: 0.9375rem; }
}

/* Phone and tablet (below 1024px): whole phone mockup scaled to 70% (240px to 168px wide),
   titles one step smaller, and rows lined up across the cards as on laptop */
@media (max-width: 1023.98px) {
  /* Frame sized by the screenshot (no fixed aspect ratio), so the whole screen fits
     with an even 7px border on all four sides; about the same height as before */
  .example .phone {
    max-width: 176px;
    aspect-ratio: auto;
    padding: 7px;
    border-radius: 28px;
  }

  .example .phone img {
    display: block;
    height: auto;
    object-fit: fill;
    border-radius: 21px;
  }

  .example h3 { font-size: 1.375rem; }

  .examples .example {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
    justify-items: start;
  }

  .examples .example .price { justify-self: stretch; }
}

@media (max-width: 743.98px) {
  .example h3 { font-size: 1.25rem; }
}

/* What we do */
.do-text {
  font-size: clamp(1.125rem, 2.4vw, 1.375rem);
  line-height: 1.4;
  max-width: 34ch;
}

/* "What we do" card (both pages, all sizes): intro, divider, list, link */
.do-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
}

/* What we do intro (both pages): avoid a one-word last line */
.do-card > .do-text { text-wrap: pretty; }

/* Phone only (both pages): balanced lines in the What we do intro */
@media (max-width: 743.98px) {
  .do-card > .do-text { text-wrap: balance; }
}

.do-card > .do-list {
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}

/* What we do as a list (both pages): one item per line, small dot markers */
.do-list {
  margin-top: 24px;
  color: #BDB9B2;
  line-height: 1.4;
  display: grid;
  gap: 10px;
}

.do-list li {
  position: relative;
  padding-left: 18px;
}

.do-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.6;
}
.do-link { margin-top: 16px; }

/* Home About: stat block, stacked above the paragraph below 1024px (laptop places it in the grid) */
.about-stat { margin-bottom: 28px; }

/* Home About paragraph, phone only: smaller than the What we do intro */
@media (max-width: 743.98px) {
  .about > .do-text { font-size: 1rem; }
}

.stat-number {
  font-size: clamp(3.5rem, 10vw, 4.5rem);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.035em;
  color: var(--text);
}

/* Approved blue accent: the "+" in the About stat */
.stat-plus { color: var(--action); }

.stat-text {
  margin-top: 14px;
  max-width: 30ch;
  color: #BDB9B2;
  text-wrap: balance;
}

/* Text links: blue underline, 44px tap height */
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--action);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.text-link:hover { text-decoration-thickness: 3px; }

.arrow {
  flex: none;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.35em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Phone frame */
.phone {
  width: 100%;
  max-width: 280px;
  margin-inline: auto;
  aspect-ratio: 390 / 844;
  padding: 10px;
  background: #0B0B0B;
  border: 1px solid var(--rule);
  border-radius: 40px;
  overflow: hidden;
}

a.phone { display: block; transition: border-color 0.15s ease; }

a.phone:hover { border-color: var(--muted); }

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 30px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

/* Contact */
.contact { padding-bottom: var(--section-gap); }

.contact-links {
  display: grid;
  gap: 4px;
  font-size: 1.125rem;
}

.contact-links .text-link { font-weight: 400; overflow-wrap: anywhere; }

.icon {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  margin-right: 0.5em;
  fill: none;
  stroke: var(--action);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Footer */
.site-footer { border-top: 1px solid var(--rule); }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.site-footer .logo {
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Tablet */
@media (min-width: 744px) {
  :root {
    --gutter: 32px;
    --section-gap: 112px;
  }

  .hero { padding-top: 96px; }

  .hero-action {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .examples-dots { display: none; }

  .examples {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    overflow-x: visible;
    scroll-snap-type: none;
    margin-inline: 0;
    padding-inline: 0;
  }

  .card { padding: 36px 32px; }

  .do-card { padding: 36px 32px; }

  .contact-links {
    display: flex;
    flex-wrap: wrap;
    column-gap: 40px;
  }
}

/* Tablet only (744px to 1023px) */
@media (min-width: 744px) and (max-width: 1023.98px) {
  /* How we work (home) and How it works (independent): descriptions as wide as the divider lines */
  .step p { max-width: none; }

  /* Navy band (both pages): 40px inside at top and bottom,
     80px black gap before it, 64px black gap after it (About on both pages) */
  .section:has(> .steps) {
    margin-top: 80px;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .section:has(> .steps) + .section { padding-top: 64px; }

  /* Independent hero headline: no one-word last line */
  .hero-wide h1 { text-wrap: balance; }

  /* "What we do" card (both pages): laptop treatment inside the card,
     intro 60ch, list in two independently flowing columns */
  .do-card > .do-text { max-width: 60ch; }

  .do-card > .do-list {
    display: block;
    columns: 2;
    column-gap: 48px;
  }

  .do-card > .do-list li { break-inside: avoid; margin-bottom: 4px; }

  /* Split the list in half, left column takes the extra item when odd
     (one selector per list length, 2 to 12 items) */
  .do-card > .do-list li:nth-child(2):nth-last-child(1),
  .do-card > .do-list li:nth-child(3):nth-last-child(1),
  .do-card > .do-list li:nth-child(3):nth-last-child(2),
  .do-card > .do-list li:nth-child(4):nth-last-child(2),
  .do-card > .do-list li:nth-child(4):nth-last-child(3),
  .do-card > .do-list li:nth-child(5):nth-last-child(3),
  .do-card > .do-list li:nth-child(5):nth-last-child(4),
  .do-card > .do-list li:nth-child(6):nth-last-child(4),
  .do-card > .do-list li:nth-child(6):nth-last-child(5),
  .do-card > .do-list li:nth-child(7):nth-last-child(5),
  .do-card > .do-list li:nth-child(7):nth-last-child(6) { break-before: column; }

  /* Home About: laptop layout, stat in column 1, paragraph across columns 2 and 3, tops aligned */
  .about {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 32px;
    align-items: start;
  }

  .about > .label { grid-column: 1 / -1; }

  .about > .do-text { grid-column: 2 / 4; grid-row: 2; max-width: 60ch; }

  .about-stat { grid-column: 1; grid-row: 2; margin-bottom: 0; }

  .stat-text { margin-top: 16px; }
}

/* Laptop */
@media (min-width: 1024px) {
  :root {
    --gutter: 48px;
    /* Spacing scale shared by both pages */
    --section-gap: 120px; /* between sections, and last section → footer */
    --hero-gap: 128px;    /* hero → first section */
    --label-gap: 28px;    /* section label → its content */
  }

  .hero + .section { padding-top: var(--hero-gap); }

  .section > .label,
  .examples-head { margin-bottom: var(--label-gap); }

  .hero {
    padding-top: 84px;
    padding-bottom: 0;
    display: grid;
    grid-template-columns: 1fr 280px;
    align-items: center;
    gap: 64px;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    border-top: 0;
  }

  .step {
    padding: 28px 0 0;
    border-top: 1px solid var(--action);
    border-bottom: 0;
  }

  /* Navy band (both pages): 64px inside at top and bottom,
     96px black gap before it, 80px black gap after it (About on both pages) */
  .section:has(> .steps) {
    margin-top: 96px;
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .section:has(> .steps) + .section { padding-top: 80px; }

  /* Independent and home hero: no phone, headline across the full width in about two lines */
  .hero-wide,
  .home .hero { display: block; }

  .hero-wide h1,
  .home .hero h1 {
    max-width: none;
    font-size: min(5.25rem, 7vw);
    text-wrap: balance;
  }

  .hero-wide .subline { max-width: none; }

  /* "What we do" card on laptop (both pages): intro, divider, two-column list, link */
  .do-card { padding: 56px 64px; }

  .do-card > .do-text { max-width: 60ch; }

  .do-card > .do-list {
    display: block;
    columns: 2;
    column-gap: 48px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--card-border);
  }

  .do-card > .do-list li { break-inside: avoid; margin-bottom: 4px; }

  /* Split the list in half, left column takes the extra item when odd
     (one selector per list length, 2 to 12 items) */
  .do-card > .do-list li:nth-child(2):nth-last-child(1),
  .do-card > .do-list li:nth-child(3):nth-last-child(1),
  .do-card > .do-list li:nth-child(3):nth-last-child(2),
  .do-card > .do-list li:nth-child(4):nth-last-child(2),
  .do-card > .do-list li:nth-child(4):nth-last-child(3),
  .do-card > .do-list li:nth-child(5):nth-last-child(3),
  .do-card > .do-list li:nth-child(5):nth-last-child(4),
  .do-card > .do-list li:nth-child(6):nth-last-child(4),
  .do-card > .do-list li:nth-child(6):nth-last-child(5),
  .do-card > .do-list li:nth-child(7):nth-last-child(5),
  .do-card > .do-list li:nth-child(7):nth-last-child(6) { break-before: column; }

  .do-card > .do-link { display: flex; width: fit-content; margin-top: 24px; }

  /* Home About: stat block on "How we work" column 1, paragraph from column 2 */
  .about {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 40px;
    align-items: start;
  }

  .about > .label { grid-column: 1 / -1; }

  /* 60ch like the What we do intro; the grid area caps it at column 3's right edge */
  .about > .do-text { grid-column: 2 / 4; grid-row: 2; max-width: 60ch; }

  .about-stat { grid-column: 1; grid-row: 2; margin-bottom: 0; }

  .stat-number { font-size: min(5.25rem, 7vw); }

  .stat-text { margin-top: 16px; }

  /* Independent "See it working": cards share row heights (phone, title, text, price, link) */
  .examples .example {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
    justify-items: start;
  }

  .examples .example .price { justify-self: stretch; }

  /* Header: larger logo (about 27%); section label and divider scaled to match */
  .site-header .logo { font-size: 1.75rem; }

  .header-brand,
  .header-section { gap: 16px; }

  .header-section { font-size: 1.0625rem; }

  .header-section::before { height: 22px; }

  /* Independent and home contact: "Message us" as a heading, matching the card titles */
  .hero-wide ~ .contact > .label,
  .home .contact > .label {
    font-size: 1.625rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--text);
  }
}
