/* ==========================================================================
   The Inner Journey — design system
   Editorial serif for headings, humanist sans for body, one accent colour.
   ========================================================================== */

:root {
  /* Palette — ivory paper, ink text, one deep-green accent */
  --bg: #f7f3ec;
  --bg-2: #efe9de;
  --bg-3: #e6dfd1;
  --ink: #1f1c18;
  --ink-2: #4a453d;
  --muted: #7a7469;
  --line: rgba(31, 28, 24, 0.12);
  --accent: #2f4f3e;
  --accent-ink: #21382c;
  --accent-soft: rgba(47, 79, 62, 0.08);
  --paper: #fffdf9;

  /* Type */
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;

  --fs-0: 0.875rem;
  --fs-1: 1rem;
  --fs-2: 1.125rem;
  --fs-3: 1.375rem;
  --fs-4: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  --fs-5: clamp(2rem, 1.4rem + 2.4vw, 3.4rem);
  --fs-6: clamp(2.4rem, 1.6rem + 3.6vw, 4.6rem);

  /* Space */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;
  --s-6: clamp(4rem, 3rem + 5vw, 8rem);

  --measure: 62ch;
  --wrap: 72rem;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171512;
    --bg-2: #1f1c18;
    --bg-3: #29251f;
    --ink: #ece6da;
    --ink-2: #c9c1b3;
    --muted: #918a7c;
    --line: rgba(236, 230, 218, 0.14);
    --accent: #9fc2ad;
    --accent-ink: #bcd8c7;
    --accent-soft: rgba(159, 194, 173, 0.1);
    --paper: #1c1916;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-2);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2);
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-6); font-variation-settings: "opsz" 144, "SOFT" 30; }
h2 { font-size: var(--fs-5); font-variation-settings: "opsz" 96; }
h3 { font-size: var(--fs-4); font-variation-settings: "opsz" 48; }
h4 { font-size: var(--fs-3); }

p { margin: 0 0 var(--s-2); max-width: var(--measure); }
p.lede { font-size: var(--fs-3); line-height: 1.5; color: var(--ink-2); }
strong { font-weight: 600; }
em { font-style: italic; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.2em; margin: 0 0 var(--s-2); }
li { margin-bottom: var(--s-1); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-5) 0; }
::selection { background: var(--accent); color: var(--bg); }

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

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2rem, 46rem); margin-inline: auto; }
.section { padding-block: var(--s-6); }
.section--tight { padding-block: var(--s-5); }
.section--alt { background: var(--bg-2); }
.section--paper { background: var(--paper); border-block: 1px solid var(--line); }

/* Kicker → title → lede : the repeated rhythm of every section */
.kicker {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--fs-0);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-2);
}
.section-head { max-width: 40rem; margin-bottom: var(--s-4); }
.section-head p { color: var(--ink-2); }

.grid { display: grid; gap: var(--s-3); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.split { display: grid; gap: var(--s-4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 52rem) {
  .split { grid-template-columns: 5fr 7fr; gap: var(--s-5); }
  .split--reverse { grid-template-columns: 7fr 5fr; }
  .split > .sticky { position: sticky; top: 6rem; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.85em 1.4em;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--sans);
  font-size: var(--fs-1);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--bg); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn--sm { padding: 0.6em 1em; font-size: var(--fs-0); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.btn-note { font-size: var(--fs-0); color: var(--muted); margin: var(--s-2) 0 0; }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; gap: var(--s-2); }
.logo {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  font-variation-settings: "opsz" 32;
}
.logo em { font-style: italic; font-weight: 400; color: var(--accent); }
.nav { display: flex; align-items: center; gap: var(--s-3); }
.nav a { font-size: var(--fs-1); color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.35em; text-decoration-color: var(--accent); }
.nav a.btn { color: var(--bg); }
.nav a.btn:hover { color: var(--bg); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5em 0.8em; color: var(--ink); font: inherit; font-size: var(--fs-0); }
@media (max-width: 47.99rem) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: var(--s-2);
    padding: var(--s-3) 1rem var(--s-4);
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding-block: var(--s-6) var(--s-6); position: relative; overflow: hidden; }
.hero .wrap { max-width: 56rem; }
.hero h1 { max-width: 16ch; margin-bottom: var(--s-3); }
.hero .lede { max-width: 48ch; margin-bottom: var(--s-4); }
.hero-mark {
  position: absolute; right: -6rem; top: -4rem; width: 26rem; height: 26rem;
  border-radius: 50%; border: 1px solid var(--line); opacity: 0.7; pointer-events: none;
}
.hero-mark::after {
  content: ""; position: absolute; inset: 3.5rem; border-radius: 50%; border: 1px solid var(--line);
}
.page-hero { padding-block: var(--s-5) var(--s-4); }
.page-hero h1 { max-width: 20ch; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-1);
}
.card h3 { font-size: var(--fs-3); margin-bottom: 0.25rem; }
.card p { font-size: var(--fs-1); color: var(--ink-2); margin: 0; }
.card .card-foot { margin-top: auto; padding-top: var(--s-2); }
.card--quiet { background: transparent; border-color: transparent; border-top: 1px solid var(--line); border-radius: 0; padding-inline: 0; }
.card .num {
  font-family: var(--serif); font-size: var(--fs-3); color: var(--accent); font-style: italic;
}

