/* Asilia Impact marketing site, 2026 redesign.
   Brand tokens come from the Asilia Designer Brief (Dhow, Udongo, Pwani, Kivuli, Nguo);
   Cormorant Garamond + Inter are the brief's named pair. */

:root {
  --bg: #F7F3EB;          /* Nguo */
  --panel: #EFE6D3;       /* between Nguo and Pwani, for quiet panels */
  --line: #DCCFB6;
  --ink: #1A2541;         /* Dhow */
  --text: #2B2B2B;        /* Kivuli */
  --muted: #5B5F69;
  --accent: #B8593A;      /* Udongo */
  --accent-ink: #9C4A2F;  /* Udongo darkened for text on Nguo (AA) */
  --band: #1A2541;
  --band-text: #F1EBDD;
  --band-muted: #B9BFCC;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 2px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111827;
    --panel: #172033;
    --line: #2A3550;
    --ink: #EFE7D6;
    --text: #D9D4C8;
    --muted: #A3A9B6;
    --accent: #D9784F;
    --accent-ink: #E38A63;
    --band: #0B1220;
    --band-text: #EFE7D6;
    --band-muted: #9AA3B5;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 30; }
.skip:focus { top: 1rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.4rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
h3 { font-size: 1.6rem; line-height: 1.15; }
p { margin: 0; }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--text); max-width: 34ch; }
.prose { max-width: 62ch; }
.prose p + p { margin-top: 1em; }
.muted { color: var(--muted); }
.kicker { font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .9rem 1.4rem; border-radius: var(--radius);
  font: 600 .95rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--ink); transition: background .2s, color .2s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.more { font-weight: 600; color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.more:hover { color: var(--ink); }
.more::after { content: " \2192"; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand span { font: 600 1.15rem/1 var(--serif); letter-spacing: .16em; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { text-decoration: none; font-size: .93rem; color: var(--text); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-ink); }
.nav .btn { padding: .65rem 1rem; font-size: .88rem; color: var(--bg); }
.nav .btn:hover { color: #fff; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--ink); padding: .5rem .8rem; font: 600 .85rem var(--sans); border-radius: var(--radius); }

@media (max-width: 960px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--bg);
         flex-direction: column; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1.2rem; }
  .nav.open { display: flex; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 1rem; justify-content: center; border-bottom: 0; }
}

/* Sections */
section { padding: clamp(64px, 9vw, 120px) 0; }
.tight { padding-top: 0; }

/* Hero: full-bleed field photo under the live site's Dhow gradient mask (105deg, 0.96 to 0.68) */
.hero { position: relative; overflow: hidden; color: var(--band-text); padding: clamp(96px, 14vh, 160px) 0 clamp(80px, 12vh, 140px);
  background: #1A2541 url('img/hero-coral-restoration.webp') center 35% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, rgba(26,37,65,.96) 0%, rgba(26,37,65,.90) 45%, rgba(26,37,65,.68) 100%); }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { color: #F7F3EB; max-width: 15ch; font-size: clamp(2.6rem, 5vw, 4.4rem); }
.hero .lede { margin-top: 1.4rem; color: rgba(247,243,235,.82); max-width: 40ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }
.hero .btn-primary { background: #B8593A; border-color: #B8593A; color: #fff; }
.hero .btn-primary:hover { background: #F7F3EB; border-color: #F7F3EB; color: #1A2541; }
.hero .btn-ghost { color: #F7F3EB; border-color: rgba(247,243,235,.6); }
.hero .btn-ghost:hover { background: #F7F3EB; color: #1A2541; }
.hero .credit { position: absolute; right: var(--gutter); bottom: 14px; z-index: 1; font-size: .75rem; color: rgba(247,243,235,.6); }

/* Page intro (inner pages) */
.intro { padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(40px, 5vw, 64px); }
.intro h1 { max-width: 18ch; }
.intro .lede { margin-top: 1.2rem; max-width: 52ch; }

/* Two doors: photo above, words below, so text never sits on faces */
.doors-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
.door { display: block; text-decoration: none; color: var(--text); }
.door figure { margin: 0; overflow: hidden; border-radius: var(--radius); }
.door img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.door h2 { margin-top: 1.4rem; font-size: clamp(1.8rem, 2.8vw, 2.4rem); }
.door p { margin-top: .6rem; max-width: 44ch; color: var(--muted); }
.door .go { display: inline-block; margin-top: 1rem; font-weight: 600; color: var(--accent-ink); border-bottom: 1px solid currentColor; }
.door:hover img { transform: scale(1.03); }
.door:hover h2 { color: var(--accent-ink); }
@media (max-width: 760px) { .doors-wrap { grid-template-columns: 1fr; } }

/* Statement */
.statement { padding-bottom: clamp(40px, 6vw, 72px); }
.statement p.big { font: 500 clamp(1.8rem, 3.4vw, 2.7rem)/1.22 var(--serif); color: var(--ink); max-width: 30ch; }
.statement .prose { margin-top: 1.8rem; }

/* Process: four verbs in a row */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 36px); margin-top: 3rem; counter-reset: s; }
.steps li { list-style: none; border-top: 2px solid var(--ink); padding-top: 1.1rem; }
.steps h3 { font-size: 1.9rem; }
.steps p { margin-top: .5rem; color: var(--muted); font-size: .98rem; }
.steps-list { padding: 0; margin-bottom: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Services grid: one feature tile + three, then a wide row */
.svc { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: auto auto; gap: 2px; background: var(--line); margin-top: 3rem; border: 1px solid var(--line); }
.svc > a { display: flex; flex-direction: column; gap: .7rem; padding: clamp(24px, 3vw, 36px); background: var(--bg); text-decoration: none; color: var(--text); min-height: 250px; }
.svc > a:hover h3 { color: var(--accent-ink); }
.svc .feature { grid-row: span 2; background: var(--band); color: var(--band-text); justify-content: space-between; }
.svc .feature h3 { color: var(--band-text); font-size: 2.2rem; }
.svc .feature p { color: var(--band-muted); }
.svc .feature .more { color: #F0B79C; }
.svc .wide { grid-column: span 2; background: var(--panel); }
.svc .tag { font-size: .82rem; color: var(--muted); margin-top: auto; }
.svc .feature .tag { color: var(--band-muted); }
@media (max-width: 900px) {
  .svc { grid-template-columns: 1fr 1fr; }
  .svc .feature { grid-row: auto; grid-column: span 2; }
}
@media (max-width: 560px) { .svc { grid-template-columns: 1fr; } .svc .feature, .svc .wide { grid-column: auto; } }

/* Proof: quote + founder */
.proof .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
blockquote { margin: 0; }
blockquote p { font: 500 clamp(1.5rem, 2.4vw, 2rem)/1.3 var(--serif); color: var(--ink); }
blockquote footer { margin-top: 1.2rem; font-size: .92rem; color: var(--muted); }
blockquote footer strong { color: var(--text); display: block; }
.founder p + p { margin-top: 1em; }
.founder h2 { margin-bottom: 1.2rem; }
@media (max-width: 860px) { .proof .wrap { grid-template-columns: 1fr; } }

/* Stories band (the one dark section) */
.band { background: var(--band); color: var(--band-text); }
.band h2, .band h3 { color: var(--band-text); }
.band .muted { color: var(--band-muted); }
.stories-head { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; }
.stories-head img { width: 96px; }
.stories-head p { margin-top: .6rem; max-width: 52ch; color: var(--band-muted); }
.essays { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(20px, 3vw, 40px); margin-top: 3rem; }
.essays a { display: block; text-decoration: none; padding: 1.4rem 0; border-top: 1px solid rgba(255,255,255,.18); }
.essays h3 { font-size: 1.45rem; color: var(--band-text); }
.essays a:hover h3 { color: #F0B79C; }
.essays time { display: block; margin-top: .6rem; font-size: .85rem; color: var(--band-muted); }
.band .more { color: #F0B79C; }
@media (max-width: 860px) { .essays { grid-template-columns: 1fr; } .stories-head { grid-template-columns: 1fr; } }

/* Closing call to action */
.close { text-align: left; }
.close .wrap { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: end; }
.close p { margin-top: 1rem; max-width: 46ch; }
.close .actions { justify-self: end; }
@media (max-width: 760px) { .close .wrap { grid-template-columns: 1fr; } .close .actions { justify-self: start; } }

/* Services page: one block per offer */
.offer { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(28px, 5vw, 80px); padding: clamp(48px, 6vw, 80px) 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.offer:first-of-type { border-top: 0; }
.offer h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); }
.offer .for { margin-top: 1rem; color: var(--muted); max-width: 40ch; }
.offer .meta { margin-top: 1.4rem; font-size: .9rem; color: var(--text); }
.offer .meta span { display: block; color: var(--muted); }
.gets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 2rem; }
.gets li { padding-left: 1.1rem; border-left: 2px solid var(--accent); }
.gets strong { display: block; color: var(--ink); font-weight: 600; }
.gets span { color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .offer { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .gets { grid-template-columns: 1fr; } }

/* Audience pages */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.split img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 60%; border-radius: var(--radius); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.pains { list-style: none; padding: 0; margin: 1.6rem 0 0; }
.pains li { padding: 1rem 0; border-top: 1px solid var(--line); }
.pains li strong { color: var(--ink); }
.map { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); margin-top: 2.6rem; }
.map > div { background: var(--bg); padding: clamp(22px, 3vw, 32px); }
.map h3 { font-size: 1.45rem; }
.map p { margin-top: .6rem; color: var(--muted); font-size: .97rem; }
.map .more { display: inline-block; margin-top: 1rem; font-size: .92rem; }
@media (max-width: 860px) { .map { grid-template-columns: 1fr; } }

/* Work page */
.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 4vw, 56px) clamp(28px, 5vw, 72px); }
.case { border-top: 2px solid var(--ink); padding-top: 1.2rem; }
.case .client { font-size: .9rem; color: var(--muted); }
.case h3 { margin-top: .4rem; font-size: 1.8rem; }
.case p { margin-top: .7rem; }
.case .did { margin-top: .9rem; font-size: .9rem; color: var(--accent-ink); }
.case a { color: var(--accent-ink); }
@media (max-width: 760px) { .cases { grid-template-columns: 1fr; } }
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); }
.quotes blockquote p { font-size: 1.35rem; }
@media (max-width: 860px) { .quotes { grid-template-columns: 1fr; } }
.panel { background: var(--panel); }

/* Stories page */
.stories-hero { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.stories-hero .mark { width: clamp(84px, 9vw, 120px); margin-bottom: 1.6rem; }
.stories-hero img.photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 860px) { .stories-hero { grid-template-columns: 1fr; } }
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem 3rem; margin-top: 2.4rem; }
.principles h3 { font-size: 1.4rem; }
.principles p { margin-top: .4rem; color: var(--muted); }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; } }
.essay-list { list-style: none; padding: 0; margin: 2.4rem 0 0; }
.essay-list li { border-top: 1px solid var(--line); }
.essay-list a { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: baseline; padding: 1.4rem 0; text-decoration: none; }
.essay-list h3 { font-size: 1.55rem; }
.essay-list p { grid-column: 1; color: var(--muted); font-size: .97rem; max-width: 70ch; }
.essay-list time { grid-row: 1; grid-column: 2; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.essay-list a:hover h3 { color: var(--accent-ink); }
@media (max-width: 600px) { .essay-list a { grid-template-columns: 1fr; } .essay-list time { grid-row: auto; grid-column: 1; } }

/* Contact */
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 96px); }
.contact dl { margin: 2rem 0 0; }
.contact dt { font-size: .85rem; color: var(--muted); margin-top: 1.2rem; }
.contact dd { margin: .2rem 0 0; font-size: 1.05rem; }
.contact dd a { color: var(--ink); }
form { display: grid; gap: 1.2rem; }
.field { display: grid; gap: .45rem; align-content: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
label { font-weight: 600; font-size: .92rem; color: var(--ink); }
input, select, textarea {
  font: 400 1rem/1.4 var(--sans); color: var(--text); background: var(--bg);
  border: 1px solid #A99C82; border-radius: var(--radius); padding: .8rem .9rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.help { font-size: .85rem; color: var(--muted); }
.error { font-size: .85rem; color: #A0321B; min-height: 1em; }
.note { padding: 1rem 1.1rem; background: var(--panel); border-left: 2px solid var(--accent); font-size: .92rem; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: .92rem; }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-foot h4 { margin: 0 0 .8rem; font: 600 .82rem/1 var(--sans); color: var(--ink); }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-foot a { text-decoration: none; color: var(--muted); }
.site-foot a:hover { color: var(--accent-ink); }
.site-foot .base { margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .85rem; }
.site-foot .about p { margin-top: .8rem; color: var(--muted); max-width: 34ch; }
@media (max-width: 760px) { .site-foot .cols { grid-template-columns: 1fr 1fr; } .site-foot .about { grid-column: span 2; } }

/* Gentle entrance for key blocks; skipped when motion is reduced */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .7s cubic-bezier(.16,1,.3,1) both; }
  .rise.d2 { animation-delay: .08s; }
  .rise.d3 { animation-delay: .16s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* Services jump list */
.jump { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; padding: 0; list-style: none; }
.jump a { display: inline-block; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-size: .9rem; color: var(--ink); }
.jump a:hover { border-color: var(--ink); }

/* Photo story cards on the Stories index */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: 2.4rem; }
.card { display: block; text-decoration: none; color: var(--text); }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.card .meta { margin-top: 1rem; font-size: .85rem; color: var(--muted); }
.card h3 { margin-top: .4rem; font-size: 1.7rem; }
.card p { margin-top: .5rem; color: var(--muted); }
.card:hover h3 { color: var(--accent-ink); }

/* Newest photo story is featured across the full row */
.card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 clamp(24px, 4vw, 56px); align-items: center; }
.card:first-child img { grid-row: span 4; aspect-ratio: 16 / 10; }
.card:first-child h3 { font-size: clamp(2rem, 3.4vw, 2.8rem); }
@media (max-width: 760px) { .card:first-child { display: block; } }

/* Contact form: honeypot kept off-screen (not display:none, which some bots skip) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sent h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
#form-err a { color: var(--accent-ink); }

/* FAQ: native details/summary, readable without JavaScript and by crawlers */
.faq h2 { margin-bottom: 1.6rem; }
.faq-list { max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.2rem 2rem 1.2rem 0; position: relative; font: 600 1.35rem/1.3 var(--serif); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 1.1rem; font: 400 1.5rem/1 var(--sans); color: var(--accent-ink); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 0 1.4rem; max-width: 68ch; color: var(--text); }

/* ---------- How we work: interactive model (after the Healthy Seaweed Cafe impact model) ---------- */
.model { padding-top: clamp(40px, 6vw, 72px); }
.model .ico { width: 1em; height: 1em; }
.m-intro { margin-top: .8rem; color: var(--muted); max-width: 52ch; }
.m-nodes { list-style: none; margin: 3rem 0 0; padding: 0 0 2.4rem; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.m-nodes > li { display: flex; justify-content: center; }
.m-arrow { flex: 1; align-self: center; margin-top: -1.8rem; color: var(--line); font-size: 1.4rem; display: flex; justify-content: center; }
.m-arrow .ico { color: var(--muted); opacity: .6; }
.m-node { background: none; border: 0; padding: 0; cursor: pointer; display: grid; justify-items: center; gap: .9rem; color: var(--muted); font: inherit; }
.m-ring { position: relative; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; font-size: 2.1rem;
  color: var(--ink); background: var(--panel); border: 2px solid var(--line); transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s, border-color .3s, background .3s; }
.m-num { position: absolute; top: -4px; left: -4px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 600 .78rem/1 var(--sans); background: var(--ink); color: var(--bg); }
.m-label { font: 600 .82rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.m-node:hover .m-ring { border-color: var(--accent); }
.m-node.on .m-ring { background: var(--band); color: #F7F3EB; border-color: var(--accent); transform: scale(1.06);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent), 0 10px 30px color-mix(in srgb, var(--accent) 25%, transparent); }
.m-node.on .m-num { background: var(--accent); color: #fff; }
.m-node.on .m-label { color: var(--accent-ink); }
.m-node:focus-visible { outline: none; }
.m-node:focus-visible .m-ring { outline: 2px solid var(--accent); outline-offset: 4px; }

.m-stage { position: relative; margin-top: 2rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--panel); }
.m-panel { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 4vw, 56px); padding: clamp(24px, 3.4vw, 40px) clamp(80px, 9vw, 120px) clamp(24px, 3.4vw, 40px) clamp(24px, 3.4vw, 40px); }
.m-panel h3 { margin-top: .6rem; font-size: clamp(1.8rem, 2.6vw, 2.3rem); }
.m-panel p { margin-top: .8rem; }
.m-sub { font: 600 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-top: .3rem !important; }
.m-panel ul { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .7rem; }
.m-panel li { position: relative; padding-left: 1.2rem; }
.m-panel li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .m-panel:not([hidden]) { animation: m-in .45s cubic-bezier(.16,1,.3,1); }
  @keyframes m-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
.m-controls { position: absolute; right: clamp(16px, 2.4vw, 28px); top: 50%; transform: translateY(-50%); display: grid; gap: .6rem; }
.m-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); transition: background .2s, color .2s, border-color .2s; }
.m-btn:hover { border-color: var(--ink); }
.m-play { background: var(--accent); border-color: var(--accent); color: #fff; }
.m-play:hover { background: var(--ink); border-color: var(--ink); }
.m-play .i-pause, .m-play[aria-pressed="true"] .i-play { display: none; }
.m-play[aria-pressed="true"] .i-pause { display: block; }

.m-leaves { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: 1.15fr repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.m-leaves li { display: grid; justify-items: center; align-content: start; gap: .35rem; text-align: center; padding: 1.6rem 1rem; border-left: 1px solid var(--line); }
.m-leaves li:first-child { border-left: 0; }
.m-leaves .ico { font-size: 1.5rem; color: var(--accent-ink); margin-bottom: .3rem; }
.m-leaves strong { font: 600 1.25rem/1.15 var(--serif); color: var(--ink); }
.m-leaves span { font-size: .85rem; color: var(--muted); }
.m-leaves .m-lead { background: var(--band); justify-items: start; text-align: left; align-content: center; }
.m-leaves .m-lead .ico { color: #F0B79C; }
.m-leaves .m-lead strong { color: #F1EBDD; font: 600 .82rem/1.5 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 900px) {
  .m-leaves { grid-template-columns: 1fr 1fr; }
  .m-leaves .m-lead { grid-column: 1 / -1; }
  .m-leaves li:nth-child(even) { border-left: 0; }
  .m-leaves li:nth-child(n+2) { border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .m-ring { width: 62px; height: 62px; font-size: 1.5rem; }
  .m-num { width: 22px; height: 22px; font-size: .7rem; }
  .m-label { font-size: .68rem; letter-spacing: .08em; }
  .m-arrow { margin-top: -1.6rem; font-size: 1rem; }
  .m-panel { grid-template-columns: 1fr; padding: 22px 22px 84px; }
  .m-controls { top: auto; bottom: 18px; right: 50%; transform: translateX(50%); grid-auto-flow: column; }
}

/* ---------- Work: filter chips and project cards ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.4rem; }
.chip { font: 500 .9rem/1 var(--sans); padding: .65rem .95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); cursor: pointer; }
.chip span { color: var(--muted); font-size: .8rem; margin-left: .25rem; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip.on span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.works { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.6vw, 36px); align-items: start; }
.wcard { border-top: 2px solid var(--ink); }
.wcard.has-img { border-top: 0; }
.wcard img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: var(--radius); }
.wbody { padding-top: 1rem; }
.wcard .client { font-size: .85rem; color: var(--muted); }
.wcard h3 { margin-top: .35rem; font-size: 1.55rem; }
.wcard .wbody > p:not(.client):not(.led) { margin-top: .6rem; font-size: .97rem; }
.wcard .led { margin-top: .7rem; font-size: .82rem; color: var(--accent-ink); }
.wtags { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.wtags li { font-size: .75rem; padding: .25rem .5rem; background: var(--panel); border-radius: var(--radius); color: var(--muted); }
.wcard .more { display: inline-block; margin-top: .9rem; font-size: .92rem; }
.wempty { max-width: 52ch; padding: 2rem 0; }
.wempty p { margin-top: .6rem; color: var(--muted); }
.wempty .more { display: inline-block; margin-top: 1rem; }
@media (max-width: 960px) { .works { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .works { grid-template-columns: 1fr; } }

/* the [hidden] attribute must win over .m-panel display:grid */
.m-panel[hidden], .wcard[hidden], .wempty[hidden] { display: none; }
.wcard img { height: auto; }
@media (max-width: 600px) { .chips { flex-wrap: nowrap; overflow-x: auto; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter) .4rem; scrollbar-width: none; } .chip { flex: none; } }

/* Work grouped by type */
.wgroup { padding: clamp(36px, 5vw, 64px) 0 0; scroll-margin-top: 84px; }
.wgroup + .wgroup { margin-top: clamp(16px, 2vw, 24px); border-top: 1px solid var(--line); }
.wgroup h2 { font-size: clamp(1.8rem, 2.8vw, 2.4rem); margin-bottom: 1.6rem; }
a.chip { text-decoration: none; display: inline-block; }

/* Placeholder cover tiles for projects without a picture yet */
.wtile { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.wtile::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0); background-size: 18px 18px; }
.wtile-ico { position: relative; width: 30%; height: auto; max-width: 96px; }
.wtile span { position: absolute; left: 14px; bottom: 12px; font: 600 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.tone-dhow { background: #1A2541; color: #F1EBDD; }
.tone-dhow::before { color: rgba(241,235,221,.18); }
.tone-dhow .wtile-ico { color: #F0B79C; }
.tone-udongo { background: #9C4A2F; color: #F7F3EB; }
.tone-udongo::before { color: rgba(247,243,235,.2); }
.tone-pwani { background: #E8DCC4; color: #1A2541; }
.tone-pwani::before { color: rgba(26,37,65,.14); }
.tone-pwani .wtile-ico { color: #9C4A2F; }
.wtile, .wcard img { transition: transform .5s cubic-bezier(.16,1,.3,1); }
.wcard:hover .wtile, .wcard:hover img { transform: translateY(-3px); }
.wtile { border: 1px solid var(--line); }
