/* ==========================================================================
   Sparsh Goel, Advocate — design system
   Warm paper + ink, brass accent. Serif display (Newsreader) / Inter UI.
   ========================================================================== */

:root {
  --paper:        #fbf9f5;
  --paper-2:      #f4f0e8;
  --surface:      #ffffff;
  --surface-2:    #fdfcfa;
  --ink:          #14181f;
  --ink-2:        #303845;
  --muted:        #5c6675;
  --faint:        #8b93a0;
  --rule:         #e5dfd3;
  --rule-2:       #efeae0;
  --accent:       #8a6a3c;
  --accent-ink:   #6f5430;
  --accent-wash:  #f6f0e5;
  --ok:           #3f6b4a;
  --warn:         #97682a;
  --risk:         #9a3f3f;
  --ok-wash:      #eef4ef;
  --warn-wash:    #fbf2e4;
  --risk-wash:    #faeeee;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 1140px;
  --measure: 68ch;
  --r: 4px;
  --r-lg: 8px;
  --shadow: 0 1px 2px rgba(20,24,31,.04), 0 8px 24px -16px rgba(20,24,31,.18);
  --shadow-lg: 0 2px 4px rgba(20,24,31,.05), 0 24px 60px -28px rgba(20,24,31,.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:       #0e1116;
    --paper-2:     #131820;
    --surface:     #151a22;
    --surface-2:   #1a212a;
    --ink:         #e9e6e0;
    --ink-2:       #cdd3dc;
    --muted:       #9aa3b0;
    --faint:       #79828f;
    --rule:        #262d38;
    --rule-2:      #1f262f;
    --accent:      #d0a768;
    --accent-ink:  #e0bd85;
    --accent-wash: #1e1c17;
    --ok:          #7fb08c;
    --warn:        #d5a561;
    --risk:        #d98b8b;
    --ok-wash:     #16201a;
    --warn-wash:   #211b12;
    --risk-wash:   #211414;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -16px rgba(0,0,0,.7);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.35), 0 24px 60px -28px rgba(0,0,0,.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }

img, svg { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--serif); font-weight: 500; line-height: 1.18;
  letter-spacing: -.012em; margin: 0 0 .5em; color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* Grid children default to min-width:auto, which lets wide content (tables,
   long code) push a track past the viewport. Every grid on this site wants
   its children to shrink instead and scroll internally. */
.article-layout > *, .contact-grid > *, .hero-inner > *,
.grid > *, .row > *, .foot-grid > *, .post > * { min-width: 0; }
.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;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

.eyebrow {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 600; color: var(--accent-ink); margin: 0 0 1rem;
}
.lede { font-size: 1.16rem; color: var(--ink-2); line-height: 1.6; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.head-inner { display: flex; align-items: center; gap: 1rem; min-height: 74px; position: relative; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--accent); color: var(--accent-ink);
  font-family: var(--serif); font-size: .92rem; letter-spacing: .06em;
  border-radius: 50%;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--serif); font-size: 1.12rem; letter-spacing: .01em; }
.brand-role { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; align-items: center; gap: .3rem; }
.nav a {
  display: inline-block; padding: .5rem .68rem; border-radius: var(--r);
  font-size: .875rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav .nav-cta { border: 1px solid var(--rule); background: var(--surface); margin-left: .4rem; }
.nav .nav-cta:hover { border-color: var(--accent); color: var(--accent-ink); }
body[data-nav="about"] .nav a[data-id="about"],
body[data-nav="practice"] .nav a[data-id="practice"],
body[data-nav="startup"] .nav a[data-id="startup"],
body[data-nav="articles"] .nav a[data-id="articles"],
body[data-nav="publications"] .nav a[data-id="publications"],
body[data-nav="contact"] .nav a[data-id="contact"] {
  color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: var(--r) var(--r) 0 0;
}
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: grid; place-items: center; width: 42px; height: 42px;
    background: none; border: 1px solid var(--rule); border-radius: var(--r); cursor: pointer;
  }
  .nav-toggle-bars { display: grid; gap: 4px; width: 18px; }
  .nav-toggle-bars i { display: block; height: 1.5px; background: var(--ink); border-radius: 2px; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: .5rem 1.25rem 1rem; box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem .2rem; border-bottom: 1px solid var(--rule-2); border-radius: 0; }
  .nav .nav-cta { margin: .6rem 0 0; text-align: center; border-radius: var(--r); }
  body[data-nav] .nav a { box-shadow: none; }
  body[data-nav="about"] .nav a[data-id="about"],
  body[data-nav="practice"] .nav a[data-id="practice"],
  body[data-nav="startup"] .nav a[data-id="startup"],
  body[data-nav="articles"] .nav a[data-id="articles"],
  body[data-nav="publications"] .nav a[data-id="publications"],
  body[data-nav="contact"] .nav a[data-id="contact"] { color: var(--accent-ink); }
}

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-tint { background: var(--paper-2); }
.section-head { max-width: var(--measure); margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); margin-bottom: 0; }

