:root {
  --background: #f6f0e7;
  --paper: #fffaf2;
  --paper-soft: #f0e7da;
  --text: #28231e;
  --muted: #6f665d;
  --soft: #9a8f82;
  --line: rgba(58, 45, 34, 0.14);
  --line-strong: rgba(143, 99, 67, 0.38);
  --accent: #8f6343;
  --accent-soft: rgba(143, 99, 67, 0.09);
  --shadow: 0 24px 70px rgba(69, 52, 36, 0.08);
  --intro-width: 660px;
  --reader-width: 700px;
  --reader-wide-width: 960px;
  --article-gutter: clamp(22px, 5vw, 56px);
  --serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color-scheme: light;
  font-family: var(--serif);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: linear-gradient(180deg, #fbf6ee 0%, var(--background) 100%);
  font-family: var(--serif);
}

a {
  color: inherit;
  text-decoration-color: rgba(143, 99, 67, 0.28);
  text-underline-offset: 0.16em;
}

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  max-width: 880px;
  margin: 0 auto;
  padding: 18px clamp(22px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 246, 238, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 720;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: rgba(255, 250, 242, 0.58);
  font-size: 0.7rem;
  font-weight: 760;
}

.nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 28px);
  overflow-x: auto;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 620;
}

.nav a {
  padding-block: 8px;
  white-space: nowrap;
  text-decoration: none;
}

.lab-hero,
.lab-section {
  max-width: 880px;
  margin: 0 auto;
  padding-inline: clamp(22px, 4vw, 40px);
}

.lab-hero {
  padding-block: clamp(56px, 8vw, 92px) clamp(42px, 6vw, 70px);
}

.lab-hero-copy,
.latest-articles-panel {
  min-width: 0;
}

.hero-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: clamp(28px, 5vw, 58px);
  align-items: start;
}

.lab-kicker,
.lab-section-heading p,
.lab-card span,
.artifact-card span,
.panel-label span,
.project-meta,
.related-article-list span,
.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lab-hero h1 {
  max-width: 100%;
  margin: 16px 0 0;
  color: var(--text);
  font-size: clamp(2.15rem, 4.4vw, 3.45rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.lab-hero-copy > p:not(.lab-kicker) {
  max-width: 100%;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.4vw, 1.13rem);
  line-height: 1.76;
  overflow-wrap: break-word;
}

.profile-card {
  margin: 4px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.72), rgba(240, 231, 218, 0.42)),
    var(--paper);
  box-shadow: var(--shadow);
}

.profile-photo {
  display: block;
  width: clamp(150px, 16vw, 188px);
  max-width: 100%;
  height: clamp(150px, 16vw, 188px);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-soft);
  box-shadow: 0 18px 44px rgba(69, 52, 36, 0.11);
  overflow: hidden;
}

.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
  transform: scale(1.08);
  transform-origin: 50% 16%;
}

.profile-card figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.45;
}

.profile-card strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 0.94rem;
}

.profile-card span {
  display: block;
}

.profile-card p {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.52;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.profile-links a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 250, 242, 0.68);
  font-size: 0.76rem;
  font-weight: 720;
  text-decoration: none;
}

.profile-links a:hover {
  border-color: var(--line-strong);
  background: var(--paper);
}

.home-visual {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: clamp(28px, 4vw, 40px);
  padding: 22px 0 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
}

.home-visual div {
  position: relative;
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 0 22px 18px;
}

.home-visual div + div {
  border-left: 1px solid var(--line);
}

.home-visual div::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--background);
  box-shadow: 0 0 0 5px rgba(143, 99, 67, 0.07);
}

.home-visual span {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-visual strong {
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 1.35vw, 1.14rem);
  line-height: 1.25;
}

.home-visual small {
  display: block;
  max-width: 220px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.45;
}

.hero-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
  gap: 18px;
  margin-top: clamp(28px, 4vw, 40px);
}

.featured-note,
.project-teaser {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.58);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.featured-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.48fr);
  gap: 20px;
  align-items: stretch;
  min-height: 260px;
  padding: clamp(22px, 3.4vw, 30px);
  overflow: hidden;
  text-decoration: none;
}

.featured-note:hover,
a.project-teaser:hover {
  border-color: var(--line-strong);
  background: rgba(255, 250, 242, 0.82);
  transform: translateY(-2px);
}

