
:root {
  --bg: #ecf4f7;
  --bg-2: #f7fbfc;
  --surface: rgba(255,255,255,0.92);
  --surface-2: #f7fafb;
  --text: #173341;
  --muted: #5b7582;
  --line: #d6e2e8;
  --accent: #2b6f91;
  --accent-soft: #dcecf4;
  --shadow: 0 12px 28px rgba(15, 42, 57, 0.06);
  --radius: 10px;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(43,111,145,0.08), transparent 32%),
    linear-gradient(180deg, #eef5f8 0%, #e9f0f3 100%);
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(236,244,247,0.9);
  border-bottom: 1px solid rgba(214,226,232,0.95);
  backdrop-filter: blur(14px);
}
.header-main {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand img { width: 42px; height: 42px; flex: 0 0 auto; }
.brand span { line-height: 1; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text);
  padding: 0.58rem 0.78rem;
  border-radius: 999px;
  font-size: 0.96rem;
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.site-nav a:hover {
  text-decoration: none;
  background: rgba(255,255,255,0.78);
}
.menu-toggle {
  display: none;
  margin-left: auto;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.8);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.hero { padding: 3rem 0 2rem; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) 340px;
  gap: 1rem;
  align-items: start;
}
.hero-copy, .hero-side, .content-page, .utility-page, .topic-card, .note-card, .subpage-card, .program-card {
  background: var(--surface);
  border: 1px solid rgba(214,226,232,0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-copy { padding: 1.4rem 1.4rem 1.25rem; }
.hero-side { padding: 1.1rem; }
.content-page, .utility-page { padding: 1.25rem 1.25rem 1.15rem; }
.page-wide { max-width: 920px; }
.section-kicker {
  margin: 0 0 0.45rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.84rem;
  font-weight: 700;
}
h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: -0.03em;
}
h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
}
h2 {
  margin: 2rem 0 0.72rem;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}
