@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes lineGrow {
  from { width: 0; }
  to { width: 32px; }
}
@keyframes pulseGlow {
  0%, 100% { opacity: .5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: .8; transform: translate(-50%, -50%) scale(1.1); }
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
@keyframes flowDash { to { stroke-dashoffset: -24; } }
.fade-in { animation: fadeInUp .8s ease-out both; }
.fade-in-d1 { animation: fadeInUp .8s ease-out .2s both; }
.fade-in-d2 { animation: fadeInUp .8s ease-out .4s both; }
.fade-in-d3 { animation: fadeInUp .8s ease-out .6s both; }
.fade-in-d4 { animation: fadeInUp .8s ease-out .8s both; }
.fade-in-d5 { animation: fadeInUp .8s ease-out 1s both; }

.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 4rem 1.5rem 6rem;
  overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  opacity: .03;
  background-image:
    linear-gradient(color-mix(in oklch, var(--foreground) 100%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklch, var(--foreground) 100%, transparent) 1px, transparent 1px);
  background-size: 100px 100px;
}
.hero-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 800px; height: 800px;
  background: var(--muted);
  border-radius: 50%;
  filter: blur(120px);
  animation: pulseGlow 8s ease-in-out infinite;
}
.hero-content {
  position: relative;
  max-width: 720px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 3rem;
}
.hero-eyebrow span {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted-foreground);
}
.hero-eyebrow-line {
  display: inline-block;
  height: 1px;
  background: color-mix(in oklch, var(--foreground) 20%, transparent);
  animation: lineGrow .8s ease-out 1s both;
}