.featured-note h2,
.current-projects h2 {
  margin: 8px 0 0;
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.featured-note h2 {
  max-width: 430px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.featured-note p {
  max-width: 460px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.68;
}

.featured-note span:not(.lab-kicker) {
  display: inline-flex;
  margin-top: 22px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 760;
}

.feature-artifact {
  display: grid;
  align-content: center;
  gap: 0;
  border-left: 1px solid var(--line);
  padding-left: 20px;
  font-family: var(--sans);
}

.feature-artifact span,
.feature-artifact strong {
  position: relative;
  display: block;
  padding: 16px 0 16px 20px;
  border-top: 1px solid var(--line);
}

.feature-artifact > :first-child {
  border-top: 0;
}

.feature-artifact span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feature-artifact strong {
  color: var(--text);
  font-size: 0.96rem;
}

.feature-artifact span::before,
.feature-artifact strong::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(143, 99, 67, 0.36);
  transform: translateY(-50%);
}

.feature-artifact strong::before {
  background: rgba(103, 124, 130, 0.48);
}

.current-projects {
  min-width: 0;
}

.project-stack-header h2 {
  max-width: 380px;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.project-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.project-teaser {
  display: grid;
  min-height: 126px;
  padding: 18px;
  text-decoration: none;
}

.project-teaser span {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-teaser h3 {
  margin: 12px 0 0;
  color: var(--text);
  font-size: clamp(1.12rem, 1.8vw, 1.35rem);
  font-weight: 520;
  letter-spacing: -0.02em;
  line-height: 1.16;
}

.project-teaser p {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.55;
}

.lab-actions,
.compare-strip div,
.reader-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.lab-actions a,
.lab-link,
.compare-strip a,
.button,
.contact-links a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 250, 242, 0.52);
  font-family: var(--sans);
  font-size: 0.93rem;
  font-weight: 680;
  text-align: center;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.lab-actions a:hover,
.lab-link:hover,
.compare-strip a:hover,
.button:hover,
.contact-links a:hover {
  border-color: var(--line-strong);
  background: var(--paper);
  transform: translateY(-1px);
}

.latest-articles-panel,
.bench-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.58);
  box-shadow: var(--shadow);
}

