/* ==========================================================================
   Systems for Mission
   One-page site. Mobile first. No framework.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Primary anchors */
  --ink: #1B1B1B;
  --pine: #1F3A2E;
  --frost-blue: #16488F;

  /* Secondary colors */
  --lavender: #C9B4E8;
  --citron: #B7C646;
  --polar: #C6D8EA;

  /* Neutrals */
  --taupe: #D9C8BB;
  --warm-cream: #F9F4EC;
  --ivory: #FEFBF6;

  /* Pale surfaces and tints */
  --lavender-tint: #ECE3F5;
  --citron-tint: #E7EDC2;
  --polar-tint: #EAF1F8;
  --sand: #EFE7DF;
  --manila: #E6DAD0;

  /* Primary call to action: Citron with Ink text (9.2:1) */
  --cta: var(--citron);
  --cta-hover: #C4D25E;
  --cta-active: #A6B53A;

  /* Text */
  --text: var(--ink);
  --text-secondary: #5C554F; /* passes AA on every light background used here */
  --line: rgba(27, 27, 27, 0.12);
  --line-strong: rgba(27, 27, 27, 0.26);
  --line-on-dark: rgba(254, 251, 246, 0.22);

  /* Type */
  --font-display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-quote: "Source Serif 4", Georgia, "Times New Roman", serif;

  --fs-hero: clamp(2.5rem, 0.9rem + 4vw, 4.5rem);
  --fs-h2: clamp(2rem, 1.35rem + 2vw, 3rem);
  --fs-h3: clamp(1.075rem, 1rem + 0.3vw, 1.2rem);
  --fs-body: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-small: 0.875rem;
  --fs-label: 0.78rem;

  /* Spacing: 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 */
  --s-1: 8px;
  --s-2: 12px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 32px;
  --s-6: 48px;
  --s-7: 64px;
  --s-8: 80px;
  --s-9: 96px;

  --section-y: clamp(72px, 4rem + 4vw, 128px);
  --gutter: clamp(20px, 4vw, 40px);
  --max: 1240px;

  /* Shape */
  --r-sm: 10px;
  --r-btn: 12px;
  --r-card: 16px;
  --r-panel: 22px;

  --shadow-soft: 0 1px 2px rgba(27, 27, 27, 0.04), 0 10px 28px -14px rgba(27, 27, 27, 0.16);
  --shadow-lift: 0 2px 4px rgba(27, 27, 27, 0.05), 0 18px 36px -18px rgba(27, 27, 27, 0.28);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 160ms;
  --t-mid: 220ms;
  --ease-reveal: cubic-bezier(0.25, 0.1, 0.25, 1); /* standard ease */

  --header-h: 72px;
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

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

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

p { text-wrap: pretty; }
a { color: inherit; }
strong { font-weight: 600; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.nowrap { white-space: nowrap; }

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

/* Focus: always visible, outline plus offset, never color alone */
:focus-visible {
  outline: 3px solid var(--frost-blue);
  outline-offset: 3px;
  border-radius: 4px;
}
.how :focus-visible,
.final-cta :focus-visible,
.site-footer :focus-visible { outline-color: var(--lavender); }

.skip-link {
  position: absolute;
  left: var(--s-3);
  top: -100px;
  z-index: 100;
  padding: var(--s-2) var(--s-3);
  background: var(--ink);
  color: var(--ivory);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--s-3); }

/* ---------- 3. Type ---------- */
/* Eyebrows: a small tinted label that marks the start of each section.
   Modest padding and a small radius, so it reads as a label, not a pill.
   The tint alternates by section; text stays Pine or Frost Blue for contrast. */
