/* Synergy Portal — single stylesheet.
   Reference-book layout: warm paper, plum ink, burnt amber accent, hairline rules. */

:root {
  --paper:      #fbf7f1;
  --surface:    #ffffff;
  --tint:       #f4ede2;
  --ink:        #2a2130;
  --ink-soft:   #554a5f;
  --muted:      #5c5165;
  --line:       #ddd1c0;
  --line-soft:  #ebe2d5;
  --accent:     #8a4b12;
  --accent-dk:  #6d3a0c;
  --teal:       #14524f;
  --teal-tint:  #e6f0ee;
  --warn-tint:  #fbf0e2;
  --radius:     3px;
  --measure:    68ch;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--teal);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
}
.skip:focus { left: 0; }

/* ---------- focus ---------- */

a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- masthead ---------- */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.masthead-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 6px 0;
  flex: 0 0 auto;
}
.brand svg { display: block; flex: 0 0 auto; }
.brand-name { white-space: nowrap; }
.brand-sub {
  display: block;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1px;
}

.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: 600 0.9rem/1 var(--sans);
  padding: 9px 12px;
  cursor: pointer;
}
.nav-toggle b { display: block; width: 16px; height: 1.5px; background: var(--ink); box-shadow: 0 5px 0 var(--ink), 0 -5px 0 var(--ink); }

.nav { margin-left: auto; }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-list a, .nav-group > button {
  display: block;
  padding: 8px 11px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  border: 0;
  background: none;
  font-family: var(--sans);
  cursor: pointer;
  border-radius: var(--radius);
  white-space: nowrap;
}
.nav-list a:hover, .nav-group > button:hover { color: var(--accent-dk); background: var(--tint); }
.nav-list a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.nav-group { position: relative; }
.nav-group > button::after {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-left: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.nav-group > button[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }

.nav-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 274px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  margin: 0;
  list-style: none;
  display: none;
}
.nav-group > button[aria-expanded="true"] + .nav-panel { display: block; }
.nav-panel a { padding: 9px 10px; font-size: 0.92rem; white-space: normal; }
.nav-panel a:hover { background: var(--tint); }

/* ---------- layout ---------- */

.shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding: 34px 0 10px;
}

@media (min-width: 950px) {
  .columns { grid-template-columns: minmax(0, 1fr) 274px; gap: 52px; }
  .columns.reverse { grid-template-columns: 274px minmax(0, 1fr); }
  .columns.reverse .rail { order: -1; }
}

main { min-width: 0; }
main > *:first-child { margin-top: 0; }

.rail { min-width: 0; }
@media (min-width: 950px) {
  .rail-sticky { position: sticky; top: 82px; }
}

/* ---------- typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.22;
  letter-spacing: -0.012em;
  font-weight: 600;
}

h1 { font-size: clamp(1.85rem, 1.35rem + 2.1vw, 2.6rem); margin: 0 0 14px; }
h2 { font-size: clamp(1.35rem, 1.13rem + 0.95vw, 1.72rem); margin: 44px 0 12px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
h3 { font-size: 1.16rem; margin: 28px 0 8px; }
h4 { font-size: 1.01rem; margin: 20px 0 6px; font-family: var(--sans); font-weight: 700; }

p { margin: 0 0 15px; max-width: var(--measure); }
main ul, main ol { max-width: var(--measure); margin: 0 0 15px; padding-left: 22px; }
main li { margin-bottom: 7px; }

.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 22px;
}

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

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 10px;
}

.page-meta {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0 0 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

/* ---------- boxes ---------- */

.box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px 22px;
  margin: 24px 0;
}
.box > *:last-child { margin-bottom: 0; }
.box h2, .box h3 { margin-top: 0; border-top: 0; padding-top: 0; }
.box h2 { font-size: 1.22rem; }

.box-title {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 9px;
}

.box.disclosure { border-left: 4px solid var(--accent); background: var(--warn-tint); }
.box.method     { border-left: 4px solid var(--teal); background: var(--teal-tint); }
.box.watch      { border-left: 4px solid var(--accent); background: var(--surface); }
.box.answer     { background: var(--tint); border-color: var(--line); }
.box.example    { border-style: dashed; background: var(--surface); }

/* ---------- affiliate link ---------- */

