/* ========== Fonts ========== */

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ========== Tokens ========== */

:root {
  /* Palette — royal navy + accent blue on cool off-white.
     Variable names retained (--color-charcoal / --color-terracotta) from the
     original terracotta palette so we didn't have to refactor every reference.
     Only the values changed. */
  --color-cream: #E4ECF8;          /* clearly blue-tinted ground (was near-white) */
  --color-cream-2: #D6E1F1;        /* slightly deeper blue tint for alt sections */
  --color-charcoal: #0E2462;       /* deep blue (was royal navy) */
  --color-slate: #2849A3;          /* medium blue */
  --color-muted: #5C77B4;          /* mid blue-grey */
  --color-terracotta: #2A60E0;     /* vivid accent blue */
  --color-terracotta-deep: #1C46B8;/* deeper accent blue */
  --color-rule: #B8C8E0;           /* blue-grey rule */

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;

  --text-display: clamp(2.75rem, 6vw + 1rem, 6rem);
  --text-h1: clamp(2rem, 3vw + 1rem, 3.5rem);
  --text-h2: clamp(1.25rem, 1vw + 1rem, 1.75rem);
  --text-lead: clamp(1.0625rem, 0.5vw + 1rem, 1.25rem);
  --text-lead-hero: clamp(1.25rem, 1vw + 1rem, 1.75rem);
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-eyebrow: 0.75rem;

  --space-section: clamp(5rem, 12vw, 11rem);
  --container-max: 72rem;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);
}

/* ========== Reset / base ========== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  background-color: var(--color-cream);
  background-image:
    /* Subtle blue paper grain — SVG fractal noise, low opacity */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.055 0 0 0 0 0.137 0 0 0 0 0.384 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(14, 36, 98, 0.10), transparent 60%),
    radial-gradient(ellipse 90% 70% at 100% 100%, rgba(42, 96, 224, 0.10), transparent 60%);
  background-attachment: fixed;
  background-blend-mode: multiply, normal, normal;
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
}

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

::selection {
  background: var(--color-terracotta);
  color: var(--color-cream);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== Skip link ========== */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--color-charcoal);
  color: var(--color-cream);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

/* ========== Logo ========== */

.logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.logo__a {
  color: var(--color-charcoal);
  font-weight: 500;
  font-style: normal;
}
.logo__b {
  color: var(--color-terracotta);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.005em;
}
.logo--small { font-size: 1rem; }

/* ========== Site header ========== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-cream) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-rule);
}
.site-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.site-header nav {
  display: none;
  gap: 2rem;
}
.site-header nav a {
  font-size: var(--text-small);
  color: var(--color-slate);
  position: relative;
  transition: color 200ms ease;
}
.site-header nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-terracotta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms ease;
}
.site-header nav a:hover {
  color: var(--color-charcoal);
}
.site-header nav a:hover::after {
  transform: scaleX(1);
}

@media (min-width: 720px) {
  .site-header nav { display: flex; }
}

/* ========== Chapters ========== */

.chapter {
  /* padding-inline expands on wide viewports to centre the content column;
     children are then naturally constrained by the chapter's content width
     and left-align by default (no per-child auto margins fighting each other) */
  padding-block: var(--space-section);
  padding-inline: max(var(--container-pad), calc((100% - var(--container-max)) / 2));
  border-top: 1px solid var(--color-rule);
  position: relative;
  /* overflow: clip clips the chapter watermark like overflow: hidden would,
     but unlike `hidden` it doesn't establish a scrollport — so position: sticky
     on descendants (the chapter eyebrow) works correctly. */
  overflow: clip;
  isolation: isolate;
}
.chapter > * {
  position: relative;
  z-index: 1;
}

