/* Layout concept: warm and personal. A big rounded portrait leads the hero, soft tinted
   section grounds alternate with one solid brand band, and everything is rounded and friendly.
   Three palettes, switched by data-palette on <html>. Single light theme by design. */
:root,
:root[data-palette="harbour"] {
  --ground: #fbf9f5;      /* page */
  --tint: #f1ede5;        /* soft section ground */
  --tint-2: #e6efef;      /* hero wash */
  --ink: #1d2b30;         /* text */
  --muted: #5b676b;
  --line: #e2ddd3;
  --brand: #0f4c5c;       /* deep harbour teal: band, buttons */
  --on-brand: #fbf9f5;
  --accent: #e09f3e;      /* warm amber */
  --accent-ink: #9a6418;  /* amber dark enough for text */
  --card: #ffffff;
}
:root[data-palette="kawakawa"] {
  --ground: #fcfcf9; --tint: #f1f5ee; --tint-2: #eaf2e5; --ink: #27332b; --muted: #5f6b62; --line: #e1e8dc;
  --brand: #3d6b4f; --on-brand: #ffffff; --accent: #d9783f; --accent-ink: #a8531f; --card: #ffffff;
  --band: #e3eedc; --band-ink: #27332b;
}
:root[data-palette="kowhai"] {
  --ground: #fcfbf8; --tint: #f6f1e4; --tint-2: #fbf1d4; --ink: #2a2620; --muted: #6a6359; --line: #e9e2d2;
  --brand: #2f2a24; --on-brand: #fcfbf8; --accent: #e8b023; --accent-ink: #8f6a06; --card: #ffffff;
}
:root {
  --display: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --r-lg: 24px; --r-md: 16px; --r-pill: 999px;
  --wide: 70rem;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 1.125rem; line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.stack { display: grid; gap: 1.1rem; }
.label { font-family: var(--display); font-weight: 700; font-size: 0.95rem; color: var(--accent-ink); letter-spacing: 0; }
.mark { color: var(--brand); }

/* Header */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; padding-block: 0.9rem; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.2rem; text-decoration: none; display: flex; align-items: center; gap: 0.55rem; }
.brand .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 1.2rem; font-family: var(--display); font-weight: 600; font-size: 0.97rem; }
.nav a { text-decoration: none; padding-block: 0.3rem; }
.nav a:hover { color: var(--brand); }
.nav a[aria-current="page"] { color: var(--brand); box-shadow: inset 0 -2px 0 var(--accent); }
.nav a.nav-cta { background: var(--brand); color: var(--on-brand); padding: 0.5rem 1rem; border-radius: var(--r-pill); box-shadow: none; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { font-family: var(--display); font-weight: 700; font-size: 1rem; text-decoration: none; padding: 0.85rem 1.4rem; border-radius: var(--r-pill); border: 2px solid var(--brand); display: inline-block; transition: transform .15s ease, background .15s ease; }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { color: var(--brand); background: transparent; }
.btn.ghost:hover { background: var(--card); }

/* Hero */
.hero { overflow: hidden; background: linear-gradient(180deg, var(--tint-2) 0%, var(--ground) 100%); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3.5rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero .stack { gap: 1.4rem; }
.hero .lede { font-size: 1.22rem; color: var(--ink); max-width: 34rem; }
.hero-photo { position: relative; justify-self: center; width: 100%; max-width: 440px; }
.hero-photo::before { content: ""; position: absolute; inset: 7% -6% -5% 9%; background: var(--accent); opacity: .28; border-radius: var(--r-lg); transform: rotate(3deg); }
.hero-photo img { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: var(--r-lg); box-shadow: 0 20px 40px -24px rgba(20, 30, 30, .45); }
.hero-photo .tag { position: absolute; left: -1rem; bottom: 1.5rem; background: var(--card); border-radius: var(--r-md); padding: 0.8rem 1rem; box-shadow: 0 12px 30px -16px rgba(20, 30, 30, .4); display: grid; gap: 0.1rem; max-width: 15rem; }
.hero-photo .tag strong { font-family: var(--display); font-weight: 800; font-size: 1rem; }
.hero-photo .tag span { font-size: 0.9rem; color: var(--muted); line-height: 1.35; }

/* Brand band */
.band-brand { background: var(--band, var(--brand)); color: var(--band-ink, var(--on-brand)); }
.band-brand .wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2.5rem; padding-block: 2.5rem; }
.stat { display: grid; gap: 0.25rem; }
.stat strong { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: 1rem; line-height: 1.45; color: var(--muted); }
@media (max-width: 720px) { .band-brand .wrap { grid-template-columns: minmax(0, 1fr); } }

/* Sections */
section.band { padding-block: clamp(3rem, 7vw, 5rem); }
section.band.alt { background: var(--tint); }
.section-head { display: grid; gap: 0.5rem; margin-bottom: 2.25rem; max-width: 44rem; }
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.item { display: grid; gap: 0.6rem; align-content: start; background: var(--card); border-radius: var(--r-lg); padding: 1.6rem; border: 1px solid var(--line); }
.alt .item { border-color: transparent; }
.item p { color: var(--muted); }
.item .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--tint-2); color: var(--brand); display: grid; place-items: center; font-family: var(--display); font-weight: 800; }
.item .icon svg { width: 22px; height: 22px; }
.item a.more { font-family: var(--display); font-weight: 700; font-size: 0.95rem; color: var(--brand); text-decoration: none; }
.item a.more::after { content: " →"; }

