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

:root {
  color-scheme: light;
  --ink: #111511;
  --ink-soft: #3d433d;
  --muted: #687268;
  --paper: #f5f2ea;
  --paper-strong: #fffdf8;
  --paper-cool: #eaf1ee;
  --line: rgba(17, 21, 17, 0.14);
  --line-strong: rgba(17, 21, 17, 0.28);
  --forest: #205f45;
  --leaf: #a9d7a8;
  --river: #2d6d7a;
  --saffron: #b8751d;
  --madder: #9b4d47;
  --night: #101510;
  --night-soft: #202821;
  --night-line: rgba(244, 240, 228, 0.18);
  --night-text: #f4f0e4;
  --shadow: 0 18px 46px rgba(24, 36, 30, 0.12);
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --max: 1180px;
  --radius: 8px;
  --nav-height: 72px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, summary { font: inherit; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--night-line);
  background: rgba(16, 21, 16, 0.9);
  color: var(--night-text);
  backdrop-filter: blur(14px);
  isolation: isolate;
  overflow: visible;
}

.site-nav::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  z-index: -1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(169, 215, 168, 0.12) 32%, rgba(169, 215, 168, 0.58) 50%, rgba(169, 215, 168, 0.12) 68%, transparent 100%);
  transform: translateX(-54%);
  animation: navTrace 9s ease-in-out infinite;
}

.nav-inner {
  width: min(var(--max), calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  white-space: nowrap;
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(244, 240, 228, 0.35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--leaf);
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(169, 215, 168, 0.42);
  border-radius: 50%;
  animation: brandBreath 5.6s ease-in-out infinite;
}

.brand-mark::after {
  inset: 10px;
  opacity: 0.6;
  animation-delay: 1.4s;
}

.brand:hover .brand-mark {
  border-color: rgba(169, 215, 168, 0.8);
}

.menu-button {
  display: none;
  min-height: 38px;
  padding: 0 36px 0 14px;
  border: 1px solid rgba(244, 240, 228, 0.25);
  border-radius: 7px;
  background: rgba(244, 240, 228, 0.07);
  color: var(--night-text);
  font-weight: 720;
  cursor: pointer;
  position: relative;
  transition: background 180ms ease, border-color 180ms ease;
}

.menu-button::before,
.menu-button::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 12px;
  height: 1px;
  background: currentColor;
  transition: transform 180ms ease, top 180ms ease, bottom 180ms ease;
}

.menu-button::before { top: 13px; }
.menu-button::after { bottom: 13px; }

.site-nav.is-open .menu-button::before {
  top: 18px;
  transform: rotate(42deg);
}

.site-nav.is-open .menu-button::after {
  bottom: 17px;
  transform: rotate(-42deg);
}

.menu-button:hover {
  background: rgba(244, 240, 228, 0.12);
  border-color: rgba(244, 240, 228, 0.38);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: rgba(244, 240, 228, 0.72);
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 0.86rem;
  white-space: nowrap;
  position: relative;
  transition: background 180ms ease, color 180ms ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 5px;
  left: 10px;
  height: 1px;
  background: var(--leaf);
  opacity: 0;
  transform: scaleX(0.35);
  transform-origin: left;
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--night-text);
  background: rgba(244, 240, 228, 0.09);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  opacity: 0.75;
  transform: scaleX(1);
}

.nav-links .language-link {
  border: 1px solid rgba(244, 240, 228, 0.2);
  margin-left: 4px;
  color: var(--night-text);
  background: rgba(244, 240, 228, 0.08);
}

.view { display: block; }
.has-router .view { display: none; }
.has-router .view.is-active { display: block; }

.hero {
  position: relative;
  min-height: min(860px, calc(88svh - var(--nav-height)));
  overflow: hidden;
  background: var(--night);
  color: var(--night-text);
  border-bottom: 1px solid var(--line-strong);
}

#breath-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.72;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(16, 21, 16, 0), var(--night));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 32px));
  min-height: min(860px, calc(88svh - var(--nav-height)));
  margin: 0 auto;
  padding: 74px 0 46px;
  display: grid;
  align-content: center;
  gap: 42px;
}

.hero-copy { max-width: 890px; }

.eyebrow,
.label {
  color: var(--forest);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--leaf);
  margin-bottom: 24px;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--leaf);
}

h1 {
  max-width: 1120px;
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: 0.96;
  letter-spacing: 0;
  font-weight: 820;
}

h1 span { display: block; }

h2 {
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 820;
  max-width: 860px;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.25;
  margin-bottom: 10px;
}