/* ---------- hero ---------- */
.hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 5vw, 4.5rem); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto -10% -60% 55%;
  height: 520px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-wash), transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-inner {
  display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr);
  gap: clamp(2rem,5vw,4rem); align-items: start;
}
@media (max-width: 880px) { .hero-inner { grid-template-columns: 1fr; } }
.hero h1 { margin-bottom: .25em; }
.hero-role {
  font-family: var(--serif); font-size: 1.35rem; color: var(--accent-ink);
  font-style: italic; margin: 0 0 1.2rem;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 1.6rem; padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--rule);
}
.hero-meta span::after { content: "·"; margin-left: .9rem; color: var(--rule); }
.hero-meta span:last-child::after { content: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }

.hero-card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 1.6rem; box-shadow: var(--shadow);
}
.hero-card h2 { font-size: 1.05rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; margin-bottom: 1rem; }
.hero-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.hero-card li {
  display: grid; gap: .1rem; padding-bottom: .85rem;
  border-bottom: 1px solid var(--rule-2); font-size: .9rem;
}
.hero-card li:last-child { border-bottom: 0; padding-bottom: 0; }
.hero-card b { font-weight: 600; }
.hero-card span { color: var(--muted); font-size: .82rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px;               /* comfortable touch target */
  padding: .72rem 1.25rem; border-radius: var(--r);
  font-family: var(--sans); font-size: .9rem; font-weight: 500; line-height: 1;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-quiet {
  padding: 0; background: none; border: 0; color: var(--accent-ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }

.card {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 1.5rem; text-decoration: none; color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin: 0; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.card-num { font-family: var(--serif); font-size: .8rem; color: var(--accent); letter-spacing: .1em; }
.card-more {
  margin-top: auto; padding-top: .6rem; font-size: .82rem; font-weight: 500;
  color: var(--accent-ink); letter-spacing: .02em;
}
a.card:hover .card-more { text-decoration: underline; text-underline-offset: 3px; }
.card-feature {
  border-left: 3px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-wash), var(--surface) 60%);
}

/* ---------- prose ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2em; font-size: 1.12rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 1.8em 0; padding: .2em 0 .2em 1.3em; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-size: 1.1rem; color: var(--ink-2); font-style: italic;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .87em; background: var(--paper-2); padding: .12em .38em; border-radius: 3px;
  border: 1px solid var(--rule-2);
}
.prose strong { font-weight: 600; }

.list-tight { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.list-tight li { padding-left: 1.4rem; position: relative; color: var(--ink-2); }
.list-tight li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 7px; height: 7px; border: 1px solid var(--accent); transform: rotate(45deg);
}
.list-check { list-style: none; padding: 0; margin: 0 0 1.2em; display: grid; gap: .6rem; }
.list-check li { padding-left: 1.8rem; position: relative; }
.list-check li::before {
  content: "\2713"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-size: .95em; font-weight: 600;
}

/* ---------- callouts ---------- */
.note {
  margin: 1.8em 0; padding: 1.2rem 1.35rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  font-size: .94rem;
}
.note > :last-child { margin-bottom: 0; }
.note-title {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; color: var(--accent-ink); margin-bottom: .5rem;
}
.note-warn { border-left-color: var(--warn); background: var(--warn-wash); }
.note-warn .note-title { color: var(--warn); }

.takeaways {
  margin: 0 0 2.5rem; padding: 1.5rem 1.6rem; border-radius: var(--r-lg);
  background: var(--paper-2); border: 1px solid var(--rule);
}
.takeaways h2 {
  font-family: var(--sans); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; color: var(--muted); margin-bottom: .9rem; margin-top: 0;
}
.takeaways ul { margin: 0; padding-left: 1.2em; display: grid; gap: .5rem; }
.takeaways li { color: var(--ink-2); font-size: .95rem; }

/* ---------- tables ---------- */
.table-scroll {
  overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--rule);
  border-radius: var(--r-lg); background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 480px; }