.label {
  display: inline-block;
  max-width: 100%;
  margin-bottom: var(--s-3);
  padding: 4px 9px 3px;
  border-radius: 4px;
  background: var(--lavender-tint);
  color: var(--pine);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.label-lavender { background: var(--lavender-tint); color: var(--pine); }
.label-citron   { background: var(--citron-tint);   color: var(--pine); }
.label-polar    { background: var(--polar-tint);    color: var(--frost-blue); }
.label-ivory    { background: var(--ivory);         color: var(--pine); }
.label-on-dark  { background: var(--lavender);      color: var(--ink); }

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section-intro {
  margin-top: var(--s-4);
  max-width: 34em;
  color: var(--ink);
  font-size: var(--fs-lead);
  line-height: 1.6;
}

/* ---------- 4. Icons ---------- */
.icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-ui { width: 22px; height: 22px; stroke-width: 2; }


/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: var(--r-btn);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--t-fast) ease,
    border-color var(--t-fast) ease,
    color var(--t-fast) ease,
    box-shadow var(--t-mid) ease,
    translate var(--t-fast) ease;
}
.btn-sm { min-height: 50px; padding: 0 18px; font-size: 0.9375rem; }

.btn-primary {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--ink);
}
.btn-primary:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  box-shadow: 0 0 0 4px rgba(183, 198, 70, 0.28), 0 12px 22px -12px rgba(31, 58, 46, 0.55);
  translate: 0 -1px;
}
.btn-primary:active {
  background: var(--cta-active);
  border-color: var(--cta-active);
  box-shadow: none;
  translate: 0 0;
}

.btn-secondary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--lavender-tint); translate: 0 -1px; }
.btn-secondary:active { background: var(--lavender); translate: 0 0; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}

.text-link {
  gap: 0.35em;
  color: var(--frost-blue);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
  transition: text-decoration-thickness var(--t-fast) ease;
}
.text-link:hover { text-decoration-thickness: 3px; }

/* ---------- 6. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(254, 251, 246, 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid) ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: var(--header-h);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  padding-block: 10px;
}

.header-actions { display: flex; align-items: center; gap: var(--s-2); }
.header-cta { display: none; }

.menu-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--t-fast) ease;
}
.menu-toggle:hover { background: var(--lavender-tint); }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.enhanced .menu-toggle { display: inline-grid; }

.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  padding: var(--s-2) var(--gutter) var(--s-4);
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 24px -16px rgba(27, 27, 27, 0.18);
}
.site-nav.is-open { display: block; }

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  text-decoration: none;
}
.nav-cta-mobile { width: 100%; margin-top: var(--s-4); }

@media (min-width: 560px) {
  .header-cta { display: inline-flex; }
  .nav-cta-mobile { display: none; }
}

@media (min-width: 960px) {
  .enhanced .menu-toggle { display: none; }
  .site-nav,
  .site-nav.is-open {
    position: static;
    display: block;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    margin-left: auto;
  }
  .nav-list { display: flex; gap: var(--s-1); }
  .nav-list a {
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--r-sm);
    font-size: 0.9375rem;
    transition: background-color var(--t-fast) ease;
  }
  .nav-list a:hover { background: var(--lavender-tint); }
}


/* ---------- 7. Hero (open editorial two-column) ---------- */
.hero {
  overflow: clip;
  padding-block: clamp(40px, 6vw, 88px) clamp(56px, 7vw, 104px);
}

.hero-grid {
  display: grid;
  gap: var(--s-6);
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.hero-title span { display: block; }

.hero-lead {
  margin-top: var(--s-4);
  max-width: 33em;
  font-size: var(--fs-lead);
  line-height: 1.6;
}

.hero-copy .btn-row { margin-top: var(--s-5); }

/* Image sits on a lavender module that runs off the right edge,
   echoing the sidebar in the screenshot itself. */
.hero-media {
  position: relative;
  isolation: isolate;
  padding-block: var(--s-4);
}
.hero-media::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 18%;
  right: calc(-1 * var(--gutter) - 50vw);
  border-radius: var(--r-panel) 0 0 var(--r-panel);
  background: var(--lavender-tint);
}
.hero-media img {
  width: 100%;
  border-radius: 18px;
}

@media (max-width: 559px) {
  .hero-copy .btn { flex: 1 1 100%; }
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: clamp(40px, 5vw, 80px);
  }
  .hero-media { padding-block: var(--s-6); }
  .hero-media::before { left: 24%; }
}


