:root {
  color-scheme: light;
  --ink: #1c2528;
  --muted: #627075;
  --paper: #f6f2e8;
  --card: #fffdf7;
  --line: #d7d0c2;
  --accent: #b9472e;
  --blue: #285b73;
  --pass: #176b4a;
  --fail: #a5352c;
  --code: #172126;
  --shadow: 0 18px 50px rgba(40, 35, 27, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 13% 7%, rgba(185, 71, 46, 0.1), transparent 24rem),
    radial-gradient(circle at 89% 20%, rgba(40, 91, 115, 0.11), transparent 25rem),
    var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid #f2a93b;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-180%);
  border-radius: 0.4rem;
  background: var(--code);
  color: #fff;
  padding: 0.7rem 1rem;
  text-decoration: none;
}

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

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 5.25rem;
  border-bottom: 1px solid rgba(98, 112, 117, 0.24);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 700;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-content: center;
  gap: 0.18rem;
  border-radius: 50%;
  background: var(--code);
  overflow: hidden;
}

.wordmark-mark span {
  display: block;
  width: 1.25rem;
  height: 0.13rem;
  border-radius: 999px;
  background: var(--paper);
  transform: rotate(-12deg);
}

.wordmark-mark span:nth-child(2) {
  width: 0.9rem;
  margin-left: 0.3rem;
}

.wordmark-mark span:nth-child(3) {
  width: 0.55rem;
  margin-left: 0.55rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

nav a {
  text-underline-offset: 0.25rem;
  text-decoration-color: transparent;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(28rem, 0.95fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
  min-height: calc(100vh - 5.25rem);
  padding: 5rem 0;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(3.3rem, 7.5vw, 6.9rem);
  font-weight: 600;
  line-height: 0.93;
}

h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.02;
}

h3 {
  margin: 0;
  font-size: 1.15rem;
}

.lede {
  max-width: 40rem;
  margin: 1.7rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 0.55rem;
  padding: 0.75rem 1.05rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--code);
  color: #fff;
  box-shadow: 0 8px 20px rgba(23, 33, 38, 0.18);
}

.button-secondary {
  border-color: var(--line);
  background: rgba(255, 253, 247, 0.62);
}

.status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  margin: 2rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  list-style: none;
}

.status-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.status-list span,
.resource-status span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--pass);
  box-shadow: 0 0 0 0.2rem rgba(23, 107, 74, 0.13);
}

.valley-panel {
  position: relative;
  min-height: 34rem;
  border: 1px solid rgba(40, 91, 115, 0.28);
  border-radius: 1.3rem;
  background: linear-gradient(150deg, rgba(255, 253, 247, 0.9), rgba(225, 235, 228, 0.82));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.valley-panel::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 45%, rgba(185, 71, 46, 0.06));
  content: "";
}

.valley-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.contour {
  fill: none;
  stroke: rgba(40, 91, 115, 0.17);
  stroke-width: 1.4;
}

.trajectory-line {
  fill: none;
  stroke: var(--accent);
  stroke-dasharray: 6 7;
  stroke-linecap: round;
  stroke-width: 3;
}

.trajectory-point {
  fill: var(--card);
  stroke: var(--accent);
  stroke-width: 5;
}

.point-four {
  fill: var(--fail);
  stroke: #f8d8d1;
}