.offer-link {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--teal);
}
.offer-link:hover { background: #0e3f3d; color: #fff; }

.offer-note {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 11px 0 0;
  max-width: var(--measure);
}

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 520px; background: var(--surface); font-size: 0.95rem; }
caption { text-align: left; font-size: 0.88rem; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--tint); }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
thead th { background: var(--tint); font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th[scope="row"] { font-weight: 600; }

/* ---------- definition lists ---------- */

.terms { margin: 20px 0; max-width: var(--measure); }
.terms dt {
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.terms dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.terms dd { margin: 5px 0 0; color: var(--ink-soft); }

.terms.compact dt { font-family: var(--sans); font-size: 0.97rem; font-weight: 700; }

/* ---------- contents / rail cards ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.card h2, .card h3 {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  border-top: 0;
  padding-top: 0;
}
.card ul { list-style: none; margin: 0; padding: 0; font-size: 0.93rem; }
.card li { margin-bottom: 8px; line-height: 1.45; }
.card li:last-child { margin-bottom: 0; }
.card p { font-size: 0.93rem; color: var(--ink-soft); }

.toc { counter-reset: toc; }
.toc ol { list-style: none; margin: 0; padding: 0; font-size: 0.93rem; }
.toc li { margin-bottom: 8px; padding-left: 26px; position: relative; line-height: 1.45; }
.toc li::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  top: 2px;
}

/* ---------- index grid ---------- */

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.index-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 17px 19px;
}
.index-grid h3 { margin: 0 0 6px; font-size: 1.05rem; }
.index-grid p { font-size: 0.93rem; color: var(--ink-soft); margin: 0; }

/* ---------- glossary strip ---------- */

.strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  margin: 22px 0;
}
.strip dl { display: grid; gap: 13px; margin: 0; max-width: none; }
@media (min-width: 680px) { .strip dl { grid-template-columns: 1fr 1fr; gap: 14px 30px; } }
.strip dt { font-weight: 700; font-size: 0.95rem; }
.strip dd { margin: 2px 0 0; font-size: 0.93rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- checklist ---------- */

.checklist { list-style: none; padding-left: 0; }
.checklist li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 11px;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 16px; height: 16px;
  border: 1.5px solid var(--teal);
  border-radius: 2px;
}

/* ---------- accordion ---------- */

.faq { margin: 22px 0; max-width: var(--measure); }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 15px 44px 15px 17px;
  font: 600 1rem/1.4 var(--sans);
  color: var(--ink);
  cursor: pointer;
  position: relative;
  border-radius: var(--radius);
}
.faq-q::after {
  content: "";
  position: absolute;
  right: 18px; top: 21px;
  width: 8px; height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}
.faq-q[aria-expanded="true"]::after { transform: translateY(4px) rotate(225deg); }
.faq-a { padding: 0 17px 4px; }
.faq-a[hidden] { display: none; }

/* ---------- timeline ---------- */

.steps { list-style: none; padding-left: 0; counter-reset: step; }
.steps li { position: relative; padding-left: 42px; margin-bottom: 18px; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--tint);
  border: 1px solid var(--line);
  color: var(--accent-dk);
  font: 700 0.85rem/25px var(--sans);
  text-align: center;
}

/* ---------- hero ---------- */

.hero { padding: 40px 0 6px; border-bottom: 1px solid var(--line); }
.hero .lede { max-width: 62ch; }

.hero-figure { margin: 0; }
.hero-figure svg { display: block; width: 100%; height: auto; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--tint);
  margin-top: 56px;
  padding: 36px 0 44px;
  font-size: 0.93rem;
  color: var(--ink-soft);
}
.site-footer .shell > * { max-width: 78ch; }
.publisher { margin: 0 0 18px; line-height: 1.75; }
.publisher .pub-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--ink); display: block; }
.publisher span { display: block; }
.footer-links { margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 0; }
.footer-links li::after { content: "·"; margin: 0 9px; color: var(--muted); }
.footer-links li:last-child::after { content: ""; margin: 0; }
.trademark { font-size: 0.88rem; color: var(--muted); margin: 0 0 14px; }
.reviewed { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* ---------- misc ---------- */

.note { font-size: 0.93rem; color: var(--muted); }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 34px 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;
}

/* ---------- small screens ---------- */

@media (max-width: 949px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line-soft);
    padding: 10px 20px 18px;
    max-height: calc(100vh - 62px);
    overflow-y: auto;
  }
  .nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid var(--line-soft); }
  .nav-list > li:last-child { border-bottom: 0; }
  .nav-list a, .nav-group > button { padding: 12px 4px; width: 100%; text-align: left; font-size: 1rem; }
  .nav-panel { position: static; display: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; margin: 0 0 10px 6px; padding: 0 0 0 10px; min-width: 0; }
  .masthead-inner { position: relative; }
}

@media (max-width: 400px) {
  body { font-size: 16px; }
  .shell, .masthead-inner { padding: 0 16px; }
  .box { padding: 16px; }
}

@media print {
  .masthead, .rail, .nav-toggle { display: none; }
  body { background: #fff; font-size: 11pt; }
}