/* Oversized chapter numeral, behind content */
.chapter[data-chapter]::before {
  content: attr(data-chapter);
  position: absolute;
  top: clamp(1rem, 4vw, 3rem);
  right: clamp(-1rem, -1vw, 1rem);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 200;
  font-size: clamp(7rem, 22vw, 18rem);
  line-height: 0.85;
  color: var(--color-terracotta);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
  letter-spacing: -0.05em;
  user-select: none;
}
/* Hero chapter numeral becomes a deliberate architectural element */
.chapter--hero[data-chapter]::before {
  font-size: clamp(12rem, 38vw, 32rem);
  opacity: 0.09;
  font-weight: 100;
  top: auto;
  bottom: -2vw;
  right: -3vw;
  letter-spacing: -0.08em;
}
.chapter--center[data-chapter]::before {
  right: 50%;
  transform: translateX(50%);
  top: 30%;
  opacity: 0.05;
}
.chapter--alt { background: var(--color-cream-2); }
.chapter:first-of-type { border-top: none; }
.chapter--center { text-align: center; }
.chapter--center .lead {
  margin-left: auto;
  margin-right: auto;
}

.chapter--hero {
  min-height: calc(100svh - 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.chapter--hero > * { width: 100%; }

/* ========== Eyebrow ========== */

.eyebrow {
  font-family: var(--font-serif);
  font-size: var(--text-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-slate);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 4.5rem;
  z-index: 5;
  padding: 0.75rem 0;
  /* Frosted-glass background so content scrolling under sticky eyebrow doesn't bleed through */
  background: color-mix(in srgb, var(--color-cream) 85%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
}
.chapter--alt .eyebrow {
  background: color-mix(in srgb, var(--color-cream-2) 85%, transparent);
}
.chapter--center .eyebrow {
  justify-content: center;
}
.eyebrow__num {
  color: var(--color-terracotta);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.eyebrow::after {
  content: '';
  flex: 0 0 3rem;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}
.chapter--center .eyebrow::after { display: none; }

/* ========== Display / titles ========== */

.display {
  font-family: var(--font-serif);
  font-size: var(--text-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 18ch;
  text-wrap: balance;
}

.title {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 22ch;
  text-wrap: balance;
}
.chapter--center .title {
  margin-left: auto;
  margin-right: auto;
}

h3 {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

/* ========== Lead paragraphs ========== */

.lead {
  font-size: var(--text-lead);
  color: var(--color-slate);
  max-width: 38rem;
  line-height: 1.55;
  margin-top: 1.75rem;
}
.lead--hero {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lead-hero);
  color: var(--color-charcoal);
  margin-top: 2.5rem;
  font-weight: 300;
  letter-spacing: -0.005em;
  max-width: 32ch;
}

/* ========== Buyer-voice quotes (Method) ========== */

.thoughts {
  margin-top: 2.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 44rem;
  border-left: 1px solid var(--color-rule);
  padding-left: clamp(1.25rem, 2vw, 2rem);
}
.thoughts li {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.125rem, 0.5vw + 1rem, 1.375rem);
  line-height: 1.45;
  color: var(--color-charcoal);
  letter-spacing: -0.005em;
}

.lead--callout {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-terracotta);
  font-size: clamp(1.25rem, 1vw + 1rem, 1.625rem);
  margin-top: 2rem;
  font-weight: 400;
}

/* Punchy serif-italic tagline (used inside Privately) */
.tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 1.5vw + 1rem, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-charcoal);
  margin-top: 3rem;
  max-width: 22ch;
}

/* ========== Pillars (Method) ========== */

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 4rem;
  padding-top: 0;
}
.pillars > article {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(1rem, 1.5vw, 1.75rem);
  align-items: baseline;
  background: #F2F6FB;
  border: 1px solid var(--color-rule);
  border-radius: 0.5rem;
  padding: clamp(1.5rem, 2vw, 1.875rem);
  box-shadow: 0 1px 2px rgba(14, 36, 98, 0.03);
}
.pillar-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 200;
  font-size: clamp(2.25rem, 3vw + 0.5rem, 3.5rem);
  line-height: 0.9;
  color: var(--color-terracotta);
  grid-row: 1 / span 2;
  letter-spacing: -0.02em;
  align-self: start;
  padding-top: 0.1em;
}
.pillars h3 {
  margin-bottom: 0.5rem;
}
.pillars p:not(.pillar-num) {
  color: var(--color-slate);
  max-width: 36ch;
  grid-column: 2;
}

