/* Emma Barber, product portfolio
   Palette: sage-tinted paper, green-black ink, one olive accent, a deep moss band. */

:root {
  --paper: #F2F3EC;
  --paper-raised: #FAFBF6;
  --ink: #1E2318;
  --ink-soft: #4B5241;
  --ink-faint: #6A715E;
  --olive: #56653A;
  --olive-deep: #3E4A28;
  --sage: #D9E1CB;
  --sage-line: #C2CCB0;
  --moss: #2C3622;
  --moss-text: #D3DCC1;

  --display: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Newsreader', Georgia, 'Times New Roman', serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--olive-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

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

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

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

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

.site-header { padding: 26px 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }

.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.brand-role { font-family: var(--display); font-size: 14px; color: var(--olive); font-weight: 500; }

.site-nav { display: flex; gap: 28px; font-family: var(--display); font-size: 16px; font-weight: 500; }
.site-nav a { text-decoration: none; color: var(--ink-soft); padding: 6px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.site-nav a:hover { color: var(--ink); border-color: var(--sage-line); }
.site-nav a[aria-current="page"] { color: var(--ink); border-color: var(--olive); }

/* ---------- Home hero ---------- */

.hero { padding: clamp(48px, 9vw, 120px) 0 clamp(40px, 6vw, 72px); }

.hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 5.2vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 19ch;
}
.hero-title .line { display: inline; }

.hero-lede { max-width: 38em; margin: 36px 0 0; color: var(--ink-soft); font-size: clamp(18px, 1.6vw, 21px); }

/* The idea-to-market path: the one orchestrated moment on the home page */
.path { margin-top: clamp(40px, 6vw, 64px); }
.path svg { width: 100%; height: auto; overflow: visible; }
.path-track { stroke: var(--sage-line); stroke-width: 2; fill: none; }
.path-run { stroke: var(--olive); stroke-width: 3; fill: none; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.path-gate { fill: var(--paper); stroke: var(--olive); stroke-width: 2; opacity: 0; }
.path-start { fill: var(--paper); stroke: var(--olive); stroke-width: 2; }
.path-end { fill: var(--olive); opacity: 0; transform-box: fill-box; transform-origin: center; }
.path-labels { display: flex; justify-content: space-between; font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--ink-faint); margin-top: 10px; }
.path-labels span:last-child { color: var(--olive-deep); }

.is-ready .path-run { animation: draw 1.8s var(--ease) .5s forwards; }
.is-ready .path-gate { animation: pop .35s var(--ease) forwards; }
.is-ready .path-gate:nth-of-type(2) { animation-delay: .95s; }
.is-ready .path-gate:nth-of-type(3) { animation-delay: 1.35s; }
.is-ready .path-gate:nth-of-type(4) { animation-delay: 1.75s; }
.is-ready .path-end { animation: land .5s var(--ease) 2.15s forwards; }

.hero-title { opacity: 0; transform: translateY(16px); }
.is-ready .hero-title { animation: rise .9s var(--ease) forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
@keyframes land { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.25); } 100% { opacity: 1; transform: scale(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Results ---------- */

.results { background: var(--sage); }
.results .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.result { padding: clamp(28px, 3.5vw, 44px) clamp(16px, 2vw, 28px); border-left: 1px solid var(--sage-line); }
.result:first-child { border-left: 0; padding-left: 0; }
.result-figure { white-space: nowrap; font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4.4vw, 60px); line-height: 1; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.result-text { margin: 12px 0 0; font-size: 17px; line-height: 1.45; color: var(--ink); max-width: 22ch; }

/* ---------- Section heads ---------- */

.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-title { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.025em; line-height: 1.05; margin: 0 0 clamp(32px, 4vw, 56px); }

/* ---------- Work list (home) ---------- */

.work-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 72px) clamp(24px, 3.5vw, 48px); }
.work-item { min-width: 0; }
.work-link { display: block; text-decoration: none; color: inherit; }
.work-thumb { border-radius: 14px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--sage); margin-bottom: clamp(20px, 2.5vw, 28px); }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.work-thumb--fit { background: #F8F7F2; }
.work-thumb--fit img { object-fit: contain; }
.work-text { display: flex; flex-direction: column; gap: 12px; }
.work-meta { font-family: var(--display); font-size: 15px; font-weight: 500; color: var(--ink-faint); margin: 0 0 8px; }
.work-title { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.12; letter-spacing: -0.015em; margin: 0; transition: color .25s; }
.work-outcome { margin: 0; color: var(--ink-soft); font-size: 18px; }
.work-cta { display: inline-block; margin-top: 14px; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--olive-deep); border-bottom: 2px solid var(--sage-line); padding-bottom: 2px; transition: border-color .25s; }
.work-cta--soon { color: var(--ink-faint); border-color: transparent; font-weight: 500; }

a.work-link:hover .work-title { color: var(--olive-deep); }
a.work-link:hover .work-cta { border-color: var(--olive); }
a.work-link:hover .work-thumb img { transform: scale(1.03); }

/* ---------- Earlier work ---------- */