/* Sequence */
.sequence { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; counter-reset: step; }
.sequence li { counter-increment: step; display: grid; gap: 0.35rem; align-content: start; background: var(--card); border-radius: var(--r-md); padding: 1.2rem; }
.sequence li::before { content: "0" counter(step); font-family: var(--display); font-weight: 800; font-size: 0.95rem; color: var(--accent-ink); }
.sequence li strong { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.sequence li span { font-size: 0.97rem; color: var(--muted); line-height: 1.45; }
.loop { margin-top: 1.25rem; display: flex; gap: 0.75rem; align-items: center; color: var(--muted); font-size: 1rem; }
.loop svg { flex: none; width: 34px; height: 24px; color: var(--accent-ink); }
@media (max-width: 860px) { .sequence { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .sequence { grid-template-columns: minmax(0, 1fr); } }

/* Meet Ben */
.meet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.meet img { width: 100%; aspect-ratio: 6 / 5; object-fit: cover; object-position: 40% 30%; border-radius: var(--r-lg); }
.pull { margin: 0.5rem 0 0; padding: 1.2rem 1.4rem; background: var(--tint); border-radius: var(--r-md); font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1.4; color: var(--brand); }
.alt .pull { background: var(--card); }
@media (max-width: 820px) { .meet { grid-template-columns: minmax(0, 1fr); gap: 2rem; } }

/* Facts list */
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.facts li { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1.25rem; padding: 1rem 1.2rem; background: var(--card); border-radius: var(--r-md); }
.facts .when { font-family: var(--display); font-weight: 800; color: var(--accent-ink); font-size: 0.95rem; padding-top: 0.15rem; }
@media (max-width: 560px) { .facts li { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; } }

/* Quotes */
.quotes { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); margin-top: 2rem; }
blockquote { margin: 0; padding: 1.5rem; border-radius: var(--r-lg); background: var(--card); }
blockquote p { font-size: 1.1rem; }
blockquote footer { margin-top: 0.75rem; font-family: var(--display); font-weight: 700; font-size: 0.92rem; color: var(--muted); }

/* Draft-only markers */
.todo { border: 2px dashed var(--accent); background: transparent !important; color: var(--muted); }
.draft [data-confirm] { box-shadow: inset 0 -2px 0 var(--accent); }
.draft-bar { background: var(--ink); color: var(--ground); font-size: 0.85rem; text-align: center; padding: 0.5rem 1rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem 1rem; }
.draft-bar button { font: inherit; font-weight: 700; border: 1.5px solid currentColor; background: transparent; color: inherit; border-radius: var(--r-pill); padding: 0.2rem 0.8rem; cursor: pointer; }
.draft-bar button[aria-pressed="true"] { background: var(--ground); color: var(--ink); }

/* CTA band */
.cta-band { background: var(--brand); color: var(--on-brand); border-radius: var(--r-lg); padding: clamp(2rem, 5vw, 3rem); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 2rem; align-items: center; }
.cta-band h2 { color: var(--on-brand); }
.cta-band p { opacity: .9; margin-top: 0.5rem; }
.cta-band .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
@media (max-width: 720px) { .cta-band { grid-template-columns: minmax(0, 1fr); } }

/* Page intro */
.page-intro { background: linear-gradient(180deg, var(--tint-2) 0%, var(--ground) 100%); }
.page-intro .wrap { padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); display: grid; gap: 1rem; }
.page-intro .lede { font-size: 1.22rem; max-width: 42rem; }