@media (min-width: 800px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* ========== Products list ========== */

.products {
  margin-top: 4.5rem;
  border-top: 1px solid var(--color-rule);
}
.products li {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0.5rem;
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--color-rule);
  position: relative;
  margin-left: calc(-1 * clamp(1rem, 2vw, 1.5rem));
  margin-right: calc(-1 * clamp(1rem, 2vw, 1.5rem));
  border-left: 2px solid transparent;
  transition: background-color 250ms ease, border-left-color 250ms ease;
}
.products li:hover {
  background-color: color-mix(in srgb, var(--color-terracotta) 4%, transparent);
  border-left-color: var(--color-terracotta);
}
.product__num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--color-muted);
  font-feature-settings: 'tnum' 1;
  letter-spacing: 0.05em;
}
.product__name {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-top: 0.25rem;
}
.product__tag {
  color: var(--color-charcoal);
  font-size: var(--text-lead);
  font-weight: 500;
  margin-top: 0.5rem;
}
.product__body {
  color: var(--color-slate);
  max-width: 50ch;
  margin-top: 0.5rem;
}
.product__detail {
  color: var(--color-slate);
  font-size: var(--text-small);
  line-height: 1.55;
  max-width: 62ch;
  margin-top: 1rem;
}
.product__link {
  margin-top: 1.25rem;
  display: inline-block;
  font-size: var(--text-small);
  color: var(--color-terracotta);
  letter-spacing: 0.02em;
  font-feature-settings: 'tnum' 1;
  transition: color 200ms ease;
}
.product__link:hover {
  color: var(--color-terracotta-deep);
}
.product__link span {
  display: inline-block;
  transition: transform 200ms ease;
  margin-left: 0.25rem;
}
.product__link:hover span {
  transform: translateX(4px);
}

@media (min-width: 800px) {
  .products li {
    grid-template-columns: 8rem 1fr auto;
    column-gap: 2rem;
    align-items: start;
  }
  .product__num {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0.75rem;
  }
  .product__name   { grid-column: 2; grid-row: 1; margin-top: 0; }
  .product__tag    { grid-column: 2; grid-row: 2; }
  .product__body   { grid-column: 2; grid-row: 3; }
  .product__detail { grid-column: 2; grid-row: 4; }
  .product__link {
    grid-column: 3;
    grid-row: 1 / -1;
    align-self: start;
    margin-top: 0.5rem;
    white-space: nowrap;
  }
}

/* ========== Markets list ========== */

.markets {
  margin-top: 4.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--color-rule);
}
.markets li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--color-rule);
}
.markets h3 {
  font-family: var(--font-sans);
  font-size: clamp(0.8125rem, 0.25vw + 0.75rem, 0.9375rem);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--color-charcoal);
  display: flex;
  align-items: center;
  gap: 0.75em;
}
.markets h3::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  background: var(--color-terracotta);
  border-radius: 50%;
  flex: 0 0 auto;
}
.markets p {
  color: var(--color-slate);
}

@media (min-width: 800px) {
  .markets li {
    grid-template-columns: 14rem 1fr;
    column-gap: 2rem;
    align-items: baseline;
  }
}

/* ========== Email CTA (contact section) ========== */

.email-cta {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.75rem, 3vw + 1rem, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--color-terracotta);
  display: inline-block;
  margin-top: 3rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid currentColor;
  transition: color 200ms ease, transform 200ms ease;
}
.email-cta:hover {
  color: var(--color-terracotta-deep);
  transform: translateY(-1px);
}

/* ========== Footer ========== */

.site-footer {
  border-top: 1px solid var(--color-rule);
  padding: 2.5rem var(--container-pad);
}
.site-footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  color: var(--color-muted);
  font-size: var(--text-small);
}

/* ========== Manifesto callout (between Method and Products) ========== */

.manifesto {
  padding: clamp(4.5rem, 10vw, 8rem) var(--container-pad);
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  background:
    radial-gradient(ellipse at center, rgba(42, 96, 224, 0.10), transparent 70%),
    var(--color-cream);
  text-align: center;
  position: relative;
}
.manifesto p {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--color-charcoal);
  max-width: 28ch;
  margin: 0 auto;
  text-wrap: balance;
}
.manifesto__pick {
  color: var(--color-terracotta);
  font-weight: 500;
}

/* ========== Case study (between manifesto and products) ========== */