.latest-articles-panel {
  width: 100%;
  margin-top: clamp(42px, 6vw, 64px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.latest-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.latest-panel-header h2 {
  max-width: 360px;
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.latest-panel-header a {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}

.latest-article-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.latest-article-list a {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.latest-article-list li:last-child a {
  border-bottom: 0;
}

.latest-article-list time {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 720;
  white-space: nowrap;
}

.latest-article-list strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.28;
}

.latest-article-list small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.45;
}

.lab-section {
  padding-block: clamp(48px, 7vw, 76px);
  border-top: 1px solid var(--line);
}

.lab-section-heading h2,
.bench-panel h2,
.compare-strip h2,
.reader h1,
.reader-body h2 {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.lab-section-heading h2,
.bench-panel h2,
.compare-strip h2 {
  font-size: clamp(2rem, 4.2vw, 3.8rem);
}

.lab-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.lab-card,
.artifact-card,
.mini-panel,
.project-card,
.related-article-list a {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.5);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.lab-card {
  min-height: 240px;
  display: flex;
  grid-column: span 2;
  flex-direction: column;
  overflow: hidden;
  padding: 22px;
  text-decoration: none;
}

.lab-card.wide {
  grid-column: span 4;
}

.lab-card:hover,
.artifact-card:hover,
.related-article-list a:hover {
  border-color: var(--line-strong);
  background: rgba(255, 250, 242, 0.8);
  transform: translateY(-2px);
}

.lab-card h3,
.artifact-card h3,
.project-card h3 {
  margin: 38px 0 0;
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 520;
  letter-spacing: -0.025em;
  line-height: 1.14;
}

.lab-card p,
.bench-panel p,
.project-card p,
.reader-dek,
.reader-body,
.about-copy p {
  color: var(--muted);
  line-height: 1.72;
}

.lab-card p {
  margin-bottom: 0;
}

.lab-reveal {
  position: static;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  opacity: 1;
  transform: none;
}

.lab-reveal strong {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lab-reveal p {
  margin: 8px 0 0;
  font-size: 0.98rem;
  line-height: 1.55;
}

.bench-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 0.55fr);
  gap: 28px;
  padding: clamp(24px, 4vw, 38px);
}

.bench-panel p {
  max-width: 650px;
  font-size: 1.06rem;
}

.signal-map {
  position: relative;
  display: block;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%, rgba(143, 99, 67, 0.13), transparent 18%),
    radial-gradient(circle at 70% 64%, rgba(103, 124, 130, 0.12), transparent 20%),
    var(--paper);
  transition:
    border-color 180ms ease,
    transform 180ms ease;
}

.signal-map:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.signal-map span {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(143, 99, 67, 0.38);
  border-radius: 50%;
  background: var(--paper);
}

.signal-map span:nth-child(1) { left: 18%; top: 24%; }
.signal-map span:nth-child(2) { left: 54%; top: 18%; }
.signal-map span:nth-child(3) { left: 72%; top: 48%; }
.signal-map span:nth-child(4) { left: 28%; top: 66%; }
.signal-map span:nth-child(5) { left: 55%; top: 76%; }

.signal-map i {
  position: absolute;
  height: 1px;
  background: rgba(143, 99, 67, 0.28);
  transform-origin: left center;
}

.signal-map i:nth-of-type(1) { width: 44%; left: 21%; top: 28%; transform: rotate(-8deg); }
.signal-map i:nth-of-type(2) { width: 34%; left: 36%; top: 62%; transform: rotate(-24deg); }
.signal-map i:nth-of-type(3) { width: 38%; left: 31%; top: 72%; transform: rotate(14deg); }

.note-grid .lab-card {
  min-height: 236px;
}

.note-grid .lab-card h3 {
  margin-top: 26px;
}

.note-thumb {
  position: relative;
  min-height: 78px;
  margin-top: auto;
  overflow: hidden;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
}

.note-thumb i {
  position: absolute;
  display: block;
  border: 1px solid rgba(58, 45, 34, 0.13);
  background: rgba(255, 250, 242, 0.64);
}

.note-thumb-leverage i {
  top: 28px;
  width: 30%;
  height: 34px;
  border-radius: 8px;
}

.note-thumb-leverage i:nth-child(1) { left: 0; }
.note-thumb-leverage i:nth-child(2) {
  left: 35%;
  border-color: rgba(103, 124, 130, 0.3);
  background: rgba(239, 246, 242, 0.7);
}
.note-thumb-leverage i:nth-child(3) { right: 0; }

.note-thumb-trace i {
  top: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.note-thumb-trace i:nth-child(1) { left: 4%; }
.note-thumb-trace i:nth-child(2) { left: 46%; }
.note-thumb-trace i:nth-child(3) { right: 6%; }

.note-thumb-trace::before,
.note-thumb-workflow::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 31px;
  height: 1px;
  background: rgba(143, 99, 67, 0.24);
}

.note-thumb-debug i {
  left: 0;
  right: 0;
  height: 12px;
  border-radius: 999px;
}

.note-thumb-debug i:nth-child(1) { top: 20px; width: 88%; }
.note-thumb-debug i:nth-child(2) { top: 40px; width: 62%; background: rgba(143, 99, 67, 0.11); }
.note-thumb-debug i:nth-child(3) { top: 60px; width: 42%; }

.note-thumb-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding-top: 18px;
}

.note-thumb-matrix i {
  position: static;
  aspect-ratio: 1;
  border-radius: 7px;
}

.note-thumb-matrix i:nth-child(2),
.note-thumb-matrix i:nth-child(3) {
  background: rgba(103, 124, 130, 0.12);
}

.note-thumb-workflow i {
  top: 24px;
  width: 16px;
  height: 16px;
  border-radius: 6px;
  background: rgba(239, 246, 242, 0.74);
}

.note-thumb-workflow i:nth-child(1) { left: 4%; }
.note-thumb-workflow i:nth-child(2) { left: 46%; }
.note-thumb-workflow i:nth-child(3) { right: 6%; }

.note-thumb-recovery i {
  top: 26px;
  width: 28%;
  height: 38px;
  border-radius: 999px;
}

.note-thumb-recovery i:nth-child(1) { left: 0; }
.note-thumb-recovery i:nth-child(2) {
  left: 34%;
  background: rgba(103, 124, 130, 0.12);
}
.note-thumb-recovery i:nth-child(3) { right: 0; }

