/* Fonts are hosted with the site and preloaded, so text doesn't reflow (and move the page) when they arrive */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/geist-latin.woff2) format('woff2'); }
@font-face { font-family: 'Red Hat Display'; font-style: normal; font-weight: 500 800; font-display: swap; src: url(fonts/redhatdisplay-latin.woff2) format('woff2'); }

/* Hands & Haven
   Spacing scale (visible gaps, font space trimmed): 14 label↔thing · 16 inside a block · 36 heading→paragraph, text→buttons · --space between sections.
   Palette: the logo's heart red, haven blue and hand yellow on white and soft grey tiles.
   Type: Red Hat Display for every heading, number and the wordmark; Geist for everything else.
   Single light theme on white, by request.
   Layout: centered section intros over wide rounded tiles, generous white space, one idea per screen. */
:root {
  --bg: #FFFFFF;
  --surface: #F5F5F7;
  --ink: #1D1D1F;
  --muted: #6E6E73;
  --rule: #E3E3E8;
  --red: #C93B3B;
  --blue: #2F62C8;
  --sky: #EAF1FF;
  --sun: #E6B832;
  --land: #FFFFFF;
  --land-edge: #C6D2E8;
  --on-red: #FFFFFF;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.08);
  --logo-red: #D14343;
  --logo-blue: #80ACFF;
  --logo-yellow: #E6B832;
  color-scheme: light;

  --display: "Red Hat Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 68rem;
  --radius: 28px;
  --space: clamp(2.75rem, 6vw, 4rem); /* the one vertical rhythm: divider→heading, heading→content, content→divider */
  --space-top: clamp(2.75rem, 6vw, 4rem); /* header bar → first line of every page, and home buttons → map */
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:has(:target) { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.55; letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.06; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.eyebrow { font-weight: 600; font-size: 1rem; color: var(--red); letter-spacing: -0.01em; }
.muted { color: var(--muted); }

/* Nav */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease);
  view-transition-name: site-nav;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 56px; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand svg { height: 30px; width: auto; flex: none; transition: transform .5s var(--ease); }
.brand:hover svg { transform: rotate(-6deg) scale(1.06); }
.nav ul { display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0; font-size: 0.875rem; }
.nav ul a { color: var(--ink); opacity: .8; transition: opacity .25s ease; }
.nav ul a:hover { opacity: 1; text-decoration: none; }
.nav ul a[aria-current="page"] { opacity: 1; font-weight: 600; }
.nav .btn { padding: 0.4rem 1rem; font-size: 0.875rem; } /* same text size as the menu links */
.nav-left { display: flex; align-items: center; gap: 0.5rem; }
.menu-btn { display: none; }
@media (max-width: 760px) {
  .nav .wrap { position: relative; }
  /* menu button: three black dots (like the section divider) that turn into a rounded X */
  .menu-btn {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 3px;
    width: 44px; height: 40px; margin-left: -8px; padding: 0;
    background: none; border: 0; border-radius: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .menu-btn span { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); transition: transform .4s var(--ease), opacity .25s ease; }
  .menu-btn::before, .menu-btn::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 3px; border-radius: 3px; background: var(--ink);
    opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scaleX(.3); transition: transform .45s var(--ease), opacity .25s ease;
  }
  .nav.open .menu-btn span { transform: scale(0); opacity: 0; }
  .nav.open .menu-btn::before { opacity: 1; transform: translate(-50%, -50%) rotate(45deg); }
  .nav.open .menu-btn::after { opacity: 1; transform: translate(-50%, -50%) rotate(-45deg); }
  .nav ul {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    padding: 0.5rem clamp(16px, 4vw, 32px) 1.25rem; font-size: 1.5rem;
    background: var(--bg); border-bottom: 1px solid var(--rule); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
    opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none;
    transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s linear .45s;
  }
  .nav.open ul { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s; }
  .nav ul li + li { border-top: 0; }
  .nav ul a { display: block; padding-block: 0.85rem; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; opacity: 1; }
  .nav ul a[aria-current="page"] { color: var(--red); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--sans); font-weight: 500; font-size: 1.0625rem;
  padding: 0.8rem 1.4rem; border-radius: 999px; border: 0;
  background: var(--red); color: var(--on-red);
  transition: transform .35s var(--ease), filter .25s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: scale(0.96); }
