/* ==========================================================================
   Wren — wrenlit.com
   Shared stylesheet. Order: @font-face → tokens → base → type → layout
   → components → utilities → media queries → reduced-motion.
   ========================================================================== */

/* ---- Fonts (self-hosted, latin subset; variable files cover their weights) */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/fonts/newsreader-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/dmmono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens --------------------------------------------------------------- */
:root {
  /* Text — near-neutral (not teal-tinted) */
  --ink:        #1C2521;
  --ink-soft:   #4A544F;
  --ink-faint:  #5E6862;   /* darkened from #6B7570 to pass AA on paper */

  /* Brand */
  --forest:     #14332C;
  --teal:       #1A4038;
  --teal-mid:   #2E6860;
  --teal-light: #6BA898;

  /* Accent */
  --copper:      #8F5A2E;  /* buttons, links (AA for white text) */
  --copper-dark: #7A4D28;  /* button hover — darken, never lighten */
  --copper-lt:   #B07040;  /* decorative only — rules, dots */

  /* Surfaces */
  --paper:      #F3EFE6;
  --paper-alt:  #EAE4D8;
  --field:      #FBF9F3;
  --rule:       rgba(28, 37, 33, 0.12);
  --rule-dark:  rgba(243, 239, 230, 0.16);

  /* Type */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:  'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Space (8px base) */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 40px; --s6: 56px; --s8: 96px;
  --section-y: 96px;

  --container: 1200px;
  --measure: 68ch;
  --radius: 4px;
  --line: 32px;            /* transcript baseline unit */
}
@media (max-width: 640px) { :root { --section-y: 56px; } }

/* ---- Reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--copper); text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--teal-mid);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--forest);
  color: var(--paper);
  padding: var(--s1) var(--s2);
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---- Typography ----------------------------------------------------------- */
h1, h2, h3, .display {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
  letter-spacing: -0.01em;
}
.display { font-size: 56px; line-height: 1.05; }
h1, .h1 { font-size: 44px; line-height: 1.10; }
h2, .h2 { font-size: 32px; line-height: 1.15; }
h3, .h3 { font-size: 21px; line-height: 1.30; font-weight: 500; }
p { line-height: 1.65; }
.small { font-size: 14px; line-height: 1.50; }

.label, .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.40;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--copper);
}
.eyebrow { display: block; margin-bottom: var(--s2); }

/* ---- Layout primitives ---------------------------------------------------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s5);
}
.section { padding-block: var(--section-y); }
.section--alt { background: var(--paper-alt); }
.section--forest { background: var(--forest); color: var(--paper); }
/* forest sections: headings/paragraphs must use light text, not --ink */
.section--forest h1, .section--forest h2, .section--forest h3,
.section--forest .display { color: var(--paper); }
.section--forest p,
.section--forest .section__head p { color: var(--teal-light); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--s3); }
.center { text-align: center; }
.center .prose { margin-inline: auto; }
.lede { font-size: 21px; line-height: 1.5; color: var(--ink-soft); }
.tnum { font-variant-numeric: tabular-nums; }

/* links on the tan panel use teal-mid (copper is on the AA line there) */
.section--alt a:not(.btn) { color: var(--teal-mid); }
/* links on forest */
.section--forest a:not(.btn) { color: var(--teal-light); }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 13px 24px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--copper); color: #fff; border-color: var(--copper); }
.btn--primary:hover { background: var(--copper-dark); border-color: var(--copper-dark); }
.btn--ghost { background: transparent; color: var(--copper); border-color: var(--copper); }
.btn--ghost:hover { background: rgba(143, 90, 46, 0.08); border-color: var(--copper-dark); }
.section--forest .btn--ghost { color: var(--paper); border-color: var(--teal-light); }
.section--forest .btn--ghost:hover { background: rgba(243, 239, 230, 0.08); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s5);
}
.cta-row .phone { font-family: var(--mono); font-size: 15px; color: var(--ink-soft); }
.section--forest .cta-row .phone { color: var(--teal-light); }

/* ---- Header / nav --------------------------------------------------------- */
.site-nav {
  background: var(--forest);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-block: 10px;
}
.site-nav__logo { display: flex; align-items: center; gap: var(--s2); text-decoration: none; }
.site-nav__logo img { height: 40px; width: 40px; }
.site-nav__wordmark {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--paper);
  text-transform: uppercase;
}
.site-nav__menu { display: flex; align-items: center; gap: var(--s5); }
.site-nav__menu a:not(.btn) {
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
  transition: color .18s ease;
}
.site-nav__menu a:not(.btn):hover { color: var(--teal-light); text-decoration: none; }
.site-nav__menu a[aria-current="page"]:not(.btn) { color: var(--teal-light); }
.site-nav :focus-visible { outline-color: var(--teal-light); }