.question-list {
  display: grid;
  gap: 0;
  max-width: 840px;
  padding: 0;
  list-style: none;
}

.question-list li {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(1.25rem, 2.6vw, 1.95rem);
  line-height: 1.28;
}

.question-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.artifact-card {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 22px;
  text-decoration: none;
}

.artifact-card h3 {
  margin-top: 16px;
  font-size: 1.22rem;
}

.artifact-lines,
.artifact-matrix,
.artifact-bubbles,
.artifact-checks {
  min-height: 138px;
  display: grid;
  align-items: end;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.artifact-lines {
  gap: 14px;
  padding-top: 28px;
}

.artifact-lines i {
  height: 14px;
  border-radius: 999px;
  background: rgba(143, 99, 67, 0.18);
}

.artifact-lines i:nth-child(2) {
  width: 76%;
}

.artifact-lines i:nth-child(3) {
  width: 58%;
}

.artifact-matrix {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 24px;
}

.artifact-matrix i {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent-soft);
}

.artifact-matrix i:nth-child(2n) {
  background: rgba(103, 124, 130, 0.09);
}

.artifact-bubbles {
  position: relative;
  display: block;
}

.artifact-bubbles i {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--accent-soft);
}

.artifact-bubbles i:nth-child(1) { width: 108px; height: 108px; left: 4px; top: 28px; }
.artifact-bubbles i:nth-child(2) { width: 88px; height: 88px; right: 22px; top: 18px; }
.artifact-bubbles i:nth-child(3) { width: 68px; height: 68px; right: 86px; bottom: 2px; }

.artifact-checks {
  gap: 12px;
  padding-top: 26px;
}

.artifact-checks i {
  height: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.compare-strip {
  border-top: 1px solid var(--line);
}

.compare-strip > p:first-child {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-page {
  min-height: calc(100svh - 69px);
  max-width: calc(var(--reader-width) + var(--article-gutter) + var(--article-gutter));
  margin: 0 auto;
  padding: clamp(50px, 8vw, 88px) var(--article-gutter)
    clamp(76px, 10vw, 126px);
}

.reader {
  width: 100%;
  max-width: var(--reader-width);
}

.back-link {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 640;
  text-decoration: none;
}

.eyebrow {
  display: block;
  margin: 0 0 14px;
}

.reader h1 {
  max-width: var(--reader-width);
  font-size: clamp(2.35rem, 4.6vw, 3.75rem);
  overflow-wrap: break-word;
}

.reader-dek {
  max-width: var(--reader-width);
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 1.55vw, 1.28rem);
  line-height: 1.68;
  overflow-wrap: break-word;
}

.reader-body {
  max-width: var(--reader-width);
  margin-top: clamp(48px, 7vw, 76px);
  color: #3f3831;
  font-size: clamp(1.06rem, 1.25vw, 1.16rem);
  line-height: 1.78;
  overflow-wrap: break-word;
}

.reader-body h2 {
  margin: 54px 0 16px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.025em;
}

.reader-body p {
  margin: 0 0 24px;
}

.reader-body ul,
.reader-body ol {
  margin: 0 0 28px;
  padding-left: 24px;
}

.reader-body li {
  margin: 11px 0;
}

.reader-body strong {
  color: var(--text);
}

.concept-figure {
  position: relative;
  margin: 34px 0 42px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(58, 45, 34, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(rgba(58, 45, 34, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 45, 34, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 250, 242, 0.9), rgba(239, 246, 242, 0.66)),
    var(--paper);
  background-size:
    24px 24px,
    24px 24px,
    auto,
    auto;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.8);
}

.concept-figure::before {
  content: "field diagram";
  position: absolute;
  top: 14px;
  right: 18px;
  color: rgba(143, 99, 67, 0.62);
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.concept-figure figcaption {
  max-width: 620px;
  margin: 0 88px 24px 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 620;
  line-height: 1.5;
}

.leverage-lanes,
.trace-flow,
.workflow-replay,
.routing-split,
.recovery-flow,
.debug-boundaries {
  display: grid;
  gap: 12px;
}

.leverage-lanes {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(174px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.leverage-map::before {
  display: none;
}

.leverage-map figcaption {
  max-width: 720px;
  margin-right: 0;
}

.leverage-lane {
  display: grid;
  min-height: 186px;
  gap: 10px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.62);
}

.leverage-lane span,
.trace-node,
.workflow-node,
.route-node,
.recovery-node,
.boundary-row {
  background: transparent;
}

.leverage-lane span {
  position: relative;
  padding: 9px 0 9px 18px;
  border-top: 1px solid rgba(58, 45, 34, 0.08);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 650;
}

.leverage-lane > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.leverage-lane span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(143, 99, 67, 0.45);
  transform: translateY(-50%);
}

.leverage-decision {
  position: relative;
  display: grid;
  min-height: 146px;
  place-items: center;
  padding: 18px;
  border: 1px solid rgba(103, 124, 130, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(239, 246, 242, 0.82), rgba(255, 250, 242, 0.78));
  text-align: center;
}

.leverage-decision::before,
.leverage-decision::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 1px;
  background: rgba(103, 124, 130, 0.34);
}

.leverage-decision::before {
  right: 100%;
}

.leverage-decision::after {
  left: 100%;
}

.leverage-decision strong,
.trace-node strong,
.workflow-node strong,
.route-node strong,
.recovery-node strong,
.boundary-row strong {
  display: block;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.3;
}

.leverage-decision small,
.ladder-steps small,
.trace-node small,
.workflow-node small,
.route-node small,
.recovery-node small,
.boundary-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.35;
}

