/* Ledger & Fields — site styles */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-italic.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Brand */
  --sapphire: #0f55af;
  --sapphire-deep: #0a3d80;
  --seaweed: #00ad82;
  --seaweed-ink: #00775a;      /* text-safe green on white */
  --tuscan-sun: #f5cb5c;
  --wild-strawberry: #f44174;
  --strawberry-ink: #b3164a;   /* text-safe error red on white */
  --black: #090809;

  /* Neutrals */
  --paper: #ffffff;
  --mist: #eef3f9;
  --rule: #c9d5e5;
  --muted: #4a5568;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --space: clamp(4rem, 9vw, 7.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--black);
  background: var(--paper);
  font-optical-sizing: auto;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--sapphire); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--sapphire-deep); text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--black); color: #fff; padding: 0.6rem 1rem;
  font-family: var(--display); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

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

/* ---------- Type ---------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--black);
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.2; font-weight: 700; }
h4 { font-size: 1.0625rem; line-height: 1.3; font-weight: 700; font-stretch: 105%; }

p { margin: 0 0 1em; max-width: 66ch; }
.lede { font-size: clamp(1.2rem, 1.8vw, 1.375rem); line-height: 1.55; color: #1f2733; }
.muted { color: var(--muted); }

ul.ticks { list-style: none; padding: 0; margin: 0 0 1.5rem; max-width: 62ch; }
ul.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.55rem; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.7rem; height: 0.45rem;
  background: var(--seaweed);
  transform: skewY(-20deg);
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 650; font-stretch: 105%;
  font-size: 1rem; line-height: 1;
  padding: 0.95rem 1.4rem;
  border-radius: 3px;
  border: 2px solid var(--sapphire);
  background: var(--sapphire); color: #fff;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--sapphire-deep); border-color: var(--sapphire-deep); color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--sapphire); }
.btn--ghost:hover { background: var(--mist); color: var(--sapphire-deep); border-color: var(--sapphire-deep); }
.btn--light { background: #fff; color: var(--sapphire); border-color: #fff; }
.btn--light:hover { background: var(--mist); border-color: var(--mist); color: var(--sapphire-deep); }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--outline-light:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.75rem; }
.brand { display: block; flex-shrink: 0; }
.brand img { width: 13.5rem; height: auto; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a {
  font-family: var(--display); font-weight: 560; font-size: 0.98rem;
  color: var(--black); text-decoration: none;
  padding: 0.55rem 0.8rem; border-radius: 3px;
}
.nav a:hover { color: var(--sapphire); background: var(--mist); }
.nav a[aria-current="page"] { color: var(--sapphire); box-shadow: inset 0 -2px 0 var(--seaweed); border-radius: 0; }
.nav .btn { margin-left: 0.75rem; padding: 0.75rem 1.1rem; color: #fff; }
.nav .btn:hover { background: var(--sapphire-deep); color: #fff; }

.nav-toggle {
  display: none;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  background: none; border: 2px solid var(--rule); border-radius: 3px;
  padding: 0.55rem 0.85rem; color: var(--black); cursor: pointer;
}

@media (max-width: 880px) {
  .brand img { width: 11rem; }
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.9rem 0; border-bottom: 1px solid var(--mist); border-radius: 0; }
  .nav a:hover { background: none; }
  .nav a[aria-current="page"] { box-shadow: none; }
  .nav .btn { margin: 1rem 0 0; padding: 0.95rem; border-bottom: 0; }
}

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

.section { padding-block: var(--space); }
.section--mist { background: var(--mist); }
.section--tight { padding-block: calc(var(--space) * 0.6); }
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { margin-bottom: 0; }

/* ---------- Hero: the "fields" ---------- */

.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(4rem, 8vw, 6rem); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.5rem; }
.hero .lede { margin-bottom: 0; }