.site-nav__toggle {
  display: none;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  position: relative;
}
.site-nav__toggle .hamburger {
  position: absolute;
  top: 21px; left: 11px; right: 11px; height: 2px;
  background: var(--paper);
  transition: background .2s ease;
}
.site-nav__toggle .hamburger::before,
.site-nav__toggle .hamburger::after {
  content: "";
  position: absolute;
  left: 0; right: 0; height: 2px;
  background: var(--paper);
  transition: transform .2s ease;
}
.site-nav__toggle .hamburger::before { top: -7px; }
.site-nav__toggle .hamburger::after { top: 7px; }
.site-nav__toggle[aria-expanded="true"] .hamburger { background: transparent; }
.site-nav__toggle[aria-expanded="true"] .hamburger::before { top: 0; transform: rotate(45deg); }
.site-nav__toggle[aria-expanded="true"] .hamburger::after { top: 0; transform: rotate(-45deg); }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { background: var(--forest); color: var(--paper); }
.site-footer .container { padding-block: var(--s8); }
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--s6);
}
.site-footer a { color: var(--teal-light); }
.site-footer__wordmark {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.site-footer p { font-size: 15px; color: var(--paper); }
.site-footer .dm-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-light);
  margin-bottom: var(--s2);
}
.site-footer__meta { font-family: var(--mono); font-size: 13px; color: var(--teal-light); }
.site-footer__meta p { color: var(--teal-light); }
.site-footer__meta p + p { margin-top: var(--s1); }
.site-footer__ai { margin-top: var(--s3); max-width: 60ch; }
.site-footer__rule { border: 0; border-top: 1px solid var(--rule-dark); margin-block: var(--s5); }

/* ---- Hero ----------------------------------------------------------------- */
.hero { text-align: center; padding-block: var(--s8); }
.hero .display { max-width: 16ch; margin-inline: auto; }
.hero p { max-width: 54ch; margin: var(--s3) auto 0; font-size: 19px; color: var(--ink-soft); }
.hero .cta-row { justify-content: center; }

/* ---- Three doors ---------------------------------------------------------- */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.door {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.section--alt .door { background: var(--paper); }
.door:hover { border-color: var(--copper-lt); background: var(--field); text-decoration: none; }
.door h3 { color: var(--ink); }
.door p { color: var(--ink-soft); font-size: 15px; }
.door .door__go { margin-top: auto; font-family: var(--mono); font-size: 13px; color: var(--copper); }

/* ---- Generic content grid (what we do, people) ---------------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); }
.stack > * + * { margin-top: var(--s3); }
.feature-row h3 { margin-bottom: var(--s1); }
.feature-row p { color: var(--ink-soft); }

/* rule-separated list (replaces bullet dots / cards) */
.ruled { list-style: none; padding: 0; margin: 0; }
.ruled > li { padding-block: var(--s3); border-top: 1px solid var(--rule); }
.ruled > li:last-child { border-bottom: 1px solid var(--rule); }
.ruled h3 { margin-bottom: var(--s1); }
.ruled p { color: var(--ink-soft); }

/* ---- Signature device: page-and-line transcript -------------------------- */
.transcript {
  --rail-w: 2.75rem;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  column-gap: var(--s3);
  max-width: 64ch;
}
.transcript__rail {
  border-right: 1px solid var(--rule);
  padding-right: var(--s1);
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  line-height: var(--line);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.transcript__rail span { display: block; height: var(--line); }
.transcript__body { padding-left: var(--s1); }
/* every line inside the body rides the 32px baseline so numbers stay level */
.transcript__body :where(p, li, h3, .role) { line-height: var(--line); margin: 0; }
.transcript__body > * + * { margin-top: var(--line); }

.commitments { list-style: none; padding: 0; margin: 0; }
.commitments > li + li { margin-top: var(--line); }
.commitments strong { display: inline; }
.commitments p { color: var(--ink-soft); margin-top: 0; }
.commitments .c-head { color: var(--ink); }

/* /about bios inside the device */
.transcript--bios { max-width: 46rem; }   /* wider so text stays readable beside the 160px portrait */
.bio {
  display: grid;
  grid-template-columns: 160px 1fr;        /* 160 = 5 × --line, keeps the baseline grid intact */
  column-gap: var(--s4);
  align-items: start;
}
.bio + .bio { margin-top: var(--line); }
.bio-portrait {
  width: 160px;
  height: 160px;
  border-radius: var(--radius);            /* square, 4px — not circular */
  display: block;
}
.bio .bio__name { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--ink); }
.bio .role {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.bio p { color: var(--ink-soft); }
.bio a { color: var(--copper); font-family: var(--mono); font-size: 13px; }

/* ---- Rates buckets -------------------------------------------------------- */
.buckets { border-top: 1px solid var(--rule); }
.bucket {
  padding-block: var(--s5);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s5);
}
.bucket h3 { color: var(--ink); }
.bucket p { color: var(--ink-soft); max-width: 60ch; }

/* ---- Forms ---------------------------------------------------------------- */
.form { max-width: 640px; }
.form__cluster { margin-top: var(--s6); }
.form__cluster > .label { display: block; color: var(--copper); margin-bottom: var(--s3); }
.field { margin-bottom: var(--s3); }
.field label,
.fieldset > legend {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: var(--s1);
}
.req { color: var(--copper); }
input, select, textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;                 /* ≥16px avoids iOS zoom */
  color: var(--ink);
  background: var(--field);
  padding: 12px 14px;
  min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal-mid);
  outline-offset: 1px;
  border-color: var(--teal-mid);
}
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: #A23B2E; }
.fieldset { border: 0; padding: 0; margin-bottom: var(--s3); }
.choice {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 4px 0;
  cursor: pointer;
}
.choice input { width: auto; min-height: 0; margin: 0; flex: 0 0 auto; }
.choice span { font-size: 16px; color: var(--ink); }
.form__note { font-size: 14px; color: var(--ink-faint); margin-top: var(--s1); }
.form__actions { margin-top: var(--s5); }
.form__actions .btn { width: 100%; justify-content: center; }
@media (min-width: 560px) { .form__actions .btn { width: auto; } }
.form-intro { max-width: 60ch; color: var(--ink-soft); }
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--copper);
  border: 1px solid var(--copper-lt);
  border-radius: var(--radius);
  padding: 4px 10px;
  margin-bottom: var(--s3);
}
/* visually-hidden honeypot (real element, off-screen, out of AT + tab order) */
.hp {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
  left: -9999px;
}