/* ---------- 8. Organizations (minimal strip, full-color logos) ---------- */
.orgs {
  padding-block: clamp(48px, 5vw, 72px);
  background: var(--warm-cream);
}

.orgs-grid {
  display: grid;
  gap: var(--s-5);
  align-items: center;
}

.orgs-title {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.orgs-copy p {
  margin-top: var(--s-2);
  max-width: 30em;
  color: var(--text-secondary);
}

.logo-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-5) var(--s-4);
}

.logo-item { display: flex; justify-content: center; }
/* The whole logo + name block is one link */
.logo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  min-width: 44px;
  padding: var(--s-2) var(--s-1);
  border-radius: var(--r-card);
  text-align: center;
  text-decoration: none;
  transition: background-color var(--t-mid) ease, translate var(--t-mid) var(--ease);
}
.logo-link:hover { background: var(--polar-tint); translate: 0 -2px; }
.logo-link:hover span { color: var(--frost-blue); }
/* All four marks are round badges, so one diameter balances them.
   Shown in their original colors, with one consistent thin frame. */
.logo-item img {
  width: clamp(76px, 5vw + 48px, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ivory);
  box-shadow: 0 0 0 1px var(--line), 0 6px 14px -10px rgba(27, 27, 27, 0.35);
  transition: translate var(--t-mid) var(--ease), box-shadow var(--t-mid) ease;
}
.logo-link:hover img {
  translate: 0 -2px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 10px 18px -10px rgba(27, 27, 27, 0.4);
}
.logo-item span {
  transition: color var(--t-mid) ease;
  max-width: 15ch;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .logo-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .orgs-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); gap: var(--s-7); }
}


/* ---------- 9. Section shells ---------- */
.section { padding-block: var(--section-y); }
.section-cream { background: var(--warm-cream); }
.section-head { margin-bottom: clamp(32px, 4vw, 56px); }

/* ---------- 10. Pain points: a plain editorial list ---------- */
.pain-grid { display: grid; gap: var(--s-6); }

.friction-list { border-top: 1px solid var(--line-strong); }
.friction-list li {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: baseline;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.friction-num {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--frost-blue);
}
.pain-close {
  margin-top: var(--s-5);
  padding-left: var(--s-4);
  border-left: 3px solid var(--pine);
  max-width: 34em;
  font-size: var(--fs-lead);
  line-height: 1.65;
}
.pain-close-lead {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.2em;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--pine);
}
/* A soft highlighter stroke behind the key sentence */
.marker {
  padding: 0 2px;
  background: linear-gradient(to top, var(--citron-tint) 0 46%, transparent 46%);
  color: var(--ink);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@media (min-width: 900px) {
  .pain-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--s-7);
    align-items: start;
  }
  .pain-head { position: sticky; top: calc(var(--header-h) + 32px); }
  .friction-list li { padding-block: 22px; }
}

/* ---------- 11. Systems project areas: two-column list, small folder-tab accent ---------- */
.projects-head {
  display: grid;
  gap: var(--s-4);
  margin-bottom: clamp(48px, 5vw, 72px);
}
.projects-head .section-intro { margin-top: 0; }

.project-list { display: grid; column-gap: var(--s-7); }
.project {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: var(--s-3);
  padding-block: 28px 32px;
  border-top: 1px solid var(--line-strong);
}
/* A small tab on each divider: a quiet nod to file folders */
.project::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 0;
  width: 56px;
  height: 7px;
  border-radius: 6px 6px 0 0;
  background: var(--taupe);
}
.project-icon { width: 26px; height: 26px; margin-top: 1px; color: var(--frost-blue); }
.project::before { transition: width 300ms var(--ease-reveal), background-color 300ms ease; }
.project-icon { transition: translate 300ms var(--ease-reveal); }
@media (hover: hover) and (pointer: fine) {
  .project:hover::before { width: 88px; background: var(--lavender); }
  .project:hover .project-icon { translate: 2px 0; }
}
.project-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.project p { margin-top: 6px; max-width: 32em; color: var(--text-secondary); }

