/* Total Care: tokens + components. See DESIGN.md */
:root {
  --paper: #FFFFFF;
  --linen: #F4F3F0;
  --sage: #E3EBDD;
  --sky: #DFEAF1;
  --ink: #16324F;
  --ink-soft: #4A5A6B;
  --heart: #D8433B;
  --line: #E6E5E1;
  --white: #FFFFFF;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --d1: clamp(44px, 7.4vw, 88px);
  --d2: clamp(34px, 4.6vw, 56px);
  --d3: clamp(24px, 2.4vw, 32px);
  --body: 18px;
  --small: 15px;
  --eyebrow: 12px;

  --r-sm: 10px;
  --r-md: 22px;
  --r-lg: 40px;
  --r-pill: 999px;

  --gutter: clamp(20px, 5vw, 64px);
  --section: clamp(72px, 12vh, 140px);
  --max: 1200px;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --t-base: 520ms;
  --t-slow: 900ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; max-width: 60ch; }
p:last-child { margin-bottom: 0; }

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

/* ---------- Type ---------- */
.d1, .d2, .d3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-variation-settings: "SOFT" 50;
  margin: 0;
  color: var(--ink);
}
.d1 { font-size: var(--d1); line-height: 1.02; letter-spacing: -0.03em; }
.d2 { font-size: var(--d2); line-height: 1.06; letter-spacing: -0.03em; }
.d3 { font-size: var(--d3); line-height: 1.2; letter-spacing: -0.01em; }
.sig { font-style: italic; color: var(--heart); }
.lede { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.55; color: var(--ink); }
.meta { font-size: var(--small); color: var(--ink-soft); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--eyebrow); font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 22px;
}
.eyebrow--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--heart); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font: 500 16px/1 var(--font-body);
  padding: 16px 26px; border-radius: var(--r-pill);
  text-decoration: none; cursor: pointer; border: 1.5px solid var(--ink);
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.btn svg { width: 18px; height: 18px; transition: transform var(--t-base) var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #0E2238; }
.btn--secondary { background: transparent; color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: var(--paper); }
.btn--on-ink { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.link { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.link:hover { text-decoration-color: var(--heart); }
:focus-visible { outline: 3px solid var(--heart); outline-offset: 3px; border-radius: 6px; }

.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--linen); color: var(--ink); font-size: var(--small); line-height: 1.2;
}
.on-tint .tag { background: var(--paper); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; background: var(--paper);
  border-bottom: 1px solid transparent; transition: border-color var(--t-base) var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 78px; }
.nav__logo img { height: 44px; width: auto; }
.nav__links { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; font-size: var(--small); font-weight: 500; }
.nav__links a { text-decoration: none; }
.nav__links a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--heart); }
.nav .btn { padding: 12px 20px; font-size: 15px; white-space: nowrap; }
@media (max-width: 480px) { .nav .btn { padding: 11px 16px; } .nav .btn svg { display: none; } .nav__logo img { height: 38px; } }
@media (max-width: 960px) { .nav__links { display: none; } }

/* ---------- Media panel (placeholder until Level 2 assets) ---------- */
.media {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background: var(--linen); isolation: isolate;
}
.media--lg { border-radius: var(--r-lg); }
.media--sky { background: var(--sky); }
.media--sage { background: var(--sage); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; animation: drift 12s var(--ease) infinite alternate; }
.media__art { position: absolute; inset: 0; display: grid; place-items: center; }
.media__art svg { width: 58%; height: auto; color: var(--ink); opacity: .8; }
.media__note {
  position: absolute; left: 16px; bottom: 16px; right: 16px;
  font-size: 12px; letter-spacing: .04em; color: var(--ink-soft);
}
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.04); } }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 5vh, 56px) 0 0; }
.hero__grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(28px, 4vw, 64px); align-items: stretch; }
.hero__copy { display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }
.hero__copy .d1 { margin-bottom: 28px; }
.hero__copy .lede { margin-bottom: 40px; max-width: 34ch; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.hero__media { min-height: min(72vh, 640px); }
.hero__card {
  position: absolute; left: 20px; right: 20px; bottom: 20px; z-index: 2;
  background: var(--paper); border-radius: var(--r-md); padding: 20px 22px;
  display: flex; justify-content: space-between; align-items: end; gap: 16px;
}
.hero__card strong { display: block; font: 300 var(--d3)/1.1 var(--font-display); letter-spacing: -.01em; }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { min-height: 420px; }
}