.case-study {
  padding-block: clamp(4.5rem, 10vw, 8rem);
  padding-inline: max(var(--container-pad), calc((100% - var(--container-max)) / 2));
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  background: var(--color-cream-2);
  position: relative;
}

.case-study__label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-small);
  color: var(--color-slate);
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.case-study .title { max-width: 22ch; }
.case-study .lead { margin-top: 1.25rem; max-width: 50ch; }

.comparison-wrap {
  margin-top: 3rem;
  overflow-x: auto;
}

.comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-small);
  line-height: 1.5;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.comparison thead th {
  font-family: var(--font-sans);
  font-weight: 500;
  text-align: left;
  vertical-align: bottom;
  padding: 0 1rem 0.875rem 0;
  color: var(--color-charcoal);
  border-bottom: 1px solid var(--color-charcoal);
  white-space: nowrap;
}
.comparison thead th:first-child { width: 22%; }
.comparison thead th.us {
  color: var(--color-terracotta);
  border-bottom-color: var(--color-terracotta);
  border-bottom-width: 3px;
  font-weight: 600;
}

/* Column-wide accent tint applied via <colgroup> */
.comparison__us-col {
  background-color: color-mix(in srgb, var(--color-terracotta) 9%, transparent);
}
.comparison__sub {
  font-weight: 400;
  font-size: 0.8em;
  color: var(--color-muted);
  display: inline-block;
  margin-left: 0.25em;
}

.comparison tbody th {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: normal;
  text-align: left;
  vertical-align: top;
  padding: 1rem 1.5rem 1rem 0;
  color: var(--color-slate);
  border-bottom: 1px solid var(--color-rule);
  white-space: nowrap;
}

.comparison tbody td {
  padding: 1rem 1rem 1rem 0;
  vertical-align: top;
  color: var(--color-charcoal);
  border-bottom: 1px solid var(--color-rule);
}
.comparison tbody td.us {
  color: var(--color-terracotta);
  font-weight: 600;
  padding-left: 1rem;
  padding-right: 1rem;
}
.comparison thead th.us {
  padding-left: 1rem;
  padding-right: 1rem;
}

.comparison tbody tr:last-child th,
.comparison tbody tr:last-child td {
  border-bottom: 0;
}

.case-study__footnote {
  font-size: var(--text-small);
  color: var(--color-muted);
  margin-top: 2rem;
  max-width: 60ch;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .comparison thead { display: none; }
  .comparison,
  .comparison tbody,
  .comparison tr { display: block; }

  .comparison tbody tr {
    border-bottom: 1px solid var(--color-rule);
    padding: 1.25rem 0;
  }
  .comparison tbody tr:last-child { border-bottom: 0; }
  .comparison tbody th {
    display: block;
    border-bottom: 0;
    padding: 0 0 0.75rem 0;
    font-family: var(--font-serif);
    color: var(--color-charcoal);
    font-size: 1.0625rem;
    white-space: normal;
  }
  .comparison tbody td {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 1rem;
    padding: 0.375rem 0;
    border-bottom: 0;
  }
  .comparison tbody td::before {
    content: attr(data-label);
    color: var(--color-muted);
    font-size: var(--text-small);
  }
  /* Mobile: emphasise the "This site" cell as a tinted row */
  .comparison tbody td.us {
    background: color-mix(in srgb, var(--color-terracotta) 9%, transparent);
    border-radius: 0.25rem;
    padding: 0.625rem 0.875rem;
    margin-top: 0.5rem;
  }
}

/* ========== Scroll progress bar ========== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-terracotta);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 60;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes scroll-progress-fill {
      from { transform: scaleX(0); }
      to   { transform: scaleX(1); }
    }
    .scroll-progress {
      animation: scroll-progress-fill linear;
      animation-timeline: scroll(root);
    }
  }
}

/* ========== Active nav link (set by script.js) ========== */

.site-header nav a.is-active {
  color: var(--color-charcoal);
}
.site-header nav a.is-active::after {
  transform: scaleX(1);
}

/* ========== Scroll-driven section reveals ========== */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes section-rise {
      from { opacity: 0; transform: translateY(24px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .chapter:not(.chapter--hero) > * {
      animation: section-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }
  }
}