h3 {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
}
p { margin: 0 0 1rem; }
.hero-lede, .article-lede {
  font-size: 1.08rem;
  color: #254758;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.72rem;
  margin: 1.2rem 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
}
.btn-secondary {
  background: rgba(255,255,255,0.78);
  color: var(--text);
}
.hero-image, .image-block {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.quick-stack, .rule-list, .step-list, .related-pages { display: grid; gap: 0.75rem; }
.quick-card, .compare-card, .stats-card, .mini-list > div, .rule, .step, .callout, .intro-slab, .side-note {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.95rem 1rem;
}
.quick-card p:last-child,
.callout p:last-child,
.topic-card p:last-child,
.note-card p:last-child,
.subpage-card p:last-child,
.program-card p:last-child,
.content-page p:last-child,
.utility-page p:last-child { margin-bottom: 0; }
.section { padding: 0 0 2rem; }
.section-head { max-width: 72ch; margin-bottom: 1rem; }
.topic-grid, .note-grid, .subpage-grid, .program-grid, .compare-grid, .mini-list, .stats-grid, .feature-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1rem;
}
.topic-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.topic-card, .note-card, .subpage-card, .program-card { padding: 1rem 1rem 0.92rem; }
.site-main { padding: 2rem 0 2.2rem; }
.aside-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) 280px;
  gap: 1rem;
  align-items: start;
}
.inline-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  margin: 1rem 0 1.2rem;
}
.inline-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.inline-table th, .inline-table td {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.inline-table th {
  background: #f4f8fa;
  font-size: 0.94rem;
}
.bullet-clean {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
}
.bullet-clean li + li { margin-top: 0.36rem; }
.related-pages a, .note-link {
  display: block;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
}
.muted { color: var(--muted); }
.site-footer { padding: 1rem 0 2rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.9fr;
  gap: 1rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(214,226,232,0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 1rem;
}
.footer-title {
  margin: 0 0 0.6rem;
  font-weight: 700;
}
@media (max-width: 980px) {
  .hero-grid, .topic-grid, .note-grid, .subpage-grid, .program-grid, .compare-grid, .mini-list, .stats-grid, .feature-layout, .footer-grid, .aside-grid {
    grid-template-columns: 1fr;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.98);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.5rem;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: grid; gap: 0.2rem; }
  .menu-toggle { display: inline-flex; }
}


/* v33 spacing + notes link + footer polish */
.page-spaced {
  padding-top: 2rem;
}

@media (min-width: 900px) {
  .page-spaced {
    padding-top: 2.75rem;
  }
}

.back-notes-link {
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.back-notes-link a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.site-footer .container,
footer .container {
  display: grid;
  gap: 0.75rem;
}

.site-footer p,
footer p {
  margin: 0;
}

.site-footer nav,
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

.site-footer a,
footer a {
  text-decoration: none;
}

.site-footer a:hover,
footer a:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}


/* v36 footer polish */
.site-footer {
  margin-top: 4.5rem;
  padding: 2.25rem 0 2.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(to bottom, rgba(0,0,0,0.025), rgba(0,0,0,0.04));
}

.site-footer .container,
footer .container {
  display: grid;
  gap: 0.9rem;
}

.site-footer p,
footer p {
  margin: 0;
}

.site-footer nav,
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

.site-footer a,
footer a {
  text-decoration: none;
}

.site-footer a:hover,
footer a:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.site-footer .footer-meta,
footer .footer-meta {
  font-size: 0.95rem;
  opacity: 0.82;
}

.site-footer .footer-nav,
footer .footer-nav {
  padding-top: 0.15rem;
  gap: 0.25rem 0.35rem;
}

.site-footer .footer-nav a,
footer .footer-nav a {
  position: relative;
}

.site-footer .footer-nav a:not(:last-child)::after,
footer .footer-nav a:not(:last-child)::after {
  content: "•";
  margin-left: 1rem;
  opacity: 0.35;
}

@media (max-width: 680px) {
  .site-footer {
    margin-top: 3.5rem;
    padding: 1.85rem 0 2.15rem;
  }

  .site-footer .footer-nav a:not(:last-child)::after,
  footer .footer-nav a:not(:last-child)::after {
    margin-left: 0.7rem;
  }
}

/* v42 final homepage header-gap alignment */
main.page-spaced > .hero:first-child {
  padding-top: 0;
}

@media (max-width: 680px) {
  main.page-spaced > .hero:first-child {
    padding-top: 0;
  }
}


/* cleanup pass: clearer menu state, external links, and mobile table handling */
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-toggle span { transition: transform 0.18s ease, opacity 0.18s ease; }
.content-page a[target="_blank"] { text-decoration: underline; text-underline-offset: 0.14em; }
@media (max-width: 760px) {
  .inline-table-wrap { overflow: visible; border: 0; background: transparent; }
  .inline-table, .inline-table thead, .inline-table tbody, .inline-table tr, .inline-table th, .inline-table td { display: block; width: 100%; min-width: 0; }
  .inline-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .inline-table tr { margin: 0 0 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: white; overflow: hidden; }
  .inline-table td { border-bottom: 1px solid var(--line); padding: 0.72rem 0.85rem; }
  .inline-table td:last-child { border-bottom: 0; }
}


.byline {
  margin: 0 0 0.85rem;
  font-size: 0.96rem;
  opacity: 0.78;
}

.byline a {
  text-decoration: none;
}

.byline a:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}


.back-link {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.back-link a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.routine-steps {
  margin: 0.9rem 0 0;
  padding-left: 1.15rem;
}

.routine-steps li {
  margin: 0 0 0.8rem;
}



/* phase 10 footer redesign */
.site-footer {
  margin-top: 4.5rem;
  padding: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.055));
}

.site-footer .container {
  display: block;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1.5fr);
  gap: 2rem 2.5rem;
  padding: 2.2rem 0 1.35rem;
}

.footer-brand-block {
  max-width: 22rem;
  text-align: left;
}

.footer-brand-title {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}

.footer-brand-copy {
  margin: 0;
  line-height: 1.55;
  opacity: 0.82;
}

.footer-links-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  align-items: start;
}

.footer-column {
  text-align: left;
}

.footer-title {
  margin: 0 0 0.7rem;
  font-weight: 700;
}

.footer-nav {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
  text-align: left;
}

.footer-nav a {
  text-decoration: none;
  line-height: 1.35;
}

.footer-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.subfooter {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.95rem 0 1.15rem;
}

.subfooter-text {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.78;
}

@media (max-width: 860px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    padding: 1.85rem 0 1.15rem;
  }

  .footer-links-wrap {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
  }
}

@media (max-width: 640px) {
  .site-footer {
    margin-top: 3.5rem;
  }

  .footer-links-wrap {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .subfooter {
    padding: 0.9rem 0 1rem;
  }

  .subfooter-text {
    line-height: 1.5;
  }
}
