@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --surface-canvas: #f4f0e6;
  --surface-panel: rgba(252, 249, 241, 0.84);
  --surface-panel-strong: rgba(248, 243, 232, 0.94);
  --ink-strong: #151915;
  --ink-muted: #465148;
  --ink-soft: #758176;
  --line-soft: rgba(21, 25, 21, 0.1);
  --line-strong: rgba(21, 25, 21, 0.18);
  --green-strong: #244d3f;
  --green-soft: rgba(36, 77, 63, 0.12);
  --graphite: #333b36;
  --olive: #697056;
  --brown: #9a684a;
  --shadow-soft: 0 18px 48px rgba(28, 34, 27, 0.08);
  --font-mono: 'IBM Plex Mono', monospace;
  --font-serif: 'Instrument Serif', serif;
}

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

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(circle at top left, rgba(36, 77, 63, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)),
    var(--surface-canvas);
  color: var(--ink-strong);
  font-family: var(--font-mono);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.debug-page {
  width: min(100%, 1480px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px;
}

.hero,
.index-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.74fr);
  gap: clamp(28px, 5vw, 70px);
  min-height: calc(100svh - 36px);
  align-items: center;
  padding: clamp(32px, 7vw, 84px);
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 244, 0.9),
    rgba(239, 235, 224, 0.74)
  );
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.index-hero {
  grid-template-columns: 1fr;
  min-height: 46svh;
  align-items: end;
}

.hero::after,
.index-hero::after {
  position: absolute;
  inset: auto -12% -22% 42%;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(36, 77, 63, 0.14), transparent 70%);
  content: '';
  pointer-events: none;
}

.hero__copy,
.index-hero__copy {
  position: relative;
  z-index: 2;
  max-width: 66ch;
  animation: enter-copy 620ms ease both;
}

.mono-label {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(3.4rem, 10vw, 8.5rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.86;
}

.hero__lead {
  max-width: 58ch;
  margin: 28px 0 0;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.45vw, 1.2rem);
}

.hero__lead span {
  color: var(--green-strong);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 0.94;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 34px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  border-bottom: 1px solid rgba(36, 77, 63, 0.34);
  color: var(--green-strong);
  font-size: 0.84rem;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    color 160ms ease;
}

.text-link:hover,
.text-link:focus-visible {
  border-color: var(--ink-strong);
  color: var(--ink-strong);
}

.divider {
  width: 1px;
  height: 1.4rem;
  background: var(--line-strong);
}

.debug-plane {
  position: relative;
  z-index: 2;
  min-height: 360px;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background:
    linear-gradient(rgba(21, 25, 21, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 25, 21, 0.055) 1px, transparent 1px),
    var(--surface-panel);
  background-size: 42px 42px;
  box-shadow: 0 18px 48px rgba(28, 34, 27, 0.06);
  overflow: hidden;
  animation: enter-plane 760ms 120ms ease both;
}

.debug-plane__line {
  position: absolute;
  left: 11%;
  right: 11%;
  height: 3px;
  border-radius: 999px;
  background: var(--green-strong);
  transform-origin: left center;
}

.debug-plane__line--one {
  top: 42%;
  transform: rotate(-10deg);
}

.debug-plane__line--two {
  top: 58%;
  background: var(--brown);
  opacity: 0.72;
  transform: rotate(8deg);
}

.debug-plane__node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border: 3px solid var(--surface-panel-strong);
  border-radius: 999px;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.debug-plane__node--active {
  top: calc(42% - 1.6rem);
  left: 22%;
  background: var(--green-strong);
}

.debug-plane__node--next {
  top: calc(58% - 1.6rem);
  right: 20%;
  background: var(--graphite);
}

.debug-plane p {
  position: absolute;
  right: 20px;
  bottom: 18px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 24px;
  margin-top: 18px;
  padding: 22px clamp(18px, 4vw, 36px);
  border-top: 1px solid var(--line-soft);
}

.status p {
  margin: 0;
}