.link-more { font-size: 1.0625rem; font-weight: 500; }
.link-more::after { content: " ›"; display: inline-block; transition: transform .35s var(--ease); }
.link-more:hover::after { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem; }

/* Sections */
section { padding-block: var(--space); }
.intro { text-align: center; display: grid; justify-items: center; gap: 14px; }
.intro h1 { font-size: clamp(2.75rem, 7.5vw, 5.25rem); max-width: 14ch; }
.intro h2 { font-size: clamp(2.1rem, 5.5vw, 3.75rem); max-width: 18ch; }
.intro .lede { font-size: clamp(1.125rem, 2vw, 1.4rem); line-height: 1.45; color: var(--muted); max-width: 38rem; }
.intro .actions { margin-top: 22px; } /* 14 + 22 = 36: text → buttons */
.hero { padding-top: calc(var(--space-top) - 14px); } /* 14px = empty header bar under the logo, so the visible gap is --space-top */
@supports not (text-box: trim-both cap alphabetic) { .hero .intro > h1:first-child { margin-top: -0.19em; } }
@supports not (text-box: trim-both cap alphabetic) { .hero .intro > .eyebrow:first-child { margin-top: -0.38em; } }
.hero h1 em { font-style: normal; color: var(--blue); }
.page-hero { padding-bottom: var(--space); }
.alt { background: var(--bg); }

/* Map tile */
.map-tile { margin: var(--space-top) auto 0; max-width: 60rem; border-radius: var(--radius); overflow: hidden; background: var(--sky); }
.map { width: 100%; max-width: 100%; height: auto; display: block; }
.map text { font-family: var(--sans); font-size: 8.5px; fill: var(--muted); }
.map .geo { font-size: 7px; text-transform: uppercase; letter-spacing: .16em; }
.map .eq { font-size: 7.5px; fill: var(--blue); }
.map .place-name { fill: var(--ink); font-weight: 600; font-size: 10.5px; }
.ring { transform-box: fill-box; transform-origin: center; animation: ring 2.8s var(--ease) infinite; }
.ring.b { animation-delay: 1.4s; }
@keyframes ring { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(2.4); opacity: 0; } }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: var(--space); }
.tiles.two { grid-template-columns: repeat(2, 1fr); }
/* tiles that open a section already get the section padding above them */
.tiles:first-child { margin-top: 0; }
.tile {
  background: var(--surface); border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid; gap: 16px; align-content: start; color: var(--ink); min-width: 0;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}

a.tile:hover { text-decoration: none; transform: translateY(-6px) scale(1.01); box-shadow: var(--shadow); }
a.tile:active { transform: scale(0.985); }
.tile h3 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
.tile p { color: var(--muted); }
.tile .when { font-size: 0.9rem; font-weight: 600; color: var(--muted); display: block; }
.tile .when::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 0.5rem; border-radius: 50%; background: var(--dot, var(--red)); vertical-align: 0; }
.tile .link-more { color: var(--blue); }
@media (max-width: 900px) { .tiles, .tiles.two { grid-template-columns: 1fr; } }

/* Hands / Haven */

.pillar .swatch { width: 44px; height: 6px; border-radius: 6px; background: var(--dot); }

/* People */
.person .avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.75rem; color: #FFFFFF; background: var(--dot); }
.person .role { color: var(--red); font-weight: 600; font-size: 0.9rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; margin-top: var(--space); text-align: center; }
.stats div { display: grid; gap: 14px; align-content: start; }
.stats strong { font-family: var(--sans); font-weight: 700; letter-spacing: -0.03em; color: var(--red); white-space: nowrap; font-size: clamp(2.75rem, 6vw, 4.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; } .stats div:last-child { grid-column: 1 / -1; } }


.tile.after { background: var(--sky); }

/* Quote */
.quote { text-align: center; display: grid; justify-items: center; gap: 16px; }
.quote p { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.2; max-width: 24ch; text-wrap: balance; }
.quote cite { font-style: normal; color: var(--muted); }

