:root {
  --bg-canvas: #f3e9d8;
  --bg-surface: #fffaf2;
  --bg-surface-hover: #ebe0cd;
  --text-primary: #262626;
  --text-muted: #575049;
  --accent-primary: #c2410c;
  --accent-secondary: #9a3412;
  --border-subtle: rgba(38, 38, 38, 0.18);
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(38, 38, 38, 0.14);
  --glow-accent: 0 0 18px -4px rgba(194, 65, 12, 0.32);
  --glass-backdrop: blur(16px) saturate(180%);
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-canvas);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 16px;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.68;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

.page-frame {
  border: 1px solid var(--text-primary);
  background-color: var(--bg-canvas);
  min-height: calc(100vh - 32px);
  min-width: 0;
}

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

.img-16-9 { aspect-ratio: 16 / 9; }
.img-4-3 { aspect-ratio: 4 / 3; }
.img-1-1 { aspect-ratio: 1 / 1; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 4.2vw, 3.35rem); margin-top: 0; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.05rem); padding-bottom: 0.45rem; border-bottom: 1px solid var(--border-subtle); }
h3 { font-size: 1.25rem; }

p, ul, ol, dl {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

p, li, dd, figcaption {
  text-wrap: pretty;
}

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

a[href^="mailto:"] {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

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

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text-primary);
  color: var(--bg-surface);
  padding: 0.65rem 1rem;
  z-index: 100;
}

.skip-link:focus { left: 1rem; top: 1rem; }

/* Header & Navigation */
.site-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.15rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
  z-index: 20;
}

.site-header--hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(22, 19, 17, 0.78) 0%, rgba(22, 19, 17, 0) 100%);
  border-bottom-color: rgba(255, 250, 242, 0.2);
}

.site-header--hero .brand-link,
.site-header--hero .nav-link,
.site-header--hero .menu-toggle {
  color: var(--bg-surface);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text-primary);
  white-space: nowrap;
  hyphens: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.35rem;
  min-width: 0;
}

.nav-link {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-primary);
  white-space: nowrap;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

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

.site-header--hero .nav-link:hover, .site-header--hero .nav-link[aria-current="page"] {
  color: #f3e9d8;
  border-bottom-color: var(--accent-primary);
}

.menu-toggle {
  display: none;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 0;
  color: var(--text-primary);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

/* Hero */
.hero-wrap {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--text-primary);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 17, 15, 0.56) 0%, rgba(20, 17, 15, 0.72) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 70ch;
  min-width: 0;
  padding: 9rem 2rem 4.5rem;
  text-align: center;
  color: var(--bg-surface);
}

.hero-kicker {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #e7d8c1;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.hero-content h1 {
  color: var(--bg-surface);
  margin-bottom: 1.15rem;
}

.hero-lead {
  font-size: 1.15rem;
  color: #f3e9d8;
  margin: 0 auto 2rem;
  max-width: 56ch;
}

/* Buttons */
.btn {
  display: inline-block;
  max-width: 100%;
  border-radius: 0;
  border: 1px solid var(--accent-primary);
  background: transparent;
  color: var(--accent-primary);
  padding: 0.8rem 1.55rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  white-space: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
  cursor: pointer;
  transition: transform 0.25s var(--ease-kinetic), background-color 0.25s var(--ease-kinetic), color 0.25s var(--ease-kinetic), box-shadow 0.25s var(--ease-kinetic);
}

.btn:hover {
  background-color: var(--accent-primary);
  color: var(--bg-surface);
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevation), var(--glow-accent);
}

.btn--hero {
  border-color: var(--bg-surface);
  color: var(--bg-surface);
  background-color: rgba(20, 17, 15, 0.35);
}

.btn--hero:hover {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--bg-surface);
}

.btn--secondary {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn--secondary:hover {
  background-color: var(--text-primary);
  color: var(--bg-surface);
}

/* Layout Column */
.journal-main {
  max-width: 1200px;
  min-width: 0;
  margin: 0 auto;
  padding: 3.25rem 2rem 4.5rem;
}

.reading-column {
  width: 100%;
  max-width: 70ch;
  min-width: 0;
  margin: 0 auto;
}

.page-intro {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.75rem;
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-primary);
  margin-bottom: 0.65rem;
  display: block;
  text-wrap: balance;
}

.meta-line {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.section-block {
  margin-bottom: 3.5rem;
  min-width: 0;
}

/* Breakout Figures & Pull Quotes */
.breakout-figure {
  margin: 2.25rem -4rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem;
}

.breakout-figure figcaption {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-top: 0.65rem;
  line-height: 1.45;
}

.inline-figure {
  margin: 2rem 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem;
}

.inline-figure figcaption {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-top: 0.6rem;
}

.pull-quote {
  margin: 2.2rem 0 2.2rem -2.5rem;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--accent-primary);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.48;
  color: var(--text-primary);
  max-width: 54ch;
  text-wrap: pretty;
}