th, td { text-align: left; padding: .85rem 1.1rem; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
thead th {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  color: var(--muted); background: var(--paper-2); border-bottom: 1px solid var(--rule);
}
tbody tr:last-child td { border-bottom: 0; }

/* ---------- page header ---------- */
.page-head { padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1.75rem, 3vw, 2.5rem); border-bottom: 1px solid var(--rule); }
.page-head h1 { max-width: 20ch; }
.page-head .lede { max-width: var(--measure); margin-bottom: 0; }
.crumbs { font-size: .8rem; color: var(--muted); margin: 0 0 1.2rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.crumbs span { margin: 0 .45rem; color: var(--rule); }

/* ---------- article ---------- */
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } }
.article-meta {
  display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center;
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--rule);
}
.article-meta span::after { content: "·"; margin-left: .8rem; color: var(--rule); }
.article-meta span:last-child::after { content: none; }
.article-body { font-size: 1.03rem; }
.article-body h2, .article-body h3 { scroll-margin-top: 100px; }

.toc { position: sticky; top: 100px; font-size: .86rem; }
@media (max-width: 980px) {
  .toc {
    position: static; margin-bottom: 2.5rem; border: 1px solid var(--rule);
    border-radius: var(--r-lg); padding: 1.2rem 1.4rem; background: var(--surface);
  }
}
.toc h2 {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; color: var(--muted); margin-bottom: .8rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; border-left: 1px solid var(--rule); }
.toc a {
  display: block; padding: .38rem 0 .38rem .9rem; margin-left: -1px;
  border-left: 1px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 500; }

.article-foot { max-width: var(--measure); margin-top: 3rem; padding-top: 1.8rem; border-top: 1px solid var(--rule); }

/* ---------- article index ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chip {
  padding: .42rem .9rem; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--muted); font-size: .82rem; font-weight: 500;
  cursor: pointer; font-family: var(--sans);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.post-list { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.post {
  display: grid; grid-template-columns: 8.5rem minmax(0,1fr); gap: 1.5rem;
  padding: 1.9rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit;
}
@media (max-width: 700px) { .post { grid-template-columns: 1fr; gap: .5rem; } }
.post:hover h3 { color: var(--accent-ink); }
.post-date { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-top: .3rem; }
.post h3 { margin: 0 0 .4rem; font-size: 1.28rem; }
.post p { margin: 0 0 .7rem; color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: .18rem .6rem;
}
.empty-note { padding: 2.5rem 0; color: var(--muted); }

/* ---------- rows (positions, education) ---------- */
.rows { display: grid; border-top: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) 12rem;
  gap: 1rem 1.5rem; padding: 1.3rem 0; border-bottom: 1px solid var(--rule-2);
  align-items: baseline;
}
@media (max-width: 760px) { .row { grid-template-columns: 1fr; gap: .25rem; padding: 1.1rem 0; } }
.row b { font-weight: 600; font-size: .97rem; }
.row span { color: var(--muted); font-size: .9rem; }
.row time { color: var(--faint); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr);
  gap: clamp(2rem,5vw,4rem); align-items: start;
}
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }
.detail-list { display: grid; gap: 1.4rem; margin: 0; }
.detail-list dt { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.detail-list dd { margin: 0; font-size: 1.02rem; }
.detail-list dd a { text-decoration: none; }
.detail-list dd a:hover { text-decoration: underline; }

form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: .82rem; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--faint); }
input, select, textarea {
  font-family: var(--sans);
  /* 16px is the floor: below it, iOS Safari zooms the page on focus. */
  font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: .75rem .85rem; width: 100%; min-height: 48px;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.form-status { font-size: .85rem; color: var(--ok); min-height: 1.2em; }

/* ---------- health check tool ---------- */
.tool {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: var(--shadow);
}
.tool-progress { height: 3px; background: var(--rule-2); border-radius: 999px; overflow: hidden; margin-bottom: 2rem; }
.tool-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
/* Each question is a <fieldset>. Reset the UA's groove border and its
   intrinsic min-width, or it draws a box and can force horizontal overflow. */
.q {
  border: 0; border-bottom: 1px solid var(--rule-2);
  margin: 0; padding: 1.3rem 0; min-width: 0;
}
.q:first-of-type { padding-top: 0; }
.q:last-of-type { border-bottom: 0; }
.q-area { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: .35rem; }
.q-text { font-size: 1rem; font-weight: 500; margin: 0 0 .3rem; }
.q-help { font-size: .85rem; color: var(--muted); margin: 0 0 .9rem; }
.q-opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.q-opts label {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; position: relative;
  border: 1px solid var(--rule); border-radius: 999px; padding: .4rem .95rem;
  font-size: .85rem; color: var(--muted); background: var(--surface-2);
}
.q-opts input { position: absolute; opacity: 0; width: 0; height: 0; }
.q-opts label:hover { border-color: var(--accent); }
.q-opts label:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.q-opts label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.result { display: none; }
.result.is-shown { display: block; }
.score-head { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; margin-bottom: 2rem; }
.score-dial { flex: none; width: 108px; height: 108px; position: relative; }
.score-dial svg { transform: rotate(-90deg); }
.score-dial .track { stroke: var(--rule-2); }
.score-dial .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.score-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 1.75rem; }
.score-copy { flex: 1 1 260px; }
.score-copy h3 { margin: 0 0 .3rem; font-size: 1.3rem; }
.score-copy p { margin: 0; color: var(--muted); font-size: .92rem; }