.fields {
  position: relative;
  aspect-ratio: 1 / 1.02;
  width: 100%;
  max-width: 30rem;
  justify-self: end;
}
.fields span {
  position: absolute; display: block;
  height: 12%;
  transform: skewY(-20deg);
  transform-origin: left center;
}
/* Rows step up and to the right, like the logo's blocks. */
.fields span:nth-child(1) { left: 0;   top: 76%; width: 44%; background: var(--sapphire); }
.fields span:nth-child(2) { left: 22%; top: 62%; width: 70%; background: var(--seaweed); }
.fields span:nth-child(3) { left: 8%;  top: 48%; width: 56%; background: var(--sapphire); }
.fields span:nth-child(4) { left: 40%; top: 34%; width: 60%; background: var(--mist); }
.fields span:nth-child(5) { left: 16%; top: 20%; width: 46%; background: var(--seaweed); }
.fields span:nth-child(6) { left: 52%; top: 6%;  width: 40%; background: var(--sapphire); }
.fields span:nth-child(7) { left: 66%; top: 20%; width: 8%; background: var(--tuscan-sun); }

@media (prefers-reduced-motion: no-preference) {
  .fields span { animation: plough .9s cubic-bezier(.2,.7,.2,1) both; }
  .fields span:nth-child(2) { animation-delay: .08s; }
  .fields span:nth-child(3) { animation-delay: .16s; }
  .fields span:nth-child(4) { animation-delay: .24s; }
  .fields span:nth-child(5) { animation-delay: .32s; }
  .fields span:nth-child(6) { animation-delay: .40s; }
  .fields span:nth-child(7) { animation-delay: .70s; }
  @keyframes plough {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
  }
}

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .fields { max-width: 20rem; justify-self: start; aspect-ratio: 1.6 / 1; order: -1; margin-bottom: -0.5rem; }
  .fields span { height: 15%; }
}

/* Page hero for inner pages */
.page-hero { padding-block: clamp(3.5rem, 7vw, 5.5rem) clamp(2.5rem, 5vw, 3.5rem); border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.page-hero h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); max-width: 18ch; }
.page-hero .lede { max-width: 44rem; margin-bottom: 0; }
.page-hero::after {
  content: ""; position: absolute; right: -2rem; bottom: 2.5rem;
  width: clamp(6rem, 18vw, 14rem); height: clamp(1.25rem, 3vw, 2.25rem);
  background: var(--seaweed); transform: skewY(-20deg);
}
.page-hero::before {
  content: ""; position: absolute; right: clamp(4rem, 12vw, 10rem); bottom: clamp(5rem, 8vw, 7rem);
  width: clamp(3rem, 8vw, 6rem); height: clamp(1.25rem, 3vw, 2.25rem);
  background: var(--sapphire); transform: skewY(-20deg);
}
@media (max-width: 700px) { .page-hero::before, .page-hero::after { display: none; } }

/* ---------- Ledger rows (services list, track record) ---------- */

.ledger { border-top: 2px solid var(--black); margin: 0; padding: 0; list-style: none; }
.ledger > li, .ledger > div {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 0.5rem 3rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.ledger h3 { margin: 0; }
.ledger p { margin: 0; }
.ledger a.row-link { font-family: var(--display); font-weight: 600; font-size: 0.98rem; display: inline-block; margin-top: 0.6rem; }
@media (max-width: 760px) { .ledger > li, .ledger > div { grid-template-columns: 1fr; } }

/* Track record: figure + description on ruled rows */
.record > div { grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr); align-items: baseline; }
.record .fig {
  font-family: var(--display); font-stretch: 120%; font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1; color: var(--sapphire);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.record p { font-size: 1.125rem; }
.record-note { font-size: 0.95rem; color: var(--muted); margin-top: 1.25rem; }
@media (max-width: 760px) { .record > div { grid-template-columns: 1fr; } }

/* ---------- Problem / outcome split ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 2.5rem; margin-top: 0.5rem; }
.outcomes h3 { font-size: 1.2rem; margin-bottom: 0.4rem; padding-top: 1rem; border-top: 3px solid var(--seaweed); }
.outcomes p { margin: 0; font-size: 1.0625rem; }
@media (max-width: 640px) { .outcomes { grid-template-columns: 1fr; } }

/* ---------- Services detail ---------- */

.service { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 1.5rem clamp(2rem, 6vw, 5rem); padding-block: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--rule); scroll-margin-top: 6rem; }
.service:first-of-type { border-top: 0; padding-top: 0; }
.service h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin-bottom: 0.6rem; }
.service .promise { font-family: var(--display); font-weight: 560; font-stretch: 100%; font-size: 1.125rem; color: var(--seaweed-ink); margin: 0; }
.service h4 { margin-top: 0.5rem; }
@media (max-width: 860px) { .service { grid-template-columns: 1fr; } }