.project-list { border-bottom: 1px solid var(--line-strong); }
.projects-close-lead { color: var(--frost-blue); }
.projects-close {
  margin-top: var(--s-6);
  max-width: 30em;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .projects-head {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--s-7);
    align-items: end;
  }
}

/* ---------- 12. Systems Assessment ---------- */
.assessment { background: var(--polar-tint); }
.assessment-grid { display: grid; gap: var(--s-5); }
.assessment-head .section-title { max-width: 15em; }
.assessment-body {
  display: grid;
  gap: var(--s-3);
  max-width: 36em;
  font-size: var(--fs-lead);
  line-height: 1.6;
}
.assessment-body strong { font-weight: 700; }
.assessment-note {
  margin-top: var(--s-3);
  padding: 14px 18px;
  border-left: 4px solid var(--frost-blue);
  background: var(--ivory);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.45;
  text-wrap: balance;
}

/* Desktop: the heading runs wide and the text steps in to the right */
@media (min-width: 900px) {
  .assessment-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s-4); row-gap: var(--s-6); }
  .assessment-head { grid-column: 1 / span 9; }
  .assessment-body { grid-column: 5 / span 8; }
}

/* ---------- 13. How It Works (Pine, process flow) ---------- */
.how {
  background: var(--pine);
  color: var(--ivory);
}
.how-head { margin-bottom: clamp(40px, 5vw, 72px); }

.steps {
  --track-x: 6px;
  position: relative;
  display: grid;
  gap: var(--s-5);
}
/* Track */
.steps::before,
.steps::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 0;
  left: var(--track-x);
  width: 2px;
  border-radius: 2px;
}
.steps::before { background: var(--line-on-dark); }
.steps::after {
  background: var(--lavender);
  transform-origin: top;
}

.step {
  position: relative;
  padding-left: var(--s-6);
}
.step-node {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 2px solid var(--lavender);
  background: var(--lavender);
  transition: background-color 700ms ease;
}
/* Timeline draws once when the section enters view (script.js adds .is-pending, then .is-drawn).
   Text stays readable throughout; only the line, nodes, numbers and a small settle animate. */
.steps.is-pending::after { transform: scaleY(0); }
.steps.is-pending .step-node { background: var(--pine); }
.steps.is-pending .step-num { opacity: 0.4; }
.steps.is-pending .step-head,
.steps.is-pending .step-title { translate: 0 6px; }
.steps::after { transition: transform 2400ms var(--ease-reveal); }
.step-num { transition: opacity 700ms ease; }
.step-head,
.step-title { transition: translate 700ms var(--ease-reveal); }
.steps.is-drawn .step-node,
.steps.is-drawn .step-num,
.steps.is-drawn .step-head,
.steps.is-drawn .step-title { transition-delay: calc(var(--step) * 600ms + 200ms); }
.step:nth-child(1) { --step: 0; }
.step:nth-child(2) { --step: 1; }
.step:nth-child(3) { --step: 2; }
.step:nth-child(4) { --step: 3; }

.step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: -16px;
  margin-bottom: var(--s-2);
}
.step-num {
  font-family: var(--font-display);
  font-size: clamp(3rem, 2.4rem + 2vw, 4.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--lavender);
}
.icon-step { width: 32px; height: 32px; color: var(--warm-cream); margin-top: 8px; }

.step-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ivory);
}
.step p { margin-top: var(--s-1); color: rgba(254, 251, 246, 0.84); font-size: 0.98rem; max-width: 30em; }

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }
  .steps::before,
  .steps::after {
    top: 6px;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 2px;
  }
  .steps::after { transform-origin: left; }
  .steps.is-pending::after { transform: scaleX(0); }
  .step { padding: var(--s-6) var(--s-5) 0 0; }
  .step-head { margin-top: 0; }
}


/* ---------- 14. Examples (complete HTML previews) ---------- */
.cases { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(56px, 7vw, 104px); }

.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-4);
  align-items: center;
}

.case-file {
  min-width: 0;
  position: relative;
}

.case-tab {
  display: inline-block;
  max-width: calc(100% - 48px);
  padding: 10px 20px 8px;
  border-radius: 12px 12px 0 0;
  background: var(--manila);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.35;
}