/* ---- Placeholder token chip ---------------------------------------------- */
.tbd {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--copper);
  border: 1px dashed var(--copper-lt);
  border-radius: var(--radius);
  padding: 0 6px;
  white-space: nowrap;
}

/* ---- People strip (home) -------------------------------------------------- */
.person .person__name { font-family: var(--serif); font-size: 21px; color: var(--ink); }
.person .role {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); margin: var(--s1) 0;
}
.person p { color: var(--ink-soft); font-size: 15px; }

/* ---- Section heading block ------------------------------------------------ */
.section__head { max-width: var(--measure); margin-bottom: var(--s6); }
.section__head.center { margin-inline: auto; }
.section__head p { color: var(--ink-soft); margin-top: var(--s2); }

/* ---- Small utilities ------------------------------------------------------ */
.mt-1 { margin-top: var(--s1); }
.mt-2 { margin-top: var(--s2); }
.mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); }
.mt-5 { margin-top: var(--s5); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.maxw { max-width: var(--measure); }
.site-footer__links p + p { margin-top: var(--s1); }
.site-footer__grid p + p { margin-top: var(--s1); }
.site-footer__coverage { max-width: 34ch; }

/* ---- Motion --------------------------------------------------------------- */
html { scroll-behavior: smooth; }
.fade-in { animation: fade-in .5s ease both; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .doors { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; gap: var(--s5); }
  .site-footer__grid { grid-template-columns: 1fr; gap: var(--s5); }
  .bucket { grid-template-columns: 1fr; gap: var(--s2); }
}
@media (max-width: 768px) {
  .site-nav__toggle { display: block; }
  .site-nav__menu {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--forest);
    padding: var(--s2) var(--s5) var(--s5);
    border-top: 1px solid var(--rule-dark);
  }
  .site-nav__menu[data-open="true"] { display: flex; }
  .site-nav__menu a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--rule-dark); }
  .site-nav__menu .btn { margin-top: var(--s3); justify-content: center; }
}
@media (max-width: 640px) {
  .container { padding-inline: var(--s3); }
  .display { font-size: clamp(28px, 7.4vw, 48px); }
  h1, .h1 { font-size: clamp(26px, 6.6vw, 44px); }
  h2, .h2 { font-size: 25px; }
  .hero { padding-block: var(--s6); }
  .hero p { font-size: 17px; }
  .hide-mobile { display: none; }
}
@media (max-width: 599px) {
  .transcript { grid-template-columns: 1fr; column-gap: 0; }
  .transcript__rail { display: none; }
  .transcript__body { border-left: 1px solid var(--rule); padding-left: var(--s3); }
  /* portrait stacks above the name, same size, left-aligned */
  .bio { grid-template-columns: 1fr; }
  .bio-portrait { margin-bottom: var(--s2); }
}

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