.earlier { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
.earlier-title { font-family: var(--display); font-weight: 650; font-size: 22px; letter-spacing: -0.01em; margin: 0 0 8px; }
.earlier-org { font-family: var(--display); font-size: 15px; font-weight: 500; color: var(--olive); margin: 0 0 6px; }
.earlier p { margin: 0; font-size: 17px; color: var(--ink-soft); line-height: 1.55; }

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

.site-footer { background: var(--moss); color: var(--moss-text); padding: clamp(64px, 9vw, 112px) 0 40px; }
.footer-title { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.025em; line-height: 1; color: #F2F3EC; margin: 0; }
.footer-text { margin: 20px 0 32px; max-width: 30em; }
.footer-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 16px; text-decoration: none; transition: background .2s, color .2s; }
.btn--light { background: #F2F3EC; color: var(--moss); }
.btn--light:hover { background: var(--sage); color: var(--moss); }
.btn--outline { border: 1.5px solid var(--moss-text); color: #F2F3EC; }
.btn--outline:hover { background: rgba(242, 243, 236, .08); color: #F2F3EC; }
.footer-small { margin-top: 72px; font-size: 14px; color: #A9B496; }

/* ---------- Case study ---------- */

.case-head { padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 4vw, 48px); }
.back { font-family: var(--display); font-weight: 500; font-size: 16px; text-decoration: none; color: var(--ink-faint); }
.back:hover { color: var(--ink); }
.case-meta { font-family: var(--display); font-size: 16px; font-weight: 500; color: var(--olive); margin: 36px 0 14px; }
.case-title { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.05; letter-spacing: -0.025em; margin: 0; max-width: 16ch; }
.case-head-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.case-hero-image { margin: 36px 0 0; }
.case-hero-image img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; }
.case-hero-image figcaption { font-family: var(--display); font-size: 14px; color: var(--ink-faint); margin-top: 10px; }
.case-standfirst { font-size: clamp(19px, 1.7vw, 22px); color: var(--ink-soft); max-width: 36em; margin: 28px 0 0; }

.facts { background: var(--sage); }
.facts .wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fact { padding: clamp(24px, 3vw, 36px) clamp(16px, 2vw, 28px); border-left: 1px solid var(--sage-line); }
.fact:first-child { border-left: 0; padding-left: 0; }
.fact-figure { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 3.6vw, 48px); line-height: 1; letter-spacing: -0.03em; }
.fact-text { margin: 10px 0 0; font-size: 17px; line-height: 1.45; color: var(--ink); }

.case-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.prose h2 { font-family: var(--display); font-weight: 650; font-size: 26px; letter-spacing: -0.015em; margin: 0 0 12px; }
.prose h2:not(:first-child) { margin-top: 48px; }
.prose p { margin: 0 0 18px; max-width: 36em; }
.prose ol { margin: 0; padding-left: 1.3em; max-width: 36em; }
.prose li { margin-bottom: 10px; padding-left: 4px; }
.prose li::marker { font-family: var(--display); font-weight: 700; color: var(--olive); }

/* Delivery plan: fills as you scroll past it */
.plan { position: sticky; top: 32px; background: var(--paper-raised); border: 1px solid var(--sage-line); border-radius: 14px; padding: clamp(22px, 2.5vw, 32px); }
.plan-title { font-family: var(--display); font-weight: 650; font-size: 20px; margin: 0 0 18px; }
.plan-dropped { display: flex; gap: 12px; padding: 12px 14px; background: var(--paper); border-radius: 10px; margin-bottom: 24px; font-size: 15px; line-height: 1.45; color: var(--ink-faint); }
.plan-dropped strong { display: block; font-family: var(--display); font-weight: 600; color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--olive); }
.plan-steps { list-style: none; margin: 0; padding: 0; position: relative; --progress: 0; }
.plan-steps::before, .plan-steps::after { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; }
.plan-steps::before { background: var(--sage-line); }
.plan-steps::after { background: var(--olive); transform-origin: top; transform: scaleY(var(--progress)); }
.plan-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 16px; padding-bottom: 22px; }
.plan-step:last-child { padding-bottom: 0; }
.plan-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 13px; background: var(--paper-raised); color: var(--olive-deep); border: 2px solid var(--sage-line); transition: background .3s, color .3s, border-color .3s; }
.plan-step.is-reached .plan-dot { background: var(--olive); border-color: var(--olive); color: #fff; }
.plan-step--hold .plan-dot { border-style: dashed; }
.plan-step--hold.is-reached .plan-dot { background: var(--paper-raised); border-color: var(--olive); color: var(--olive-deep); }
.plan-when { font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--olive); }
.plan-name { font-family: var(--display); font-weight: 650; font-size: 17px; margin: 1px 0 4px; }
.plan-desc { font-size: 15px; line-height: 1.5; color: var(--ink-soft); margin: 0; }

.figure { margin: 0; }
.figure img { border-radius: 12px; border: 1px solid var(--sage-line); width: 100%; }
.figure figcaption { font-family: var(--display); font-size: 14px; color: var(--ink-faint); margin-top: 10px; }

.next { border-top: 1px solid var(--sage-line); padding: clamp(40px, 5vw, 64px) 0; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.next-label { font-family: var(--display); font-size: 15px; font-weight: 500; color: var(--ink-faint); margin: 0 0 6px; }
.next-title { font-family: var(--display); font-weight: 650; font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.02em; margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .case-body { grid-template-columns: minmax(0, 1fr); }
  .case-head-grid { grid-template-columns: minmax(0, 1fr); }
  .case-hero-image { max-width: 480px; margin-top: 8px; }
  .plan { position: static; }
  .earlier { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .work-list { grid-template-columns: minmax(0, 1fr); }
  body { font-size: 18px; }
  .results .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result { border-left: 0; padding-left: 0; border-top: 1px solid var(--sage-line); }
  .result:nth-child(-n+2) { border-top: 0; }
  .result:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--sage-line); }
  .facts .wrap { grid-template-columns: minmax(0, 1fr); }
  .fact { border-left: 0; padding-left: 0; border-top: 1px solid var(--sage-line); }
  .fact:first-child { border-top: 0; }
  .site-nav { gap: 20px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title, .path-gate, .path-end { opacity: 1; transform: none; animation: none !important; }
  .path-run { stroke-dashoffset: 0; animation: none !important; }
  .work-thumb img { transition: none; }
  .plan-steps { --progress: 1 !important; }
}