.case-media {
  position: relative;
  overflow: hidden;
  border: 10px solid var(--manila);
  border-radius: 0 var(--r-panel) var(--r-panel) var(--r-panel);
  background: var(--ivory);
}

/* Responsive live website viewport with native internal scrolling. */
.site-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: 34px;
  padding: 0 var(--s-2);
  border-radius: 10px 10px 0 0;
  background: var(--warm-cream);
  border-bottom: 1px solid var(--line);
}
.site-dots { display: inline-flex; gap: 5px; }
.site-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--taupe); }
.site-url {
  min-width: 0;
  flex: 1;
  max-width: 22rem;
  margin-inline: auto;
  padding: 3px 12px;
  border-radius: 6px;
  background: var(--ivory);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-frame {
  position: relative;
  min-width: 0;
  /* No min-height here: with aspect-ratio it forced the frame wider than small screens */
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 0 0 10px 10px;
  background: var(--ivory);
}
.site-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}
/* script.js renders the site at a 1280px desktop width and scales it down */
.site-frame.is-scaled iframe {
  inset: 0 auto auto 0;
  width: 1280px;
  height: var(--site-h, 800px);
  border-radius: 0;
  transform: scale(var(--site-scale, 1));
  transform-origin: top left;
}
/* On touch screens the preview is view-only, so it never traps page scrolling */
@media (hover: none), (pointer: coarse) {
  .site-frame.is-scaled iframe { pointer-events: none; }
}
.site-preview .preview-open { margin: 10px; }
@media (max-width: 559px) {
  .site-frame { aspect-ratio: 4 / 3; }
}
.site-frame iframe:focus-visible { outline-offset: -3px; }

.case-copy { padding-inline: var(--s-1); }
.case-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.25rem + 0.9vw, 2.125rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.case-copy p { margin-top: var(--s-3); max-width: 30em; font-size: var(--fs-lead); line-height: 1.6; }

@media (min-width: 900px) {
  .case {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); /* visual about 58% */
    gap: clamp(40px, 5vw, 72px);
  }
  .case-flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .case-flip .case-file { order: 2; }
  .case-copy { padding: 0; }
}


/* ---------- 15. Testimonials: three editorial quotes, no cards ---------- */
.testimonials-section { background: var(--lavender-tint); }

/* Phones and tablets: stacked, separated by a thin rule */
.testimonials { display: grid; gap: var(--s-5); }
.quote {
  display: grid;
  grid-template-rows: 1fr auto; /* attributions line up along the bottom */
  gap: var(--s-4);
  margin: 0;
}
.quote + .quote { padding-top: var(--s-5); border-top: 1px solid var(--line-strong); }

.quote blockquote p {
  max-width: 32em;
  font-family: var(--font-quote);
  font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.375rem);
  font-weight: 400;
  line-height: 1.55;
  text-indent: -0.42em; /* hangs the opening quotation mark in the margin */
}
/* The measurable result gets a soft Citron underline */
.quote-stat {
  padding-inline: 1px;
  background: linear-gradient(to top, var(--citron) 0 0.22em, transparent 0.22em);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.quote figcaption {
  display: grid;
  gap: 2px;
  padding-top: var(--s-3);
  border-top: 1px solid var(--line-strong);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.quote figcaption strong { font-weight: 700; }
.quote figcaption span { color: var(--pine); }

/* Desktop: three equal columns divided by thin vertical rules */
@media (min-width: 1024px) {
  .testimonials {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr auto;
    gap: 0;
  }
  /* Quotes and attributions share rows across all three columns, so the names line up */
  @supports (grid-template-rows: subgrid) {
    .quote { grid-row: span 2; grid-template-rows: subgrid; row-gap: var(--s-4); }
  }
  .quote { padding-inline: var(--s-5); }
  .quote:first-child { padding-left: 0; }
  .quote:last-child { padding-right: 0; }
  .quote + .quote { padding-top: 0; border-top: 0; border-left: 1px solid var(--line-strong); }
}

/* ---------- 16. Who it's for ---------- */
.audience-grid { display: grid; gap: var(--s-6); align-items: start; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-top: var(--s-5);
}
.tags li {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--citron-tint);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.4;
}

.audience-list-title {
  margin-bottom: var(--s-2);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}
.check-list { border-top: 1px solid var(--line-strong); }
.check-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--s-2);
  align-items: start;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}