/* Timeline */
.timeline { list-style: none; margin: var(--space) auto 0; padding: 0; max-width: 44rem; display: grid; }
.timeline li { display: grid; grid-template-columns: 7rem 1fr; gap: 1.5rem; padding-block: 36px; /* room between entries (title → text inside stays 16px) */ border-top: 1px solid var(--rule); }
.timeline li:last-child { border-bottom: 1px solid var(--rule); }
.timeline time { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.timeline h3 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin-bottom: 16px; } /* same 16px as inside the cards */
.timeline p { color: var(--muted); }
.timeline li > div { min-width: 0; }
@media (max-width: 600px) { .timeline li { grid-template-columns: 1fr; gap: 14px; } }

/* Long-form story */
.story { max-width: 44rem; margin-inline: auto; display: grid; gap: 16px; }
.story h3 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
.story p { color: var(--muted); }
.story + .story { margin-top: var(--space); }
.space-top { margin-top: var(--space); }
.space-bottom { padding-bottom: var(--space); }

/* Next / CTA */
.cta { text-align: center; }


/* Footer */
footer { border-top: 1px solid var(--rule); padding-block: 2rem 2.5rem; font-size: 0.85rem; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

/* Motion: hero settles in on load; sections rise into place as they scroll into view. */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: translateY(40px) scale(.97); } to { opacity: 1; transform: none; } }
.load > * { animation: rise 1s var(--ease) both; }
.load > *:nth-child(2) { animation-delay: .08s; }
.load > *:nth-child(3) { animation-delay: .16s; }
.load > *:nth-child(4) { animation-delay: .24s; }
.load > *:nth-child(5) { animation-delay: .32s; }
.map-tile.load-in { animation: settle 1.2s var(--ease) .3s both; }
/* Each block fades up once when it comes into view, and always finishes (never left half-faded) */
.reveal { transition: opacity .9s var(--ease), transform .9s var(--ease); }
html.js .reveal:not(.in) { opacity: 0; transform: translateY(24px); }
.tiles > .reveal:nth-child(2) { transition-delay: .08s; }
.tiles > .reveal:nth-child(3) { transition-delay: .16s; }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .25s ease both vt-out; }
::view-transition-new(root) { animation: .45s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}



/* Section dividers: a hairline across the content width, marked by the logo's three colors. */
main > * + section { position: relative; }
main > * + section::before {
  content: ""; position: absolute; top: 0; height: 1px; background: var(--rule);
  inset-inline: max(clamp(16px, 4vw, 32px), calc((100% - var(--wrap)) / 2 + clamp(16px, 4vw, 32px)));
}
main > * + section::after {
  content: ""; position: absolute; top: 0; left: 50%; width: 8px; height: 8px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--logo-blue);
  box-shadow: -16px 0 0 var(--logo-red), 16px 0 0 var(--logo-yellow), 0 0 0 10px var(--bg), -16px 0 0 10px var(--bg), 16px 0 0 10px var(--bg);
}

img.avatar { object-position: 50% 30%; background: var(--surface); }