.ladder-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  padding-top: 10px;
}

.ladder-steps div {
  position: relative;
  display: grid;
  min-height: 132px;
  align-content: end;
  padding: 18px 0 0;
  border-top: 4px solid rgba(143, 99, 67, 0.2);
  background: transparent;
}

.ladder-steps div:nth-child(2) {
  min-height: 164px;
  border-top-color: rgba(143, 99, 67, 0.34);
}

.ladder-steps div:nth-child(3) {
  min-height: 198px;
  border-top-color: rgba(103, 124, 130, 0.58);
}

.ladder-steps strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.78rem;
}

.ladder-steps span {
  display: block;
  margin-top: 18px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 720;
  line-height: 1.25;
}

.trace-flow {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.trace-node,
.workflow-node,
.route-node,
.recovery-node,
.boundary-row {
  border-radius: 0;
}

.trace-node.good,
.workflow-node.good,
.route-node.good,
.recovery-node.good,
.boundary-row.good {
  border-color: rgba(78, 115, 105, 0.42);
}

.trace-node.bad,
.route-node.bad,
.boundary-row.bad {
  border-color: rgba(143, 99, 67, 0.42);
}

.trace-node {
  min-height: 128px;
  padding: 18px 18px 18px 22px;
  border-left: 4px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 250, 242, 0.7), transparent 72%);
}

.workflow-replay {
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding-top: 20px;
}

.workflow-replay::before,
.recovery-flow::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  height: 1px;
  background: var(--line-strong);
}

.workflow-node {
  position: relative;
  min-height: 118px;
  padding: 38px 0 0;
}

.workflow-node::before,
.recovery-node::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 0;
  width: 13px;
  height: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--background);
}

.routing-split {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.route-node {
  min-height: 140px;
  padding: 18px 0 0;
  border-top: 4px solid var(--line);
  background: transparent;
}

.route-node.hub {
  min-height: 160px;
  display: grid;
  align-content: center;
  justify-self: center;
  width: min(170px, 100%);
  aspect-ratio: 1;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.74);
  text-align: center;
}

.recovery-flow {
  position: relative;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  padding-top: 20px;
}

.recovery-node {
  position: relative;
  min-height: 118px;
  padding: 38px 0 0;
}

