/* Hallmark · macrostructure: Split Studio · tone: soft editorial health · theme: Garden · anchor hue: leaf green · audience: general · use: read and judge
 * contrast: pass (40–41) · nav: N9 · footer: Ft1 · slop: pass (42–45)
 * honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (34, 49–57) · icons: pass (30)
 */
/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V5 */
@import url("tokens.css");

html,
body {
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 20rem;
  color: var(--color-ink);
  background: var(--color-paper);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.78;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: var(--rule-medium);
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  inset-block-start: var(--space-sm);
  inset-inline-start: var(--space-sm);
  z-index: 500;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-on-accent);
  background: var(--color-accent);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.nav-edge {
  position: relative;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - var(--space-xl), var(--content-wide));
  margin-inline: auto;
  padding-block: var(--space-lg);
  border-bottom: var(--rule-thin) solid var(--color-rule);
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu-btn {
  position: relative;
}

.nav-menu-btn summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: var(--space-md);
  border: var(--rule-thin) solid var(--color-accent);
  border-radius: var(--radius-pill);
  color: var(--color-accent);
  background: var(--color-paper);
  font-weight: 700;
  line-height: 1;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.nav-menu-btn summary::-webkit-details-marker {
  display: none;
}

.nav-menu-btn summary:hover,
.nav-menu-btn[open] summary {
  color: var(--color-on-accent);
  background: var(--color-accent);
}

.nav-menu-btn summary:active {
  transform: translateY(1px);
}

.nav-menu-btn summary[aria-disabled="true"],
.nav-sheet a[aria-disabled="true"],
.chapter-nav a[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-sheet {
  position: absolute;
  inset-block-start: calc(100% + var(--space-sm));
  inset-inline-end: 0;
  display: grid;
  min-width: min(20rem, calc(100vw - var(--space-xl)));
  padding: var(--space-xs);
  border: var(--rule-thin) solid var(--color-rule);
  border-radius: var(--radius-soft);
  background: var(--color-paper-raised);
}

.nav-sheet a {
  min-height: 2.75rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-small);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
}

.nav-sheet a:hover,
.nav-sheet a:focus-visible,
.nav-sheet a[aria-current="page"] {
  color: var(--color-ink);
  background: var(--color-accent-soft);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  width: min(100% - var(--space-xl), var(--content-wide));
  margin: var(--space-lg) auto 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.breadcrumb a,
.chapter-nav a,
.foot-links a {
  white-space: nowrap;
}

.page-shell {
  width: min(100% - var(--space-xl), var(--content-wide));
  margin-inline: auto;
}

.hero-split {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
  padding-block: var(--space-2xl) var(--space-3xl);
}

.hero-copy {
  min-width: 0;
}

.hero-copy h1,
.reference-hero h1 {
  max-width: 9.5ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.08;
  overflow-wrap: anywhere;
  min-width: 0;
}

.hero-copy .lede,
.reference-hero .lede {
  max-width: 52ch;
  margin: var(--space-lg) 0 0;
  color: var(--color-ink-soft);
  font-size: var(--text-md);
  line-height: 1.72;
}

.scope-note {
  max-width: 62ch;
  margin: var(--space-lg) 0 0;
  padding-block-start: var(--space-md);
  border-top: var(--rule-thin) solid var(--color-rule);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.tissue-map {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: var(--space-md);
  border-radius: var(--radius-soft);
  background: var(--color-paper-soft);
}

.tissue-layer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-md);
  align-items: center;
  min-height: 4.5rem;
  padding: var(--space-md);
  border: var(--rule-thin) solid var(--color-rule);
  border-radius: var(--radius-small);
  background: var(--color-paper-raised);
}

.tissue-layer strong {
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: 1.25;
}

.tissue-layer span {
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-align: end;
}

.tissue-map figcaption,
.evidence-figure figcaption {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.article-flow {
  display: grid;
  gap: var(--space-4xl);
  padding-block-end: var(--space-4xl);
}

.studio-row {
  display: grid;
  gap: var(--space-xl);
  align-items: start;
}

.studio-copy {
  min-width: 0;
}

.studio-copy h2,
.reference-section h2 {
  max-width: 18ch;
  margin: 0 0 var(--space-xl);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  min-width: 0;
}

.studio-copy h3,
.studio-proof h3 {
  margin: var(--space-xl) 0 var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}

.studio-copy p,
.reference-section p {
  max-width: var(--content-prose);
  margin: 0 0 var(--space-lg);
}

.studio-copy p:last-child,
.reference-section p:last-child {
  margin-bottom: 0;
}

.studio-copy dfn {
  color: var(--color-accent);
  font-style: normal;
  font-weight: 700;
}

.studio-proof {
  min-width: 0;
  padding: var(--space-xl);
  border-top: var(--rule-medium) solid var(--color-accent);
  background: var(--color-paper-soft);
}

.studio-proof > :first-child {
  margin-top: 0;
}

.studio-proof > :last-child {
  margin-bottom: 0;
}

.studio-proof p,
.studio-proof li,
.studio-proof dd {
  color: var(--color-ink-soft);
}

.fact-list,
.signal-list,
.source-list,
.connection-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact-list li,
.signal-list li,
.connection-list li {
  display: grid;
  gap: var(--space-xs);
  padding-block: var(--space-md);
  border-bottom: var(--rule-thin) solid var(--color-rule);
}

.fact-list li:last-child,
.signal-list li:last-child,
.connection-list li:last-child {
  border-bottom: 0;
}

.fact-list strong,
.signal-list strong,
.connection-list strong {
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: 1.35;
}

.evidence-sheet {
  margin: 0;
}

.evidence-sheet div {
  display: grid;
  gap: var(--space-xs);
  padding-block: var(--space-md);
  border-bottom: var(--rule-thin) solid var(--color-rule);
}

.evidence-sheet div:last-child {
  border-bottom: 0;
}

.evidence-sheet dt {
  color: var(--color-ink);
  font-weight: 700;
}

.evidence-sheet dd {
  margin: 0;
}

.source-ref {
  display: inline-block;
  margin-inline-start: var(--space-2xs);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.body-quote {
  max-width: 58ch;
  margin: var(--space-2xl) 0;
  padding-inline-start: var(--space-lg);
  border-inline-start: var(--rule-medium) solid var(--color-accent);
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: 1.7;
}

.caution-band {
  padding: var(--space-xl);
  border-top: var(--rule-medium) solid var(--color-caution);
  background: var(--color-caution-soft);
}

.caution-band h2 {
  margin-top: 0;
}

.practice-sequence {
  margin: 0;
  padding: 0;
  counter-reset: practice;
  list-style: none;
}

.practice-sequence li {
  position: relative;
  padding: var(--space-lg) 0 var(--space-lg) 3.25rem;
  border-bottom: var(--rule-thin) solid var(--color-rule);
  counter-increment: practice;
}

.practice-sequence li::before {
  position: absolute;
  inset-block-start: var(--space-lg);
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: var(--rule-thin) solid var(--color-accent);
  border-radius: 50%;
  color: var(--color-accent);
  content: counter(practice);
  font-family: var(--font-display);
  font-weight: 900;
}

.practice-sequence strong {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-ink);
}

.chapter-nav {
  display: grid;
  gap: var(--space-sm);
  width: min(100% - var(--space-xl), var(--content-wide));
  margin: 0 auto var(--space-3xl);
  padding-block: var(--space-xl);
  border-block: var(--rule-thin) solid var(--color-rule);
}

.chapter-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 2.75rem;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  text-decoration: none;
}

