:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --ink: #121417;
  --muted: #555d6b;
  --accent: #e27b4f;
  --accent-dark: #a64f2f;
  --accent-soft: rgba(226, 123, 79, 0.2);
  --teal: #67b79c;
  --blue: #24639d;
  --red: #c44f5d;
  --card: rgba(255, 255, 255, 0.8);
  --stroke: rgba(18, 20, 23, 0.12);
  --shadow: 0 30px 80px rgba(18, 20, 23, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, #fff3e3, transparent 42%),
    radial-gradient(circle at 10% 65%, rgba(103, 183, 156, 0.16), transparent 52%),
    radial-gradient(circle at 80% 20%, rgba(36, 99, 157, 0.1), transparent 38%);
  z-index: -3;
}

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -2;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0.5px);
  opacity: 0.55;
  animation: drift 14s ease-in-out infinite;
}

.orb-a {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(226, 123, 79, 0.46), transparent 70%);
  top: -120px;
  right: -140px;
  animation-delay: -3s;
}

.orb-b {
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, rgba(36, 99, 157, 0.32), transparent 70%);
  bottom: -200px;
  left: -120px;
  animation-delay: -7s;
}

.grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      to right,
      rgba(27, 27, 26, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      rgba(27, 27, 26, 0.05) 1px,
      transparent 1px
    );
  background-size: 120px 120px;
  opacity: 0.15;
  animation: grid-drift 18s linear infinite;
}

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

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(18px);
  background: rgba(246, 247, 251, 0.88);
  border-bottom: 1px solid rgba(27, 27, 26, 0.05);
  z-index: 5;
  width: 100%;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 4vw;
  max-width: 1360px;
  margin: 0 auto;
  gap: 14px;
}

.logo {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(18, 20, 23, 0.08);
}

.logo-mark img {
  width: 28px;
  height: 28px;
}

.logo-type {
  font-weight: 700;
  font-size: 1.05rem;
}

.nav {
  display: flex;
  gap: 16px;
  font-size: 0.92rem;
  color: var(--muted);
  white-space: nowrap;
}

.nav a {
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav a:hover {
  color: var(--ink);
}

.nav a:hover::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-toggle:hover {
  background: #fff;
  transform: translateY(-2px);
}

.mobile-menu {
  border-top: 1px solid rgba(27, 27, 26, 0.06);
  background: rgba(246, 247, 251, 0.92);
  backdrop-filter: blur(18px);
}

.mobile-nav {
  display: grid;
  gap: 10px;
  padding: 14px 6vw 8px;
  max-width: 1200px;
  margin: 0 auto;
}

.mobile-nav a {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(18, 20, 23, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.mobile-actions {
  display: flex;
  gap: 12px;
  padding: 0 6vw 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.mobile-actions .btn {
  flex: 1 1 180px;
}

.mobile-nav a:hover {
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 14px 30px rgba(36, 99, 157, 0.24);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(36, 99, 157, 0.28);
}

.btn-ghost {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
}

.btn-ghost:hover {
  background: #fff;
  transform: translateY(-2px);
}

.flat-icon,
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.flat-icon {
  width: 1em;
  height: 1em;
}

.card-icon {
  width: 34px;
  height: 34px;
  padding: 7px;
  margin-bottom: 14px;
  border-radius: 10px;
  color: var(--blue);
  background: rgba(36, 99, 157, 0.1);
}

main {
  padding: 10px 6vw 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 40px;
  align-items: start;
  padding: 44px 0 40px;
}

.hero-copy {
  max-width: 560px;
  min-width: 0;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1.03;
  margin: 8px 0 18px;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.headline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3776ab 0 48%, #ffd43b 52% 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: 0.82em;
  margin: 0 0.04em;
  padding: 0.04em;
  border-radius: 0.18em;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9))
    drop-shadow(0 4px 8px rgba(18, 20, 23, 0.14));
  vertical-align: 0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.status-row a {
  display: inline-flex;
  height: 22px;
}

.status-row img {
  display: block;
  height: 22px;
}

.install {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(36, 99, 157, 0.18);
  box-shadow: 0 14px 34px rgba(18, 20, 23, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
}

.install span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.install code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--accent-soft);
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--accent-dark);
  font-weight: 500;
}

.paper-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid rgba(18, 20, 23, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(18, 20, 23, 0.06);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.paper-link:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(36, 99, 157, 0.22);
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.resource-links a {
  position: relative;
}

.resource-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.resource-links a:hover::after {
  transform: scaleX(1);
}

.hero-card {
  background: var(--card);
  border-radius: 24px;
  padding: 26px;
  border: 1px solid rgba(27, 27, 26, 0.08);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.hero-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 40px 90px rgba(27, 27, 26, 0.16);
}

.hero-card pre {
  min-height: 180px;
}

.code-shell {
  margin: 0;
  background: #0f1115;
  color: #f5f5f5;
  padding: 18px;
  padding-top: 42px;
  border-radius: 16px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.copy-code {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font: 600 0.72rem "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.copy-code:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.copy-code i {
  font-size: 0.86rem;
}

.code-shell-hero {
  height: 180px;
  overflow-y: auto;
}

.code-shell::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  background: linear-gradient(
    120deg,
    rgba(103, 183, 156, 0.1),
    rgba(226, 123, 79, 0.1),
    rgba(36, 99, 157, 0.08)
  );
  opacity: 0;
  animation: code-glow 3.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.code-block {
  display: block;
  position: relative;
  white-space: pre;
  z-index: 1;
}

.tok-comment {
  color: #8b98aa;
}

.tok-keyword {
  color: #9fc1dd;
}

.tok-string {
  color: #e8b99f;
}

.tok-number {
  color: #c4b5fd;
}

.tok-name {
  color: #b4cdbf;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 2px;
  background: var(--teal);
  vertical-align: text-bottom;
  animation: caret 0.9s steps(1, end) infinite;
  position: relative;
  z-index: 1;
}

.hero-card-header,
.hero-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 0;
}

.hero-card-footer {
  margin-top: 12px;
  gap: 10px;
}

.rendered-viz {
  position: relative;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(18, 20, 23, 0.12);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.rendered-viz img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  animation: viz-reveal 1.2s ease forwards;
}

.rendered-viz:hover {
  border-color: rgba(36, 99, 157, 0.28);
  box-shadow: 0 14px 30px rgba(18, 20, 23, 0.08);
  transform: translateY(-2px);
}

.tag {
  background: rgba(36, 99, 157, 0.12);
  color: var(--blue);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.section-title {
  margin: 70px 0 30px;
}

.section-title h2 {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  margin: 10px 0 0;
}

.workflow {
  margin-top: 40px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(18, 20, 23, 0.1);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 48px rgba(18, 20, 23, 0.08);
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(420px, 1.45fr);
  gap: 24px;
  align-items: center;
}

.higher-order-note {
  margin-top: 40px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(18, 20, 23, 0.1);
  background: radial-gradient(
      circle at 82% 22%,
      rgba(103, 183, 156, 0.18),
      transparent 34%
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.74));
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
  gap: 26px;
  align-items: center;
  box-shadow: 0 18px 48px rgba(18, 20, 23, 0.08);
  overflow: hidden;
}

.higher-order-note h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.35rem);
  line-height: 1.15;
  margin: 10px 0 0;
}