.hero-lede,
.page-lede,
.section-intro {
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-lede {
  max-width: 760px;
  margin-top: 30px;
  color: rgba(244, 240, 228, 0.78);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(244, 240, 228, 0.25);
  border-radius: 7px;
  color: var(--night-text);
  background: rgba(244, 240, 228, 0.08);
  font-weight: 720;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 240, 228, 0.55);
  background: rgba(244, 240, 228, 0.13);
}

.button.primary {
  color: #0f1a12;
  border-color: var(--leaf);
  background: var(--leaf);
}

.foundation-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--night-line);
}

.foundation-strip a {
  min-height: 112px;
  padding: 20px;
  background: rgba(244, 240, 228, 0.06);
  transition: background 180ms ease;
}

.foundation-strip a:hover { background: rgba(244, 240, 228, 0.1); }

.foundation-strip strong {
  display: block;
  color: #cde2c4;
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 12px;
}

.foundation-strip span {
  color: rgba(244, 240, 228, 0.7);
  font-size: 0.88rem;
}

.section {
  padding: 92px 0;
  border-bottom: 1px solid var(--line);
}

.section.alt { background: var(--paper-cool); }
.section.dark {
  background: var(--night);
  color: var(--night-text);
  border-color: var(--night-line);
}

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.75fr);
  gap: 44px;
  align-items: end;
  margin-bottom: 42px;
}

.section-head.compact {
  display: block;
  margin-bottom: 28px;
}

.practice-flow,
.room-grid,
.evidence-grid,
.source-list {
  display: grid;
  gap: 16px;
}

.practice-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.research-spine {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: stretch;
}

.research-spine article,
.term-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
}

.research-spine article {
  padding: 26px;
}

.research-spine p:last-child {
  color: var(--ink-soft);
  max-width: 850px;
}

.term-strip {
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 8px;
}

.term-strip a,
.term-chip-list a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(32, 95, 69, 0.24);
  border-radius: 999px;
  color: var(--forest);
  background: rgba(32, 95, 69, 0.06);
  font-size: 0.86rem;
  font-weight: 760;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.term-strip a:hover,
.term-chip-list a:hover {
  transform: translateY(-1px);
  border-color: rgba(32, 95, 69, 0.42);
  background: rgba(32, 95, 69, 0.1);
}

.practice-flow article,
.room-card,
.evidence-grid article,
.prose-panel,
.side-rail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
}

.practice-flow article {
  min-height: 230px;
  padding: 24px;
}