/* Map legend sits under the map so labels stay readable at every width */
.map-legend { list-style: none; margin: 0; padding: 1rem clamp(1rem, 3vw, 1.5rem) 1.25rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 2.5rem; }
.map-legend li { display: grid; grid-template-columns: auto 1fr; column-gap: 0.6rem; align-items: center; }
.map-legend li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); grid-row: 1 / span 2; }
.map-legend strong { font-family: var(--display); font-weight: 700; font-size: 1rem; }
.map-legend span { color: var(--muted); font-size: 0.875rem; grid-column: 2; }
.map .narrow-only { display: none; }
@media (max-width: 640px) {
  .map .wide-only { display: none; }
  .map .narrow-only { display: inline; }
  .map-legend { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

.btn.secondary { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }
.btn.secondary:hover { background: color-mix(in srgb, var(--red) 8%, transparent); filter: none; }
.intro .actions { gap: 0.75rem; }
.page-hero + .wrap > .tiles:first-child, .page-hero + .wrap > .stats:first-child { margin-top: 0; }

/* Keep names like "Happy Hearts Indonesia" on one line when text wraps */
.keep { white-space: nowrap; }

/* Phones: keep the two hero buttons on one row */
@media (max-width: 480px) {
  .intro .actions { flex-wrap: nowrap; gap: 0.6rem; }
  .intro .actions .btn { font-size: 0.95rem; padding: 0.7rem 1.05rem; white-space: nowrap; }
}

/* Dotted map (Our work page) */
.dot-map { position: relative; max-width: 60rem; margin: 0 auto; }
.dot-map .map { overflow: hidden; }
.dot-map .dots { stroke: #8E8E94; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.pin { cursor: pointer; outline: none; }
.pin .halo { fill: var(--pin); opacity: .14; transition: transform .5s var(--ease), opacity .3s ease; transform-box: fill-box; transform-origin: center; }
.pin .ring { fill: none; stroke: var(--pin); stroke-width: 1; }
.pin .core { fill: var(--pin); stroke: var(--bg); stroke-width: 1.2; }
.pin:hover .halo, .pin:focus-visible .halo, .pin.active .halo { transform: scale(1.35); opacity: .22; }
.map-card {
  position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 14px)) scale(.96); opacity: 0;
  display: grid; justify-items: center; gap: 0.15rem; min-width: 13rem; padding: 1rem 1.25rem;
  background: var(--bg); color: var(--ink); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow);
  text-align: center; transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.map-card.on { opacity: 1; transform: translate(-50%, calc(-100% - 14px)); }
.map-card.below { transform: translate(-50%, 14px) scale(.96); }
.map-card.below.on { transform: translate(-50%, 14px); }
.map-card:hover { text-decoration: none; }
.map-card::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pin); margin-bottom: 0.35rem; }
.map-card strong { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.map-card span { color: var(--muted); font-size: 0.9rem; }
.map-card .link-more { color: var(--blue); font-size: 0.9rem; margin-top: 0.35rem; }
.map-hint { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 0.75rem; }

/* Touch screens can't hover: show the location list under the dotted map instead of the hint */
.dot-map .map-legend { display: none; }
.dot-map .map-legend a { display: contents; color: inherit; }
.dot-map .map-legend a:hover { text-decoration: none; }
@media (hover: none), (max-width: 760px) {
  .dot-map .map-hint { display: none; }
  .dot-map .map-legend { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 1.25rem 0 0; width: fit-content; margin-inline: auto; }
}

/* Page titles: more room between the big headline and the text under it */
.intro h1 + .lede, .intro h2 + .lede { margin-top: 22px; } /* 14 + 22 = 36: heading → its paragraph */ /* heading → its paragraph: a touch more room than label → heading */

/* Photo strip: scattered sizes and heights, swipe or drag sideways */
.gallery { margin-top: var(--space); }
.strip {
  display: flex; align-items: flex-start; gap: 24px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab;
  padding-inline: max(clamp(16px, 4vw, 32px), calc((100vw - var(--wrap)) / 2 + clamp(16px, 4vw, 32px)));
  scroll-padding-inline: max(clamp(16px, 4vw, 32px), calc((100vw - var(--wrap)) / 2 + clamp(16px, 4vw, 32px)));
}
.strip::-webkit-scrollbar { display: none; }
.strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.strip.dragging img { pointer-events: none; }
.strip:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.shot { margin: 0; flex: none; scroll-snap-align: start; display: grid; gap: 14px; }
.shot figcaption { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar, 3 / 4); object-fit: cover; border-radius: 18px; background: var(--surface); user-select: none; -webkit-user-drag: none; }
.shot.lg { width: clamp(240px, 30vw, 380px); }
.shot.md { width: clamp(200px, 24vw, 300px); margin-top: clamp(40px, 8vw, 110px); }
.shot.sm { width: clamp(170px, 19vw, 240px); margin-top: clamp(16px, 3vw, 40px); }
.shot[style*="4 / 3"] { width: clamp(300px, 38vw, 480px); }
.strip-nav { display: flex; justify-content: flex-end; gap: 0.5rem; max-width: var(--wrap); margin: 1.25rem auto 0; padding-inline: clamp(16px, 4vw, 32px); }
.strip-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink);
  font: 600 1.5rem/1 var(--sans); cursor: pointer; transition: background .25s ease, opacity .25s ease, transform .35s var(--ease);
}
.strip-btn:hover:not(:disabled) { background: var(--rule); }
.strip-btn:active:not(:disabled) { transform: scale(.94); }
.strip-btn:disabled { opacity: .35; cursor: default; }
@media (hover: none) { .strip-nav { display: none; } .strip { cursor: auto; } }

