.intro {
  min-height: calc(100dvh - 64px);
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  background: var(--hero-bg);
  color: var(--hero-text);
  position: relative;
  overflow: hidden;
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.12), transparent 60%);
  pointer-events: none;
}

.intro-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0 24px;
  position: relative;
}

.hero-footer {
  position: relative;
  align-self: end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 22px;
  color: rgba(241, 245, 249, 0.55);
  font-size: 12px;
}

.footer-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(241, 245, 249, 0.78);
  font-weight: 700;
}

.hero-footer svg {
  width: 14px;
  height: 14px;
}

.secret-entry {
  width: 20px;
  height: 20px;
  display: inline-grid !important;
  place-items: center;
  opacity: 0.45;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.secret-entry:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.secret-entry img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.intro-copy {
  max-width: 600px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intro .eyebrow {
  background: rgba(45, 212, 191, 0.15);
  color: #5eead4;
}

h1 {
  font-size: clamp(29px, 4.5vw, 50px);
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 800;
}

.lead {
  margin-top: 20px;
  color: var(--hero-muted);
  font-size: clamp(14.5px, 1.35vw, 17px);
  line-height: 1.75;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--hero-text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--ink);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.intro-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-slow);
}

.intro-visual:hover {
  transform: scale(1.02);
}

.intro-visual a {
  display: block;
}

.intro-visual img {
  border-radius: var(--radius-md);
}

.intro-visual figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.2);
}

.intro-visual figcaption strong {
  color: rgba(255, 255, 255, 0.9);
}

.intro-note {
  margin-top: 12px;
  color: rgba(241, 245, 249, 0.74);
  font-size: 14.5px;
  line-height: 1.75;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.12);
}

.hero-metrics div {
  padding: 13px;
  background: rgba(255, 255, 255, 0.05);
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  color: white;
  font-size: 21px;
  line-height: 1.1;
}

.hero-metrics span {
  margin-top: 6px;
  color: rgba(241, 245, 249, 0.65);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-hero {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 18px;
}

.page-hero h1 {
  color: var(--ink);
  max-width: 900px;
}

.page-hero p:not(.eyebrow) {
  max-width: 700px;
  margin-top: 16px;
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.project-section {
  padding: 36px 0 54px;
}

.content-section {
  padding: 36px 0;
}

.section-heading {
  max-width: 900px;
  margin-bottom: 40px;
}

.section-heading h2 {
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 700;
}

.section-heading p:not(.eyebrow) {
  max-width: 700px;
  margin-top: 12px;
  color: var(--ink-secondary);
  font-size: 17px;
  line-height: 1.7;
}

.section-heading.split-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
  max-width: none;
}

.section-heading.split-heading p:not(.eyebrow) {
  margin: 0;
}

.compact-heading {
  margin-bottom: 22px;
}

.featured-project {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.featured-project:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

.featured-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
}

.project-index {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.featured-copy h3 {
  margin-top: 12px;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 700;
}

.featured-copy p {
  margin-top: 16px;
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
}

.project-facts div {
  padding: 9px 11px;
  background: var(--surface-alt);
}

.project-facts dt {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-facts dd {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.project-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--surface-alt);
  border-left: 1px solid var(--border);
  overflow: hidden;
}

.project-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.text-link.dark-link {
  background: var(--accent);
  color: white;
}

.text-link.dark-link:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.read-link {
  align-self: flex-start;
  display: inline-flex;
  margin-top: 16px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.read-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.compact-list {
  max-width: var(--container);
  margin: 0 auto;
}

.project-list-card {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1fr);
  content-visibility: auto;
  contain-intrinsic-size: 420px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.project-list-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-3px);
}

.project-list-card .project-preview {
  min-height: 220px;
  border-left: 0;
  border-right: 1px solid var(--border);
}

.project-list-copy {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-list-copy h2 {
  margin-top: 10px;
  font-size: clamp(18px, 1.8vw, 23px);
  line-height: 1.2;
  font-weight: 700;
}

.project-list-copy p {
  margin-top: 12px;
  color: var(--ink-secondary);
  font-size: 13.5px;
  line-height: 1.7;
}

.compact-facts {
  margin-top: 12px;
}

.meta-line,
.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: 13px;
}

.byline {
  margin-top: 22px;
}

.status-badge,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-alt);
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-evergreen {
  border-color: rgba(13, 148, 136, 0.35);
  background: var(--accent-subtle);
  color: var(--accent);
}

