/* ==========================================================================
   He Aturangi Ka Mamao — design system
   Palette taken from the manaia logo: deep teal body, bright cyan highlights,
   pale linework. Adjust the tokens in :root to retune the whole site.
   ========================================================================== */

/* ---------- Fonts (local files, no external requests) ---------- */
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/CormorantGaramond-Light.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/CormorantGaramond-LightItalic.ttf') format('truetype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/CormorantGaramond-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/CormorantGaramond-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/CormorantGaramond-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* brand — sampled from the manaia logo */
  --paper:        #F2F8F9;   /* page ground, a hair cooler than white */
  --paper-lift:   #FFFFFF;   /* cards and input fields */
  --paper-deep:   #DDEEF1;   /* alternating band */
  --ink:          #0E2837;   /* "HE ATURANGI" navy, sampled from the logo */
  --ink-2:        #14485C;
  --ink-soft:     #3A6472;   /* muted text, 6.0:1 on --paper */
  --accent:       #01B8C8;   /* "KA MAMAO" cyan, sampled from the logo */
  --accent-lift:  #5FDCE8;   /* accent on dark surfaces */
  --accent-deep:  #06788C;   /* accent dark enough for text on light, 4.8:1 */
  --deepsea:      #006788;   /* the manaia body teal, sampled from the logo */
  --deepsea-lift: #04829F;

  /* Deliberately still warm. The crisis strip and helpline numbers must not
     recede into a teal page — the contrast is the point. */
  --awhi:         #C0492E;

  /* semantic */
  --bg:           var(--paper);
  --surface:      var(--paper-lift);
  --text:         var(--ink);
  --text-muted:   var(--ink-soft);
  --rule:         color-mix(in srgb, #0E2837 16%, transparent);
  --rule-strong:  color-mix(in srgb, #0E2837 32%, transparent);

  /* type */
  --display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  --serif:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --body:    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 1.8vw, 3rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.2vw, 4.5rem);
  --step-5:  clamp(3.2rem, 2rem + 5.4vw, 6.75rem);

  /* space + shape */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 62ch;
  --wrap: 1240px;
  --wrap-narrow: 820px;
  --radius: 2px;
  --shadow-1: 0 1px 2px rgba(14,40,55,.06), 0 6px 18px -8px rgba(14,40,55,.16);
  --shadow-2: 0 2px 4px rgba(14,40,55,.08), 0 22px 48px -18px rgba(14,40,55,.32);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 77px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:focus-within { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, picture { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:where(a, button, [tabindex], input, textarea, select):focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 1px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -110%);
  z-index: 200; background: var(--ink); color: var(--paper);
  padding: .7rem 1.2rem; font-family: var(--display); text-transform: uppercase;
  letter-spacing: .08em; text-decoration: none;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- Type primitives ---------- */
.eyebrow {
  font-family: var(--display); font-weight: 600; font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: .2em; color: var(--accent-deep);
  display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem;
}
.eyebrow::before {
  content: ""; inline-size: 2rem; block-size: 1px;
  background: currentColor; flex: none;
}
.eyebrow--center { justify-content: center; }
.eyebrow--center::after {
  content: ""; inline-size: 2rem; block-size: 1px; background: currentColor; flex: none;
}
.display {
  font-family: var(--display); font-weight: 900; line-height: .95;
  text-transform: uppercase; letter-spacing: -.005em;
}
.h1 { font-size: var(--step-4); }
.h2 { font-size: var(--step-3); }
.h3 { font-family: var(--display); font-weight: 700; font-size: var(--step-2); line-height: 1.05; text-transform: uppercase; }
.h4 { font-family: var(--display); font-weight: 600; font-size: var(--step-1); line-height: 1.15; text-transform: uppercase; letter-spacing: .02em; }
.lead {
  font-family: var(--serif); font-weight: 300; font-size: var(--step-2);
  line-height: 1.35; color: var(--ink-2); max-width: 40ch;
}
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose a { color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.prose a:hover { color: var(--ink); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose ul { padding-left: 1.15rem; }
.prose li + li { margin-top: .4rem; }
.muted { color: var(--text-muted); }
.reo { font-style: italic; }
.small { font-size: var(--step--1); }
.label {
  font-family: var(--display); font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .16em;
}

/* ---------- Layout ---------- */
.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - var(--gutter) * 2, var(--wrap-narrow)); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink .eyebrow { color: var(--accent-lift); }
.section--ink .lead, .section--ink .muted { color: color-mix(in srgb, #F2F8F9 74%, transparent); }
.section--deepsea { background: var(--deepsea); color: #E8F6F9; }
.section--deepsea .eyebrow { color: var(--accent-lift); }
.section--deepsea .lead, .section--deepsea .muted { color: color-mix(in srgb, #fff 78%, transparent); }
.section--deep { background: var(--paper-deep); }
.section-head { margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head--center { text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .lead { margin-inline: auto; max-width: 48ch; }
.section-head--split {
  display: grid; gap: clamp(1rem, 3vw, 3rem);
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 900px) { .section-head--split { grid-template-columns: 1.1fr .9fr; } }
.grid { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.rule { block-size: 1px; background: var(--rule); border: 0; margin: 0; }
.stack { display: grid; gap: 1.25rem; align-content: start; justify-items: start; }

/* koru divider */
.divider { display: flex; align-items: center; justify-content: center; gap: 1rem; color: var(--accent); }
.divider::before, .divider::after {
  content: ""; block-size: 1px; flex: 1 1 auto; max-inline-size: 12rem;
  background: linear-gradient(90deg, transparent, currentColor);
}
.divider::after { background: linear-gradient(270deg, transparent, currentColor); }
.divider svg { inline-size: 2.6rem; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: #0E2837; --btn-fg: #F2F8F9; --btn-bd: #0E2837;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .85rem 1.5rem; background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bd); border-radius: var(--radius);
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  text-transform: uppercase; letter-spacing: .1em; text-decoration: none;
  cursor: pointer; transition: transform .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { inline-size: 1.05em; block-size: 1.05em; flex: none; }
.btn--accent { --btn-bg: #01B8C8; --btn-fg: #0E2837; --btn-bd: #01B8C8; }
.btn--accent:hover { --btn-bg: #5FDCE8; --btn-bd: #5FDCE8; }
.btn--ghost { --btn-bg: transparent; --btn-fg: #0E2837; --btn-bd: rgba(14,40,55,.32); }
.btn--ghost:hover { --btn-bd: #0E2837; }
.btn--on-dark { --btn-bg: transparent; --btn-fg: #F2F8F9; --btn-bd: rgba(255,255,255,.4); }
.btn--on-dark:hover { --btn-bg: #F2F8F9; --btn-fg: #0E2837; --btn-bd: #F2F8F9; }
.btn--awhi { --btn-bg: #C0492E; --btn-fg: #fff; --btn-bd: #C0492E; }
.btn--awhi:hover { --btn-bg: #A33C24; --btn-bd: #A33C24; }
.btn--sm { padding: .55rem 1rem; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  text-transform: uppercase; letter-spacing: .1em; text-decoration: none;
  color: var(--accent-deep); border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.link-arrow svg { inline-size: .95em; transition: transform .25s var(--ease); }
.link-arrow:hover { color: var(--ink); border-bottom-color: currentColor; }
.link-arrow:hover svg { transform: translateX(4px); }
.section--ink .link-arrow, .section--deepsea .link-arrow { color: var(--accent-lift); }
.section--ink .link-arrow:hover, .section--deepsea .link-arrow:hover { color: #fff; }

/* ---------- Header ---------- */
/* Kept fully opaque on purpose: the brand lockup below relies on `mix-blend-mode:
   darken` against this exact background to drop the logo PNG's cream ground. */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow .3s var(--ease);
}
.header__inner {
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
  min-height: 76px; padding-block: .6rem;
}
.header[data-scrolled="true"] { box-shadow: 0 1px 0 rgba(14,40,55,.06), 0 10px 30px -22px rgba(14,40,55,.4); }

/* --------------------------------------------------------------------------
   Brand lockup — assets/brand/hakm-logo.png
   A transparent PNG of the full lockup (manaia mark + wordmark), 1458x383.
   It simply sits in an <img>; the old crop offsets and blend-mode workaround
   are gone, because that artwork had an opaque cream background and this
   doesn't.
   -------------------------------------------------------------------------- */
.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.brand img { block-size: clamp(34px, 4.4vw, 46px); inline-size: auto; }

/* The footer uses the reversed lockup (hakm-logo-reverse.png), where the
   near-black "HE ATURANGI" is repainted white so it reads on the dark ground.
   Generated from the main logo by tools/make-reverse-logo.ps1 — no plaque
   needed, the artwork sits straight on the background. */
.footer__logo { display: inline-block; line-height: 0; }
.footer__logo img { inline-size: 100%; max-inline-size: 240px; block-size: auto; }

.nav { margin-left: auto; }
.nav__list { list-style: none; display: flex; align-items: center; gap: clamp(.9rem, 1.9vw, 1.75rem); }
.nav__link {
  font-family: var(--display); font-weight: 600; font-size: 1.02rem;
  text-transform: uppercase; letter-spacing: .09em; text-decoration: none;
  color: var(--ink-2); padding-block: .35rem; position: relative; white-space: nowrap;
  transition: color .2s var(--ease);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .28s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--ink); }
.header__cta { flex: none; }
.nav__toggle {
  display: none; margin-left: auto; align-items: center; gap: .5rem;
  background: transparent; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: .5rem .8rem; font-family: var(--display); font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; cursor: pointer;
}
.nav__toggle svg { inline-size: 1.1rem; }

@media (max-width: 1080px) {
  .nav__toggle { display: inline-flex; }
  /* Anchored to the header itself, not the viewport, so it stays put whether or
     not the crisis bar above is still on screen. */
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    background: var(--paper); color: var(--ink);
    border-bottom: 1px solid var(--rule);
    padding: 1rem var(--gutter) 1.75rem; box-shadow: var(--shadow-2);
    display: grid; gap: .25rem;
    clip-path: inset(0 0 100% 0); opacity: 0; pointer-events: none;
    transition: clip-path .35s var(--ease), opacity .2s var(--ease);
    max-height: 76svh; overflow-y: auto;
  }
  .nav[data-open="true"] { clip-path: inset(0 0 0 0); opacity: 1; pointer-events: auto; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link {
    display: block; padding: .85rem 0; border-bottom: 1px solid var(--rule);
    color: var(--ink); font-size: 1.25rem;
  }
  .nav__link::after { display: none; }
  .header__cta { display: none; }
  .nav__mobile-cta { margin-top: 1.25rem; display: grid; gap: .5rem; }
}
@media (min-width: 1081px) { .nav__mobile-cta { display: none; } }

/* ---------- Hero (home) ---------- */
.hero { position: relative; background: var(--ink); color: var(--paper); isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: var(--ink); }
.hero__media img, .hero__media video {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover;
}
.hero__media video { opacity: 0; transition: opacity 1.2s var(--ease); }
.hero__media video[data-playing="true"] { opacity: 1; }
.hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(6,20,28,.88) 0%, rgba(6,20,28,.4) 32%, rgba(6,20,28,.52) 62%, rgba(6,20,28,.94) 100%),
    radial-gradient(120% 90% at 12% 88%, rgba(6,20,28,.62), transparent 62%);
}
.hero__inner {
  display: grid; align-content: end; gap: 1.4rem;
  min-height: min(88svh, 880px); padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: clamp(3rem, 7vw, 5.5rem);
}
.hero__kupu {
  font-family: var(--serif); font-weight: 300; font-style: italic;
  font-size: var(--step-2); color: var(--accent-lift); margin-bottom: -.4rem;
}
.hero__title { font-size: var(--step-5); max-width: 18ch; }
.hero__title em { font-style: normal; color: var(--accent-lift); }
.hero__text { max-width: 54ch; font-size: var(--step-1); color: rgba(242,248,249,.88); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .85rem; align-items: center; margin-top: .6rem; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center;
  margin-top: clamp(1.5rem, 4vw, 2.5rem); padding-top: 1.4rem;
  border-top: 1px solid rgba(242,248,249,.22);
  font-family: var(--display); font-size: .95rem; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(242,248,249,.7);
}
.hero__meta strong { color: var(--accent-lift); font-weight: 600; }
.hero__video-toggle {
  position: absolute; right: var(--gutter); bottom: 1.25rem; z-index: 3;
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(5,17,24,.55);
  border: 1px solid rgba(255,255,255,.3);
  color: var(--paper); padding: .5rem .85rem; border-radius: 100px; cursor: pointer;
  font-family: var(--display); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  backdrop-filter: blur(6px);
}
.hero__video-toggle:hover { background: rgba(5,17,24,.85); }
.hero__video-toggle svg { inline-size: 1rem; }

/* play button */
.play-btn {
  --size: 4.4rem;
  position: relative;
  display: inline-grid; place-items: center; inline-size: var(--size); block-size: var(--size);
  border-radius: 50%; border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  backdrop-filter: blur(4px); transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.play-btn::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  animation: pulse 3.2s var(--ease) infinite;
}
.play-btn svg { inline-size: 1.45rem; translate: 2px 0; }
.play-btn:hover { background: #fff; color: var(--ink); transform: scale(1.06); }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 70% { transform: scale(1.28); opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .play-btn::after { animation: none; } }

/* ---------- Pull quote ---------- */
.quote { max-width: 46ch; }
.quote__mark { font-family: var(--serif); font-size: 4rem; line-height: .55; color: var(--accent); display: block; }
.quote__text {
  font-family: var(--serif); font-weight: 300; font-size: var(--step-2); line-height: 1.35;
  margin-top: .9rem;
}
.quote__by { margin-top: 1.2rem; font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; color: var(--accent-deep); }
.quote-band { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 900px) { .quote-band { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(1.4rem, 2.5vw, 2rem); display: flex; flex-direction: column; gap: .7rem;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card__num { font-family: var(--display); font-size: .8rem; letter-spacing: .16em; color: var(--accent-deep); }
.card__icon { color: var(--accent-deep); inline-size: 2.2rem; block-size: 2.2rem; margin-bottom: .3rem; }
.card p { color: var(--text-muted); }
.card--link { text-decoration: none; }
.card--link:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--accent); }
.card--ink { background: rgba(242,248,249,.07); border-color: rgba(242,248,249,.18); }
.section--ink .card--ink p { color: rgba(242,248,249,.72); }
.card--feature { padding: 0; overflow: hidden; }
.card--feature .card__body { padding: clamp(1.4rem, 2.5vw, 2rem); display: flex; flex-direction: column; gap: .6rem; }
.card__img { aspect-ratio: 3 / 2; object-fit: cover; inline-size: 100%; background: var(--paper-deep); }
.card__foot { margin-top: auto; padding-top: .5rem; }

.figure { margin: 0; }
.figure img { inline-size: 100%; border-radius: var(--radius); }
.figure figcaption { margin-top: .75rem; font-size: var(--step--1); color: var(--text-muted); }
.figure--frame img { border: 1px solid var(--rule); box-shadow: var(--shadow-1); }
.section--ink .figure figcaption, .section--deepsea .figure figcaption { color: rgba(242,248,249,.66); }

/* stat */
.stat { display: grid; gap: .2rem; }
.stat__num { font-family: var(--display); font-weight: 900; font-size: var(--step-3); line-height: 1; color: var(--accent-deep); }
.section--ink .stat__num, .section--deepsea .stat__num { color: var(--accent-lift); }
.stat__label { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: .82rem; color: var(--text-muted); }
.section--ink .stat__label, .section--deepsea .stat__label { color: rgba(242,248,249,.66); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; display: grid; gap: 0; }
.timeline__item {
  display: grid; gap: .35rem 2rem; padding: clamp(1.1rem, 2.5vw, 1.6rem) 0;
  border-top: 1px solid var(--rule); position: relative;
}
.timeline__item:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) {
  .timeline__item { grid-template-columns: 12rem 1fr; align-items: start; }
}
.timeline__when {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; font-size: .95rem; color: var(--accent-deep); padding-top: .2rem;
}
.timeline__what { display: grid; gap: .45rem; justify-items: start; }
.timeline__item[data-state="next"] {
  background: color-mix(in srgb, #01B8C8 12%, transparent);
  padding-inline: clamp(.85rem, 2vw, 1.25rem);
  border-top-color: var(--accent);
}
.tag {
  display: inline-flex; align-items: center; gap: .4rem; align-self: start;
  font-family: var(--display); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em;
  padding: .25rem .6rem; border: 1px solid var(--rule-strong); border-radius: 100px; color: var(--text-muted);
}
.tag--accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.tag--deepsea { background: var(--deepsea); border-color: var(--deepsea); color: #E8F6F9; }
.tag--hold { background: color-mix(in srgb, #C0492E 14%, transparent); border-color: color-mix(in srgb, #C0492E 45%, transparent); color: #8E3620; }
.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Video grid ---------- */
.vgrid { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.vcard { display: flex; flex-direction: column; gap: .8rem; text-align: left; }
.vcard__thumb {
  position: relative; display: block; inline-size: 100%; aspect-ratio: 16 / 9;
  overflow: hidden; border-radius: var(--radius); background: var(--ink);
  border: 0; padding: 0; cursor: pointer; color: #fff;
}
.vcard__thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .4s var(--ease); }
.vcard__thumb:hover img { transform: scale(1.045); }
.vcard__thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,17,24,0) 45%, rgba(5,17,24,.7) 100%);
  pointer-events: none;
}
.vcard__play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.vcard__play span {
  display: grid; place-items: center; inline-size: 3.4rem; block-size: 3.4rem; border-radius: 50%;
  background: rgba(5,17,24,.45); border: 1px solid rgba(255,255,255,.55);
  backdrop-filter: blur(4px); transition: background-color .3s var(--ease), transform .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.vcard__thumb:hover .vcard__play span { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: scale(1.08); }
.vcard__play svg { inline-size: 1.1rem; translate: 2px 0; }
.vcard__dur {
  position: absolute; bottom: .6rem; right: .6rem; z-index: 3;
  font-family: var(--display); font-size: .78rem; letter-spacing: .08em;
  background: rgba(5,17,24,.72); color: #fff;
  padding: .12rem .45rem; border-radius: 2px;
}
.vcard__series {
  position: absolute; top: .6rem; left: .6rem; z-index: 3;
  font-family: var(--display); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em;
  background: var(--accent); color: var(--ink);
  padding: .2rem .55rem; border-radius: 2px;
}
.vcard__title { font-family: var(--display); font-weight: 700; font-size: var(--step-1); line-height: 1.1; text-transform: uppercase; }
.vcard__meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: var(--step--1); color: var(--text-muted); }
.vcard p { color: var(--text-muted); font-size: var(--step--1); }

/* Description, clamped to three lines until someone asks for the rest.
   main.js only adds the toggle to descriptions that are genuinely cut off. */
.vcard__desc p {
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; line-clamp: 3;
  overflow: hidden;
}
.vcard__desc[data-expanded="true"] p { -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.vcard__more {
  margin-top: .4rem; padding: 0; background: none; border: 0; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .12em; color: var(--accent-deep);
  border-bottom: 1px solid transparent;
}
.vcard__more:hover { color: var(--ink); border-bottom-color: currentColor; }
.section--ink .vcard__more { color: var(--accent-lift); }
.section--ink .vcard__more:hover { color: #fff; }
.vcard--wide .vcard__desc p { -webkit-line-clamp: 5; line-clamp: 5; }
.section--ink .vcard p, .section--ink .vcard__meta { color: rgba(242,248,249,.7); }
.vcard--held .vcard__thumb { cursor: not-allowed; }
.vcard--held .vcard__thumb img { opacity: .28; filter: grayscale(1); }
.vcard__hold {
  position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; gap: .5rem;
  padding: 1.25rem; text-align: center; color: var(--paper);
}
.vcard__hold svg { inline-size: 1.6rem; margin-inline: auto; color: var(--accent-lift); }
.vcard__hold span { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: .82rem; line-height: 1.35; }

.vcard--wide { grid-column: 1 / -1; display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; }
@media (min-width: 860px) { .vcard--wide { grid-template-columns: 1.35fr 1fr; } }
.vcard--wide .vcard__title { font-size: var(--step-2); }
.vcard--wide .vcard__body { display: grid; gap: .8rem; justify-items: start; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter {
  background: transparent; border: 1px solid var(--rule-strong); border-radius: 100px;
  padding: .45rem 1rem; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: .88rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted);
  transition: color .22s var(--ease), background-color .22s var(--ease), border-color .22s var(--ease);
}
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter__count { opacity: .6; margin-left: .35rem; }
.vgrid__empty { grid-column: 1 / -1; padding: 3rem 0; text-align: center; color: var(--text-muted); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(5,17,24,.93);
  backdrop-filter: blur(10px);
}
.lightbox[data-open="true"] { display: grid; place-items: center; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__panel { inline-size: min(100%, 1100px); display: grid; gap: 1rem; }
.lightbox__frame {
  position: relative; inline-size: 100%; aspect-ratio: 16 / 9;
  background: #000; border: 1px solid rgba(255,255,255,.16);
  box-shadow: var(--shadow-2);
}
.lightbox__frame iframe, .lightbox__frame video {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0;
}
.lightbox__missing {
  position: absolute; inset: 0; display: grid; place-content: center; gap: .6rem;
  padding: 2rem; text-align: center; color: rgba(255,255,255,.8);
}
.lightbox__missing code { font-size: .85rem; color: var(--accent-lift); word-break: break-all; }
.lightbox__bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; color: var(--paper); }
.lightbox__title { font-family: var(--display); font-weight: 700; font-size: var(--step-1); text-transform: uppercase; line-height: 1.1; }
.lightbox__sub { font-size: var(--step--1); color: rgba(242,248,249,.66); margin-top: .25rem; }
.lightbox__close {
  flex: none; display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; border: 1px solid rgba(255,255,255,.35);
  color: var(--paper); padding: .5rem .9rem; border-radius: var(--radius); cursor: pointer;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: .85rem;
}
.lightbox__close:hover { background: var(--paper); color: var(--ink); }
.lightbox__close svg { inline-size: .9rem; }
.lightbox__foot { font-size: var(--step--1); color: rgba(242,248,249,.6); text-align: right; }
.lightbox__foot:empty { display: none; }
.lightbox__foot a { color: var(--accent-lift); text-decoration: underline; text-underline-offset: .2em; }
.lightbox__foot a:hover { color: #fff; }
body[data-lock="true"] { overflow: hidden; }

/* ---------- Page header (interior pages) ---------- */
.pagehead { position: relative; background: var(--ink); color: var(--paper); isolation: isolate; overflow: hidden; }
.pagehead__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: var(--ink); }
.pagehead__media img, .pagehead__media video {
  position: absolute; inset: 0;
  inline-size: 100%; block-size: 100%; object-fit: cover;
}
.pagehead__media img { opacity: .5; transition: opacity 1.2s var(--ease); }
/* Same loop as the home hero, eased back just enough that page titles stay
   readable over it. Once it is running the poster fades out from underneath —
   otherwise the two are stacked and the result is muddy rather than dim. */
.pagehead__media video { opacity: 0; transition: opacity 1.2s var(--ease); }
.pagehead__media video[data-playing="true"] { opacity: .8; }
.pagehead__media:has(video[data-playing="true"]) img { opacity: 0; }
.pagehead::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(6,20,28,.9), rgba(6,20,28,.5) 55%, rgba(6,20,28,.92));
}
.pagehead__inner { padding-top: clamp(3.5rem, 8vw, 6rem); padding-bottom: clamp(3rem, 6vw, 5rem); display: grid; gap: 1rem; justify-items: start; }
.pagehead .h1 { max-width: 24ch; }
.pagehead .lead { color: rgba(242,248,249,.84); max-width: 48ch; }
.pagehead .eyebrow { color: var(--accent-lift); }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: rgba(242,248,249,.6); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent-lift); }

/* ---------- Partners ---------- */
/* Supplied logos vary wildly — wide and narrow, white-background and full-bleed
   dark. Each one sits in an identical white tile and is scaled to fit inside it,
   so the set reads as a row rather than a jumble. */
.logo-tile {
  display: block;                     /* NOT grid — see the note below */
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(.9rem, 2vw, 1.25rem);
  block-size: clamp(110px, 12vw, 140px); inline-size: 100%;
}
/* The image box fills the tile's content box exactly, and object-fit:contain
   scales the artwork to fit inside it. contain never crops, so no logo is cut
   off whatever its shape.
   Do not switch this to max-block-size:100% on a centred grid item — the
   percentage has no definite row to resolve against, the image keeps its
   natural size, and tall logos overflow and get clipped. */
.logo-tile img {
  inline-size: 100%; block-size: 100%;
  object-fit: contain; object-position: center;
}

.partner-strip { display: grid; gap: clamp(.75rem, 2vw, 1.25rem); align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.partner-strip a { text-decoration: none; display: block; transition: transform .25s var(--ease); }
.partner-strip a:hover { transform: translateY(-3px); }

.partner-card { display: grid; gap: .9rem; padding: clamp(1.25rem, 2.5vw, 1.75rem); background: var(--surface); border: 1px solid var(--rule); align-content: start; }
.partner-card .logo-tile { block-size: 108px; }
.partner-card__role { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; color: var(--accent-deep); }
.partner-card p { color: var(--text-muted); font-size: var(--step--1); }

/* ---------- People ---------- */
.person { display: grid; gap: .75rem; }
.person img { aspect-ratio: 1; object-fit: cover; border-radius: 50%; inline-size: clamp(96px, 13vw, 140px); border: 1px solid var(--rule); }
.person__name { font-family: var(--display); font-weight: 700; font-size: var(--step-1); text-transform: uppercase; line-height: 1.1; }
.person__role { font-size: var(--step--1); color: var(--text-muted); }

/* ---------- Support / crisis ---------- */
.awhi-bar { background: var(--awhi); color: #fff; font-family: var(--display); letter-spacing: .06em; }
.awhi-bar__inner { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; align-items: center; justify-content: center; padding-block: .6rem; text-align: center; font-size: .98rem; }
.awhi-bar a { color: #fff; text-decoration: underline; text-underline-offset: .2em; font-weight: 600; }
.helpline-grid { display: grid; gap: 1px; background: var(--rule-strong); border: 1px solid var(--rule-strong); }
@media (min-width: 700px) { .helpline-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .helpline-grid { grid-template-columns: repeat(3, 1fr); } }
.helpline { background: var(--surface); padding: clamp(1.25rem, 2.5vw, 1.75rem); display: grid; gap: .4rem; align-content: start; }
.helpline__name { font-family: var(--display); font-weight: 700; font-size: var(--step-1); text-transform: uppercase; line-height: 1.1; }
.helpline__num { font-family: var(--display); font-weight: 900; font-size: var(--step-2); line-height: 1.05; color: var(--awhi); text-decoration: none; letter-spacing: .01em; }
.helpline__num:hover { text-decoration: underline; }
.helpline p { font-size: var(--step--1); color: var(--text-muted); }
.section--deepsea .helpline-grid { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.22); }
.section--deepsea .helpline { background: var(--deepsea-lift); }
.section--deepsea .helpline__num { color: #7FE4F2; }
.section--deepsea .helpline p { color: rgba(255,255,255,.76); }

.callout {
  border-left: 3px solid var(--accent); background: color-mix(in srgb, #01B8C8 12%, transparent);
  padding: clamp(1.1rem, 2.5vw, 1.6rem); display: grid; gap: .5rem;
}
.callout--awhi { border-left-color: var(--awhi); background: color-mix(in srgb, #C0492E 9%, transparent); }
.callout__title { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: var(--step-1); }
.callout__list { list-style: none; display: grid; gap: .3rem; color: var(--text-muted); font-size: var(--step--1); }
.callout__list li { padding-left: 1rem; position: relative; }
.callout__list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  inline-size: .35rem; block-size: .35rem; border-radius: 50%; background: var(--accent);
}
.section--deepsea .callout__list { color: rgba(255,255,255,.82); }
.section--ink .callout, .section--deepsea .callout { background: rgba(255,255,255,.08); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field > label { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: .84rem; }
/* Set the text colour explicitly. The global reset gives form controls
   `color: inherit`, so on a dark section (the registration form sits on the
   forest band) they inherited near-white text onto a cream field and whatever
   someone typed was invisible. */
.field input, .field textarea, .field select {
  padding: .8rem .9rem; background: var(--paper-lift); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); width: 100%;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-soft); opacity: 1; }
.field select option { color: var(--ink); background: var(--paper-lift); }
/* the tick itself, which also inherits */
.field--check input[type="checkbox"] { accent-color: var(--accent-deep); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent-deep); }
.field__hint { font-size: var(--step--1); color: var(--text-muted); }
/* submission status, set by main.js */
[data-form-note] { max-width: 46ch; }
[data-form-note][data-state="ok"] {
  color: var(--ink); font-weight: 600;
  border-left: 3px solid var(--accent); padding: .6rem 0 .6rem .8rem;
}
[data-form-note][data-state="error"] {
  color: #8E3620; font-weight: 600;
  border-left: 3px solid var(--awhi); padding: .6rem 0 .6rem .8rem;
}
[data-form-note][data-state="busy"] { color: var(--text-muted); }
.section--deepsea [data-form-note][data-state="ok"] { color: #fff; }
.section--deepsea [data-form-note][data-state="error"] { color: #F6C9B4; }
.btn[disabled] { opacity: .55; cursor: wait; transform: none; }
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: .7rem; }
.field--check input { inline-size: 1.1rem; block-size: 1.1rem; margin-top: .3rem; width: auto; }
.field--check label { text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 400; font-size: var(--step--1); line-height: 1.5; }
@media (min-width: 700px) { .form--2col { grid-template-columns: 1fr 1fr; } .form--2col .field--full { grid-column: 1 / -1; } }

/* ---------- Accordion ---------- */
.acc { border-top: 1px solid var(--rule); }
.acc__item { border-bottom: 1px solid var(--rule); }
.acc__item > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.15rem 0; cursor: pointer; list-style: none;
  font-family: var(--display); font-weight: 600; font-size: var(--step-1); text-transform: uppercase; line-height: 1.15;
}
.acc__item > summary::-webkit-details-marker { display: none; }
.acc__item > summary::after {
  content: "+"; font-family: var(--display); font-size: 1.6rem; line-height: 1;
  color: var(--accent-deep); flex: none; transition: transform .3s var(--ease);
}
.acc__item[open] > summary::after { transform: rotate(45deg); }
.acc__body { padding-bottom: 1.4rem; max-width: var(--measure); color: var(--text-muted); display: grid; gap: .8rem; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(242,248,249,.76); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--accent-lift); }
.footer__top { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 900px) { .footer__top { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; } }
.footer__col { display: grid; gap: .65rem; align-content: start; }
.footer__col h3 { font-family: var(--display); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .16em; color: var(--accent-lift); margin-bottom: .3rem; }
.footer__list { list-style: none; display: grid; gap: .45rem; }
.footer__brand p { max-width: 36ch; font-size: var(--step--1); }
.footer__bottom {
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.5rem;
  border-top: 1px solid rgba(242,248,249,.16);
  display: flex; flex-wrap: wrap; gap: .75rem 2rem; align-items: center; justify-content: space-between;
  font-size: var(--step--1);
}
.footer__pepeha { font-family: var(--serif); font-style: italic; font-size: var(--step-1); color: var(--accent-lift); }

/* ---------- Motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal][data-shown="true"] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Print ---------- */
@media print {
  .header, .footer, .awhi-bar, .lightbox, .hero__video-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Pānui signup ----------
   Deliberately an inline band rather than a popup. Somebody may open this site
   in the worst week of their life; an interstitial demanding an email address
   before they can read is the wrong thing to put in front of them. */
.subscribe { display: grid; gap: 1.75rem; align-items: center; }
@media (min-width: 880px) { .subscribe { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
.subscribe__form { align-content: start; }
@media (min-width: 560px) {
  .subscribe__form { grid-template-columns: 1fr 1fr; align-items: end; }
  .subscribe__form .field--full { grid-column: 1 / -1; }
}