/* ---------- Intro (tech) ---------- */
.intro__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.intro .d2 { max-width: 16ch; }
@media (max-width: 860px) { .intro__grid { grid-template-columns: 1fr; } }

/* ---------- Local authorities marquee ---------- */
.authorities { padding: 0 0 var(--section); }
/* the eyebrow now has a line of copy under it, so the 28px gap that used to
   separate eyebrow from strip moves to the note instead */
.authorities .eyebrow { margin-bottom: 10px; }
.authorities__note { max-width: 62ch; margin: 0 0 28px; }
.marquee {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex; align-items: center; gap: clamp(40px, 5vw, 80px); width: max-content;
  list-style: none; margin: 0; padding: 22px clamp(20px, 2.5vw, 40px);
  /* 96s, not 48s: the strip carries twice as many logos as it was built for,
     so the duration doubles to keep the same speed on screen */
  animation: marquee 91s linear infinite;
}
/* Pause only for keyboard users tabbing through. Deliberately NOT paused on
   hover: the strip is wide, and a cursor resting anywhere over it froze the
   whole thing, which reads as a broken carousel rather than a deliberate pause. */
.marquee:focus-within .marquee__track { animation-play-state: paused; }
.marquee__track li { flex: none; }
.marquee__track img {
  height: clamp(56px, 6vw, 80px); width: auto;
}
@keyframes marquee { to { transform: translateX(-50%); } }
/* Visitors with "reduce motion" switched on keep the same single row and scroll
   it themselves, rather than it reflowing into a tall stack of wrapped lines. */
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee__track {
    animation: none; width: auto; max-width: 100%; flex-wrap: nowrap;
    overflow-x: auto; padding-bottom: 26px; scrollbar-width: thin;
  }
  .marquee__track li[aria-hidden="true"] { display: none; }
}