/* "Projects" dropdown in the header */
.has-sub { position: relative; }
.sub-toggle {
  display: flex; align-items: center; gap: 0.35rem; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; letter-spacing: inherit; color: var(--ink); opacity: .8; transition: opacity .25s ease;
}
.has-sub:hover .sub-toggle, .has-sub.open .sub-toggle, .has-sub.current .sub-toggle { opacity: 1; }
.has-sub.current .sub-toggle { font-weight: 600; }
.nav .has-sub .sub {
  position: absolute; top: calc(100% + 16px); left: 50%; z-index: 60; display: grid; gap: 2px; min-width: 11rem;
  padding: 0.4rem; margin: 0; list-style: none; background: var(--bg); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translate(-50%, -6px);
  transition: opacity .25s var(--ease), transform .35s var(--ease), visibility 0s linear .35s;
}
.nav .has-sub .sub::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px; } /* keeps hover alive between label and menu */
.has-sub:hover .sub, .has-sub:focus-within .sub, .has-sub.open .sub {
  opacity: 1 !important; visibility: visible !important; transform: translate(-50%, 0) !important;
  transition: opacity .25s var(--ease), transform .35s var(--ease), visibility 0s !important;
}
.nav .has-sub .sub a { display: block; padding: 0.55rem 0.8rem; border-radius: 9px; opacity: 1; }
.nav .has-sub .sub a:hover { background: var(--surface); }
.nav .has-sub .sub a[aria-current="page"] { color: var(--red); }

@media (max-width: 760px) {
  /* in the phone menu, tapping Projects expands Lampung and Sumba beneath it */
  .sub-toggle { width: 100%; justify-content: space-between; padding-block: 0.85rem; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; opacity: 1; }
  .nav .has-sub .sub, .has-sub:hover .sub, .has-sub:focus-within .sub {
    position: static; transform: none !important; visibility: hidden !important; opacity: 0 !important;
    max-height: 0; overflow: hidden; padding: 0 0 0 1rem; border: 0; box-shadow: none; background: none; min-width: 0;
    transition: max-height .4s var(--ease), opacity .3s ease, visibility 0s linear .4s !important;
  }
  .nav.open .has-sub.open .sub {
    visibility: inherit !important; opacity: 1 !important; max-height: 12rem; padding-bottom: 0.6rem;
    transition: max-height .45s var(--ease), opacity .3s ease, visibility 0s !important;
  }
  .nav .has-sub .sub::before { display: none; }
  .nav .has-sub .sub li + li { border-top: 0; }
  .nav .has-sub .sub a { padding: 0.45rem 0; font-size: 1.15rem; color: var(--muted); }
  .nav .has-sub .sub a:hover { background: none; }
}

/* Scroll-driven photo section (Sumba): pins, and vertical scroll slides the photos sideways */
.hscroll { padding-block: 0; }
.hscroll .hs-sticky { padding-block: var(--space); }
.hscroll.is-pinned .hs-sticky {
  position: sticky; top: var(--nav-h, 56px); height: calc(100vh - var(--nav-h, 56px)); height: calc(100svh - var(--nav-h, 56px));
  display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-block: 0;
}
.hscroll.is-pinned .gallery { margin-top: clamp(1.5rem, 4vh, var(--space)); }
.hscroll.is-pinned .strip { overflow: visible; scroll-snap-type: none; cursor: auto; will-change: transform; }
.hscroll.is-pinned .strip-nav { display: none; }
.hscroll.is-pinned .shot.lg { width: min(clamp(240px, 30vw, 380px), 40vh); }
.hscroll.is-pinned .shot.md { width: min(clamp(200px, 24vw, 300px), 32vh); margin-top: min(clamp(40px, 8vw, 110px), 8vh); }
.hscroll.is-pinned .shot.sm { width: min(clamp(170px, 19vw, 240px), 26vh); margin-top: min(clamp(16px, 3vw, 40px), 4vh); }
.hscroll.is-pinned .shot[style*="9 / 16"] { width: min(clamp(160px, 18vw, 230px), 26vh); }
.hscroll.is-pinned .shot[style*="4 / 3"] { width: min(clamp(300px, 38vw, 480px), 52vh); } /* landscape photos: wider, about the height of a medium one */
.hscroll.is-pinned .gallery { animation: none; }

