:root {
  --bg: #0b0b0c;
  --bg-soft: #0f0f11;
  --surface: #131316;
  --surface-raised: #19191d;
  --border-subtle: #1e1e22;
  --border: #2a2a2f;
  --border-strong: #3a3a40;
  --text: #f2efe9;
  --text-secondary: #b5b2ab;
  --text-muted: #8a8a85;
  --accent: #e8b57c;
  --accent-hover: #f4c896;
  --accent-on: #1a1207;
  --success: #8fcba1;
  --font-sans: "Geist", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1200px;
  --gutter: 24px;
  --header-height: 76px;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="light"] {
  --bg: #faf8f3;
  --bg-soft: #f4f2ec;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border-subtle: #e8e5dc;
  --border: #d8d4c9;
  --border-strong: #b8b4a8;
  --text: #0b0b0c;
  --text-secondary: #3a3a36;
  --text-muted: #6a6a65;
  --accent: #9c6b22;
  --accent-hover: #835715;
  --accent-on: #ffffff;
  --success: #1f6a3d;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.12;
  content: "";
  pointer-events: none;
}

body.menu-open {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-on);
}

img,
svg {
  display: block;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-on);
  transform: translateY(-160%);
  transition: transform 180ms var(--ease);
}

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

.page-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 500;
  height: 2px;
  pointer-events: none;
}

.page-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.site-header.scrolled {
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 97%, transparent);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 14px;
  width: max-content;
}

.brand-mark,
.footer-brand img,
.closing-mark img {
  color: var(--text);
  filter: invert(1);
}

[data-theme="light"] .brand-mark,
[data-theme="light"] .footer-brand img,
[data-theme="light"] .closing-mark img,
[data-theme="light"] .map-origin img {
  filter: none;
}