/* ---------- Numbered rows ---------- */
.rows { list-style: none; margin: 48px 0 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 90px 4fr 7fr; gap: clamp(16px, 3vw, 48px);
  padding: 32px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.row__n { font: 300 var(--d3)/1 var(--font-display); color: var(--ink-soft); }
.row h3 { margin: 0; }
@media (max-width: 760px) { .row { grid-template-columns: 56px 1fr; } .row p { grid-column: 2; } }

/* ---------- Purpose ---------- */
.panel { border-radius: var(--r-lg); padding: clamp(28px, 7vw, 100px); }
.panel--linen { background: var(--linen); }
.panel--sage { background: var(--sage); }
.panel--sky { background: var(--sky); }
.purpose .d2 { max-width: 22ch; }
.purpose p.meta { margin-top: 32px; }

/* ---------- Signature: I statements ---------- */
.choose { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: clamp(48px, 8vw, 110px) clamp(24px, 6vw, 90px); text-align: center; overflow: hidden; }
.choose .eyebrow { color: #B9C6D3; justify-content: center; }
.choose__line { font: 300 var(--d1)/1.04 var(--font-display); letter-spacing: -.03em; min-height: 2.2em; display: grid; place-items: center; margin: 0; }
.choose__rot { display: inline-block; transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease); }
.choose__rot.is-out { opacity: 0; transform: translateY(18px); }
.choose__i { font-style: italic; color: #F0A49E; }
.choose__list { list-style: none; padding: 0; margin: 48px auto 0; max-width: 980px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.choose__list li {
  font-size: var(--small); padding: 8px 14px; border-radius: var(--r-pill);
  border: 1px solid rgba(251, 247, 240, .22); color: #D5DEE7;
  transition: border-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.choose__list li.is-on { border-color: var(--paper); color: var(--paper); }

/* ---------- Support ---------- */
.support__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 80px); }
.topics { display: grid; gap: 28px; }
.topic h3 { font: 600 var(--small)/1.3 var(--font-body); letter-spacing: .02em; margin: 0 0 12px; }
@media (max-width: 860px) { .support__grid { grid-template-columns: 1fr; } }

/* ---------- Homes (editorial gallery, no property details) ---------- */
.homes__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 44px; }
.homes__head p { max-width: 46ch; }
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: clamp(180px, 22vw, 300px); gap: clamp(12px, 1.6vw, 24px); margin: 0; }
.gallery__item { margin: 0; min-width: 0; }
.gallery__item--hero { grid-column: 1 / span 7; grid-row: span 2; }
.gallery__item--a { grid-column: 8 / span 5; }
.gallery__item--b { grid-column: 8 / span 5; }
.gallery__item--c { grid-column: 1 / span 5; }
.gallery__item--d { grid-column: 6 / span 7; }
.gallery__item--hero .media { border-radius: var(--r-lg); }
.media--fill { width: 100%; height: 100%; }
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 200px; }
  .gallery__item--hero { grid-column: 1 / -1; grid-row: span 2; }
  .gallery__item--a, .gallery__item--b, .gallery__item--c, .gallery__item--d { grid-column: auto; }
}

/* ---------- Four-up cards (what we provide, what every role involves) ----------
   auto-fit rather than a fixed four columns, because the careers block uses the
   same component with three items and a hard repeat(4) would leave a hole. */