/* Phones: the photo strip becomes a vertical, staggered stack (like landonorris.com on mobile) */
@media (max-width: 760px) {
  .hscroll .strip {
    flex-direction: column; overflow: visible; scroll-snap-type: none; cursor: auto; gap: clamp(2rem, 9vw, 3rem);
    padding-inline: clamp(16px, 4vw, 32px); transform: none !important;
  }
  .hscroll .strip-nav { display: none; }
  .hscroll .shot, .hscroll .shot.lg, .hscroll .shot.md, .hscroll .shot.sm { margin-top: 0; }
  .hscroll .shot.lg { width: 86%; }
  .hscroll .shot.md { width: 68%; }
  .hscroll .shot.sm { width: 58%; }
  .hscroll .shot[style*="9 / 16"] { width: 56%; }
  .hscroll .shot:nth-child(even) { align-self: flex-end; }
  .hscroll .shot:nth-child(even) figcaption { text-align: right; }
  .hscroll .shot { transition: opacity .9s var(--ease), transform .9s var(--ease); }
  html.js .hscroll .shot:not(.in) { opacity: 0; transform: translateY(24px); }
}

/* Quote credit: name and title on separate lines on phones */
@media (max-width: 760px) {
  .quote cite .cite-sep { display: none; }
  .quote cite .cite-role { display: block; }
}

.story.centered { text-align: center; }

/* Trim the invisible space fonts add above capitals and below the baseline,
   so every gap you see is exactly the spacing that is set. */
main :is(h1, h2, h3, p, figcaption, time, blockquote cite, .tile > .link-more) { text-box: trim-both cap alphabetic; }

/* Home page only: the big headline sits a little lower under the header */
.hero.home-hero { padding-top: calc(var(--space-top) * 1.5 - 14px); } /* current live home */
.hero.home-red {
  /* new home: header + opening fill exactly one screen, with the text centered in it */
  min-height: calc(100vh - var(--nav-h, 57px)); min-height: calc(100svh - var(--nav-h, 57px));
  display: grid; align-items: center; padding-block: var(--space);
}
.wordmark { letter-spacing: -0.02em; } /* lowercase, like the hands & haven logo */

/* A story that follows its heading directly reads like the heading's paragraph: same gap as heading → intro text */
.intro + .story.space-top { margin-top: 36px; }
/* heading → a big number: the same 36px as heading → paragraph, with the number trimmed to its digits */
.intro + .stats, .stats + .story.space-top { margin-top: 36px; } /* number → its story text: same 36px */
main .stats :is(strong, span) { text-box: trim-both cap alphabetic; }

/* Computers with a mouse: the dots menu also opens on hover, and Projects expands on hover inside it */
@media (max-width: 760px) and (hover: hover) and (pointer: fine) {
  .nav.open .has-sub:hover .sub {
    visibility: inherit !important; opacity: 1 !important; max-height: 12rem; padding-bottom: 0.6rem;
    transition: max-height .45s var(--ease), opacity .3s ease, visibility 0s !important;
  }
}