/* Offer cards */
.offer { padding: var(--s-4) var(--s-3); }
.offer .meta { font-size: var(--fs-0); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.offer h3 { font-size: var(--fs-4); }
.offer ul { margin: var(--s-2) 0; padding-left: 1.1em; font-size: var(--fs-1); color: var(--ink-2); }
.offer--featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Lenses — the four frames */
.lens { border-top: 1px solid var(--line); padding-top: var(--s-2); }
.lens h3 { font-size: var(--fs-3); }
.lens p { font-size: var(--fs-1); color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Testimonials
   -------------------------------------------------------------------------- */
.quote {
  border-left: 2px solid var(--accent);
  padding: var(--s-1) 0 var(--s-1) var(--s-3);
  margin: 0;
}
.quote p {
  font-family: var(--serif); font-size: var(--fs-3); line-height: 1.4;
  font-variation-settings: "opsz" 24; color: var(--ink);
  margin-bottom: var(--s-2); max-width: 36ch;
}
.quote footer { font-size: var(--fs-0); color: var(--muted); }
.quote footer strong { color: var(--ink-2); font-weight: 500; }
.quote--sm p { font-size: var(--fs-2); }
.proof-line { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: baseline; color: var(--muted); font-size: var(--fs-0); }
.proof-line .big { font-family: var(--serif); font-size: var(--fs-4); color: var(--ink); line-height: 1; }
.quote-wall { columns: 1; column-gap: var(--s-4); }
@media (min-width: 52rem) { .quote-wall { columns: 2; } }
.quote-wall .quote { break-inside: avoid; margin-bottom: var(--s-4); }

/* Credentials strip */
.creds { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); font-size: var(--fs-0); color: var(--muted); padding: 0; margin: 0; list-style: none; }
.creds li::before { content: "·"; margin-right: 0.6em; color: var(--accent); }
.creds li:first-child::before { content: none; }

/* --------------------------------------------------------------------------
   Portrait
   -------------------------------------------------------------------------- */
.portrait { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; filter: saturate(0.85) contrast(1.02); background: var(--bg-3); }
.portrait--round { aspect-ratio: 1; border-radius: 50%; width: 9rem; }
.caption { font-size: var(--fs-0); color: var(--muted); margin-top: var(--s-1); }

/* --------------------------------------------------------------------------
   Letters block
   -------------------------------------------------------------------------- */
.letters {
  background: var(--ink); color: var(--bg);
}
.letters .kicker { color: #9fc2ad; }
@media (prefers-color-scheme: dark) { .letters { background: var(--bg-3); color: var(--ink); } }
.letters h2, .letters h3 { color: inherit; }
.letters p { color: inherit; opacity: 0.85; }
.letters .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.letters .btn:hover { background: var(--bg-2); }
.letters .btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.letters .btn--ghost:hover { background: rgba(255,255,255,0.08); }
.letters-list { list-style: none; padding: 0; margin: 0; }
.letters-list li { border-top: 1px solid rgba(255,255,255,0.15); padding: var(--s-2) 0; margin: 0; display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-1); }
.letters-list li span:last-child { opacity: 0.6; white-space: nowrap; font-size: var(--fs-0); }
.letters-list a { color: inherit; text-decoration: none; }
.letters-list a:hover { text-decoration: underline; }
.letters-list--light li { border-top-color: var(--line); }
.letters-list--light li:last-child { border-bottom: 1px solid var(--line); }
.letters-list--light a { color: var(--ink); }

/* Substack cards (rendered by assets/letters-cards.js) */
.letter-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.letter-card {
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink);
  transition: transform 160ms ease, border-color 160ms ease;
}
.letter-card:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--ink); }
.letter-card__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; filter: saturate(0.8); background: var(--bg-3); }
.letter-card__img--empty { background: linear-gradient(135deg, var(--bg-2), var(--bg-3)); }
.letter-card__body { padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-1); flex: 1; }
.letter-card__date { font-size: var(--fs-0); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.letter-card__title { font-size: var(--fs-3); margin: 0; }
.letter-card__sub { font-size: var(--fs-1); color: var(--ink-2); margin: 0; }
.letter-card__more { margin-top: auto; padding-top: var(--s-2); font-size: var(--fs-0); color: var(--accent); }
.letters .letter-card { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); color: inherit; }
.letters .letter-card:hover { border-color: rgba(255,255,255,0.4); color: inherit; }
.letters .letter-card__title { color: inherit; }
.letters .letter-card__sub { color: inherit; opacity: 0.75; }
.letters .letter-card__more { color: #9fc2ad; }
.letters .letter-card__date { color: inherit; opacity: 0.6; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
details { border-top: 1px solid var(--line); padding: var(--s-2) 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-family: var(--serif); font-size: var(--fs-3); list-style: none; display: flex; justify-content: space-between; gap: var(--s-2); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-family: var(--sans); flex: none; }
details[open] summary::after { content: "–"; }
details p { margin-top: var(--s-2); color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Prose (long-form pages)
   -------------------------------------------------------------------------- */
.prose h2 { margin-top: var(--s-5); font-size: var(--fs-4); }
.prose h3 { margin-top: var(--s-4); }
.prose p { font-size: var(--fs-2); }
.prose .pull { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.25; color: var(--accent-ink); margin-block: var(--s-4); max-width: 30ch; }
@media (prefers-color-scheme: dark) { .prose .pull { color: var(--accent); } }

/* --------------------------------------------------------------------------
   Final CTA
   -------------------------------------------------------------------------- */
.cta-final { text-align: left; }
.cta-final h2 { max-width: 18ch; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-5) var(--s-4); font-size: var(--fs-0); color: var(--muted); }
.site-footer .cols { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-bottom: var(--s-4); }
.site-footer h4 { font-family: var(--sans); font-size: var(--fs-0); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: var(--s-2); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); border-top: 1px solid var(--line); padding-top: var(--s-3); }

/* --------------------------------------------------------------------------
   Reveal on scroll — gentle fade only, honours reduced motion
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.muted { color: var(--muted); }
.small { font-size: var(--fs-0); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.max-measure { max-width: var(--measure); }

/* --------------------------------------------------------------------------
   Essays
   -------------------------------------------------------------------------- */
.article-meta { font-size: var(--fs-0); color: var(--muted); margin-top: var(--s-2); }
.article-body { padding-block: var(--s-4) var(--s-3); }
.article-body p { font-size: 1.2rem; line-height: 1.7; }
.article-body h2 { font-size: var(--fs-3); margin-top: var(--s-5); }
.article-foot { padding-bottom: var(--s-6); }
.cta-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-4) var(--s-3); margin-top: var(--s-3); }
.cta-box h3 { font-size: var(--fs-4); margin-bottom: var(--s-3); max-width: 22ch; }
.essay-list { display: flex; flex-direction: column; }
.essay-row { display: block; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); padding: var(--s-4) 0; }
.essay-row:last-child { border-bottom: 1px solid var(--line); }
.essay-row:hover { color: var(--ink); }
.essay-row:hover .essay-row__title { color: var(--accent); }
.essay-row__meta { font-size: var(--fs-0); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.essay-row__title { font-size: var(--fs-4); margin: var(--s-1) 0; transition: color 160ms ease; }
.essay-row__dek { color: var(--ink-2); margin: 0; }
.essay-upcoming { list-style: none; padding: 0; margin: var(--s-3) 0 0; }
.essay-upcoming li { font-family: var(--serif); font-size: var(--fs-3); border-top: 1px solid var(--line); padding: var(--s-2) 0; margin: 0; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Work with me v3: offers, principles, placeholders, contact form
   -------------------------------------------------------------------------- */
.offer__tag { font-family: var(--serif); font-style: italic; font-size: var(--fs-2); color: var(--ink) !important; margin-bottom: var(--s-2) !important; }
.offer p + p { margin-top: var(--s-1) !important; }
.offer__price { font-family: var(--serif); font-size: var(--fs-3); color: var(--ink) !important; margin-bottom: var(--s-1) !important; }
#principles .card--quiet h3 { font-size: var(--fs-3); }
#principles .card--quiet h3 em { font-style: italic; }
.prose .placeholder, .placeholder {
  font-family: var(--sans); font-size: var(--fs-1); line-height: 1.5;
  background: #fff3c4; color: #6b4e00; border: 1px dashed #c9a227;
  padding: var(--s-2); border-radius: var(--radius); max-width: var(--measure);
}
.placeholder--inline { display: inline; padding: 0.1em 0.4em; font-size: var(--fs-0); }
@media (prefers-color-scheme: dark) { .placeholder { background: #3a2f00; color: #ffe08a; border-color: #8a6d00; } }

.contact-form { gap: 0; }
.contact-form .field { margin-bottom: var(--s-3); }
.contact-form__row { display: grid; gap: 0 var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.contact-form label { display: block; font-size: var(--fs-0); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-1); }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; box-sizing: border-box;
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7em 0.9em;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-form textarea { resize: vertical; }
.contact-form .field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .btn-row { margin-top: var(--s-1); }
.form-status { min-height: 1.5em; font-size: var(--fs-1); color: var(--ink-2); margin: var(--s-2) 0 0; }
.form-status.is-ok { color: var(--accent-ink); }
.form-status.is-error { color: #a33; }
@media (prefers-color-scheme: dark) { .form-status.is-ok { color: var(--accent); } }
.grid--2-strict { grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
@media (min-width: 52rem) { .grid--2-strict { grid-template-columns: 1fr 1fr; } }
.pull { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.25; color: var(--accent-ink); max-width: 30ch; }
@media (prefers-color-scheme: dark) { .pull { color: var(--accent); } }
details summary .placeholder--inline { margin-left: 0.5em; vertical-align: middle; }