.higher-order-copy > p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.higher-order-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.network-mini {
  padding: 16px;
  border: 1px solid rgba(18, 20, 23, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.network-mini > span {
  display: inline-flex;
  margin-bottom: 12px;
  font-weight: 700;
}

.network-mini p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-canvas {
  height: 140px;
  border-radius: 14px;
  background: rgba(246, 247, 251, 0.9);
  overflow: hidden;
}

.mini-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mini-canvas line {
  stroke: rgba(36, 99, 157, 0.58);
  stroke-width: 3;
  stroke-linecap: round;
}

.mini-canvas circle {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 3;
}

.mini-canvas .hyperedge {
  fill: rgba(226, 123, 79, 0.28);
  stroke: rgba(166, 79, 47, 0.5);
  stroke-width: 3;
}

.mini-canvas .hyperedge-alt {
  fill: rgba(36, 99, 157, 0.18);
  stroke: rgba(36, 99, 157, 0.45);
}

.mini-canvas .hyperedge-teal {
  fill: rgba(103, 183, 156, 0.28);
  stroke: rgba(70, 142, 118, 0.52);
}

.higher-order-examples {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.higher-order-examples span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(36, 99, 157, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.workflow h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  line-height: 1.15;
  margin: 10px 0 0;
}

.workflow-rail {
  display: grid;
  grid-template-columns: 1fr 34px 1fr 34px 1fr;
  gap: 12px;
  align-items: stretch;
}

.workflow-item {
  padding: 18px;
  border: 1px solid rgba(18, 20, 23, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.workflow-item span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent-dark);
  font-size: 0.78rem;
}

.workflow-item strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}

.workflow-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.workflow-arrow {
  position: relative;
  min-height: 100%;
}

.workflow-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
}

.workflow-arrow::after {
  content: "";
  position: absolute;
  top: calc(50% - 5px);
  right: 2px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--teal);
  border-right: 2px solid var(--teal);
  transform: rotate(45deg);
}

.feature-grid,
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 20px;
}

.feature-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--stroke);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover,
.tutorial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(18, 20, 23, 0.12);
}

.feature-card h3 {
  margin-top: 0;
}

.data-feature {
  margin-top: 70px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(18, 20, 23, 0.12);
  background: radial-gradient(
      circle at 14% 24%,
      rgba(103, 183, 156, 0.18),
      transparent 36%
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7));
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  gap: 28px;
  align-items: center;
  box-shadow: 0 18px 48px rgba(18, 20, 23, 0.08);
}

.data-feature h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  line-height: 1.15;
  margin: 10px 0 12px;
}