.pull-quote cite {
  display: block;
  margin-top: 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-style: normal;
  color: var(--text-muted);
}

/* Thinly Divided Icon-Led Rows (No Cards) */
.ledger-rows {
  border-top: 1px solid var(--text-primary);
  margin: 1.75rem 0 2.25rem;
}

.ledger-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 1rem 1.25rem;
  align-items: start;
  padding: 1.25rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.25s var(--ease-kinetic);
}

.ledger-row > div {
  min-width: 0;
}

.ledger-row:hover {
  background-color: var(--bg-surface);
}

.row-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
  margin-top: 0.2rem;
}

.row-title {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  margin: 0 0 0.35rem;
}

.row-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.row-title a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.row-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.row-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 0.25rem;
}

/* Evidence vs Inference Definition List */
.evidence-list {
  border-top: 1px solid var(--border-subtle);
  margin: 1.5rem 0 2rem;
}

.evidence-list dt {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--text-primary);
  margin-top: 1.15rem;
}

.evidence-list dd {
  margin-left: 0;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Numbered Inspection Sequence */
.inspection-sequence {
  list-style: none;
  padding: 0;
  margin: 1.75rem 0;
  counter-reset: step;
  border-top: 1px solid var(--border-subtle);
}

.inspection-sequence li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.inspection-sequence li::before {
  content: "0" counter(step);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--accent-primary);
  line-height: 1.2;
}

.inspection-sequence strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

/* Keep table columns readable; scroll instead of splitting words. */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.94rem;
  line-height: 1.55;
  text-align: left;
}

th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

th {
  font-family: var(--font-serif);
  font-weight: 400;
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
  border-bottom: 1px solid var(--text-primary);
}

/* Accessible Disclosure FAQ Rows */
.faq-list {
  border-top: 1px solid var(--text-primary);
  margin: 1.5rem 0 2rem;
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.15rem 2rem 1.15rem 0.25rem;
  font-family: var(--font-serif);
  font-size: 1.14rem;
  line-height: 1.5;
  position: relative;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0.5rem;
  top: 1rem;
  font-family: var(--font-sans);
  font-size: 1.25rem;
  color: var(--accent-primary);
}

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

.faq-answer {
  padding: 0 0.5rem 1.25rem 0.25rem;
  color: var(--text-muted);
}

/* Contact Tool Form */
.field-group {
  min-width: 0;
  margin-bottom: 1.25rem;
}

.field-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--text-primary);
  border-radius: 4px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
}

.field-group textarea {
  resize: vertical;
}

.preview-box {
  max-width: 100%;
  overflow-x: auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  margin: 1rem 0 1.25rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.status-note {
  font-size: 0.9rem;
  color: var(--accent-primary);
  min-height: 1.4em;
  margin-top: 0.6rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--text-primary);
  background-color: var(--bg-surface);
  padding: 2.5rem 2rem;
}

.footer-inner {
  max-width: 70ch;
  min-width: 0;
  margin: 0 auto;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.footer-block {
  margin-bottom: 1.15rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.footer-links a {
  color: var(--text-primary);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .breakout-figure { margin: 2rem -1.5rem; }
  .pull-quote { margin-left: 0; }
}

@media (max-width: 768px) {
  body { padding: 8px; }
  .page-frame { min-height: calc(100vh - 16px); }
  .site-header { padding: 1rem 1.15rem; }
  .menu-toggle { display: inline-block; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 1.25rem 1.35rem;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--text-primary);
    box-shadow: var(--shadow-elevation);
    z-index: 30;
  }
  .site-header--hero .primary-nav {
    background-color: #1f1b18;
    border-bottom-color: var(--accent-primary);
  }
  .primary-nav.is-open { display: flex; }
  .journal-main { padding: 2.25rem 1.15rem 3rem; }
  .breakout-figure { margin: 1.75rem 0; }
  .ledger-row {
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 0.85rem;
  }
  .row-tag { grid-column: 2; padding-top: 0; }
  .site-footer { padding: 2rem 1.15rem; }
}

@media (max-width: 480px) {
  .site-header { gap: 0.75rem; }
  .brand-link {
    gap: 0.4rem;
    font-size: clamp(0.875rem, 3.8vw, 1.1rem);
    letter-spacing: 0;
  }
  .hero-content { padding: 7rem 1.15rem 3.5rem; }
  .inspection-sequence li {
    grid-template-columns: 2.4rem minmax(0, 1fr);
    gap: 0.7rem;
  }
  .ledger-row {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 0;
    padding-left: 0;
    row-gap: 0.5rem;
  }
  .row-tag { grid-column: 1; }
  .btn { padding-right: 1rem; padding-left: 1rem; }
}