.service-index { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; padding: 0; list-style: none; }
.service-index a {
  display: inline-block; font-family: var(--display); font-weight: 560; font-size: 0.95rem;
  padding: 0.5rem 0.85rem; border: 1px solid var(--rule); border-radius: 3px; text-decoration: none; color: var(--black); background: #fff;
}
.service-index a:hover { border-color: var(--sapphire); color: var(--sapphire); }

/* ---------- Steps (Our Approach, What happens next) ---------- */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0 2rem;
  padding: 2.25rem 0; border-top: 1px solid var(--rule);
}
.steps > li:last-child { border-bottom: 1px solid var(--rule); }
.steps > li::before {
  content: counter(step);
  font-family: var(--display); font-stretch: 125%; font-weight: 800;
  font-size: 3.25rem; line-height: 0.9; color: var(--sapphire);
}
.steps h3 { margin-bottom: 0.5rem; }
.steps p:last-child { margin-bottom: 0; }
@media (max-width: 600px) { .steps > li { grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0 1rem; } .steps > li::before { font-size: 2.25rem; } }

.steps--compact > li { padding: 1.25rem 0; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0 1rem; }
.steps--compact > li::before { font-size: 1.75rem; }
.steps--compact p { font-size: 1.0625rem; }

/* ---------- People ---------- */

.founders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 760px) { .founders { grid-template-columns: 1fr; } }
.person img { width: 100%; max-width: 22rem; aspect-ratio: 1; object-fit: cover; margin-bottom: 1.5rem; clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%); }
.person h2, .person h3 { margin-bottom: 0.15rem; }
.person .role { font-family: var(--display); font-weight: 560; color: var(--seaweed-ink); margin-bottom: 1.1rem; }
.person p { font-size: 1.0625rem; }
.person .creds { font-size: 0.98rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 0.9rem; margin-top: 1.25rem; }
.person .li { font-family: var(--display); font-weight: 600; font-size: 0.98rem; }

.founders-teaser { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.founders-teaser .faces { display: flex; gap: 1rem; }
.founders-teaser .faces figure { margin: 0; text-align: left; }
.founders-teaser .faces img { width: clamp(8rem, 16vw, 11rem); aspect-ratio: 1; object-fit: cover; clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%); }
.founders-teaser figcaption { font-family: var(--display); font-weight: 600; font-size: 0.95rem; margin-top: 0.6rem; }
@media (max-width: 760px) { .founders-teaser { grid-template-columns: 1fr; } }

/* ---------- Principles grid (About / Approach) ---------- */