/* ===== Home: red opening screen (test) ===== */
:root { --red-deep: #6A2427; } /* dark, muted wine red for the opening screen */
body:has(.home-red) { background: var(--bg); }
.hero.home-red { background: var(--red-deep); color: #FFFFFF; }
.home-red h1 { color: #FFFFFF; }
.home-red h1 em { color: #FFD45C; }
.home-red .lede { color: rgba(255, 255, 255, 0.86); }
/* on computers the intro breaks into three set lines; phones wrap it naturally */
@media (min-width: 761px) { .home-red .lede { max-width: none; } .home-red .lede .ln { display: block; } }
.home-red .btn { background: #FFFFFF; color: var(--red-deep); }
.home-red .btn.secondary { background: transparent; color: #FFFFFF; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
.home-red .btn.secondary:hover { background: rgba(255, 255, 255, 0.12); }
.home-red a:focus-visible { outline-color: #FFFFFF; }

/* header sits on the red until you scroll past the opening */
body:has(.home-red) .nav:not(.scrolled) {
  background: var(--red-deep); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: transparent;
  --logo-red: #FFFFFF; --logo-blue: #FFFFFF; --logo-yellow: #FFFFFF; --bg: var(--red-deep);
}
body:has(.home-red) .nav:not(.scrolled) .brand,
body:has(.home-red) .nav:not(.scrolled) .sub-toggle,
body:has(.home-red) .nav:not(.scrolled) #site-menu > li > a { color: #FFFFFF; }
body:has(.home-red) .nav:not(.scrolled) .btn { background: #FFFFFF; color: var(--red-deep); }
body:has(.home-red) .nav:not(.scrolled) .menu-btn span,
body:has(.home-red) .nav:not(.scrolled) .menu-btn::before,
body:has(.home-red) .nav:not(.scrolled) .menu-btn::after { background: #FFFFFF; }
body:has(.home-red) .nav { transition: background-color .4s var(--ease), border-color .4s var(--ease); }
/* the dropdowns keep their white panels and dark text */
body:has(.home-red) .nav:not(.scrolled) .has-sub .sub { --bg: #FFFFFF; }
@media (max-width: 760px) {
  body:has(.home-red) .nav:not(.scrolled) #site-menu { background: var(--red-deep); border-bottom-color: transparent; }
  body:has(.home-red) .nav:not(.scrolled) .has-sub .sub a { color: rgba(255, 255, 255, 0.8); }
}

/* Home: footer continues the red */
body:has(.home-red) footer { background: var(--red-deep); border-top: 0; color: rgba(255, 255, 255, 0.86); }
body:has(.home-red) footer a { color: #FFFFFF; }
body:has(.home-red) footer a:hover { color: #FFFFFF; text-decoration: underline; }
body:has(.home-red) footer a:focus-visible { outline-color: #FFFFFF; }
/* red meets red, so a faint white line marks the footer, with the same 2rem to the text as on the other pages */
body:has(.home-red) footer { padding-top: 0; }
body:has(.home-red) footer .wrap { position: relative; padding-top: 2rem; }
body:has(.home-red) footer .wrap::before { content: ""; position: absolute; top: 0; left: clamp(16px, 4vw, 32px); right: clamp(16px, 4vw, 32px); height: 1px; background: rgba(255, 255, 255, 0.2); }

/* Short pages: the footer always sits at the bottom of the screen */
body { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

/* Contact form (Get involved) */
.contact { max-width: 36rem; margin: 36px auto 0; display: grid; gap: 16px; }
.contact .field { display: grid; gap: 14px; }
.contact label { font-size: 0.9rem; font-weight: 600; color: var(--ink); text-box: trim-both cap alphabetic; }
.contact input, .contact textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1.5px solid transparent; border-radius: 14px; padding: 14px 16px; width: 100%;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.contact textarea { resize: vertical; min-height: 9rem; }
.contact input:focus, .contact textarea:focus { outline: none; border-color: var(--blue); background: #FFFFFF; }
.contact .actions { margin-top: 20px; justify-content: center; }
.contact .btn { border: 0; cursor: pointer; font: inherit; }
.contact .btn:disabled { opacity: .6; cursor: default; }
.contact .hp { position: absolute; left: -9999px; }
.form-status { text-align: center; color: var(--muted); min-height: 1lh; }
.form-status.ok { color: #1F7A4D; }
.form-status.err { color: var(--red); }
/* card date labels stay on one line, shrinking a touch only when the card is narrow */
.tile:has(> .when) { container-type: inline-size; }
.tile .when { white-space: nowrap; font-size: min(0.9rem, 5.2cqi); }
.intro .lede + .muted { margin-top: 22px; } /* 14 + 22 = 36: intro text → the partnership note */
/* A single wide card (Sumba: in the news) */
.tiles.one { grid-template-columns: 1fr; max-width: 48rem; margin-inline: auto; }
.tile.news h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.25; }
.tile.news .when { white-space: normal; font-size: 0.9rem; }