.hero-badges {
  display: flex; gap: .75rem; justify-content: center;
  flex-wrap: wrap; margin-bottom: 2.5rem;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: .35rem .75rem;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--foreground) 3%, transparent);
  color: color-mix(in oklch, var(--foreground) 60%, transparent);
  transition: all .3s;
  text-decoration: none;
}
.hero-badge:hover {
  border-color: color-mix(in oklch, var(--foreground) 25%, transparent);
  color: color-mix(in oklch, var(--foreground) 90%, transparent);
  background: color-mix(in oklch, var(--foreground) 6%, transparent);
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}
.badge-dot.green { background: var(--success); box-shadow: 0 0 6px color-mix(in oklch, var(--success) 40%, transparent); }
.badge-dot.blue { background: var(--info); box-shadow: 0 0 6px color-mix(in oklch, var(--info) 40%, transparent); }
.badge-dot.purple { background: var(--chart-4); box-shadow: 0 0 6px color-mix(in oklch, var(--chart-4) 40%, transparent); }
.hero h1 {
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -0.03em;
  line-height: .95;
  margin-bottom: 2rem;
}
.hero h1 .dim { color: color-mix(in oklch, var(--foreground) 20%, transparent); }
.hero-sub {
  color: var(--muted-foreground);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 2rem;
}
.hero-sub strong { color: color-mix(in oklch, var(--foreground) 75%, transparent); font-weight: 400; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.15em;
  padding: .75rem 1.5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  transition: all .3s;
  cursor: pointer;
}
.btn:hover {
  border-color: color-mix(in oklch, var(--foreground) 30%, transparent);
  color: color-mix(in oklch, var(--foreground) 90%, transparent);
  background: color-mix(in oklch, var(--foreground) 5%, transparent);
}
.scroll-indicator {
  position: absolute; bottom: 3rem;
  left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.scroll-indicator span {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .3em;
  color: var(--muted-foreground);
  margin-right: -.3em;
}
.scroll-indicator-line {
  width: 1px; height: 32px;
  background: linear-gradient(to bottom, color-mix(in oklch, var(--foreground) 40%, transparent), transparent);
  animation: scrollBounce 1.5s ease-in-out infinite;
}

.diagram {
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 40%, color-mix(in oklch, var(--foreground) 3.5%, transparent), transparent 70%),
    color-mix(in oklch, var(--foreground) 1.5%, transparent);
  padding: 2rem 1.5rem 1.5rem;
}
.diagram svg { display: block; width: 100%; height: auto; }
.diagram-tall { display: none !important; }
.diagram figcaption {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  justify-content: center;
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid color-mix(in oklch, var(--foreground) 5%, transparent);
}
.legend {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.legend::before {
  content: ""; width: 18px; height: 0;
  border-top: 2px dashed currentColor;
}
.legend.request { color: var(--flow-request); }
.legend.data { color: var(--flow-data); }
.legend.identity { color: var(--flow-identity); }
.legend span { color: var(--muted-foreground); }
.dg-group { fill: color-mix(in oklch, var(--foreground) 2.5%, transparent); stroke: color-mix(in oklch, var(--foreground) 28%, transparent); stroke-width: 1; }
.dg-node { fill: var(--card); stroke: color-mix(in oklch, var(--foreground) 16%, transparent); stroke-width: 1; }
.dg-node.accent { fill: color-mix(in oklch, var(--foreground) 6%, var(--card)); stroke: color-mix(in oklch, var(--main) 70%, transparent); }
.dg-zone { fill: none; stroke: color-mix(in oklch, var(--foreground) 14%, transparent); stroke-dasharray: 3 4; }
.dg-name { font-family: var(--font-sans); font-size: 13px; font-weight: 400; fill: var(--foreground); }
.dg-sub { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; fill: var(--muted-foreground); }
.dg-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .22em; fill: color-mix(in oklch, var(--foreground) 40%, transparent); }
.dg-edge-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; }
.flow { fill: none; stroke-width: 1.5; stroke-dasharray: 5 7; animation: flowDash 1.6s linear infinite; }
.flow.request { stroke: var(--flow-request); }
.flow.data { stroke: var(--flow-data); }
.flow.identity { stroke: var(--flow-identity); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.split-card {
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--foreground) 2%, transparent);
  padding: 1.5rem;
}
.split-card.accent { border-color: color-mix(in oklch, var(--foreground) 20%, transparent); background: color-mix(in oklch, var(--foreground) 4%, transparent); }
.split-card ul { list-style: none; display: grid; gap: .85rem; margin-top: 1rem; }
.split-card li {
  display: grid; grid-template-columns: 18px 1fr; gap: .75rem;
  font-size: .9rem; color: color-mix(in oklch, var(--foreground) 70%, transparent); line-height: 1.55;
}
.split-card li svg { width: 18px; height: 18px; margin-top: .15rem; stroke: color-mix(in oklch, var(--foreground) 45%, transparent); }
.split-card.accent li svg { stroke: var(--flow-data); }
.split-card li small { display: block; font-size: .8rem; color: color-mix(in oklch, var(--foreground) 35%, transparent); }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.app-card {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: .6rem;
  transition: border-color .3s, background .3s;
}
.app-card:hover { border-color: color-mix(in oklch, var(--foreground) 25%, transparent); background: color-mix(in oklch, var(--foreground) 3%, transparent); }
.app-card-top { display: flex; align-items: center; gap: .75rem; }
.app-mono { width: 36px; height: 36px; }
.app-mono svg { width: 18px; height: 18px; }
.app-name { font-weight: 400; font-size: .95rem; line-height: 1.3; }
.app-desc { font-size: .8rem; color: var(--muted-foreground); line-height: 1.6; flex: 1; }
.app-launch { font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted-foreground); }
.app-card:hover .app-launch { color: color-mix(in oklch, var(--foreground) 80%, transparent); }