.icon-check {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  padding: 4px;
  border-radius: 50%;
  background: var(--citron);
  color: var(--ink);
  stroke-width: 3;
}
.audience-note {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-5);
  max-width: 36em;
  color: var(--text-secondary);
  font-size: 0.98rem;
}
.audience-note .audience-note-lead {
  color: var(--pine);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

@media (min-width: 960px) {
  .audience-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-8); }
  .audience-intro { position: sticky; top: calc(var(--header-h) + 32px); }
}

/* ---------- 17. About: text with a then-and-now photo pair ---------- */
.about-grid { display: grid; gap: var(--s-7); }

.about-text {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-4);
  max-width: 36em;
  font-size: var(--fs-lead);
  line-height: 1.6;
}
.about-lead { font-weight: 500; }
.about-text .about-close {
  margin-top: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line-strong);
  color: var(--pine);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.about-photos { display: grid; gap: var(--s-6); }
.about-photo { margin: 0; }
.about-photo img {
  width: 100%;
  object-fit: cover;
  border-radius: 14px 18px;
  background: var(--sand);
}
.about-photo-then { width: 86%; }
.about-photo-then img { aspect-ratio: 4 / 3; }
.about-photo-now { width: 94%; justify-self: end; }
.about-photo-now img { aspect-ratio: 3 / 2; }
.about-photo figcaption {
  margin-top: var(--s-2);
  max-width: 38ch;
  color: var(--text-secondary);
  font-size: var(--fs-small);
  line-height: 1.5;
}
/* If a photo file is missing, its figure steps aside instead of showing a broken image */
.about-photo.is-missing { display: none; }

@media (max-width: 459px) {
  .about-photo-then,
  .about-photo-now { width: 100%; }
}
@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--s-8);
    align-items: start;
  }
  .about-photos { order: -1; padding-top: var(--s-1); }
}

/* ---------- 18. Final CTA + footer (Ink) ---------- */
.final-cta {
  background: var(--ink);
  color: var(--ivory);
  padding-block: clamp(80px, 9vw, 128px);
}
.final-cta-inner { display: grid; gap: var(--s-5); }

.final-title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(2.125rem, 1.4rem + 3vw, 3.75rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.final-lead {
  max-width: 34em;
  font-size: var(--fs-lead);
  color: rgba(254, 251, 246, 0.86);
}
.final-body .btn-row { margin-top: var(--s-5); gap: var(--s-3) var(--s-5); }
.final-cta .text-link { color: var(--ivory); }

@media (min-width: 900px) {
  .final-cta-inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--s-7);
    align-items: end;
  }
}
@media (max-width: 559px) {
  .final-body .btn-row { flex-direction: column; align-items: stretch; }
  .final-body .btn { width: 100%; }
}

/* Slow ambient ripple around the main button; it rests while hovered or focused */
@keyframes cta-ripple {
  0%   { box-shadow: 0 0 0 0 rgba(183, 198, 70, 0.45), 0 0 0 0 rgba(201, 180, 232, 0.35); }
  60%  { box-shadow: 0 0 0 14px rgba(183, 198, 70, 0), 0 0 0 26px rgba(201, 180, 232, 0); }
  100% { box-shadow: 0 0 0 0 rgba(183, 198, 70, 0), 0 0 0 0 rgba(201, 180, 232, 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn-ambient.is-live { animation: cta-ripple 3.2s ease-out 1.2s infinite; }
  .btn-ambient.is-live:hover,
  .btn-ambient.is-live:focus-visible { animation: none; }
}

.site-footer {
  border-top: 1px solid var(--line-on-dark);
  background: var(--ink);
  color: var(--ivory);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-5);
  padding-block: var(--s-5);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); }