.data-feature p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.data-code {
  min-height: 0;
}

.tutorial {
  margin-top: 70px;
}

.tutorial-card {
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  border: 1px solid var(--stroke);
  display: grid;
  grid-template-rows: auto minmax(3.2rem, auto) 1fr;
  gap: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-step {
  align-self: start;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.tutorial-card h3 {
  align-self: start;
  margin: 0;
  line-height: 1.2;
}

.tutorial-body {
  display: grid;
  grid-template-rows: 190px 1fr;
  gap: 12px;
  height: 100%;
}

.tutorial-body .code-shell {
  min-height: 170px;
  height: 190px;
}

.tutorial-body .code-block {
  min-width: auto;
}

.tutorial-body pre {
  padding: 14px;
  padding-top: 42px;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.5;
  min-height: 190px;
  height: 190px;
}

.tutorial-body .rendered-viz {
  align-self: end;
  margin-top: 0;
  min-height: 220px;
  display: flex;
  align-items: center;
}

.tutorial-body .rendered-viz img {
  max-height: 260px;
  object-fit: contain;
}

.tutorial-card:nth-of-type(2) .rendered-viz img {
  animation-delay: 0.2s;
}

.tutorial-card:nth-of-type(3) .rendered-viz img {
  animation-delay: 0.4s;
}

.citation {
  margin-top: 80px;
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(280px, 1.25fr);
  gap: 28px;
  align-items: start;
  padding: 28px;
  border: 1px solid rgba(18, 20, 23, 0.12);
  border-radius: 24px;
  background: linear-gradient(
      135deg,
      rgba(36, 99, 157, 0.08),
      rgba(255, 255, 255, 0.82)
    ),
    rgba(255, 255, 255, 0.82);
}

.citation h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  line-height: 1.15;
  margin: 10px 0 12px;
}

.citation p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.citation-box {
  border: 1px solid rgba(18, 20, 23, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.citation-label {
  padding: 14px 16px;
  font-weight: 700;
}

.citation-box .code-shell {
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(18, 20, 23, 0.1);
  max-height: 360px;
}

.cta {
  margin-top: 80px;
}

.cta-card {
  background: linear-gradient(120deg, #0b0d12, #1a2d4f);
  color: #fff;
  border-radius: 28px;
  padding: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.cta-card .eyebrow {
  color: #ffd2b5;
}

.cta-card p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 520px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta .btn-primary {
  background: #fff;
  color: #111;
}

.cta .btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.back-to-top {
  display: flex;
  justify-content: center;
  margin-top: 38px;
}

.back-to-top a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(18, 20, 23, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(18, 20, 23, 0.06);
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.back-to-top a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.site-footer {
  padding: 40px 6vw 60px;
  border-top: 1px solid rgba(27, 27, 26, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
}

.site-footer p a {
  color: var(--ink);
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.footer-links a {
  padding: 6px 0;
}

.footer-links a:hover {
  color: var(--ink);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.8s ease forwards;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes caret {
  0%,
  45% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes code-glow {
  0%,
  100% {
    opacity: 0;
  }
  40% {
    opacity: 0.25;
  }
  60% {
    opacity: 0.15;
  }
}

@keyframes viz-reveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(18px) translateX(-10px);
  }
}

@keyframes grid-drift {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 120px 120px;
  }
}

@media (max-width: 1040px) {
  .nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-header-inner {
    gap: 16px;
  }

  .cta-card {
    padding: 28px;
  }

  .workflow,
  .higher-order-note,
  .data-feature,
  .citation {
    grid-template-columns: 1fr;
  }

  .workflow-rail {
    grid-template-columns: 1fr;
  }

  .workflow-arrow {
    min-height: 22px;
  }

  .workflow-arrow::before {
    top: 0;
    bottom: 0;
    left: 50%;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--accent), var(--teal));
  }

  .workflow-arrow::after {
    top: auto;
    bottom: 2px;
    right: calc(50% - 5px);
    transform: rotate(135deg);
  }
}

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

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 30px;
  }

  .hero-copy,
  .hero-card {
    width: 100%;
    max-width: 100%;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .eyebrow {
    letter-spacing: 0.12em;
  }

  .cta-actions {
    width: 100%;
    flex-direction: column;
  }

  .cta-actions .btn {
    width: 100%;
    flex: 0 0 auto;
  }

  .hero-card {
    padding: 26px clamp(16px, 6vw, 26px);
  }

  .hero-card-header,
  .hero-card-footer {
    flex-wrap: wrap;
  }

  .workflow,
  .higher-order-note,
  .data-feature,
  .citation {
    padding: 20px;
  }

  .higher-order-visual {
    grid-template-columns: 1fr;
  }

}

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

  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .orb,
  .grid {
    animation: none;
  }

  .btn {
    transition: none;
  }

  .hero-card {
    transition: none;
  }

  .rendered-viz img {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .code-shell::before,
  .cursor {
    animation: none;
  }
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