.brand-wordmark,
.footer-brand > span {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.brand-wordmark strong,
.footer-brand strong {
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.mobile-nav-footer {
  display: none;
}

.site-nav a {
  position: relative;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color 180ms var(--ease);
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -10px;
  left: 0;
  height: 1px;
  background: var(--text);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms var(--ease);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.language-dropdown {
  position: relative;
}

.language-dropdown-mobile {
  min-width: 220px;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 74px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background-color 180ms var(--ease);
}

.language-trigger:hover,
.language-trigger[aria-expanded="true"] {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.language-trigger-flag,
.language-option-flag {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1;
}

.language-trigger-code {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.language-trigger svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  transition: transform 180ms var(--ease);
}

.language-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 220;
  display: grid;
  width: 260px;
  max-height: min(520px, calc(100vh - 100px));
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 180ms;
}

.language-dropdown.open .language-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.language-option {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.language-option:hover,
.language-option[aria-selected="true"] {
  background: var(--bg-soft);
  color: var(--text);
}

.language-option-name {
  font-size: 13px;
  font-weight: 500;
}

.language-option-code {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background-color 180ms var(--ease);
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.icon-button svg,
.button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.theme-button .sun-icon,
[data-theme="light"] .theme-button .moon-icon {
  display: none;
}

[data-theme="light"] .theme-button .sun-icon {
  display: block;
}

.github-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background-color 180ms var(--ease);
}

.github-button svg,
.project-link svg,
.closing-actions svg {
  fill: currentColor;
}

.github-button:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.menu-button {
  display: none;
}

.hero {
  position: relative;
  min-height: 100svh;
  padding-top: calc(var(--header-height) + 92px);
  overflow: hidden;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--border-subtle);
  content: "";
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: center;
}

.hero-copy {
  grid-column: 1 / span 7;
  padding-bottom: 64px;
}

.eyebrow,
.status,
.project-note,
.diagram-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--text-muted);
}

.hero-title {
  max-width: 780px;
  margin: 0;
  font-size: clamp(52px, 7vw, 92px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.hero-title > span {
  display: block;
}

.hero-title-emphasis {
  color: var(--text-muted);
}

.hero-lead {
  max-width: 620px;
  margin: 40px 0 0;
  color: var(--text-secondary);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.hero-actions,
.closing-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 40px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}

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

.button-primary {
  background: var(--accent);
  color: var(--accent-on);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  border-color: var(--border);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color 180ms var(--ease);
}

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

.ecosystem-map {
  grid-column: 8 / -1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.map-origin {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
}

.map-origin img {
  color: var(--text);
  filter: invert(1);
}

.map-origin div,
.branch-heading div,
.map-node {
  display: flex;
  flex-direction: column;
}

.map-origin strong,
.branch-heading strong,
.map-node > span {
  font-size: 13px;
  font-weight: 600;
}

.map-origin span,
.branch-heading div span,
.map-node small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.map-trunk {
  position: relative;
  width: 36px;
  height: 36px;
  margin: 12px auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
}

.map-trunk::before {
  position: absolute;
  top: 11px;
  left: 12px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  border-radius: 1px;
  content: "";
  transform: rotate(45deg);
}

.map-branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 24px 24px;
}

.map-branch {
  position: relative;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
}

.map-branch::before {
  display: none;
}

.branch-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 42px;
  margin-bottom: 8px;
}

.map-node {
  gap: 2px;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-soft);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

a.map-node:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.section {
  padding-block: 160px;
  border-bottom: 1px solid var(--border-subtle);
}

.statement-grid,
.section-heading {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.section-heading > :first-child {
  grid-column: 1 / span 3;
}

.statement-grid > div,
.section-heading > :last-child {
  grid-column: 4 / -1;
}

.section-title {
  max-width: 940px;
  margin: 0;
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.section-title > span {
  display: block;
}

.section-title .muted {
  color: var(--text-muted);
}

.section-intro {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.6;
}

.branch-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 96px;
}

.branch-card {
  display: flex;
  flex-direction: column;
  min-height: 540px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

.branch-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.branch-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.branch-glyph {
  color: var(--border-strong);
  font-size: 96px;
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.8;
}

.lambda-glyph {
  font-family: Arial, sans-serif;
  font-weight: 400;
}

.branch-card-copy {
  margin-top: auto;
}

.branch-card-copy .eyebrow {
  margin-bottom: 16px;
}

.branch-card h3 {
  margin: 0;
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.branch-card-copy > p:last-child {
  max-width: 490px;
  margin: 20px 0 32px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.branch-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.branch-card-meta span + span::before {
  margin-right: 8px;
  content: "/";
}

.projects {
  background: var(--bg-soft);
}

.projects .eyebrow,
.principles .eyebrow {
  margin: 0;
}

.project-list {
  display: grid;
  gap: 24px;
  margin-top: 96px;
}

.project-card {
  display: grid;
  grid-template-columns: 5fr 7fr;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.project-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 40px;
  border-right: 1px solid var(--border);
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 72px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 9px;
}

.status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-stable {
  color: var(--success);
}

.status-stable i {
  background: var(--success);
}

.status-building i {
  background: var(--accent);
}

.project-info > .eyebrow {
  margin-bottom: 12px;
}

.project-info h3 {
  margin: 0;
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.project-description {
  max-width: 470px;
  margin: 24px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.project-tags li {
  padding: 7px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.project-link,
.project-note {
  align-self: flex-start;
  margin-top: auto;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: auto;
}

.project-actions .project-link,
.project-actions .project-note {
  margin-top: 0;
}

.project-link-primary {
  color: var(--text);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-top: 32px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color 180ms var(--ease);
}

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

.project-link > span:last-child {
  transition: transform 180ms var(--ease);
}

.project-link:hover > span:last-child {
  transform: translate(3px, -3px);
}

.project-note {
  padding-top: 32px;
  color: var(--text-muted);
}

.project-visual {
  position: relative;
  min-width: 0;
  min-height: 620px;
  overflow: hidden;
  background: var(--surface);
}

.window-chrome {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.window-chrome i {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
}

.window-chrome i:first-child {
  margin-left: 16px;
}

.window-chrome > span:last-child {
  margin-left: 10px;
}

.flow-visual {
  margin: 48px 48px 0 0;
  min-height: calc(100% - 48px);
  border: 1px solid var(--border);
  border-right: 0;
  border-bottom: 0;
  border-radius: 10px 0 0;
  background: var(--bg-soft);
}

.flow-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 574px;
  padding: 52px clamp(28px, 5vw, 72px);
  background-image: radial-gradient(var(--border) 0.7px, transparent 0.7px);
  background-size: 16px 16px;
}

.flow-layer {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
}

.flow-layer > span,
.flow-layer small,
.flow-targets,
.flow-channel {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.flow-layer strong {
  margin: 8px 0 4px;
  font-size: 20px;
  font-weight: 500;
}

.flow-channel {
  display: flex;
  align-items: center;
  height: 64px;
}

.flow-channel span {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-secondary);
  text-align: center;
}

.flow-targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 24px;
}

.flow-targets span {
  padding: 10px;
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.forge-visual {
  display: grid;
  grid-template-columns: 72px 1fr;
  padding: 48px 0 0 48px;
  background-image: linear-gradient(90deg, transparent 95%, var(--border-subtle) 95%);
  background-size: 24px 100%;
}

.forge-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 10px 0 0;
  background: var(--bg-soft);
}

.forge-sidebar img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

[data-theme="light"] .forge-sidebar img {
  filter: invert(1);
}

.forge-sidebar span {
  width: 16px;
  height: 2px;
  background: var(--border-strong);
}

.forge-sidebar span.active {
  background: var(--accent);
}

.forge-workspace {
  align-self: stretch;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 0;
  background: var(--bg-soft);
}

.forge-workspace .window-chrome {
  justify-content: space-between;
  padding: 0 20px;
}

.forge-workspace .window-chrome small {
  color: var(--success);
}

.forge-workspace pre {
  margin: 0;
  padding: 56px 48px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.5vw, 15px);
  line-height: 1.9;
  white-space: pre-wrap;
}

.forge-workspace code b {
  color: var(--text);
  font-weight: 500;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 12px 24px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.metric-row > span {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}

.metric-row > span + span {
  border-left: 1px solid var(--border);
}

.metric-row small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.metric-row strong {
  font-size: 17px;
  font-weight: 500;
}

.app-visual {
  padding: 48px 0 0 48px;
}

.app-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 10px 0 0;
  background: var(--bg-soft);
  font-size: 11px;
  font-weight: 600;
}

.app-toolbar div {
  display: flex;
  gap: 12px;
}

.app-toolbar i {
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
}

.app-toolbar button,
.demo-app button {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
}

.app-toolbar button {
  padding: 7px 11px;
}

.app-workspace {
  display: grid;
  grid-template-columns: 116px 1fr 136px;
  min-height: 524px;
  border-left: 1px solid var(--border);
  background: var(--bg-soft);
}

.app-palette,
.app-inspector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.app-palette {
  border-right: 1px solid var(--border-subtle);
}

.app-palette strong,
.app-inspector > strong {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 8px;
}

.app-palette span {
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--surface);
}

.app-canvas {
  position: relative;
  display: grid;
  place-items: center;
  background-image: radial-gradient(var(--border) 0.7px, transparent 0.7px);
  background-size: 14px 14px;
}

.canvas-label {
  position: absolute;
  top: 10px;
  left: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.demo-app {
  display: flex;
  flex-direction: column;
  width: 72%;
  min-height: 210px;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-raised);
  outline: 1px solid var(--accent);
  outline-offset: 5px;
}

.demo-app small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.demo-app strong {
  margin-top: 20px;
  font-size: 18px;
}

.demo-app p {
  margin: 6px 0 20px;
  color: var(--text-muted);
  font-size: 10px;
}

.demo-app button {
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--accent-on);
}

.app-inspector {
  border-left: 1px solid var(--border-subtle);
}

.app-inspector label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.app-inspector label span {
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-secondary);
}

.ai-visual {
  display: grid;
  grid-template-rows: 48px 1fr;
  padding: 48px 0 0 48px;
  background: var(--surface);
}

.ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 10px 0 0;
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.ai-toolbar div {
  display: flex;
  gap: 20px;
}

.ai-toolbar b,
.ai-toolbar > span:last-child {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.ai-toolbar b:first-child {
  color: var(--text);
}

.ai-workspace {
  display: grid;
  grid-template-columns: 112px 1fr 132px;
  min-height: 482px;
  border-left: 1px solid var(--border);
  background: var(--bg-soft);
}

.ai-library,
.ai-properties {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.ai-library {
  border-right: 1px solid var(--border-subtle);
}

.ai-library strong,
.ai-properties > strong {
  margin-bottom: 8px;
  font-size: 8px;
}

.ai-library > span {
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-secondary);
}

.ai-canvas {
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(var(--border) 0.7px, transparent 0.7px);
  background-size: 16px 16px;
}

.ai-canvas-meta {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.ai-canvas svg {
  width: 100%;
  height: 100%;
}

.ai-edge {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 4;
  stroke-linecap: round;
}

.ai-port {
  fill: var(--accent);
  stroke: var(--bg-soft);
  stroke-width: 4;
}

.ai-port.output {
  fill: var(--success);
}

.ai-node rect {
  fill: var(--surface-raised);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.ai-node circle {
  fill: var(--accent);
  stroke: var(--bg-soft);
  stroke-width: 3;
}

.ai-node-title {
  fill: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
}

.ai-node-meta {
  fill: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.ai-node-muted {
  opacity: 0.55;
}

.ai-properties {
  border-left: 1px solid var(--border-subtle);
}

.ai-properties label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-properties label b {
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 400;
}

.ai-validation {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  color: var(--success);
}

.ai-validation i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.architecture-grid {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 72px;
  align-items: start;
}

.architecture-copy {
  position: sticky;
  top: calc(var(--header-height) + 48px);
}

.architecture-copy .eyebrow {
  margin-top: 48px;
}

.architecture-copy .section-title {
  font-size: clamp(38px, 4vw, 56px);
}

.architecture-diagram {
  --system-link: clamp(72px, 10vw, 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 540px;
  padding: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.system-row,
.system-between {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--system-link) minmax(0, 1fr);
  align-items: center;
}

.diagram-node {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
}

.diagram-node span {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.diagram-node small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.primary-node {
  border-color: var(--border-strong);
}

.system-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.system-link::before {
  position: absolute;
  border-radius: 999px;
  background: var(--border-strong);
  content: "";
}

.system-link::after {
  position: absolute;
  width: 9px;
  height: 9px;
  border-right: 3px solid var(--border-strong);
  border-bottom: 3px solid var(--border-strong);
  border-radius: 1px;
  content: "";
}

.system-link span {
  position: relative;
  z-index: 1;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  white-space: nowrap;
}

.system-link.horizontal::before {
  top: calc(50% - 2px);
  right: 9px;
  left: 6px;
  height: 4px;
}

.system-link.horizontal::after {
  top: calc(50% - 6px);
  right: 6px;
  transform: rotate(-45deg);
}

.system-between {
  min-height: 144px;
}

.system-link.vertical {
  grid-column: 1;
  height: 144px;
}

.system-link.vertical::before {
  top: 8px;
  bottom: 10px;
  left: calc(50% - 2px);
  width: 4px;
}

.system-link.vertical::after {
  bottom: 7px;
  left: calc(50% - 6px);
  transform: rotate(45deg);
}

.principles-heading > .section-title {
  grid-column: 4 / -1;
}

.principles-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 96px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.principle {
  min-height: 360px;
  padding: 32px;
}

.principle + .principle {
  border-left: 1px solid var(--border);
}

.principle h3 {
  margin: 96px 0 16px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.principle p {
  max-width: 300px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.closing {
  padding-block: 96px;
}

.closing-panel {
  position: relative;
  padding: 80px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.closing-mark {
  position: absolute;
  top: 64px;
  right: 80px;
  color: var(--text-muted);
}

.closing-panel h2 {
  max-width: 800px;
  margin: 112px 0 0;
  font-size: clamp(48px, 7vw, 86px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.closing-panel > h2 + p {
  max-width: 680px;
  margin: 32px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.65;
}

.site-footer {
  padding-block: 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.footer-brand > span {
  font-size: 15px;
}

.footer-inner > p {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.footer-links {
  display: flex;
  justify-self: end;
  gap: 24px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.footer-links a {
  transition: color 180ms var(--ease);
}

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

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 440ms var(--ease), transform 440ms var(--ease);
  transition-delay: calc(var(--reveal-delay, 0) * 80ms);
}

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

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero {
    padding-top: calc(var(--header-height) + 64px);
  }

  .hero-copy {
    grid-column: 1 / span 7;
  }

  .ecosystem-map {
    grid-column: 8 / -1;
  }

  .map-branches {
    --map-line-offset: 5px;
    gap: 12px;
    padding-inline: 16px;
  }

  .map-node {
    padding-inline: 10px;
  }

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

  .project-info {
    min-height: 520px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .project-visual {
    min-height: 560px;
  }

  .flow-canvas {
    min-height: 518px;
  }

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

  .architecture-copy {
    position: static;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 68px;
  }

  .header-inner {
    grid-template-columns: 1fr auto auto;
  }

  .menu-button {
    display: grid;
    justify-self: end;
    margin-right: 8px;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 32px var(--gutter);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 180ms;
  }

  .site-nav.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .site-nav a {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text);
    font-size: 24px;
    letter-spacing: -0.03em;
  }

  .site-nav a::after {
    display: none;
  }

  .mobile-nav-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 24px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .header-actions .github-button,
  .header-actions .language-dropdown-desktop {
    display: none;
  }

  .mobile-nav-footer .language-trigger {
    width: 100%;
    min-width: 220px;
  }

  .mobile-nav-footer .language-menu {
    top: auto;
    right: 0;
    bottom: calc(100% + 8px);
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding-bottom: 96px;
  }

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

  .hero-copy,
  .ecosystem-map {
    grid-column: 1;
  }

  .hero-copy {
    padding-bottom: 24px;
  }

  .ecosystem-map {
    margin-top: 48px;
  }

  .section {
    padding-block: 112px;
  }

  .statement-grid,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-heading > :first-child,
  .statement-grid > div,
  .section-heading > :last-child,
  .principles-heading > .section-title {
    grid-column: 1;
  }

  .statement-grid > div,
  .section-heading > :last-child {
    margin-top: 48px;
  }

  .branch-cards {
    grid-template-columns: 1fr;
    margin-top: 64px;
  }

  .project-list {
    margin-top: 64px;
  }

  .architecture-diagram {
    --system-link: 72px;
    padding: 28px;
  }

  .diagram-node {
    padding: 16px;
  }

  .diagram-node span {
    font-size: 14px;
  }

  .principles-list {
    grid-template-columns: 1fr;
    margin-top: 64px;
  }

  .principle {
    min-height: auto;
  }

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

  .principle h3 {
    margin-top: 72px;
  }

  .closing-panel {
    padding: 48px;
  }

  .closing-mark {
    top: 40px;
    right: 48px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-inner > p {
    justify-self: end;
  }

  .footer-links {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }

  body::before {
    background-size: 40px 40px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .brand-wordmark {
    font-size: 16px;
  }

  .hero {
    padding-top: calc(var(--header-height) + 56px);
  }

  .hero-title {
    font-size: clamp(46px, 15vw, 68px);
  }

  .hero-lead {
    margin-top: 28px;
  }

  .hero-actions,
  .closing-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .hero-actions .text-link {
    justify-content: center;
    min-height: 44px;
  }

  .map-branches {
    grid-template-columns: 1fr;
  }

  .map-branches::before,
  .map-branch::before {
    display: none;
  }

  .map-trunk {
    height: 24px;
  }

  .map-branch + .map-branch {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
  }

  .section-title {
    font-size: 40px;
  }

  .branch-card {
    min-height: 480px;
    padding: 24px;
  }

  .branch-glyph {
    font-size: 72px;
  }

  .branch-card h3 {
    font-size: 38px;
  }

  .project-card {
    min-height: auto;
  }

  .project-info {
    min-height: 580px;
    padding: 28px 24px;
  }

  .project-meta {
    margin-bottom: 56px;
  }

  .project-info h3 {
    font-size: 40px;
  }

  .project-visual {
    min-height: 460px;
  }

  .flow-visual {
    min-height: calc(100% - 24px);
    margin: 24px 16px 0;
    border-right: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
  }

  .flow-canvas {
    min-height: 414px;
    padding: 28px 20px;
  }

  .forge-visual,
  .app-visual {
    padding: 24px 0 0 16px;
  }

  .forge-visual {
    grid-template-columns: 48px 1fr;
  }

  .forge-sidebar img {
    width: 28px;
    height: 28px;
  }

  .forge-workspace pre {
    padding: 36px 20px;
    font-size: 11px;
  }

  .metric-row {
    margin-inline: 10px;
  }

  .metric-row > span {
    padding: 12px 8px;
  }

  .metric-row strong {
    font-size: 13px;
  }

  .app-workspace {
    grid-template-columns: 76px 1fr;
    min-height: 414px;
  }

  .app-inspector {
    display: none;
  }

  .app-toolbar div {
    display: none;
  }

  .demo-app {
    width: 80%;
    padding: 18px;
  }

  .ai-visual {
    grid-template-rows: 44px 1fr 36px;
    padding: 24px 0 0 16px;
  }

  .ai-toolbar div b:not(:first-child),
  .ai-toolbar > span:last-child {
    display: none;
  }

  .ai-workspace {
    grid-template-columns: 72px 1fr;
    min-height: 356px;
  }

  .ai-properties {
    display: none;
  }

  .ai-library {
    padding-inline: 8px;
  }

  .ai-library > span {
    padding-inline: 6px;
  }

  .architecture-diagram {
    --system-link: 64px;
    min-height: 0;
    padding: 20px 16px;
  }

  .system-between,
  .system-link.vertical {
    min-height: 104px;
    height: 104px;
  }

  .system-link span {
    padding-inline: 4px;
    font-size: 7px;
  }

  .diagram-node {
    padding: 12px 10px;
  }

  .diagram-node span {
    overflow-wrap: anywhere;
    font-size: 12px;
  }

  .diagram-node small {
    font-size: 7px;
  }

  .closing {
    padding-block: 48px;
  }

  .closing-panel {
    padding: 32px 24px;
  }

  .closing-mark {
    top: 28px;
    right: 24px;
  }

  .closing-mark img {
    width: 48px;
    height: 48px;
  }

  .closing-panel h2 {
    font-size: 48px;
  }

  .closing-actions .button {
    width: 100%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-inner > p,
  .footer-links {
    justify-self: start;
  }

  .footer-links {
    grid-column: 1;
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

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