:root {
  --bg: #f7f1e8;
  --surface: #fffaf2;
  --surface-alt: #f0e7d8;
  --text: #2b2118;
  --muted: #6b5b4b;
  --primary: #c2562f;
  --primary-hover: #a64623;
  --accent: #e0a03a;
  --border: #dfd2be;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .08);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.prose-wrap {
  max-width: 70ch;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--text);
  border: 2px solid var(--accent);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  top: 4px;
  left: 4px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.site-nav a:hover { color: var(--primary); text-decoration: none; }

/* Hero & Quiz Stage */
.hero-stage {
  padding: 32px 0 48px;
}
.hero-header {
  max-width: 760px;
  margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--text);
  margin-top: 0;
}
h1 { font-size: 40px; margin-bottom: 12px; }
h2 { font-size: 28px; margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 8px; }
.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 64ch;
}

.tool-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-primary:focus-visible, .btn-secondary:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
}


/* Engage Bar */
.engage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.engage-btn[data-gf-liked] {
  border-color: var(--primary);
  background: #fdece5;
  color: #8c3518;
}
.share-feedback {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

/* Sections */
.section-band {
  padding: 56px 0;
}
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-lead {
  color: var(--muted);
  max-width: 68ch;
  margin: 0 0 24px;
}

/* Split Band */
.split-band {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: center;
}
.key-points {
  padding-left: 20px;
  margin: 16px 0 0;
}
.key-points li { margin-bottom: 10px; }
.split-figure {
  margin: 0;
}
.split-figure figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

/* 3x3 Atlas Grid */
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.atlas-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.atlas-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.atlas-head h3 { margin: 0; font-size: 18px; }
.atlas-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 26px;
  border-radius: 6px;
  background: var(--text);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.atlas-role {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}
.atlas-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Prose */
.prose-wrap h2 { margin-top: 32px; }
.prose-wrap h2:first-child { margin-top: 0; }
.prose-wrap ul, .prose-wrap ol { padding-left: 22px; }
.prose-wrap li { margin-bottom: 8px; }

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.faq-item p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* Comments */
.comment-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.form-row label {
  font-size: 14px;
  font-weight: 600;
}
.form-row input, .form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.form-msg { margin: 10px 0 0; font-size: 14px; color: var(--primary); }
.comments-list { display: grid; gap: 12px; }
.comments-list[data-gf-empty]::before {
  content: "No results shared yet. Complete the quiz above and be the first to post your alignment.";
  display: block;
  color: var(--muted);
  font-size: 14px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.comment-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.comment-card[data-gf-owner] { border-color: var(--primary); }
.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
.comment-meta strong { color: var(--text); }
.owner-badge {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}
.comment-body { margin: 0 0 8px; }
.comment-replies { margin-top: 10px; padding-left: 16px; border-left: 2px solid var(--border); display: grid; gap: 8px; }

/* Inner & Legal Pages */
.content-page { padding: 48px 0 64px; }
.breadcrumb { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.page-lead, .legal-date { color: var(--muted); margin-top: 0; margin-bottom: 24px; }
.page-cta { margin-top: 32px; }

/* Footer */
.site-footer {
  background: var(--text);
  color: #e6dac8;
  padding: 40px 0 28px;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 250, 242, 0.14);
}
.footer-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fffaf2;
}
.footer-note { margin: 0; color: #cbbba6; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links a { color: #f7f1e8; }
.footer-bottom {
  padding-top: 18px;
  color: #b7a690;
}
.footer-bottom p { margin: 0; }

/* Quiz Widget Styles */
.mat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
}
.mat-bar {
  height: 8px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}
.mat-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width .2s ease;
}
.mat-question {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 24px;
  min-height: 64px;
}
.mat-choices {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.mat-choice {
  min-height: 52px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.mat-choice:hover { border-color: var(--primary); background: #fdece5; }
.mat-choice.is-picked { background: var(--primary); border-color: var(--primary); color: #fff; }
.mat-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.mat-hint { font-size: 12px; color: var(--muted); }

/* Result Dashboard */
.mat-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.mat-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fdece5;
  color: #8c3518;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.mat-result-title { font-size: 32px; margin: 0 0 6px; }
.mat-result-sub { color: var(--primary); font-weight: 600; margin: 0 0 12px; }
.mat-result-desc { color: var(--muted); margin: 0 0 20px; }
.mat-axes { display: grid; gap: 14px; margin-bottom: 20px; }
.mat-axis-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.mat-axis-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-alt);
}
.mat-axis-mid {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.mat-axis-dot {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--surface);
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-sm);
}
.mat-result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.mat-tally {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.mat-svg-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

@media (max-width: 820px) {
  .split-band, .mat-result-grid { grid-template-columns: 1fr; }
  .atlas-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  .header-inner { flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .site-nav { gap: 14px; flex-wrap: wrap; }
  .tool-shell { padding: 20px 16px; }
  .mat-question { font-size: 20px; min-height: auto; }
  .mat-choices { grid-template-columns: 1fr; }
  .atlas-grid { grid-template-columns: 1fr; }
  .mat-result-actions .btn-primary, .mat-result-actions .btn-secondary { width: 100%; }
  .footer-inner { flex-direction: column; }
}


/* Editorial Masthead & Visual Polish */
.hero-masthead {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}
.hero-masthead .hero-header { margin-bottom: 0; }
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.hero-art {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}
.hero-art img {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
}
.tool-shell {
  border-top: 4px solid var(--primary);
}
.mat-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 56px;
  box-shadow: var(--shadow-sm);
}
.mat-choice:hover { transform: translateY(-1px); }
.atlas-banner {
  margin: 0 0 28px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.atlas-banner img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}
.atlas-cell {
  transition: border-color .15s ease, transform .15s ease;
}
.atlas-cell:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
@media (max-width: 820px) {
  .hero-masthead { grid-template-columns: 1fr; gap: 16px; }
  .hero-art img { max-height: 180px; }
}
/* Tables, Methodology & Result Next Steps */
.prose-wrap table, .prose-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 15px;
}
.prose-wrap th, .prose-wrap td, .prose-body th, .prose-body td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose-wrap th, .prose-body th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--text);
}
.prose-wrap tr:last-child td, .prose-body tr:last-child td { border-bottom: none; }
.mat-next-box {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}
.mat-next-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.mat-next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mat-next-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.mat-next-link:hover { border-color: var(--primary); color: var(--primary); }
.dnd-meta-row {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 14px;
}
.dnd-meta-row strong { color: var(--text); }