.wordmark-light { color: var(--ivory); }
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  font-size: 0.9375rem;
  text-decoration: none;
  color: rgba(254, 251, 246, 0.84);
  transition: color var(--t-fast) ease;
}
.footer-nav a:hover { color: var(--ivory); text-decoration: underline; text-underline-offset: 0.3em; }
.footer-legal { font-size: var(--fs-small); color: rgba(254, 251, 246, 0.72); }


/* ---------- 19. Gentle one-time entrance for selected blocks ---------- */
/* script.js adds .is-pending, then removes it once the block scrolls into view. */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    transition: opacity 650ms var(--ease-reveal), translate 650ms var(--ease-reveal);
    transition-delay: calc(var(--d, 0) * var(--stagger, 120ms));
  }
  [data-reveal].is-pending { opacity: 0; translate: 0 16px; }
  /* Project rows keep their own hover transitions alongside the entrance */
  .project[data-reveal] { transition-property: opacity, translate; }
}

/* ---------- 20. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .logo-link:hover,
  .logo-link:hover img,
  .btn:hover { translate: none; }
}

/* Progressive navigation: all links remain usable if JavaScript is unavailable. */
@media (max-width: 959px) {
  html:not(.enhanced) .site-header { position: static; }
  html:not(.enhanced) .header-inner { flex-wrap: wrap; padding-block: 12px; }
  html:not(.enhanced) .site-nav { position: static; display: block; order: 3; width: 100%; padding: 0; box-shadow: none; }
  .site-nav { max-height: calc(100dvh - var(--header-h)); overflow-y: auto; }
}
@media (max-width: 559px) {
  .nowrap { white-space: normal; }
}

/* Each live overview scales the whole document, including the bottom and right edges. */
.system-preview { padding: 10px; }
.system-overview { position: relative; width: 100%; aspect-ratio: var(--sheet-ratio, 1.4); overflow: hidden; background: var(--ivory); }
.system-overview iframe { position: absolute; inset: 0 auto auto 0; border: 0; transform-origin: top left; pointer-events: none; visibility: hidden; }
.system-preview.is-ready iframe { visibility: visible; }
.preview-fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; font-size: var(--fs-small); text-align: center; background: var(--ivory); }
.system-preview.is-ready .preview-fallback { display: none; }
.preview-open { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-top: 10px; padding: 8px 14px; background: var(--warm-cream); border: 1px solid var(--line-strong); border-radius: 8px; font-size: var(--fs-small); font-weight: 600; text-decoration: none; }
.preview-open:hover { background: var(--lavender-tint); }
.preview-open:focus-visible { outline-offset: -3px; }
.preview-dialog { width: min(1400px, calc(100vw - 40px)); max-width: none; height: min(920px, calc(100dvh - 40px)); max-height: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--ivory); color: var(--ink); }
.preview-dialog[open] { display: flex; flex-direction: column; }
.preview-dialog::backdrop { background: rgba(27, 27, 27, .65); }
.preview-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.preview-toolbar h2 { align-self: center; font: 700 clamp(1.125rem, 2vw, 1.5rem)/1.3 var(--font-display); }
.preview-toolbar p { grid-column: 1 / -1; font-size: var(--fs-small); color: var(--text-secondary); }
.preview-close { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; border: 1px solid var(--ink); border-radius: 10px; background: var(--ivory); color: var(--ink); font: 600 0.875rem var(--font-body); cursor: pointer; }
.preview-close:hover { background: var(--lavender-tint); }
.preview-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.preview-fit { min-height: 44px; padding: 8px 16px; font-size: var(--fs-small); }
.preview-fit[aria-pressed="true"] { background: var(--lavender); }
.preview-direct { font-size: var(--fs-small); }
.preview-viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.preview-viewport iframe { display: block; width: 100%; height: 100%; border: 0; transform-origin: top left; }
body.preview-is-open { overflow: hidden; }
@media (max-width: 559px) {
  .preview-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 12px; }
  .preview-toolbar { padding: 12px; gap: 8px 12px; }
}