.pipe {
  position: relative;
  list-style: none;
  display: grid;
  grid-template-columns: 5.5rem repeat(4, 1fr) 5.5rem;
  gap: 1rem;
  align-items: center;
}
.pipe::before {
  content: "";
  position: absolute;
  left: 2.75rem; right: 2.75rem; top: 50%;
  height: 1px;
  background: linear-gradient(90deg, var(--flow-request), color-mix(in oklch, var(--foreground) 25%, transparent) 30%, color-mix(in oklch, var(--foreground) 25%, transparent) 70%, var(--flow-data));
}
.pipe-end {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .15em;
  color: color-mix(in oklch, var(--foreground) 55%, transparent);
  text-align: center;
}
.pipe-end::before {
  content: "";
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--background);
  border: 1.5px solid var(--flow-request);
  box-shadow: 0 0 10px color-mix(in oklch, var(--info) 35%, transparent);
}
.pipe-end.last::before { border-color: var(--flow-data); box-shadow: 0 0 10px color-mix(in oklch, var(--success) 35%, transparent); }
.pipe-stage {
  position: relative;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
  min-height: 100%;
  transition: border-color .3s;
}
.pipe-stage:hover { border-color: color-mix(in oklch, var(--foreground) 22%, transparent); }
.pipe-head { display: flex; align-items: center; justify-content: space-between; }
.pipe-head svg { width: 20px; height: 20px; stroke: color-mix(in oklch, var(--foreground) 70%, transparent); }
.pipe-n { font-family: var(--font-mono); font-size: 10px; letter-spacing: .3em; color: color-mix(in oklch, var(--foreground) 30%, transparent); }
.pipe-title { font-weight: 400; font-size: .95rem; }
.pipe-desc { font-size: .8rem; color: var(--muted-foreground); line-height: 1.6; flex: 1; }
.pipe-desc code, .faq-a code { font-family: var(--font-mono); font-size: .75rem; color: color-mix(in oklch, var(--foreground) 70%, transparent); }
.pill {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: .12em;
  padding: .25rem .55rem;
  border: 1px solid var(--border);
  color: color-mix(in oklch, var(--foreground) 55%, transparent);
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.always { color: var(--success); border-color: color-mix(in oklch, var(--success) 30%, transparent); }
.modebar {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: .08em;
  text-align: center;
}
.modebar span { padding: .3rem .25rem; color: color-mix(in oklch, var(--foreground) 30%, transparent); }
.modebar span + span { border-left: 1px solid var(--border); }
.modebar .on { color: var(--main-foreground); background: var(--main); }
.pipe-var { font-family: var(--font-mono); font-size: 9px; letter-spacing: .04em; color: color-mix(in oklch, var(--foreground) 30%, transparent); overflow-wrap: anywhere; }
.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
.mode {
  border-left: 1px solid var(--border);
  padding: .25rem 0 .25rem 1rem;
  font-size: .85rem; color: var(--muted-foreground); line-height: 1.6;
}
.mode code {
  display: block;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .05em;
  color: color-mix(in oklch, var(--foreground) 85%, transparent);
  margin-bottom: .15rem;
}

.app-store-footer {
  margin-top: 1.5rem;
  color: color-mix(in oklch, var(--foreground) 35%, transparent);
  font-size: .85rem;
}

.statement {
  padding: 8rem 0;
  text-align: center;
  border-top: 1px solid color-mix(in oklch, var(--foreground) 5%, transparent);
  position: relative;
  overflow: hidden;
}
.statement-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 500px;
  background: color-mix(in oklch, var(--foreground) 10%, transparent);
  border-radius: 50%;
  filter: blur(120px);
  opacity: .1;
}
.statement p {
  position: relative;
  font-size: clamp(1.5rem, 3.5vw, 3rem);
  font-weight: 300;
  color: var(--muted-foreground);
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 760px;
  margin: 0 auto;
}
.statement .highlight { color: color-mix(in oklch, var(--foreground) 90%, transparent); }

.scale-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
.scale-card {
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--foreground) 2%, transparent);
  padding: 1.5rem;
  display: flex; flex-direction: column;
}
.scale-card .diagram { border: none; background: none; padding: 0; margin-top: auto; }
.scale-card .diagram figcaption { display: block; text-align: left; font-size: .8rem; color: var(--muted-foreground); line-height: 1.6; }
.scale-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 1.5rem;
}
.scale-big { font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.scale-big small { display: block; margin-top: .5rem; }
.bars { display: grid; gap: 1.1rem; margin-top: auto; }
.bar-row { display: grid; gap: .4rem; }
.bar-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: color-mix(in oklch, var(--foreground) 60%, transparent); }
.bar-meta b { font-family: var(--font-mono); font-weight: 400; font-size: .9rem; color: var(--foreground); font-variant-numeric: tabular-nums; }
.bar-meta b small { color: color-mix(in oklch, var(--foreground) 35%, transparent); font-size: .7rem; margin-left: .25rem; }
.bar { height: 6px; background: color-mix(in oklch, var(--foreground) 6%, transparent); overflow: hidden; }
.bar > span { display: block; height: 100%; min-width: 3px; background: linear-gradient(90deg, color-mix(in oklch, var(--chart-4) 50%, transparent), var(--flow-identity)); }
.sizing {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.sizing div {
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-size: .8rem; color: var(--muted-foreground); line-height: 1.5;
}
.sizing b { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 1.05rem; color: color-mix(in oklch, var(--foreground) 90%, transparent); margin-bottom: .2rem; }

.qs-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  align-items: start;
}
.code-block {
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--foreground) 2%, transparent);
  padding: 1.5rem;
  overflow-x: auto;
}
.code-block pre {
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.9;
  color: color-mix(in oklch, var(--foreground) 75%, transparent);
}
.code-block .c { color: color-mix(in oklch, var(--foreground) 30%, transparent); }
.code-block .k { color: var(--chart-4); }
.code-block .s { color: var(--success); }

