/* ---------- SHARED SITE STYLES ----------
   Tokens, reset, nav, footer, section-head, and tag pills used across every
   page. Homepage-only styles (hero, work list, contact form, tweaks panel,
   etc.) stay inline in index.html. Page-specific styles (article cards,
   article body typography) stay inline on their own pages. */

/* Cross-document view transitions between same-origin pages (Chromium today,
   no-op elsewhere). Paired with speculation-rules prerendering so
   navigation feels instant instead of a hard page flash. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .22s;
  animation-timing-function: ease-out;
}

:root {
  /* accent — defaults set by tweak */
  --accent: #d1491e;
  --accent-deep: #8f2f12;
  --accent-soft: #fbe9df;
  --accent-ink: #ffffff;

  --ink: #111111;
  --ink-2: #2a2a2a;
  --muted: #6b6b6b;
  --muted-2: #a0a0a0;
  --rule: #e6e4e0;
  --rule-strong: #1a1a1a;
  --bg: #f7f4ee;           /* warm cream */
  --card: #ffffff;
  --max: 1240px;

  /* Brand palette — used site-wide alongside --accent */
  --brand-coral: #f47759;  /* Offcall */
  --brand-coral-deep: #c84b2e;
  --brand-coral-soft: #fde8e0;
  --brand-mint: #1bb193;   /* MDCalc */
  --brand-mint-deep: #0f7a65;
  --brand-mint-soft: #d9f1ea;
  --brand-blue: #1e3a5f;   /* anchor */
  --brand-blue-deep: #0f2440;
  --brand-blue-soft: #e2ebf4;

  --sans: "Inter", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, #ffffff);
  outline-offset: 4px;
}
::selection { background: var(--accent); color: #fff; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 4px;
  transform: translateY(-140%);
  transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- NAV ---------- */
nav.site {
  view-transition-name: site-nav;
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
nav.site .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
nav.site .brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
  display: flex; align-items: center; gap: 12px;
}
nav.site .brand .mark {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  overflow: hidden;
}
nav.site .brand .mark svg { display: block; width: 100%; height: 100%; }
nav.site ul { display: flex; gap: 32px; list-style: none; align-items: center; }
nav.site ul a {
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  position: relative;
  padding: 6px 0;
}
nav.site ul a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .2s;
}
nav.site ul a:hover::after { transform: scaleX(1); }
nav.site ul a.current { color: var(--ink); }
nav.site ul a.current::after { transform: scaleX(1); }
nav.site .cta {
  font-size: 14px; font-weight: 500;
  padding: 10px 18px;
  background: var(--ink); color: #fff;
  border-radius: 4px;
  transition: background .2s;
}
nav.site .cta:hover { background: var(--accent); }
nav.site .cta::after { display: none; }
nav.site .cta.current { color: #fff; } /* .current sets a dark text color; the CTA pill always needs white regardless */
nav.site .mobile-contact { display: none; }

/* ---------- SECTIONS (generic) ---------- */
section { padding: 112px 0; border-bottom: 1px solid var(--rule); position: relative; }
.section-head {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  margin-bottom: 64px;
  align-items: start;
}
.section-head .marker {
  display: flex; flex-direction: column; gap: 12px;
}
.section-head .marker .icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--icon-soft, var(--accent-soft));
  color: var(--icon-deep, var(--accent-deep));
  border-radius: 50%;
  margin-bottom: 4px;
  transition: transform .3s cubic-bezier(.4,1.4,.6,1);
}
.section-head .marker .icon svg { width: 28px; height: 28px; }
.section-head:hover .marker .icon { transform: rotate(-8deg) scale(1.05); }
.section-head .marker .big {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 84px;
  line-height: .85;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.section-head .marker .label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.section-head h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 22ch;
  text-wrap: balance;
}
.section-head h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* Generic category tag pill, colored by type */
.tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}
.tag.cat-product  { background: var(--brand-mint-soft);  color: var(--brand-mint-deep); }
.tag.cat-writing  { background: var(--brand-coral-soft); color: var(--brand-coral-deep); }
.tag.cat-policy   { background: var(--brand-blue-soft);  color: var(--brand-blue-deep); }
.tag.cat-advocacy { background: #f0ede6; color: var(--ink); border: 1px solid var(--rule); }

/* ---------- FOOTER ---------- */
footer {
  view-transition-name: site-footer;
  padding: 56px 0 40px;
  font-size: 13px;
  color: var(--muted);
}
footer .row {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
footer a:hover { color: var(--accent); }
footer .social { display: flex; gap: 24px; }
footer .sig {
  font-family: var(--serif); font-style: italic;
  font-size: 28px;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
footer .sig .dash { color: var(--accent); }
footer .signature {
  margin: 8px 0 20px;
  max-width: 180px;
}
footer .signature svg { width: 100%; height: auto; display: block; }

/* responsive */
@media (max-width: 960px) {
  .container { padding: 0 20px; }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .section-head .marker .big { font-size: 56px; }
  nav.site .inner { height: 64px; }
  nav.site ul { display: none; }
  nav.site .mobile-contact {
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    background: var(--ink);
    color: #fff;
    border-radius: 4px;
  }
  section { padding: 72px 0; }
}

@media (max-width: 520px) {
  nav.site .brand span:last-child { max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