.status-working {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.status-seedling {
  border-color: rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
}

.status-archived {
  border-color: var(--border);
  background: var(--surface-alt);
  color: var(--ink-muted);
}

.results-section {
  padding-top: 48px;
}

.article-hero {
  padding: 80px 0 48px;
}

.article-hero h1 {
  max-width: 960px;
  color: var(--ink);
}

.article-hero p {
  max-width: 780px;
  margin-top: 18px;
  color: var(--ink-secondary);
  font-size: 19px;
  line-height: 1.75;
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 20px;
  align-items: start;
}

.index-stack {
  display: grid;
  gap: 36px;
}

.index-group {
  display: grid;
  gap: 14px;
}

.index-group-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.index-group-heading h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.index-group-heading span {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
}

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

.archive-search {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.archive-search label {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.archive-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

.archive-search input:focus {
  outline: 2px solid var(--accent-subtle);
  border-color: var(--accent);
}

.archive-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 28px;
  padding: 26px 30px;
  background: var(--surface);
}

.archive-card[hidden] {
  display: none;
}

.archive-card time {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.archive-card h2 {
  margin-top: 8px;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.25;
}

.archive-card h2 a {
  color: var(--ink);
}

.archive-card h2 a:hover {
  color: var(--accent);
}

.archive-card p {
  max-width: 760px;
  margin-top: 10px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.pinned-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content-card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.content-sidebar {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 14px;
}

.sidebar-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.sidebar-card h2 {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.3;
}

.sidebar-card p {
  margin-top: 10px;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.toc-card a {
  display: block;
  padding: 7px 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.35;
  border-top: 1px solid var(--border-subtle);
}

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

.toc-level-3 {
  padding-left: 12px !important;
}

.toc-level-4 {
  padding-left: 24px !important;
}

.sidebar-facts {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--border);
}

.sidebar-facts div {
  padding: 10px 12px;
  background: var(--surface-alt);
}

.sidebar-facts dt {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-facts dd {
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.article-body ul {
  padding-left: 18px;
}

.article-body li + li {
  margin-top: 8px;
}

.image-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.image-row-wide {
  grid-template-columns: repeat(2, 1fr);
}

.evidence-figure,
.mesh-figure {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  cursor: pointer;
}

.evidence-figure:hover,
.mesh-figure:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.evidence-figure img,
.mesh-figure img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: var(--surface-alt);
}

.evidence-figure figcaption,
.mesh-figure figcaption {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
}

.evidence-figure figcaption strong,
.mesh-figure figcaption strong {
  color: var(--ink);
  font-weight: 600;
}

.explorable-panel {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  margin: 28px 0;
}

.explorable-copy {
  padding: 28px;
}

.explorable-copy h3 {
  margin-top: 12px;
  font-size: 24px;
  line-height: 1.25;
}

.explorable-copy p {
  margin-top: 10px;
  color: var(--ink-secondary);
  font-size: 14px;
}

.explorable-copy input[type="range"] {
  width: 100%;
  margin-top: 22px;
  accent-color: var(--accent);
}

.explorable-copy output {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.explorable-panel figure {
  display: grid;
  align-content: center;
  background: var(--surface-alt);
  border-left: 1px solid var(--border);
}

.explorable-panel img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.explorable-panel figcaption {
  padding: 12px 16px;
  color: var(--ink-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.switcher-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.switcher-buttons button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-alt);
  color: var(--ink-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.switcher-buttons button.is-active,
.switcher-buttons button:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

.method-list {
  display: grid;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
}

.method-article-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.method-article-card h2 {
  margin-top: 12px;
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1.25;
}

.method-article-card h2 a {
  color: var(--ink);
}

.method-article-card h2 a:hover {
  color: var(--accent);
}

.method-article-card p {
  margin-top: 10px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.method-card-links {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.method-card-links div {
  display: grid;
  gap: 6px;
}

.method-card-links span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.method-card-links a:not(.text-link) {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.pagination button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink-secondary);
  font-weight: 700;
}

.pagination button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.reference-list {
  margin-top: 14px;
  padding-left: 20px;
}

.reference-list li {
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.reference-list li + li {
  margin-top: 10px;
}

.reference-list a {
  color: var(--accent);
  font-weight: 700;
}

.reference-list span {
  display: block;
  color: var(--ink-muted);
  font-size: 12px;
}

.related-links {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.related-links a {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.article-body {
  padding-bottom: 48px;
  counter-reset: article-figure;
  content-visibility: auto;
  contain-intrinsic-size: 1200px;
}

.article-body p,
.article-body li {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.85;
}

.article-body p + p,
.article-body p + ul,
.article-body ul + p {
  margin-top: 22px;
}

.article-body h2 {
  margin-top: 40px;
  margin-bottom: 14px;
  font-size: 28px;
  line-height: 1.25;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.3;
}

.article-body a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body mark {
  padding: 0.1em 0.28em;
  border-radius: 0.35em;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.26), rgba(250, 204, 21, 0.42));
  color: var(--ink);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.article-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--accent);
  background: var(--accent-subtle);
  color: var(--ink-secondary);
}

.article-body hr {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.md-codeblock {
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0b1220;
  box-shadow: var(--shadow-md);
}

.md-codeblock figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: #111827;
}

.md-codeblock button {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(45, 212, 191, 0.32);
  border-radius: var(--radius-full);
  background: rgba(45, 212, 191, 0.08);
  color: #67e8f9;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.md-codeblock button:hover {
  border-color: rgba(45, 212, 191, 0.7);
  color: white;
  background: rgba(45, 212, 191, 0.18);
}

.md-codeblock pre {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #dbeafe;
  white-space: pre;
}

.md-codeblock code {
  color: inherit;
}

.md-table-wrap {
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.md-table {
  width: 100%;
  min-width: 560px;
  background: var(--surface);
}

.md-table th,
.md-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.md-table th {
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
}

.md-table td {
  color: var(--ink-secondary);
  font-size: 14px;
}

.md-math,
.md-inline-math {
  color: var(--ink);
}

.md-math {
  margin: 26px 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  font-size: 15px;
  line-height: 1.7;
  white-space: normal;
}

.md-inline-math {
  padding: 0.05em 0.25em;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.md-math mjx-container {
  max-width: 100%;
  margin: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
}

.md-inline-math mjx-container {
  display: inline-block;
  max-width: 100%;
}

.md-cite,
.md-footnotes a {
  color: var(--accent);
  font-weight: 800;
}

.md-footnotes {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.md-footnotes h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.md-footnotes li {
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.md-figure {
  margin: 28px 0;
  max-width: min(100%, 820px);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  counter-increment: article-figure;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.md-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 560px;
  margin: 0 auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.md-figure figcaption {
  align-self: stretch;
  padding: 12px 16px;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.55;
  border-top: 1px solid var(--border);
}

.article-body .md-figure figcaption::before {
  content: "Fig " counter(article-figure) ". ";
  color: var(--ink);
  font-weight: 800;
}

.md-callout {
  margin: 26px 0;
  padding: 18px 20px 18px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--accent-subtle), var(--surface-alt));
  box-shadow: var(--shadow-sm);
}

.md-callout strong {
  display: block;
  color: var(--ink);
  margin-bottom: 8px;
  font-size: 15px;
}

.md-callout p {
  margin-top: 10px;
  color: var(--ink-secondary);
  font-size: 15px;
}

.md-callout-result {
  background: linear-gradient(90deg, var(--accent-subtle), var(--surface-alt));
}

.md-callout-note {
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), var(--surface-alt));
}

.md-callout-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.13), var(--surface-alt));
}

.md-callout-important {
  border-left-color: #8b5cf6;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.12), var(--surface-alt));
}

.md-callout-danger {
  border-left-color: #ef4444;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.11), var(--surface-alt));
}

.compare-panel {
  margin: 30px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.compare-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.compare-stage img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.compare-top {
  position: absolute;
  inset: 0;
}

.compare-panel figcaption {
  padding: 10px 2px 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.compare-panel label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.compare-panel input {
  width: 100%;
  accent-color: var(--accent);
}

.appendix {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.appendix details + details {
  border-top: 1px solid var(--border);
}

.appendix summary {
  padding: 18px 22px;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.appendix-body,
.appendix .reference-list,
.appendix > details > p {
  padding: 0 22px 22px;
}

.appendix-body p {
  margin-top: 12px;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.appendix-body pre {
  margin-top: 14px;
}

.about-section {
  padding: 38px 0 64px;
}

.about-profile {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.about-profile img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.about-profile h2 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.2;
  font-weight: 700;
}

.about-profile p {
  margin-top: 14px;
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.75;
}

.contact-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.contact-actions a {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--ink-secondary);
  transition: all var(--transition-fast);
}

.contact-actions a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-2px);
}

.contact-actions svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.about-grid article {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: all var(--transition-base);
}

.about-grid article:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.about-grid span {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.about-grid strong {
  display: block;
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

.about-grid p {
  margin-top: 8px;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink-secondary);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: all var(--transition-base);
  z-index: 50;
}

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

.scroll-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--transition-base);
  cursor: zoom-out;
}

.lightbox.active {
  opacity: 1;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 14px;
  white-space: nowrap;
}

@media (max-width: 1040px) {
  .intro-layout,
  .featured-project,
  .about-profile,
  .project-list-card {
    grid-template-columns: 1fr;
  }

  .section-heading.split-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-list-card .project-preview {
    min-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .project-preview {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .image-row {
    grid-template-columns: 1fr 1fr;
  }

  .content-layout,
  .explorable-panel,
  .method-article-card {
    grid-template-columns: 1fr;
  }

  .content-sidebar {
    position: static;
  }

  .explorable-panel figure {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

}

@media (max-width: 768px) {
  .intro-layout {
    padding: 42px 0 20px;
    gap: 32px;
  }

  .page-hero {
    padding: 38px 0 14px;
  }

  .project-section {
    padding: 28px 0 42px;
  }

  .content-section {
    padding: 32px 0;
  }

  .about-section {
    padding: 28px 0 48px;
  }

  .featured-project {
    border-radius: var(--radius-md);
  }

  .featured-copy {
    padding: 24px;
  }

  .project-list-copy {
    padding: 20px;
  }

  .about-profile {
    padding: 24px;
    gap: 24px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .project-facts {
    grid-template-columns: 1fr;
  }

  .image-row,
  .image-row-wide {
    grid-template-columns: 1fr;
  }

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

  .article-hero {
    padding: 48px 0 30px;
  }

  .article-body p,
  .article-body li {
    font-size: 16px;
    line-height: 1.8;
  }

  .content-card {
    padding: 22px;
  }

  .archive-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 22px;
  }

  .hero-footer {
    flex-direction: column;
    padding-bottom: 16px;
  }

  .explorable-copy {
    padding: 22px;
  }

}

@media print {
  .topbar,
  .scroll-top,
  .intro-actions,
  .theme-toggle,
  .mobile-toggle {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .intro,
  .project-section,
  .article-hero,
  .page-hero {
    padding: 24px 0;
  }

  a {
    text-decoration: underline;
  }
}