.table-card { border: 1px solid var(--border); background: color-mix(in oklch, var(--foreground) 2%, transparent); padding: .5rem 1rem 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--muted-foreground);
  text-align: left; padding: .75rem .5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 400;
}
tbody td { padding: .75rem .5rem; border-bottom: 1px solid color-mix(in oklch, var(--foreground) 5%, transparent); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: color-mix(in oklch, var(--foreground) 2%, transparent); }
.td-label { font-weight: 400; }
.td-value { font-family: var(--font-mono); font-size: .8rem; color: var(--muted-foreground); }
.qs-note { margin-top: 1.25rem; font-size: .85rem; color: var(--muted-foreground); line-height: 1.7; }
.qs-note code { font-family: var(--font-mono); font-size: .8rem; color: color-mix(in oklch, var(--foreground) 65%, transparent); }

.faq { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.25rem 0;
  font-size: 1rem; font-weight: 400; color: color-mix(in oklch, var(--foreground) 85%, transparent);
  transition: color .3s;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { color: var(--foreground); }
.faq-q::after {
  content: "+"; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 1rem; color: color-mix(in oklch, var(--foreground) 35%, transparent);
  transition: transform .3s;
}
.faq-item[open] .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 2.5rem 1.4rem 0; font-size: .9rem; color: var(--muted-foreground); line-height: 1.75; max-width: 760px; }
.faq-a a { color: color-mix(in oklch, var(--foreground) 75%, transparent); border-bottom: 1px solid color-mix(in oklch, var(--foreground) 20%, transparent); }
.faq-a a:hover { color: var(--foreground); }

@media (max-width: 1024px) {
  .pipe { grid-template-columns: repeat(2, 1fr); }
  .pipe::before { display: none; }
  .pipe-end { flex-direction: row; justify-content: center; }
  .sizing { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero { padding: 3.5rem 1.25rem 5rem; min-height: 90vh; }
  .hero-sub { font-size: 1rem; }
  .split, .scale-grid, .qs-grid, .modes { grid-template-columns: 1fr; }
  .pipe { grid-template-columns: 1fr; gap: .75rem; }
  .pipe::before {
    display: block;
    left: 50%; right: auto; top: 0; bottom: 0;
    width: 1px; height: auto;
    background: linear-gradient(180deg, var(--flow-request), color-mix(in oklch, var(--foreground) 25%, transparent) 20%, color-mix(in oklch, var(--foreground) 25%, transparent) 80%, var(--flow-data));
  }
  .pipe-end { padding: .25rem 0; flex-direction: column; }
  .pipe-end span { background: var(--background); padding: 0 .5rem; }
  .diagram-wide { display: none !important; }
  .diagram-tall { display: block !important; }
  .diagram { padding: 1.25rem 1rem 1rem; }
  .statement { padding: 5rem 0; }
  .statement p { font-size: clamp(1.25rem, 4vw, 2rem); }
  .code-block { padding: 1rem; }
  .code-block pre { font-size: .75rem; }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1rem 4rem; min-height: 85vh; }
  .hero h1 { font-size: clamp(1.75rem, 8vw, 2.25rem); }
  .hero-sub { font-size: .9rem; margin-bottom: 2rem; }
  .hero-eyebrow { margin-bottom: 2rem; }
  .hero-eyebrow span { font-size: 9px; letter-spacing: .2em; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .sizing { grid-template-columns: 1fr; }
  table { font-size: .8rem; }
  .td-value { word-break: break-all; }
  .statement { padding: 3.5rem 0; }
  .scroll-indicator { bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .flow, .hero-glow, .scroll-indicator-line { animation: none; }
  .fade-in, .fade-in-d1, .fade-in-d2, .fade-in-d3, .fade-in-d4, .fade-in-d5, .hero-eyebrow-line { animation: none; }
  .hero-eyebrow-line { width: 32px; }
}

.arrowhead.request { fill: var(--flow-request); }
.arrowhead.data { fill: var(--flow-data); }
.arrowhead.identity { fill: var(--flow-identity); }
.dg-edge-label.data { fill: var(--flow-data); }
.dg-edge-label.identity { fill: var(--flow-identity); }
.dg-edge-label.dim { fill-opacity: .6; }
.section-label.flush { margin-bottom: 0; }
.section-lead.flush { margin: 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
.mono-note.spaced { margin-top: 1.5rem; }
.scale-card .section-label { margin-bottom: 1rem; }
.hero-actions.start { justify-content: flex-start; margin-top: 1.5rem; }
.bars { list-style: none; }
#appstore .mono-note { margin-bottom: 1rem; }
.app-card .mono-note { margin-bottom: 0; }