.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; }
.principles h3 { font-size: 1.2rem; padding-top: 1rem; border-top: 3px solid var(--sapphire); }
.principles p { font-size: 1.0625rem; margin: 0; }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--sapphire); color: #fff;
  padding-block: clamp(5rem, 10vw, 7.5rem) clamp(4rem, 8vw, 6rem);
  clip-path: polygon(0 clamp(2rem, 5vw, 4rem), 100% 0, 100% 100%, 0 100%);
  margin-top: calc(var(--space) * -0.25);
}
.cta-band h2 { color: #fff; max-width: 20ch; }
.cta-band p { color: #e3ecf8; }
.cta-band .lede { color: #fff; }

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

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.form { display: grid; gap: 1.35rem; }
.field label { display: block; font-family: var(--display); font-weight: 620; font-size: 1rem; margin-bottom: 0.4rem; }
.field .hint { font-family: var(--body); font-weight: 400; color: var(--muted); font-size: 0.95rem; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1.0625rem; color: var(--black);
  padding: 0.8rem 0.9rem; border: 1.5px solid #9fb0c6; border-radius: 3px; background: #fff;
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--sapphire); outline: 3px solid var(--tuscan-sun); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.35rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form .btn { justify-self: start; cursor: pointer; font-size: 1.0625rem; padding: 1rem 1.6rem; }
.form-note { font-size: 0.95rem; color: var(--muted); margin: 0; }

.alert { border-left: 4px solid var(--strawberry-ink); background: #fdeef3; padding: 1rem 1.2rem; margin-bottom: 1.5rem; }
.alert p { margin: 0; color: #5c0b26; }
.alert[hidden] { display: none; }

.aside-panel { background: var(--mist); padding: clamp(1.5rem, 3vw, 2.25rem); }
.aside-panel h2 { font-size: 1.5rem; }
.aside-panel + .aside-panel { margin-top: 1.5rem; }
.aside-panel p { font-size: 1.0625rem; }

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

.site-footer { background: var(--black); color: #c9d2de; padding-block: 3.5rem 2.5rem; font-size: 1rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
.footer-grid img { width: 13rem; margin-bottom: 1.1rem; }
.footer-grid p { margin: 0 0 0.5rem; }
.footer-grid h2 { font-size: 1rem; color: #fff; font-stretch: 105%; margin-bottom: 0.8rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.45rem; }
.footer-base { border-top: 1px solid #2a2f38; margin-top: 2.5rem; padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 0.92rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Utilities ---------- */

.center-narrow { max-width: 44rem; }
.mt-0 { margin-top: 0; }
.prose h2 { margin-top: 2.5rem; font-size: 1.6rem; }
.prose h2:first-child { margin-top: 0; }

/* Keep the header button readable when it is the current page */
.nav a.btn, .nav a.btn[aria-current="page"] { color: #fff; box-shadow: none; border-radius: 3px; }
.nav a.btn:hover { background: var(--sapphire-deep); color: #fff; }

/* ---------- Photo hero (home) ---------- */

.hero--photo {
  position: relative;
  background: #f6f8fb;
  padding-block: clamp(4rem, 8vw, 7rem);
  min-height: clamp(34rem, 46vw, 42rem);
  display: flex; align-items: center;
  isolation: isolate;
}
.hero--photo .wrap { display: block; position: relative; z-index: 2; }
.hero-copy { max-width: 35rem; }
.hero--photo h1 { font-size: clamp(2.4rem, 4.2vw, 3.6rem); }
.hero--photo h1 { color: var(--sapphire); }
.hero--photo .lede { color: #1f2733; }

.hero-photo {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 64%;
  background: url("../img/hero-desk.jpg") left center / cover no-repeat;
  z-index: 0;
}
/* Fade the photo into the page behind the text */
.hero-photo::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #f6f8fb 0%, rgba(246,248,251,.95) 18%, rgba(246,248,251,.5) 40%, rgba(246,248,251,0) 60%);
}
/* Brand stripes on the left edge, echoing the logo (wide screens only) */
.hero--photo::before, .hero--photo::after {
  content: ""; position: absolute; top: 0; bottom: 0; z-index: 1;
  transform: skewX(-8deg); transform-origin: bottom left;
}
.hero--photo::before { left: -3rem; width: 3rem; background: var(--sapphire); }
.hero--photo::after  { left: 0.9rem; width: 0.6rem; background: var(--seaweed); }
@media (max-width: 1279px) {
  .hero--photo::before, .hero--photo::after { display: none; }
}

@media (max-width: 880px) {
  .hero--photo { display: block; min-height: 0; padding-top: 0; background: #fff; }
  .hero--photo::before, .hero--photo::after { display: none; }
  .hero-photo {
    position: relative; width: 100%; height: clamp(14rem, 58vw, 22rem);
    background-position: 35% center;
    margin-bottom: 2.25rem;
  }
  .hero-photo::before { background: linear-gradient(0deg, #fff 0%, rgba(255,255,255,0) 30%); }
  .hero-copy { padding-left: 0; }
}