.practice-flow b,
.room-card span,
.evidence-grid b,
.rail-item b {
  display: block;
  color: var(--forest);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.practice-flow p,
.room-card p,
.evidence-grid p,
.prose-panel p,
.rail-item span {
  color: var(--ink-soft);
}

.room-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.room-card {
  min-height: 230px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.room-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.primary-room {
  background: #162117;
  color: var(--night-text);
  border-color: rgba(244, 240, 228, 0.18);
}

.primary-room p { color: rgba(244, 240, 228, 0.74); }
.primary-room span { color: var(--leaf); }

.room-card em {
  margin-top: auto;
  padding-top: 22px;
  color: var(--forest);
  font-style: normal;
  font-size: 0.86rem;
  font-weight: 760;
}

.primary-room em {
  color: var(--leaf);
}

.connection-map {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-strong);
}

.connection-map a {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 20px 22px;
  border-top: 1px solid var(--line);
  transition: background 180ms ease;
}

.connection-map a:first-child { border-top: 0; }
.connection-map a:hover { background: rgba(32, 95, 69, 0.06); }
.connection-map b { color: var(--forest); }
.connection-map span { color: var(--ink-soft); }

.page-hero {
  background: var(--night);
  color: var(--night-text);
  padding: 88px 0 74px;
  border-bottom: 1px solid var(--night-line);
}

.page-hero .label { color: var(--leaf); }
.page-hero h2 { max-width: 980px; }
.page-lede {
  max-width: 760px;
  margin-top: 24px;
  color: rgba(244, 240, 228, 0.72);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  margin-bottom: 28px;
  border: 1px solid rgba(244, 240, 228, 0.22);
  border-radius: 6px;
  color: rgba(244, 240, 228, 0.72);
  font-size: 0.86rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.prose-panel {
  padding: 30px;
}

.prose-panel p + p { margin-top: 16px; }

details {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

summary {
  list-style: none;
  cursor: pointer;
  display: block;
  font-weight: 760;
  padding-right: 32px;
  position: relative;
}

summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  color: var(--forest);
  position: absolute;
  top: 0;
  right: 0;
}
details[open] summary::after { content: "−"; }
details p { margin-top: 12px; }

.side-rail {
  padding: 22px;
}

.rail-item {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.rail-item:first-of-type { border-top: 0; }
.rail-item b { margin-bottom: 7px; }

.evidence-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.evidence-grid article {
  min-height: 230px;
  padding: 24px;
}

.evidence-list {
  display: grid;
  gap: 1px;
  margin: 18px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}

.evidence-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 16px;
  background: var(--paper-strong);
}

.evidence-list b { color: var(--forest); }
.evidence-list span { color: var(--ink-soft); }

.report {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  padding: 30px;
}

.report h3 {
  max-width: 760px;
  margin-bottom: 18px;
}

.report p {
  max-width: 900px;
  color: var(--ink-soft);
}

.report p + p { margin-top: 16px; }

.term-link {
  color: var(--forest);
  font-weight: 760;
  text-decoration-line: underline;
  text-decoration-color: rgba(32, 95, 69, 0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.term-link:hover {
  color: #123d2b;
  text-decoration-color: currentColor;
}

.section.dark .term-link,
.page-hero .term-link,
.hero .term-link {
  color: #cde2c4;
  text-decoration-color: rgba(205, 226, 196, 0.38);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}

.report-grid div {
  min-height: 120px;
  padding: 18px;
  background: var(--paper-strong);
}

.report-grid b {
  display: block;
  color: var(--forest);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.report-grid span { color: var(--ink-soft); }

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.report-table th,
.report-table td {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.report-table th {
  color: var(--forest);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.term-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.term-report {
  margin-top: 0;
}

.term-context-list {
  display: grid;
  gap: 1px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}

.term-context-list a {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  padding: 18px;
  background: var(--paper-strong);
  transition: background 180ms ease;
}

.term-context-list a:hover {
  background: #f7fbf1;
}

.term-context-list b {
  color: var(--forest);
}

.term-context-list span {
  color: var(--ink-soft);
}

.term-rail {
  position: sticky;
  top: 92px;
}

.term-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 18px;
}

.source-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.source {
  min-height: 150px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(244, 240, 228, 0.06);
}

.source strong {
  display: block;
  color: #cde2c4;
  margin-bottom: 10px;
}

.source span {
  color: rgba(244, 240, 228, 0.68);
  font-size: 0.92rem;
}

.dossier-index {
  margin-top: 46px;
}

.dossier-index .label {
  color: var(--leaf);
}

.dossier-index h3 {
  color: var(--night-text);
  margin-bottom: 18px;
}

.dossier-list {
  display: grid;
  gap: 1px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--night-line);
}

.dossier-list div {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) 1fr;
  gap: 22px;
  padding: 16px 18px;
  background: rgba(244, 240, 228, 0.06);
}

.dossier-list b {
  color: #cde2c4;
}

.dossier-list span {
  color: rgba(244, 240, 228, 0.7);
}

.footer {
  padding: 42px 0;
  background: var(--night);
  color: rgba(244, 240, 228, 0.66);
  font-size: 0.9rem;
}

.footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

@keyframes navTrace {
  0%, 100% { transform: translateX(-54%); opacity: 0.55; }
  48% { transform: translateX(54%); opacity: 0.95; }
}

@keyframes brandBreath {
  0%, 100% { transform: scale(0.65); opacity: 0.2; }
  45% { transform: scale(1.28); opacity: 0.82; }
  70% { transform: scale(1.06); opacity: 0.34; }
}

@media (max-width: 980px) {
  .nav-inner {
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 0;
    gap: 12px;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .nav-links {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: 0;
    padding: 0 10px;
    border: 1px solid var(--night-line);
    border-radius: var(--radius);
    background: rgba(244, 240, 228, 0.055);
    overflow-x: visible;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: max-height 220ms ease, padding 220ms ease, opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  }

  .site-nav.is-open .nav-links {
    max-height: 360px;
    padding: 10px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 10px;
  }

  .nav-links .language-link {
    margin-left: 0;
  }
  .hero-inner { padding-top: 52px; }
  .foundation-strip,
  .practice-flow,
  .room-grid,
  .evidence-grid,
  .source-list,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-head,
  .detail-layout,
  .research-spine,
  .term-layout {
    grid-template-columns: 1fr;
  }

  .term-rail {
    position: static;
  }
}

@media (max-width: 620px) {
  .foundation-strip,
  .practice-flow,
  .room-grid,
  .evidence-grid,
  .source-list,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .section { padding: 68px 0; }
  .page-hero { padding: 58px 0 54px; }
  h1 {
    font-size: clamp(2rem, 8.6vw, 2.4rem);
    line-height: 1.03;
  }
  .hero-lede { font-size: 1rem; }
  .hero-actions .button { width: 100%; }
  .connection-map a,
  .evidence-list div,
  .dossier-list div,
  .term-context-list a {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .report { padding: 22px; }
  .report-table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
  .brand { font-size: 0.96rem; }
  .research-spine article,
  .term-strip {
    padding: 20px;
  }
}

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