.areas { display: grid; gap: .95rem; margin: 0 0 2.2rem; }
.area-bar { height: 6px; background: var(--rule-2); border-radius: 999px; overflow: hidden; }
.area-bar i { display: block; height: 100%; border-radius: 999px; transition: width .6s ease; }
.lvl-ok .area-bar i { background: var(--ok); }
.lvl-warn .area-bar i { background: var(--warn); }
.lvl-risk .area-bar i { background: var(--risk); }
.area-label { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; font-size: .92rem; }
.area-label b { font-weight: 500; }
.area-label span { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.lvl-ok .area-label span { color: var(--ok); }
.lvl-warn .area-label span { color: var(--warn); }
.lvl-risk .area-label span { color: var(--risk); }

.actions-list { display: grid; gap: .8rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.actions-list li {
  display: grid; grid-template-columns: auto minmax(0,1fr); gap: .9rem;
  padding: 1rem 1.2rem; border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--surface-2); font-size: .93rem;
}
.prio {
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  padding: .2rem .55rem; border-radius: 3px; white-space: nowrap; height: fit-content;
}
.prio-1 { background: var(--risk-wash); color: var(--risk); }
.prio-2 { background: var(--warn-wash); color: var(--warn); }
.prio-3 { background: var(--ok-wash); color: var(--ok); }
.actions-list b { display: block; font-weight: 600; margin-bottom: .15rem; }
.actions-list p { margin: 0; color: var(--muted); font-size: .88rem; }

/* ---------- disclaimer gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center; padding: 1.5rem;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
}
.gate[hidden] { display: none; }
.gate-panel {
  --gp: clamp(1.4rem, 4vw, 2.6rem);
  width: min(100%, 620px); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: var(--gp); box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
}
@supports (height: 100dvh) { .gate-panel { max-height: 88dvh; } }
.gate-panel h2 { font-size: 1.5rem; margin-bottom: .2em; }
.gate-panel .eyebrow { margin-bottom: .8rem; }
.gate-panel p { font-size: .93rem; color: var(--ink-2); }
.gate-panel ul { font-size: .93rem; color: var(--ink-2); padding-left: 1.2em; margin: 0 0 1.1em; }
.gate-panel li { margin-bottom: .4em; }

/* The notice is long on a phone. Pin the actions to the bottom of the panel
   so "I agree" is reachable without scrolling to the end of the text. */
.gate-foot {
  position: sticky; bottom: calc(var(--gp) * -1);
  margin: 1.5rem calc(var(--gp) * -1) calc(var(--gp) * -1);
  padding: 1.1rem var(--gp) var(--gp);
  background: var(--surface); border-top: 1px solid var(--rule);
}
.gate-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.gate-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 46px; }
.gate-fine { font-size: .78rem; color: var(--faint); margin: .9rem 0 0; }