/* Long-form */
.prose { max-width: 40rem; display: grid; gap: 1.1rem; }
.prose h2 { margin-top: 1.25rem; font-size: 1.6rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.prose li::marker { color: var(--accent-ink); }

.service { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1.5rem 3rem; padding: 2rem; margin-bottom: 1.25rem; background: var(--card); border-radius: var(--r-lg); border: 1px solid var(--line); }
.service .side { display: grid; gap: 0.5rem; align-content: start; }
.service h2 { font-size: 1.6rem; }
.service dl { margin: 0; display: grid; gap: 1.1rem; }
.service dt { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--brand); }
.service dd { margin: 0.2rem 0 0; }
@media (max-width: 760px) { .service { grid-template-columns: minmax(0, 1fr); padding: 1.4rem; } }

/* FAQ */
.faq { display: grid; gap: 0.75rem; max-width: 48rem; }
.faq details { background: var(--card); border-radius: var(--r-md); border: 1px solid var(--line); padding-inline: 1.3rem; }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2.25rem 1.1rem 0; position: relative; font-family: var(--display); font-weight: 700; font-size: 1.12rem; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 0.95rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--tint-2); color: var(--brand); display: grid; place-items: center; font-weight: 800; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding-bottom: 1.3rem; display: grid; gap: 0.8rem; }
.faq .answer p:first-child { font-weight: 700; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 3rem; align-items: start; }
.portrait { width: 100%; max-width: 20rem; border-radius: var(--r-lg); overflow: hidden; background: var(--tint); aspect-ratio: 4 / 5; display: grid; place-items: center; font-family: var(--display); font-size: 3rem; color: var(--muted); position: sticky; top: 6rem; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
@media (max-width: 760px) { .about-grid { grid-template-columns: minmax(0, 1fr); } .portrait { max-width: 14rem; position: static; } }

/* Writing */
.articles { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.articles li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.25rem; padding: 1.1rem 1.3rem; background: var(--card); border-radius: var(--r-md); border: 1px solid var(--line); }
.alt .articles li { border-color: transparent; }
.articles time { font-family: var(--display); font-weight: 700; font-size: 0.85rem; color: var(--accent-ink); padding-top: 0.25rem; }
.articles h3 { font-size: 1.15rem; }
.articles p { color: var(--muted); font-size: 1rem; margin-top: 0.25rem; }
@media (max-width: 560px) { .articles li { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; } }

/* Contact */
.contact-card { display: grid; gap: 1.1rem; max-width: 36rem; padding: 1.8rem; background: var(--card); border-radius: var(--r-lg); border: 1px solid var(--line); }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; }
.contact-row .label { min-width: 5rem; }
.contact-row .value { font-family: var(--display); font-size: 1.3rem; font-weight: 800; user-select: all; overflow-wrap: anywhere; }
.copy { font-family: var(--display); font-size: 0.9rem; font-weight: 700; background: var(--tint-2); color: var(--brand); border: 0; border-radius: var(--r-pill); padding: 0.4rem 0.9rem; cursor: pointer; }