.trajectory-labels {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trajectory-labels li {
  position: absolute;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 0.5rem;
  width: 10.5rem;
  border: 1px solid rgba(215, 208, 194, 0.9);
  border-radius: 0.65rem;
  background: rgba(255, 253, 247, 0.9);
  padding: 0.7rem 0.8rem;
  box-shadow: 0 7px 20px rgba(40, 35, 27, 0.08);
  backdrop-filter: blur(5px);
}

.trajectory-labels li:nth-child(1) { top: 7%; left: 4%; }
.trajectory-labels li:nth-child(2) { top: 33%; left: 30%; }
.trajectory-labels li:nth-child(3) { top: 56%; left: 51%; }
.trajectory-labels li:nth-child(4) { right: 3%; bottom: 5%; }

.trajectory-labels span {
  grid-row: 1 / 3;
  color: var(--accent);
  font: 800 0.68rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.trajectory-labels strong {
  font-size: 0.85rem;
}

.trajectory-labels small {
  color: var(--muted);
  font-size: 0.7rem;
}

.section {
  padding: 7rem 0;
}

.section-heading {
  max-width: 49rem;
}

.section-heading > p:last-child {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

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

.method-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}

.stage {
  position: relative;
  min-height: 15rem;
  border: 1px solid rgba(28, 37, 40, 0.16);
  border-right: 0;
  padding: 1.35rem;
}

.stage:first-child {
  border-radius: 0.8rem 0 0 0.8rem;
}

.stage:last-child {
  border-right: 1px solid rgba(28, 37, 40, 0.16);
  border-radius: 0 0.8rem 0.8rem 0;
}

.stage:not(:last-child)::after {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -0.82rem;
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border: 1px solid rgba(28, 37, 40, 0.18);
  border-radius: 50%;
  background: var(--card);
  color: var(--blue);
  content: "→";
  font-weight: 900;
  transform: translateY(-50%);
}

.stage-hypothesis { background: #ffd6cc; }
.stage-request { background: #d8eccb; }
.stage-candidate { background: #c9e9ed; }
.stage-oracle { background: #cddff4; }

.stage-number {
  display: block;
  margin-bottom: 3.5rem;
  font: 800 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.stage p {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
}

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

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.resource-card {
  display: flex;
  min-height: 26rem;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  padding: 1.4rem;
  box-shadow: 0 8px 24px rgba(40, 35, 27, 0.055);
}

.resource-card:nth-child(2) {
  transform: translateY(1.4rem);
}

.resource-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--code);
  color: #fff;
  font: 800 1.15rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.resource-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 2rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
}

.resource-card > p:not(.resource-status) {
  color: var(--muted);
}

.resource-link {
  display: flex;
  min-height: 3.15rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: 0.85rem;
  font-weight: 800;
}

.resource-link::after {
  content: "↗";
  font-size: 1.1rem;
}

.resource-link.is-pending {
  color: var(--muted);
}

.resource-link.is-pending::after {
  content: "…";
}

.checksum {
  margin-top: 1rem;
  border-radius: 0.45rem;
  background: #efeade;
  padding: 0.7rem;
}

.checksum span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.checksum code {
  overflow-wrap: anywhere;
  font-size: 0.72rem;
}

.release-note {
  display: grid;
  grid-template-columns: minmax(15rem, 0.65fr) minmax(0, 1.35fr);
  gap: 3rem;
  margin-bottom: 7rem;
  border: 2px solid var(--blue);
  border-radius: 1rem;
  background: #e9f2f5;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.release-note h2 {
  font-size: 2rem;
}

.release-note > p {
  margin: 0;
  color: #34474f;
  font-size: 1.03rem;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0 3.5rem;
  color: var(--muted);
  font-size: 0.84rem;
}

footer p {
  margin: 0;
}

footer a {
  font-weight: 800;
  text-underline-offset: 0.2rem;
}

.error-page {
  min-height: 100vh;
}

.error-main {
  display: grid;
  min-height: calc(100vh - 13rem);
  place-items: center;
}

.error-card {
  width: min(47rem, 100%);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  padding: clamp(1.7rem, 5vw, 4rem);
  box-shadow: var(--shadow);
}

.error-card h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 8vw, 5.8rem);
}

.error-card > p:not(.eyebrow) {
  max-width: 35rem;
  color: var(--muted);
  font-size: 1.1rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 4.5rem 0;
  }

  .valley-panel {
    min-height: 31rem;
  }

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

  .stage {
    border-right: 1px solid rgba(28, 37, 40, 0.16);
  }

  .stage:first-child,
  .stage:last-child {
    border-radius: 0;
  }

  .stage:not(:last-child)::after {
    display: none;
  }

  .resource-card:nth-child(2) {
    transform: none;
  }

  .release-note {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 4.7rem;
  }

  nav {
    display: none;
  }

  .hero {
    gap: 3rem;
  }

  h1 {
    font-size: clamp(3.1rem, 16vw, 5rem);
  }

  .valley-panel {
    min-height: 28rem;
  }

  .trajectory-labels li {
    width: 8.7rem;
    padding: 0.55rem;
  }

  .trajectory-labels li:nth-child(2) { left: 23%; }
  .trajectory-labels li:nth-child(3) { left: 42%; }

  .section {
    padding: 5rem 0;
  }

  .method-flow,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: auto;
    padding: 1.2rem;
  }

  .stage-number {
    margin-bottom: 2rem;
  }

  .resource-card {
    min-height: 22rem;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