.provide {
  list-style: none; margin: clamp(36px, 4vw, 52px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(14px, 1.8vw, 24px);
}
.provide__item { background: var(--linen); border-radius: var(--r-md); padding: clamp(24px, 2.6vw, 34px); }
.provide__item h3 { font: 300 clamp(20px, 1.8vw, 24px)/1.15 var(--font-display); margin: 0 0 12px; }
.provide__item p { font-size: var(--small); color: var(--ink-soft); margin: 0; max-width: none; }

/* ---------- Properties ----------
   The note is a left-ruled slab rather than another rounded panel: the page
   already runs linen, sage and sky panels and a fourth would read as
   decoration. This one is a statement about a young person's privacy, so it
   takes the heart rule to mark it as something to read rather than skim. */
.note {
  margin: clamp(32px, 4vw, 52px) 0 0;
  padding: clamp(22px, 3vw, 32px) clamp(20px, 3vw, 36px);
  background: var(--linen); border-left: 3px solid var(--heart);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  max-width: 78ch;
}
.note__h { font: 300 var(--d3)/1.1 var(--font-display); margin: 0 0 14px; }
.note p { max-width: none; }
.note--safeguard { margin-top: clamp(48px, 6vw, 80px); }

.props { list-style: none; margin: clamp(40px, 5vw, 64px) 0 0; padding: 0; border-top: 1px solid var(--line); }
.prop {
  display: grid; grid-template-columns: 4fr 8fr; gap: clamp(16px, 3vw, 64px);
  padding: clamp(28px, 3vw, 40px) 0; border-bottom: 1px solid var(--line);
}
.prop__head .d3 { margin: 0 0 6px; }
.prop__head .meta { margin: 0; }
.prop__body p { margin-bottom: .9em; }
.prop__body .tags { margin-top: 20px; }
@media (max-width: 760px) { .prop { grid-template-columns: 1fr; gap: 14px; } }

/* ---------- Podcast + careers ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.duo .panel { display: flex; flex-direction: column; gap: 20px; padding: clamp(32px, 5vw, 64px); }
.duo .panel .btns { margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px; padding-top: 12px; }
.eps { list-style: none; padding: 0; margin: 0; border-top: 1px solid rgba(22, 50, 79, .15); }
.eps li { border-bottom: 1px solid rgba(22, 50, 79, .15); }
.eps a { display: flex; justify-content: space-between; padding: 12px 0; text-decoration: none; font-size: var(--small); }
.eps a:hover span:first-child { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }

/* ---------- Aims ---------- */
.aims { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(28px, 5vw, 80px); border-top: 1px solid var(--line); counter-reset: aim; }
.aim { padding: 28px 0 28px 64px; border-bottom: 1px solid var(--line); position: relative; counter-increment: aim; }
.aim::before { content: counter(aim, decimal-leading-zero); position: absolute; left: 0; top: 26px; font: 300 var(--d3)/1 var(--font-display); color: var(--ink-soft); }
.aim p { font-size: clamp(18px, 1.4vw, 20px); }
@media (max-width: 760px) { .aims { grid-template-columns: 1fr; } }

/* ---------- Split (podcast, careers) ---------- */
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.split__lead .btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.eps--cols { columns: 2; column-gap: 32px; border-top: 0; }
.eps--cols li { break-inside: avoid; border-top: 1px solid rgba(22, 50, 79, .15); border-bottom: 0; }
/* each entry now carries a title as well as the credit line, so it stacks
   instead of pushing the runtime out to the right of a one-line row */
.eps--cols a { flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 0; }
.eps__t { font-size: var(--body); line-height: 1.35; }
.eps--cols a:hover .eps__t { text-decoration: underline; text-underline-offset: 4px; }
.prose p { margin-bottom: 1.1em; }
.offer { background: var(--linen); border-radius: var(--r-md); padding: clamp(22px, 3vw, 36px); margin: 28px 0; }
.offer .d3 { margin-bottom: 12px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .eps--cols { columns: 1; } }

/* ---------- Referral / contact ---------- */
.contact__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 80px); }
.contact__details { display: grid; gap: 22px; margin-top: 36px; font-size: var(--small); }
.contact__details dt { color: var(--ink-soft); font-size: var(--eyebrow); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.contact__details dd { margin: 0; font-size: var(--body); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: var(--small); font-weight: 500; }
.field input, .field textarea {
  font: 400 var(--body)/1.4 var(--font-body); color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 16px; min-height: 52px; width: 100%;
  transition: border-color var(--t-base) var(--ease);
}
.field textarea { min-height: 150px; resize: vertical; }
.field select {
  font: 400 var(--body)/1.4 var(--font-body); color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 16px; min-height: 52px; width: 100%;
}
.field select:focus { outline: 3px solid rgba(216, 67, 59, .35); outline-offset: 0; border-color: var(--ink); }
/* honeypot: off-screen rather than display:none, so bots that skip hidden
   inputs still fill it in */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field input:focus, .field textarea:focus { outline: 3px solid rgba(216, 67, 59, .35); outline-offset: 0; border-color: var(--ink); }
.field.is-error input, .field.is-error textarea { border-color: var(--heart); }
.field__err { font-size: 14px; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.field__err::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--heart); }
.form__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
@media (max-width: 860px) { .contact__grid, .form { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--paper); margin-top: 0; padding: clamp(56px, 9vw, 110px) 0 36px; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.footer .d3 { color: var(--paper); max-width: 30ch; margin-bottom: 56px; }
.footer__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; font-size: var(--small); color: #C9D3DD; }
.footer__grid h4 { font-size: var(--eyebrow); letter-spacing: .12em; text-transform: uppercase; color: var(--paper); margin: 0 0 12px; font-weight: 600; }
.footer__grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer__grid a { text-decoration: none; }
.footer__grid a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }
.footer__base { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(251, 247, 240, .15); font-size: 13px; color: #9FB0C0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .media img, .media video { animation: none; }
  .choose__rot { transition: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
