:root {
  --bg-canvas: #fbf1f0;
  --bg-surface: rgba(255, 250, 248, 0.86);
  --bg-surface-hover: rgba(255, 250, 248, 0.96);
  --text-primary: #1c1917;
  --text-muted: #57504d;
  --accent-primary: #6b2155;
  --accent-secondary: #8c2d6e;
  --border-subtle: rgba(107, 33, 85, 0.22);
  --border-light: rgba(255, 250, 248, 0.28);
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(28, 25, 23, 0.14);
  --glow-accent: 0 0 24px -4px rgba(107, 33, 85, 0.32);
  --glass-backdrop: blur(16px) saturate(180%);
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, Consolas, "Courier New", monospace;
}

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

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.65;
  font-size: 16px;
  overflow-wrap: anywhere;
  hyphens: auto;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 0;
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--accent-secondary);
}

h1, h2, h3, h4 {
  line-height: 1.18;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.mono-label, .badge-pill, .step-num, th, .meta-caption, .small-heading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.prose-width {
  max-width: 70ch;
  margin: 0 auto;
}

/* Header: strictly static/relative, left-aligned brand, balanced nav groups */
.site-header {
  position: relative;
  background-color: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  background-color: var(--accent-primary);
  color: #fffaf8;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-radius: 50%;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  max-width: 760px;
  margin-left: auto;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
}

.nav-group a {
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}

.nav-group a:hover,
.nav-group a[aria-current="page"] {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  background: var(--accent-primary);
  color: #fffaf8;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-dropdown {
  display: none;
  background-color: #fffaf8;
  border-bottom: 2px solid var(--accent-primary);
  padding: 1rem 1.5rem;
}

.mobile-dropdown.open {
  display: block;
}

.mobile-dropdown ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.mobile-dropdown a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Hero: Solid blush field, very large headline, no imagery */
.hero-blush {
  background-color: var(--bg-canvas);
  padding: 4.5rem 0 4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-eyebrow {
  display: inline-block;
  background-color: rgba(107, 33, 85, 0.1);
  color: var(--accent-primary);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
}

.hero-blush h1 {
  font-size: clamp(2.35rem, 5.2vw, 4.4rem);
  max-width: 18ch;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-lead {
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  color: var(--text-muted);
  max-width: 66ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

/* Buttons: borderless plum pills with high-contrast light labels */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--accent-primary);
  color: #fffaf8;
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.65rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-kinetic), box-shadow 0.25s var(--ease-kinetic), background-color 0.2s ease;
}

.btn-pill:hover {
  background-color: var(--accent-secondary);
  color: #fffaf8;
  transform: translateY(-3px) scale(1.015);
  box-shadow: var(--shadow-elevation), var(--glow-accent);
}

.btn-pill-light {
  background-color: #fffaf8;
  color: var(--accent-primary);
}

.btn-pill-light:hover {
  background-color: #fbf1f0;
  color: var(--accent-primary);
}

/* Chapters & Full-Width Plum Blocks */
.section-neutral {
  background-color: var(--bg-canvas);
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-plum {
  background-color: var(--accent-primary);
  color: #fffaf8;
  padding: 4.5rem 0;
}

.section-plum h2,
.section-plum h3,
.section-plum h4 {
  color: #fffaf8;
}

.section-plum .text-muted {
  color: rgba(255, 250, 248, 0.82);
}

/* Editorial Split-Screen Layout */
.split-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.split-section.reverse {
  grid-template-columns: 0.85fr 1.15fr;
}

.split-copy h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin: 0.5rem 0 1.1rem;
}

.split-copy p {
  margin-bottom: 1.1rem;
  max-width: 68ch;
}

/* Render Frame: Square corners, plain softly-lit backdrop, explicit illustration label */
.render-frame {
  background-color: #fffaf8;
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-elevation);
}

.render-frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: #f3e6e4;
}

.render-caption {
  padding: 0.85rem 1.1rem;
  background-color: #fffaf8;
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.badge-round {
  display: inline-block;
  background-color: var(--accent-primary);
  color: #fffaf8;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* Translucent Cards over Plum Fields */
.glass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.glass-card {
  background: rgba(255, 250, 248, 0.13);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-light);
  border-radius: 0;
  padding: 1.75rem;
  color: #fffaf8;
  transition: transform 0.3s var(--ease-kinetic), box-shadow 0.3s var(--ease-kinetic), background 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px) scale(1.015);
  background: rgba(255, 250, 248, 0.2);
  box-shadow: var(--shadow-elevation);
}

.glass-card h3 {
  font-size: 1.25rem;
  margin: 0.6rem 0 0.75rem;
  color: #fffaf8;
}

.glass-card p {
  font-size: 0.95rem;
  color: rgba(255, 250, 248, 0.9);
  margin-bottom: 1rem;
}

.glass-card a {
  color: #fffaf8;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Neutral Ivory Cards */
.ivory-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 1.75rem;
  transition: transform 0.3s var(--ease-kinetic), box-shadow 0.3s var(--ease-kinetic);
}

.ivory-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevation);
}

/* Ordered Observation-to-Evidence Strip */
.evidence-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2.25rem 0;
}

.evidence-node {
  background-color: #fffaf8;
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  border-radius: 0;
  position: relative;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: #fffaf8;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.evidence-node h4 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.evidence-node p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Contributor / Method Strip with Round Avatars */
.contributor-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.5rem 0.9rem;
  background-color: #fffaf8;
  border: 1px solid var(--border-subtle);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: #fffaf8;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Source-Linked Definitions & Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--border-subtle);
  background-color: #fffaf8;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

th, td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background-color: rgba(107, 33, 85, 0.08);
  color: var(--accent-primary);
}

/* FAQ Accordion */
.faq-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

details.faq-item {
  background-color: #fffaf8;
  border: 1px solid var(--border-subtle);
  padding: 1.1rem 1.35rem;
  color: var(--text-primary);
}

details.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

details.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  background-color: var(--accent-primary);
  color: #fffaf8;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

details.faq-item[open] summary::after {
  content: "−";
}

details.faq-item p {
  margin-top: 0.85rem;
  color: var(--text-muted);
}

/* Contact Form & Tool */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-subtle);
  background-color: #fffaf8;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 0;
}

.draft-output {
  background-color: #fffaf8;
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  min-height: 210px;
  margin-bottom: 1rem;
}

/* Footer */
.site-footer {
  background-color: #1c1917;
  color: #fbf1f0;
  padding: 3.5rem 0 2.5rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid rgba(251, 241, 240, 0.16);
}

.site-footer h3 {
  color: #fbf1f0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.site-footer a {
  color: #fbf1f0;
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(251, 241, 240, 0.76);
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-kinetic), transform 0.65s var(--ease-kinetic);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .split-section,
  .split-section.reverse,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-grid;
    place-items: center;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-blush {
    padding: 3rem 0 2.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  .mobile-dropdown ul {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
