:root {
  --ink: #f8f9fa;
  --paper: #202124;
  --muted: #5f6368;
  --signal: #1967d2;
  --blue: #4285f4;
  --red: #ea4335;
  --yellow: #fbbc04;
  --green: #34a853;
  --green-text: #137333;
  --line: rgba(32, 33, 36, 0.14);
  --line-soft: rgba(32, 33, 36, 0.065);
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --max-width: 100rem;
  --sans: "Helvetica Neue", "Neue Haas Grotesk Text Pro", Inter, ui-sans-serif,
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas,
    monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-width: 20rem;
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--signal);
  color: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.7rem 1rem;
  transform: translateY(-200%);
  background: var(--signal);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

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

.grid,
.glow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.grid {
  z-index: 1;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-position: center;
  background-size: clamp(4rem, 7vw, 7rem) clamp(4rem, 7vw, 7rem);
  mask-image: linear-gradient(
    90deg,
    transparent,
    rgba(0, 0, 0, 0.2) 44%,
    rgba(0, 0, 0, 0.85)
  );
  opacity: 0.22;
}

.glow {
  z-index: 2;
  background:
    radial-gradient(
      circle at 82% 25%,
      rgba(66, 133, 244, 0.09),
      transparent 24rem
    ),
    radial-gradient(
      circle at 72% 62%,
      rgba(52, 168, 83, 0.06),
      transparent 22rem
    ),
    radial-gradient(
      circle at 96% 68%,
      rgba(234, 67, 53, 0.055),
      transparent 18rem
    ),
    linear-gradient(90deg, var(--ink) 0%, transparent 62%);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 3;
}

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 50%;
  display: flex;
  width: min(100%, var(--max-width));
  align-items: center;
  justify-content: space-between;
  padding: 1.8rem var(--gutter);
  transform: translateX(-50%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
}

.brand-mark i {
  width: 0.19rem;
  height: 0.19rem;
  align-self: center;
  justify-self: center;
  border-radius: 1px;
  background: rgba(32, 33, 36, 0.16);
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(4),
.brand-mark i:nth-child(6),
.brand-mark i:nth-child(8) {
  width: 0.31rem;
  height: 0.31rem;
  box-shadow: 0 0 0.8rem rgba(66, 133, 244, 0.2);
}

.brand-mark i:nth-child(2) {
  background: var(--blue);
}

.brand-mark i:nth-child(4) {
  background: var(--red);
}

.brand-mark i:nth-child(6) {
  background: var(--yellow);
}

.brand-mark i:nth-child(8) {
  background: var(--green);
}

.brand-name {
  max-width: 10rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 100vw;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 168, 83, 0.3);
  animation: breathe 3.2s ease-out infinite;
}

.hero {
  display: grid;
  width: min(100%, var(--max-width));
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(8rem, 14vh, 10rem) var(--gutter) 3rem;
  grid-template-columns: minmax(0, 1.18fr) minmax(25rem, 0.82fr);
  gap: clamp(3rem, 6vw, 7rem);
  align-items: center;
  border-inline: 1px solid var(--line-soft);
}

.hero-copy {
  max-width: 62rem;
}

.eyebrow,
.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 clamp(1.5rem, 4vh, 3rem);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span:first-child,
.section-label span:first-child {
  color: var(--signal);
}

.eyebrow span + span::before,
.section-label span + span::before {
  display: inline-block;
  width: 2.8rem;
  height: 1px;
  margin-right: 1rem;
  vertical-align: middle;
  background: var(--line);
  content: "";
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 9ch;
  margin-bottom: clamp(2.2rem, 6vh, 5rem);
  font-size: clamp(3.3rem, 6.4vw, 7rem);
  font-weight: 520;
  letter-spacing: -0.068em;
  line-height: 0.91;
}

h1 em {
  position: relative;
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.04em;
}

h1 em::after {
  position: absolute;
  right: 0.04em;
  bottom: -0.045em;
  left: 0.04em;
  height: 0.045em;
  background: linear-gradient(
    90deg,
    var(--blue) 0 25%,
    var(--red) 25% 50%,
    var(--yellow) 50% 75%,
    var(--green) 75% 100%
  );
  content: "";
}

.hero-bottom {
  display: grid;
  max-width: 51rem;
  grid-template-columns: minmax(0, 31rem);
  gap: 2.5rem;
  align-items: end;
}

.intro {
  margin-bottom: 0;
  color: #4f5358;
  font-size: clamp(1rem, 1.5vw, 1.28rem);
  line-height: 1.55;
}