/* ---------- footer ---------- */
.site-foot { background: var(--paper-2); border-top: 1px solid var(--rule); padding: clamp(2.5rem,5vw,4rem) 0 2rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; padding-bottom: 2.5rem; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-name { font-family: var(--serif); font-size: 1.2rem; margin: 0; }
.foot-sub { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin: .1rem 0 1rem; }
.foot-addr { font-size: .88rem; color: var(--muted); margin: 0; line-height: 1.6; }
.foot-h {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: .9rem;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.foot-col a { font-size: .88rem; color: var(--ink-2); text-decoration: none; }
.foot-col a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-legal { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.foot-legal p { font-size: .78rem; color: var(--faint); line-height: 1.65; max-width: 90ch; }
.foot-legal strong { color: var(--muted); }
.foot-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; margin-bottom: 0; }
.foot-meta a { color: var(--faint); }

/* ==========================================================================
   Touch and small-screen refinements
   Every interactive control clears a 44px touch target, and the small
   letterspaced labels come up to at least 12px so they stay legible on a
   phone. Measured at 375px.
   ========================================================================== */

.btn-quiet { min-height: 0; }
.nav-toggle { -webkit-tap-highlight-color: transparent; }
a, button, label, summary { -webkit-tap-highlight-color: rgba(138, 106, 60, .15); }

@media (max-width: 900px) {
  /* Give back vertical space: the sticky header is 74px on desktop. */
  .head-inner { min-height: 62px; }
  .brand { min-height: 44px; }
  .brand-mark { width: 34px; height: 34px; font-size: .85rem; }
  .brand-name { font-size: 1.05rem; }
  .nav-toggle { width: 44px; height: 44px; }
  .article-body h2, .article-body h3 { scroll-margin-top: 78px; }
  .toc { top: 78px; }

  /* Small labels: 11.2–11.5px is too small on a handset. */
  .eyebrow, .note-title, .foot-h, .takeaways h2, .toc h2 { font-size: .8rem; }
  .brand-role, .tag, .q-area, .post-date, .row time, .prio { font-size: .75rem; }
  .hero-meta, .article-meta { font-size: .82rem; }
  .foot-legal p { font-size: .8rem; }

  /* Pill controls need real height to be tappable. */
  .chip { min-height: 44px; padding: .5rem 1.05rem; }
  .q-opts { gap: .55rem; }
  .q-opts label { min-height: 44px; padding: .55rem 1.15rem; }
  .q { padding: 1.5rem 0; }

  /* Standalone links become block targets rather than 20px slivers. */
  .foot-col ul { gap: .1rem; }
  .foot-col a { display: block; padding: .5rem 0; }
  /* Tap-to-call and tap-to-email are the two most-used controls on a phone. */
  .detail-list dd a { display: inline-flex; align-items: center; min-height: 48px; }
  thead th { font-size: .8rem; }
  .crumbs { font-size: .82rem; }
  .list-tight li { padding-top: .2rem; padding-bottom: .2rem; }

  /* Buttons go full width — easier to hit, and it reads as a deliberate stack. */
  .hero-actions, .form-actions, .gate-actions { gap: .6rem; }
  .hero-actions .btn, .form-actions .btn { flex: 1 1 100%; }
}

@media (max-width: 420px) {
  body { font-size: 16.5px; }
  .wrap { width: min(100% - 2rem, var(--wrap)); }
  .hero-meta { gap: .3rem .7rem; }
  .hero-meta span::after { margin-left: .7rem; }
}

/* ---------- print ---------- */
@media print {
  .site-head, .site-foot, .gate, .toc, .nav-toggle, .hero-actions, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .wrap { width: 100%; }
  a { color: #000; text-decoration: none; }
  .article-layout, .section { padding: 0; display: block; }
  .tool { border: 0; box-shadow: none; padding: 0; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