.debug-boundaries {
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.boundary-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.boundary-row:last-child {
  border-bottom: 0;
}

.boundary-row span {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mini-visual {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mini-visual span {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 16px;
  background: rgba(103, 124, 130, 0.11);
}

.mini-visual span:nth-child(2) {
  width: 74%;
  background: rgba(143, 99, 67, 0.12);
}

.mini-visual span:nth-child(3) {
  width: 52%;
}

.project-page {
  max-width: calc(var(--reader-wide-width) + var(--article-gutter) + var(--article-gutter));
}

.project-page .reader,
.project-page .reader-body {
  max-width: var(--reader-wide-width);
}

.project-page .reader > h1,
.project-page .reader > .reader-dek,
.project-page .reader-body > h2,
.project-page .reader-body > p,
.project-page .reader-body > ul,
.project-page .reader-body > ol {
  max-width: var(--reader-width);
}

.architecture-diagram {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 30px 0 38px;
}

.arch-node {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.58);
}

.arch-node strong {
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.98rem;
}

.arch-node span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.45;
}

.arch-core {
  border-color: var(--line-strong);
  background: var(--paper);
}

.arch-vm {
  grid-column: 3 / 6;
  min-height: 112px;
}

.arch-arrow {
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 760;
}

.arch-arrow-up {
  justify-self: center;
}

.related-article-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.related-article-list a {
  display: grid;
  gap: 8px;
  padding: 18px;
  text-decoration: none;
}

.related-article-list strong {
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .lab-hero,
  .bench-panel {
    grid-template-columns: 1fr;
  }

  .hero-feature-grid {
    grid-template-columns: 1fr;
  }

  .signal-map {
    max-width: 760px;
  }

  .lab-card,
  .lab-card.wide {
    grid-column: span 3;
  }

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

  .architecture-diagram {
    grid-template-columns: 1fr;
  }

  .leverage-lanes,
  .ladder-steps,
  .trace-flow,
  .workflow-replay,
  .routing-split,
  .recovery-flow {
    grid-template-columns: 1fr;
  }

  .leverage-lane,
  .leverage-decision {
    min-height: 0;
  }

  .leverage-decision::before,
  .leverage-decision::after {
    display: none;
  }

  .arch-vm {
    grid-column: auto;
  }

  .arch-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .arch-arrow-up {
    transform: none;
  }
}

@media (max-width: 700px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .lab-hero {
    display: block;
  }

  .hero-intro {
    grid-template-columns: 1fr;
  }

  .profile-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 28px;
    padding: 14px;
  }

  .profile-photo {
    width: 88px;
    height: 88px;
  }

  .profile-card figcaption {
    margin-top: 0;
  }

  .profile-links {
    margin-top: 10px;
  }

  .lab-hero,
  .lab-section,
  .article-page {
    width: 100%;
    max-width: none;
  }

  .lab-hero-copy,
  .latest-articles-panel,
  .reader,
  .reader-body,
  .reader-dek {
    width: 100%;
    max-width: 100%;
  }

  .nav {
    width: 100%;
    gap: 8px 12px;
    flex-wrap: wrap;
    overflow-x: visible;
    font-size: 0.84rem;
  }

  .nav a[href$="#explorations"],
  .nav a[href$="#artifacts"] {
    display: none;
  }

  .nav a[href$="#field-notes"] {
    font-size: 0;
  }

  .nav a[href$="#field-notes"]::after {
    content: "Notes";
    font-size: 0.84rem;
  }

  .lab-card-grid,
  .artifact-grid,
  .home-visual {
    grid-template-columns: 1fr;
  }

  .home-visual div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 18px;
  }

  .home-visual small {
    max-width: none;
  }

  .featured-note {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .feature-artifact {
    grid-template-columns: 1fr;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 18px;
    padding-left: 0;
  }

  .lab-card,
  .lab-card.wide {
    grid-column: auto;
  }

  .lab-hero h1 {
    max-width: 100%;
    font-size: clamp(1.85rem, 8vw, 2.2rem);
    line-height: 1.12;
    text-wrap: wrap;
    overflow-wrap: anywhere;
  }

  .reader h1 {
    max-width: 100%;
    font-size: clamp(1.85rem, 8vw, 2.2rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .lab-hero-copy > p:not(.lab-kicker),
  .reader-dek,
  .reader-body {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px) {
  .lab-hero,
  .lab-section {
    padding-inline: 22px;
  }

  .lab-hero {
    padding-block: 64px 48px;
  }

  .latest-articles-panel {
    margin-top: 42px;
  }

  .lab-actions,
  .compare-strip div,
  .reader-actions,
  .contact-links {
    flex-direction: column;
  }

  .lab-actions a,
  .lab-link,
  .compare-strip a,
  .button,
  .contact-links a {
    width: 100%;
  }

  .latest-panel-header {
    flex-direction: column;
  }

  .latest-article-list a {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