.text-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--paper);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    border-color 180ms ease,
    color 180ms ease;
}

.hero-bottom .text-link {
  width: min(100%, 18rem);
}

.text-link:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.arrow {
  font-size: 1rem;
  transition: transform 180ms ease;
}

.text-link:hover .arrow {
  transform: translateY(0.22rem);
}

.matrix-stage {
  position: relative;
  width: 100%;
  height: clamp(31rem, 63vh, 42rem);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(66, 133, 244, 0.035), transparent 35%),
    rgba(255, 255, 255, 0.72);
  isolation: isolate;
}

.matrix-stage::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 3.1rem 3.1rem;
  content: "";
  mask-image: radial-gradient(circle at 54% 45%, black, transparent 78%);
  opacity: 0.48;
}

.matrix-stage-head {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.matrix-stage-head span:first-child {
  color: var(--signal);
}

#matrix-field {
  position: absolute;
  z-index: 1;
  inset: 3.5rem 0 7.25rem;
  display: block;
  width: 100%;
  height: calc(100% - 10.75rem);
  touch-action: pan-y;
}

.matrix-caption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  min-height: 7.25rem;
  padding: 1rem 1.1rem;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.93);
}

.matrix-caption-title {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.matrix-caption dl {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.matrix-caption dl div {
  min-width: 0;
}

.matrix-caption dt {
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.matrix-caption dd {
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--mono);
  font-size: clamp(0.65rem, 0.9vw, 0.78rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-caption dd sup {
  color: var(--green-text);
  font-size: 0.68em;
}

.scroll-cue {
  position: absolute;
  right: var(--gutter);
  bottom: 2.7rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(90deg) translateY(-100%);
  transform-origin: right top;
}

.scroll-cue i {
  display: block;
  width: 3.5rem;
  height: 1px;
  overflow: hidden;
  background: var(--line);
}

.scroll-cue i::after {
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--blue),
    var(--red),
    var(--yellow),
    var(--green)
  );
  content: "";
  animation: scan 2.8s ease-in-out infinite;
}

.premise {
  width: min(100%, var(--max-width));
  min-height: 92svh;
  margin: 0 auto;
  padding: clamp(6rem, 14vh, 10rem) var(--gutter);
  border: 1px solid var(--line-soft);
  background: rgba(248, 249, 250, 0.82);
  backdrop-filter: blur(0.2rem);
}

.section-label {
  margin-bottom: clamp(4rem, 10vh, 8rem);
}

.premise-content {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(15rem, 0.8fr);
  gap: clamp(3rem, 9vw, 9rem);
  align-items: end;
}

.premise h2 {
  max-width: 12ch;
  margin-bottom: 0;
  font-size: clamp(3.1rem, 6.4vw, 7.2rem);
  font-weight: 500;
  letter-spacing: -0.063em;
  line-height: 0.96;
}

.premise h2 span {
  color: var(--muted);
}

.premise-detail {
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.premise-detail p {
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
  color: #4f5358;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.65;
}

.premise-detail .matrix-equation {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
  color: var(--paper);
  font-family: var(--mono);
  font-size: clamp(1.2rem, 2.1vw, 1.8rem);
  line-height: 1;
}

.matrix-equation > span:first-child {
  color: var(--signal);
}

.matrix-equation .fraction {
  display: grid;
  min-width: 6.5rem;
  grid-template-rows: 1fr 1fr;
  color: var(--paper);
  font-size: 0.68em;
  text-align: center;
}

.matrix-equation .fraction span:first-child {
  padding: 0 0.4rem 0.35rem;
  border-bottom: 1px solid var(--paper);
}

.matrix-equation .fraction span:last-child {
  padding-top: 0.35rem;
}

.contact-link {
  position: relative;
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--paper);
  font-size: 0.86rem;
  transition:
    color 180ms ease,
    border-color 180ms ease;
}

.contact-link::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--signal);
  content: "";
  transition: transform 240ms ease;
}

.contact-link:hover {
  border-color: transparent;
  color: var(--signal);
}

.contact-link:hover::after {
  transform: scaleX(1);
}

.theorem {
  width: min(100%, var(--max-width));
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(6rem, 13vh, 9rem) var(--gutter)
    clamp(7rem, 15vh, 11rem);
  border-inline: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(135deg, rgba(66, 133, 244, 0.025), transparent 38%),
    rgba(248, 249, 250, 0.68);
}

