/* Role Handbook — site styles
   Editorial, calm, readable. No frameworks, no JS. */

:root {
  --ink: #16213b;
  --ink-2: #2a3552;
  --ink-3: #4b5470;
  --paper: #faf8f4;
  --paper-2: #f2ecdf;
  --card: #ffffff;
  --line: #e5ded2;
  --line-strong: #cec5b4;
  --accent: #b45309;
  --accent-2: #d97706;
  --accent-soft: #fdf3e3;
  --teal: #0f766e;
  --teal-soft: #eaf4f2;
  --red: #b91c1c;
  --red-soft: #fdf1f1;
  --muted: #6f6a60;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 33, 59, 0.05), 0 10px 30px rgba(22, 33, 59, 0.07);
  --shadow-sm: 0 1px 2px rgba(22, 33, 59, 0.04);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1140px;
  --wrap-narrow: 820px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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;
}

::selection { background: #f3d9b1; color: var(--ink); }

img { max-width: 100%; height: auto; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-2); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

h1, h2, h3, .brand-name, .section-title { font-family: var(--serif); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.wrap--narrow { max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 28px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

.dot { margin: 0 8px; color: var(--line-strong); }

.small { font-size: 0.9rem; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-name { font-size: 1.16rem; font-weight: 700; letter-spacing: -0.01em; }
.site-nav { display: flex; gap: 30px; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none;
  color: var(--ink-3);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 0;
}
.site-nav a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 0.97rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn + .btn { margin-left: 10px; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #0d1730; color: var(--paper); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: #fff; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 78px 0 62px; border-bottom: 1px solid var(--line); }
.hero-inner { max-width: var(--wrap); }
.hero h1 {
  font-size: clamp(2.35rem, 5.2vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
  margin: 14px 0 22px;
  max-width: 19ch;
  font-weight: 700;
}
.hero-sub {
  max-width: 62ch;
  font-size: 1.12rem;
  color: var(--ink-3);
  margin: 0 0 30px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .btn + .btn { margin-left: 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent-2); }

/* ---------------------------------------------------------------- sections */
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-title {
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  letter-spacing: -0.015em;
  margin: 0 0 30px;
  font-weight: 700;
}

/* topic cards */
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.topic-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.topic-card h3 {
  font-size: 1.5rem;
  letter-spacing: -0.012em;
  margin: 6px 0 10px;
}
.topic-card p { color: var(--ink-3); margin: 0 0 18px; }
.topic-card .btn { align-self: flex-start; margin-top: auto; }
.link-list { list-style: none; margin: 0 0 22px; padding: 0; }
.link-list li { border-top: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 1px solid var(--line); }
.link-list a {
  display: block;
  padding: 10px 2px;
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
}
.link-list a:hover { color: var(--accent); }

/* guide list */
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.guide-row:last-child { border-bottom: 1px solid var(--line); }
.guide-row h3 { font-size: 1.32rem; margin: 4px 0 8px; letter-spacing: -0.01em; }
.guide-row h3 a { text-decoration: none; }
.guide-row h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent-2); }
.guide-row p { margin: 0; color: var(--ink-3); font-size: 0.98rem; }
.guide-row-meta {
  font-size: 0.82rem !important;
  color: var(--muted) !important;
  text-align: right;
  white-space: nowrap;
  padding-top: 6px;
}

/* principles */
.principles { background: var(--paper-2); }
.principles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.principle h3 { font-family: var(--sans); font-size: 1.05rem; margin: 0 0 8px; }
.principle p { margin: 0; color: var(--ink-3); font-size: 0.96rem; }

/* newsletter */
.newsletter { background: var(--ink); color: var(--paper); }
.newsletter .section-title { color: var(--paper); margin-bottom: 14px; }
.newsletter p { color: #d9d4c9; max-width: 56ch; }
.newsletter-inner { display: grid; grid-template-columns: 1.7fr 1fr; gap: 40px; align-items: center; }
.newsletter-cta { justify-self: end; }
.newsletter-cta .btn { margin-bottom: 12px; }
.btn-light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-light:hover { background: #ffffff; color: var(--ink); }
.newsletter a { color: #f3c47c; }
.newsletter a:hover { color: #ffdca8; }
.newsletter .small { color: #b9b3a6; }

/* ---------------------------------------------------------------- article */
.article-header { padding: 56px 0 34px; }
.article-header h1 {
  font-size: clamp(2.05rem, 4.1vw, 3.05rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 12px 0 18px;
}
.dek { font-size: 1.13rem; color: var(--ink-3); margin: 0 0 20px; max-width: 66ch; }
.article-meta { font-size: 0.88rem; color: var(--muted); margin: 0; }
.article-meta a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); }
.article-meta a:hover { color: var(--accent); }

.article-body { font-size: 1.075rem; line-height: 1.75; }
.article-body > p:first-of-type { font-size: 1.12rem; color: var(--ink-2); }
.article-body h2 {
  font-size: 1.62rem;
  line-height: 1.22;
  letter-spacing: -0.012em;
  margin: 2.6rem 0 0.8rem;
  scroll-margin-top: 92px;
}
.article-body h3 {
  font-family: var(--sans);
  font-size: 1.12rem;
  margin: 1.9rem 0 0.5rem;
}
.article-body p { margin: 0 0 1.1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.2rem; padding-left: 1.35rem; }
.article-body li { margin: 0.4rem 0; }
.article-body strong { font-weight: 700; }
.article-body blockquote {
  margin: 1.4rem 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-3);
  font-style: italic;
}

/* table of contents */
.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 24px 20px;
  margin: 4px 0 36px;
}
.toc-title {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.toc ol { margin: 0; padding-left: 1.1rem; columns: 2; column-gap: 36px; font-size: 0.93rem; }
.toc li { margin: 0.3rem 0; break-inside: avoid; }
.toc a { color: var(--ink-3); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* content blocks */
.key-takeaways {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 22px 26px;
  margin: 28px 0 34px;
}
.kt-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px !important;
}
.key-takeaways ul { margin: 0; padding-left: 1.15rem; }
.key-takeaways li { margin: 0.35rem 0; color: var(--ink-2); }

.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 26px 0;
  background: var(--card);
}
.callout p { margin: 0 0 0.6rem; }
.callout p:last-child { margin-bottom: 0; }
.callout-title {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin-bottom: 6px !important;
}
.callout--tip { border-left-color: var(--teal); background: var(--teal-soft); }
.callout--tip .callout-title { color: var(--teal); }
.callout--warning { border-left-color: var(--red); background: var(--red-soft); }
.callout--warning .callout-title { color: var(--red); }
.callout--note { border-left-color: var(--accent-2); background: var(--accent-soft); }
.callout--note .callout-title { color: var(--accent); }

.script-box {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  padding: 24px 26px;
  margin: 26px 0;
}
.script-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f3c47c;
  margin: 0 0 10px !important;
}
.script-box p { margin: 0; color: #f5f1e8; font-family: var(--serif); font-size: 1.1rem; line-height: 1.55; }
.script-box p + p { margin-top: 10px; }
.script-box em { color: #e7dfd0; }

.checklist { list-style: none; padding: 0; margin: 22px 0 26px; }
.checklist li { position: relative; padding-left: 30px; margin: 0.55rem 0; }
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--teal);
  font-weight: 700;
}

.table-wrap { overflow-x: auto; margin: 26px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--card); }
.table-wrap th {
  text-align: left;
  background: var(--paper-2);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-strong);
}
.table-wrap td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: #fbf9f4; }

.disclaimer {
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 28px;
}

/* faq / sources / related */
.faq { margin-top: 52px; border-top: 1px solid var(--line); padding-top: 36px; }
.faq h2 { margin-top: 0; }
.faq-item { margin: 0 0 24px; }
.faq-item h3 { margin-top: 0; font-size: 1.06rem; }
.faq-item p { color: var(--ink-2); }
.sources { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 32px; }
.sources h2 { margin-top: 0; font-size: 1.35rem; }
.sources ol { font-size: 0.95rem; color: var(--ink-3); }
.sources li { margin: 0.5rem 0; }
.related { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 36px; }
.related h2 { margin-top: 0; }

.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.card--link { text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.card--link:hover { color: inherit; border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.card h3 { font-size: 1.12rem; margin: 0 0 8px; line-height: 1.3; }
.card p { margin: 0; color: var(--ink-3); font-size: 0.94rem; }
.card-meta { margin-top: 12px !important; font-size: 0.8rem !important; color: var(--muted) !important; }

.article-footnote {
  margin-top: 48px;
  padding: 22px 26px;
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  color: var(--ink-2);
}
.article-footnote p { margin: 0; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  margin-top: 80px;
  background: var(--ink);
  color: #d9d4c9;
  padding: 64px 0 34px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 32px;
}
.brand--footer { color: var(--paper); margin-bottom: 14px; }
.brand--footer .brand-mark { background: var(--paper); color: var(--ink); }
.footer-brand p { margin: 0; max-width: 34ch; font-size: 0.94rem; color: #b9b3a6; }
.footer-col h2 {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f3c47c;
  margin: 4px 0 14px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 10px; }
.footer-col a { color: #d9d4c9; text-decoration: none; font-size: 0.94rem; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid rgba(250, 248, 244, 0.14);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-bottom p { margin: 0; font-size: 0.86rem; color: #a9a395; }
.footer-bottom a { color: #d9d4c9; }
.footer-bottom .small { max-width: 62ch; }

/* ---------------------------------------------------------------- misc */
.notfound { padding: 100px 0 120px; }
.notfound h1 { font-size: clamp(2.2rem, 4vw, 3rem); margin: 10px 0 16px; }
.notfound p { color: var(--ink-3); margin-bottom: 18px; }
.notfound .btn + .btn { margin-left: 10px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .topic-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .topic-grid, .card-grid { grid-template-columns: 1fr; }
  .newsletter-inner { grid-template-columns: 1fr; gap: 24px; }
  .newsletter-cta { justify-self: start; }
  .principles-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .guide-row { grid-template-columns: 1fr; gap: 6px; }
  .guide-row-meta { text-align: left; padding-top: 0; }
  .toc ol { columns: 1; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap, .wrap--narrow { padding: 0 20px; }
  .hero { padding: 54px 0 44px; }
  .section { padding: 48px 0; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 0.9rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .btn { width: 100%; text-align: center; }
  .btn + .btn { margin-left: 0; margin-top: 10px; }
  .hero-actions .btn + .btn { margin-top: 0; }
  .article-body { font-size: 1.02rem; }
  .article-header { padding: 40px 0 26px; }
  .script-box, .key-takeaways { margin-left: -4px; margin-right: -4px; }
}

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

@media print {
  .site-header, .site-footer, .toc, .newsletter, .related, .hero-actions { display: none; }
  body { background: #fff; }
  .article-body a { text-decoration: underline; }
}


/* ---------------------------------------------------------------- interactive tools */
.tool {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 24px 26px;
  margin: 26px 0;
  box-shadow: var(--shadow-sm);
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
}
.tool-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.tool-field input,
.tool-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.tool-field input:focus,
.tool-field select:focus {
  outline: 3px solid var(--accent-2);
  outline-offset: 1px;
  border-color: var(--ink);
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.tool-actions button {
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
}
.tool-actions button:hover { background: #0d1730; }
.tool-actions button[type="button"] {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.tool-actions button[type="button"]:hover { border-color: var(--ink); background: #fff; }
.tool-error {
  color: var(--red);
  font-size: 0.92rem;
  margin: 14px 0 0;
}
.tool-results {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 22px;
}
.tool-result {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.tool-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px !important;
}
.tool-value {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 !important;
}
.tool-note {
  margin: 16px 0 0;
  font-size: 0.92rem;
  color: var(--ink-3);
  grid-column: 1 / -1;
}
.tool [hidden] { display: none !important; }

@media (max-width: 760px) {
  .tool-grid, .tool-results { grid-template-columns: 1fr; }
  .tool { padding: 20px; }
}