.chapter-nav a:hover {
  color: var(--color-accent);
}

.chapter-nav small {
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
}

.reference-hero {
  padding-block: var(--space-2xl) var(--space-3xl);
}

.reference-hero h1 {
  max-width: 12ch;
}

.reference-grid {
  display: grid;
  gap: var(--space-3xl);
  padding-block-end: var(--space-4xl);
}

.reference-section {
  max-width: 58rem;
}

.source-list {
  display: grid;
  gap: var(--space-xl);
  counter-reset: sources;
}

.source-list li {
  position: relative;
  padding-inline-start: 3rem;
  counter-increment: sources;
}

.source-list li::before {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  color: var(--color-accent);
  content: "[" counter(sources) "]";
  font-weight: 700;
}

.source-list cite {
  display: block;
  color: var(--color-ink);
  font-style: normal;
  font-weight: 700;
}

.source-list p {
  margin: var(--space-xs) 0 0;
  color: var(--color-ink-soft);
}

.foot-mast {
  display: grid;
  gap: var(--space-lg);
  width: min(100% - var(--space-xl), var(--content-wide));
  margin-inline: auto;
  padding-block: var(--space-2xl);
  border-top: var(--rule-thin) solid var(--color-rule);
}

.foot-mast p {
  margin: 0;
}

.foot-mast .wordmark {
  display: block;
  margin-bottom: var(--space-xs);
}

.foot-tagline {
  max-width: 40ch;
  color: var(--color-muted);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  font-size: var(--text-sm);
}

@media (min-width: 48rem) {
  .nav-edge,
  .breadcrumb,
  .page-shell,
  .chapter-nav,
  .foot-mast {
    width: min(100% - var(--space-2xl), var(--content-wide));
  }

  .hero-split {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-2xl);
  }

  .studio-row {
    grid-template-columns: minmax(0, 7fr) minmax(16rem, 4fr);
    gap: var(--space-2xl);
  }

  .studio-row--reverse .studio-copy {
    grid-column: 2;
  }

  .studio-row--reverse .studio-proof,
  .studio-row--reverse .evidence-figure {
    grid-column: 1;
    grid-row: 1;
  }

  .chapter-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-nav a:last-child {
    text-align: end;
  }

  .foot-mast {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

@media (min-width: 64rem) {
  .hero-split {
    padding-block: var(--space-3xl) var(--space-4xl);
  }

  .studio-proof {
    position: sticky;
    inset-block-start: var(--space-xl);
  }
}

@media (max-width: 30rem) {
  .nav-edge,
  .breadcrumb,
  .page-shell,
  .chapter-nav,
  .foot-mast {
    width: min(100% - var(--space-lg), var(--content-wide));
  }

  .wordmark {
    font-size: var(--text-base);
  }

  .nav-menu-btn summary {
    padding-inline: var(--space-sm);
  }

  .nav-sheet {
    position: fixed;
    inset-block-start: 4.75rem;
    inset-inline: var(--space-sm);
    min-width: 0;
  }

  .hero-split {
    padding-block: var(--space-xl) var(--space-3xl);
  }

  .studio-proof,
  .caution-band {
    padding: var(--space-lg);
  }

  .tissue-layer {
    grid-template-columns: minmax(0, 1fr);
  }

  .tissue-layer span {
    text-align: start;
  }

  .chapter-nav a {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-xs);
  }
}

@media (hover: hover) and (pointer: fine) {
  .chapter-nav a:hover {
    transform: translateX(2px);
    transition: color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
  }
}

@media (pointer: coarse) {
  a,
  summary {
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
}

@media print {
  .nav-edge,
  .breadcrumb,
  .chapter-nav,
  .foot-mast,
  .skip-link {
    display: none;
  }

  body {
    color: var(--color-ink);
    background: var(--color-paper);
  }

  .page-shell {
    width: 100%;
  }

  .studio-proof {
    position: static;
  }
}