.status div > p:last-child {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.article-index {
  margin-top: 22px;
  padding: clamp(20px, 4vw, 42px);
  border-top: 1px solid var(--line-soft);
}

.article-card {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 134px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(252, 249, 241, 0.72);
  color: var(--ink-strong);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.article-card:hover,
.article-card:focus-visible {
  border-color: rgba(36, 77, 63, 0.28);
  background: rgba(252, 249, 241, 0.9);
  transform: translateY(-2px);
}

.article-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
}

.article-card span {
  min-width: 0;
}

.article-card strong {
  display: block;
  margin: 4px 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.5vw, 2.4rem);
  font-weight: 400;
  line-height: 0.98;
}

.article-card small {
  display: block;
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.article-card__kicker {
  display: block;
  color: var(--ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-card--index {
  max-width: 940px;
}

.article-card--muted {
  opacity: 0.72;
}

.article-page {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 18px;
}

.article-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 3.2rem;
  margin-bottom: 14px;
  padding: 0.4rem 0.2rem;
  background: color-mix(in srgb, var(--surface-canvas) 88%, transparent);
  backdrop-filter: blur(12px);
  color: var(--ink-soft);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-link {
  color: var(--green-strong);
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(360px, 1fr);
  gap: clamp(22px, 4vw, 46px);
  align-items: center;
  min-height: min(680px, calc(100svh - 82px));
  padding: clamp(18px, 3.5vw, 40px);
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 244, 0.9),
    rgba(239, 235, 224, 0.72)
  );
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.article-hero__copy {
  animation: enter-copy 620ms ease both;
}

.article-hero h1 {
  font-size: clamp(2.2rem, 4.9vw, 5rem);
  max-width: 11ch;
}

.article-hero__lead {
  max-width: 56ch;
  margin: 18px 0 0;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.35vw, 1.14rem);
}

.article-hero__media {
  margin: 0;
  animation: enter-plane 760ms 120ms ease both;
}

.article-hero__media img,
.article-figure img {
  width: 100%;
  border: 1px solid rgba(21, 25, 21, 0.08);
  border-radius: 22px;
  box-shadow: 0 22px 58px rgba(28, 34, 27, 0.12);
  object-fit: cover;
}

.article-body {
  display: grid;
  grid-template-columns: minmax(0, 72ch);
  justify-content: center;
  gap: 0;
  padding: clamp(28px, 5vw, 58px) 18px 0;
}

.article-body h1 {
  display: none;
}

.article-body h2 {
  margin: 3.2rem 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4vw, 3.45rem);
  font-weight: 400;
  line-height: 0.98;
}

.article-body h3 {
  margin: 2.4rem 0 0.8rem;
  font-size: 1.1rem;
}

.article-body p,
.article-body li {
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 1.72;
}

.article-body p {
  margin: 0 0 1.15rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.35rem;
  padding-left: 1.4rem;
}

.article-body li + li {
  margin-top: 0.42rem;
}

.article-body strong {
  color: var(--ink-strong);
}

.article-body code {
  padding: 0.12em 0.34em;
  border-radius: 0.34em;
  background: rgba(21, 25, 21, 0.06);
}

.article-body hr {
  width: 100%;
  margin: 2.2rem 0 0.4rem;
  border: 0;
  border-top: 1px solid var(--line-soft);
}

.article-figure {
  width: min(100%, 980px);
  margin: 0 auto 2.6rem;
}

.article-figure figcaption {
  max-width: 64ch;
  margin: 0.8rem 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.article-neighbors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: clamp(48px, 7vw, 86px) 0 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

@keyframes enter-copy {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes enter-plane {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 880px) {
  .hero,
  .index-hero,
  .article-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .debug-plane {
    min-height: 260px;
  }

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

  .article-neighbors {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .debug-page {
    padding: 10px;
  }

  .hero,
  .index-hero,
  .article-hero {
    padding: 28px 22px;
    border-radius: 22px;
  }

  .divider {
    display: none;
  }

  .article-page {
    padding: 10px;
  }

  .article-card {
    grid-template-columns: 1fr;
  }

  .article-topbar {
    position: static;
  }
}