/* Footer */
.site-foot { background: var(--tint); color: var(--muted); border-top: 1px solid var(--line); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-block: 2rem 2.5rem; font-size: 0.95rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-family: var(--display); font-weight: 600; }
.site-foot a { text-decoration: none; opacity: .9; }
.site-foot a:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .hero-photo { max-width: 340px; justify-self: start; }
  .hero-photo .tag { left: auto; right: -0.5rem; }
}

/* Articles */
.q { font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--accent-ink); max-width: 42rem; }
.page-intro .label a { text-decoration: none; }
.article-wrap { display: grid; gap: 2rem; padding-bottom: 4rem; }
.article-wrap > * { max-width: 46rem; }
.in-short { background: var(--tint-2); border-radius: var(--r-md); padding: 1.3rem 1.5rem; display: grid; gap: 0.4rem; }
.in-short p:last-child { font-size: 1.1rem; }
.article-body { max-width: none; }
.article-body h2 { font-size: 1.45rem; margin-top: 1.5rem; }
.article-body ul, .article-body ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.5rem; }
.article-body a { color: var(--brand); }
.art-note { color: var(--muted); font-size: 0.95rem; font-style: italic; }
.author-card { display: flex; gap: 1.2rem; align-items: flex-start; padding: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.author-card img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; flex: none; }
.author-card div { display: grid; gap: 0.9rem; min-width: 0; }
.author-card .btn { margin: 0.2rem 0.4rem 0 0; }
.featured { display: grid; gap: 0.6rem; text-decoration: none; background: var(--brand); color: var(--on-brand); border-radius: var(--r-lg); padding: clamp(1.5rem, 4vw, 2.25rem); transition: transform .15s ease; }
.featured:hover { transform: translateY(-2px); }
.featured .label { color: var(--accent); opacity: 1; }
.featured h3 { color: var(--on-brand); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
.featured .q { color: color-mix(in srgb, var(--on-brand) 85%, var(--accent)); font-size: 1.05rem; }
.featured p { opacity: .92; }
.featured .more { font-family: var(--display); font-weight: 700; color: var(--accent); }
.featured .more::after { content: " →"; }
.articles h3 a { text-decoration: none; }
.articles h3 a:hover { color: var(--brand); text-decoration: underline; }
@media (max-width: 560px) { .author-card { flex-direction: column; } }
.core-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.core-grid .core-card { display: grid; gap: 0.55rem; align-content: start; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--r-lg); padding: 1.5rem; transition: transform .15s ease; }
.alt .core-grid .core-card { border-color: transparent; border-top-color: var(--brand); }
.core-card:hover { transform: translateY(-2px); }
.core-card h3 { font-size: 1.25rem; }
.core-card .q { font-size: 1rem; }
.core-card p:not(.q) { color: var(--muted); font-size: 1rem; }
.core-card .more { font-family: var(--display); font-weight: 700; color: var(--brand); font-size: 0.95rem; }
.core-card .more::after { content: " →"; }
.podcast { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 2rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.6rem; }
.pod-text { display: grid; gap: 0.6rem; }
.pod-text h3 { font-size: 1.3rem; }
.pod-text p:not(.label) { color: var(--muted); }
.pod-actions .btn { margin: 0.3rem 0.4rem 0 0; }
.pod-embed { width: 100%; height: 152px; border: 0; border-radius: 12px; }
@media (max-width: 760px) { .podcast { grid-template-columns: minmax(0, 1fr); } }

.article-image { margin: 0 0 1.75rem; }
.article-image img { display: block; width: 100%; height: auto; border-radius: 12px; }
.site-foot .privacy-note { font-size: 0.8rem; opacity: 0.75; margin-top: 0.75rem; }