.theorem-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 0.72fr) minmax(40rem, 1.28fr);
  gap: clamp(3.5rem, 7vw, 8rem);
  align-items: start;
}

.theorem-copy {
  max-width: 37rem;
}

.theorem-kicker {
  margin-bottom: 1.2rem;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.theorem h2 {
  max-width: 8ch;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
  font-size: clamp(3.6rem, 6.2vw, 6.8rem);
  font-weight: 500;
  letter-spacing: -0.068em;
  line-height: 0.91;
}

.theorem h2 span {
  position: relative;
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.theorem h2 span::after {
  position: absolute;
  right: 0;
  bottom: -0.03em;
  left: 0.05em;
  height: 0.04em;
  background: linear-gradient(
    90deg,
    var(--red) 0 35%,
    var(--yellow) 35% 65%,
    var(--blue) 65% 100%
  );
  content: "";
}

.theorem-lede {
  margin-bottom: 2.4rem;
  color: #4f5358;
  font-size: clamp(1.03rem, 1.3vw, 1.2rem);
  line-height: 1.65;
}

.theorem-lede em {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.9em;
  font-style: normal;
}

.theorem-statement {
  margin-bottom: 1.4rem;
  padding: 1.5rem 0;
  border-block: 1px solid var(--line);
}

.theorem-statement > p:last-child {
  max-width: 34rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.6;
}

.theorem-statement .theorem-formula {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  margin-bottom: 1.3rem;
  color: var(--paper);
  font-family: var(--mono);
  font-size: clamp(0.82rem, 1vw, 0.98rem);
  letter-spacing: -0.025em;
}

.theorem-formula span:first-child {
  color: var(--signal);
}

.theorem-formula span:last-child {
  flex-basis: 100%;
  padding-left: 2.15rem;
  color: var(--green-text);
  font-size: 0.9em;
}

.theorem-caveat {
  margin-bottom: 1.6rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  line-height: 1.6;
  text-transform: uppercase;
}

.theorem-source {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 1.4rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--paper);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    color 180ms ease,
    border-color 180ms ease;
}

.theorem-source:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.theorem-demo {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1.5rem 5rem rgba(32, 33, 36, 0.055);
}

.theorem-demo::before {
  position: absolute;
  z-index: 0;
  inset: 3.5rem 0 0;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 3rem 3rem;
  content: "";
  mask-image: linear-gradient(135deg, black, transparent 74%);
  opacity: 0.28;
  pointer-events: none;
}

.theorem-demo-head,
.theorem-demo-body,
.theorem-demo-footer,
.theorem-demo figcaption {
  position: relative;
  z-index: 1;
}

.theorem-demo-head {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.15rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.theorem-demo-head span:first-child {
  color: var(--signal);
}

.theorem-demo-head span:last-child::before {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.6rem;
  border-radius: 50%;
  background: var(--red);
  content: "";
  transition: background 220ms ease;
}

.theorem-demo.is-repaired .theorem-demo-head span:last-child::before {
  background: var(--green);
}

.theorem-demo-body {
  display: grid;
  min-height: 31rem;
  padding: clamp(1.35rem, 2.5vw, 2.25rem);
  grid-template-columns: minmax(12rem, 0.74fr) minmax(19rem, 1.26fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}

.pattern-panel,
.matching-panel {
  min-width: 0;
}

.demo-panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-panel-label span:last-child {
  color: var(--paper);
}

.pattern-grid-wrap {
  position: relative;
  width: min(100%, 17rem);
  margin-inline: auto;
}

.pattern-grid,
.pattern-overlay {
  --cell-gap: 0.34rem;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: var(--cell-gap);
}

.pattern-grid {
  position: relative;
  z-index: 1;
}

.pattern-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.pattern-cell {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid rgba(32, 33, 36, 0.1);
  background: rgba(248, 249, 250, 0.72);
}

.pattern-cell::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.14rem;
  height: 0.14rem;
  transform: translate(-50%, -50%);
  background: rgba(32, 33, 36, 0.17);
  content: "";
  transition:
    width 220ms ease,
    height 220ms ease,
    transform 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.pattern-cell.is-nonzero::after {
  width: 34%;
  height: 34%;
  background: rgba(32, 33, 36, 0.74);
}

.pattern-cell.is-matched::after {
  width: 48%;
  height: 48%;
  background: var(--match-color);
  box-shadow: 0 0 0 0.19rem rgba(255, 255, 255, 0.95);
}

.pattern-cell[data-match-color="blue"],
.graph-edge[data-match-color="blue"] {
  --match-color: var(--blue);
}

.pattern-cell[data-match-color="red"],
.graph-edge[data-match-color="red"] {
  --match-color: var(--red);
}

.pattern-cell[data-match-color="yellow"],
.graph-edge[data-match-color="yellow"] {
  --match-color: var(--yellow);
}

.pattern-cell[data-match-color="green"],
.graph-edge[data-match-color="green"] {
  --match-color: var(--green);
}

.pattern-cell.is-ghost::after {
  width: auto;
  height: auto;
  background: transparent;
  color: var(--red);
  content: "+";
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.3vw, 1rem);
  line-height: 1;
}

.zero-block {
  position: relative;
  grid-column: 3 / 7;
  grid-row: 1 / 4;
  border: 1px solid rgba(234, 67, 53, 0.58);
  background: rgba(234, 67, 53, 0.055);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}

.zero-block span {
  position: absolute;
  right: 0.35rem;
  bottom: 0.28rem;
  padding: 0.2rem 0.3rem;
  background: rgba(255, 255, 255, 0.9);
  color: #b3261e;
  font-family: var(--mono);
  font-size: clamp(0.45rem, 0.65vw, 0.57rem);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.theorem-demo.is-repaired .zero-block {
  opacity: 0;
  transform: scale(0.97);
}

.zero-count {
  min-height: 2.5em;
  margin: 1.1rem auto 0;
  color: #b3261e;
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.035em;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
  transition: color 220ms ease;
}

.theorem-demo.is-repaired .zero-count {
  color: var(--green-text);
}

.matching-graph {
  display: block;
  width: 100%;
  height: auto;
  max-height: 23rem;
  overflow: visible;
}

.graph-edge {
  stroke: rgba(32, 33, 36, 0.17);
  stroke-linecap: round;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  transition:
    stroke 240ms ease,
    stroke-width 240ms ease,
    opacity 240ms ease;
}

.graph-edge.is-matched {
  stroke: var(--match-color);
  stroke-width: 3.6;
}

.graph-edge.is-ghost {
  opacity: 0.58;
  stroke: var(--red);
  stroke-dasharray: 5 6;
  stroke-width: 1.5;
}

.graph-axis-labels {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.11em;
  text-anchor: middle;
}

.graph-node rect,
.graph-node circle {
  fill: #ffffff;
  stroke: rgba(32, 33, 36, 0.38);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  transition:
    fill 220ms ease,
    stroke 220ms ease,
    stroke-width 220ms ease;
}

.graph-node text {
  fill: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
}

.graph-node.is-unmatched rect,
.graph-node.is-unmatched circle {
  fill: rgba(234, 67, 53, 0.045);
  stroke: var(--red);
  stroke-width: 2.4;
}

.theorem-demo.is-repaired .graph-edge.is-matched {
  animation: draw-match 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.theorem-demo-footer {
  display: grid;
  min-height: 7.5rem;
  padding: 1.15rem;
  grid-template-columns: auto minmax(8rem, 1fr) auto;
  gap: clamp(1rem, 2vw, 1.8rem);
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.rank-result {
  display: flex;
  min-width: 6.2rem;
  flex-direction: column;
  gap: 0.15rem;
  padding-right: 1.25rem;
  border-right: 1px solid var(--line);
}

.rank-result > span,
.match-status span:last-child {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rank-result strong {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.1;
}

.rank-result strong span {
  color: var(--red);
  transition: color 220ms ease;
}

.theorem-demo.is-repaired .rank-result strong span {
  color: var(--green-text);
}

.match-status {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.16rem;
  margin: 0;
}

.match-status span:first-child {
  color: var(--paper);
  font-size: 0.79rem;
}

.theorem-toggle {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--paper);
  border-radius: 0;
  background: var(--paper);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.055em;
  line-height: 1.3;
  text-align: left;
  text-transform: uppercase;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.theorem-toggle span:first-child {
  max-width: 14rem;
}

.theorem-toggle span:last-child {
  color: var(--yellow);
  font-size: 1rem;
}

.theorem-toggle:hover {
  border-color: var(--signal);
  background: var(--signal);
  transform: translateY(-0.08rem);
}

.theorem-toggle:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

.theorem-toggle[aria-pressed="true"] {
  border-color: rgba(52, 168, 83, 0.35);
  background: rgba(52, 168, 83, 0.09);
  color: var(--green-text);
}

.theorem-toggle[aria-pressed="true"] span:last-child {
  color: var(--green-text);
  transform: rotate(45deg);
}

.theorem-demo figcaption {
  padding: 0.75rem 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.site-footer {
  display: flex;
  width: min(100%, var(--max-width));
  min-height: 8rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 auto;
  padding: 2rem var(--gutter);
  border-inline: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(1.2rem);
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero [data-reveal]:nth-child(2) {
  transition-delay: 100ms;
}

.hero [data-reveal]:nth-child(3) {
  transition-delay: 220ms;
}

@keyframes breathe {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 168, 83, 0.34);
  }
  55%,
  100% {
    box-shadow: 0 0 0 0.55rem rgba(52, 168, 83, 0);
  }
}

@keyframes scan {
  0% {
    transform: translateX(-110%);
  }
  55%,
  100% {
    transform: translateX(240%);
  }
}

@keyframes draw-match {
  from {
    stroke-dasharray: 0 520;
  }
  to {
    stroke-dasharray: 520 0;
  }
}

@media (max-width: 74rem) {
  .theorem-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .theorem-copy {
    max-width: 46rem;
  }

  .theorem h2 {
    max-width: 9ch;
  }

  .theorem-demo {
    width: min(100%, 54rem);
    justify-self: center;
  }
}

@media (max-width: 56rem) {
  .hero {
    min-height: auto;
    padding-bottom: 7rem;
    grid-template-columns: minmax(0, 1fr);
    gap: 5rem;
  }

  .hero-copy {
    max-width: 47rem;
  }

  .matrix-stage {
    width: min(100%, 40rem);
    height: 36rem;
    justify-self: center;
  }

  .premise-content {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .premise-detail {
    max-width: 30rem;
    justify-self: end;
  }

  .grid {
    mask-image: linear-gradient(
      180deg,
      transparent,
      rgba(0, 0, 0, 0.6) 45%,
      rgba(0, 0, 0, 0.2)
    );
  }
}

@media (max-width: 42rem) {
  .site-header {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand-name {
    max-width: 7rem;
    font-size: 0.64rem;
  }

  .status {
    min-height: 2.2rem;
    padding-inline: 0.75rem;
    font-size: 0.61rem;
  }

  .hero {
    min-height: auto;
    padding-top: 8.5rem;
    padding-bottom: 5.5rem;
    align-items: center;
    gap: 4.2rem;
  }

  h1 {
    font-size: clamp(3.25rem, 15vw, 5.1rem);
  }

  .hero-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.2rem;
  }

  .text-link {
    width: min(100%, 18rem);
  }

  .scroll-cue {
    display: none;
  }

  .matrix-stage {
    height: 34rem;
  }

  #matrix-field {
    bottom: 9.5rem;
    height: calc(100% - 13rem);
  }

  .matrix-caption {
    min-height: 9.5rem;
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .matrix-caption-title {
    writing-mode: initial;
  }

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

  .premise {
    min-height: 100svh;
    padding-top: 5.5rem;
    padding-bottom: 5.5rem;
  }

  .section-label {
    margin-bottom: 4rem;
  }

  .premise h2 {
    font-size: clamp(2.9rem, 13vw, 4.7rem);
  }

  .premise-detail {
    justify-self: stretch;
  }

  .theorem {
    min-height: auto;
    padding-top: 5.5rem;
    padding-bottom: 6rem;
  }

  .theorem h2 {
    font-size: clamp(3.2rem, 14vw, 5rem);
  }

  .theorem-demo-head {
    min-height: 3.25rem;
  }

  .theorem-demo-body {
    min-height: auto;
    padding: 1.25rem;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.8rem;
  }

  .pattern-grid-wrap {
    width: min(100%, 16.5rem);
  }

  .matching-graph {
    max-height: 21rem;
  }

  .theorem-demo-footer {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .theorem-toggle {
    grid-column: 1 / -1;
  }

  .site-footer {
    min-height: 9rem;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
  }
}

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

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media (forced-colors: active) {
  #matrix-field,
  .grid,
  .glow {
    display: none;
  }

  .status-dot,
  .brand-mark i:nth-child(2),
  .brand-mark i:nth-child(4),
  .brand-mark i:nth-child(6),
  .brand-mark i:nth-child(8) {
    background: Highlight;
  }

  .pattern-cell.is-nonzero::after,
  .pattern-cell.is-matched::after {
    background: CanvasText;
  }

  .zero-block,
  .graph-node.is-unmatched rect,
  .graph-node.is-unmatched circle {
    border-color: Highlight;
    stroke: Highlight;
  }

  .graph-edge.is-matched {
    stroke: Highlight;
  }
}
