:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #5f6673;
  --soft: #f6f8fb;
  --line: #e5e9f0;
  --blue: #387ed1;
  --blue-dark: #1f5fae;
  --cyan: #28b7c9;
  --green: #0f9d58;
  --amber: #d97706;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(20, 37, 63, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(56, 126, 209, 0.13), transparent 34rem),
    linear-gradient(180deg, #fff 0%, #fbfcff 100%);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(20, 20, 20, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(20, 20, 20, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 62%);
  z-index: -2;
}

.page-glow {
  position: fixed;
  inset: auto -20vw -35vh auto;
  width: 52vw;
  height: 52vw;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(40, 183, 201, 0.16), transparent 64%);
  pointer-events: none;
  z-index: -1;
  animation: floatGlow 12s ease-in-out infinite alternate;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(44px, 5.2vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}
h2 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}
h3 { margin-bottom: 8px; font-size: 18px; letter-spacing: -0.02em; }

.hero,
.strip,
.section,
.footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  position: relative;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.site-header.is-scrolled {
  border-bottom: 1px solid rgba(229, 233, 240, 0.8);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  padding: 16px 0;
  transition: padding 0.15s ease;
}
.site-header.is-scrolled .header-inner {
  padding: 12px 0;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -0.02em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 30px rgba(56, 126, 209, 0.25);
}
.brand-mark svg { display: block; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-toggle {
  position: relative;
  z-index: 35;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.7);
}
.nav-cta svg { flex-shrink: 0; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(430px, 0.92fr);
  align-items: center;
  gap: 42px;
  padding: 70px 0 44px;
}
.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--blue); }
.lead { max-width: 700px; margin-bottom: 30px; color: var(--muted); font-size: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 14px 32px rgba(56, 126, 209, 0.24); }
.button.primary:hover { background: var(--blue-dark); box-shadow: 0 18px 38px rgba(56, 126, 209, 0.28); }
.button.primary span { transition: transform 0.18s ease; }
.button.primary:hover span { transform: translateX(3px); }
.button.secondary { border: 1px solid var(--line); background: #fff; }

.orchestration-card {
  padding: 16px;
  border: 1px solid rgba(229, 233, 240, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.panel-header { display: flex; align-items: center; gap: 7px; padding: 4px 2px 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #d9dee8; }
.dot.red { background: #ff6b6b; } .dot.yellow { background: #f5bf4f; } .dot.green { background: #35c979; }
.panel-title { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.flow-map {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 45%, rgba(56, 126, 209, 0.12), transparent 18rem),
    linear-gradient(180deg, #fbfdff, #fff);
}
.flow-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(56, 126, 209, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 88%);
}
.flow-node {
  position: absolute;
  z-index: 2;
  width: 134px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(20, 37, 63, 0.08);
  animation: nodeBreathe 4.5s ease-in-out infinite;
}
.flow-node strong, .flow-node small, .node-kicker { display: block; }
.flow-node small { color: var(--muted); font-size: 12px; }
.node-kicker { margin-bottom: 4px; color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.flow-node.active { border-color: rgba(56, 126, 209, 0.45); box-shadow: 0 0 0 6px rgba(56, 126, 209, 0.08), 0 16px 38px rgba(56, 126, 209, 0.12); }
.clean-flow .node-document { left: 30px; top: 46px; }
.clean-flow .node-core { left: calc(50% - 67px); top: 46px; animation-delay: 0.2s; }
.clean-flow .node-provider { right: 30px; top: 46px; animation-delay: 0.4s; }
.clean-flow .node-inbound { left: calc(50% - 67px); top: 174px; animation-delay: 0.6s; }
.clean-flow .node-reconcile { left: 30px; bottom: 42px; animation-delay: 0.8s; }
.clean-flow .node-outbound { right: 30px; bottom: 42px; animation-delay: 1s; }
.flow-lines { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
.flow-path { fill: none; stroke: rgba(56, 126, 209, 0.34); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 9 10; animation: dashFlow 18s linear infinite; }
.flow-path.main { stroke: rgba(56, 126, 209, 0.46); }
.packet { fill: var(--blue); }
.packet-two { fill: var(--cyan); }
.packet-three { fill: var(--green); }
.trace-log { margin-top: 12px; display: grid; gap: 6px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.trace-row { display: flex; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.trace-time { color: var(--blue); font-weight: 800; }
.muted-row { color: var(--muted); }

 display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-top: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.strip div { padding: 20px; background: rgba(255, 255, 255, 0.82); }
.strip strong, .strip span { display: block; }
.strip strong { margin-bottom: 4px; }
.strip span, .muted, .section-copy, .card p, .timeline-item p, .arch-node small, .footer span { color: var(--muted); }

.section { padding: 88px 0; }
.split { display: grid; grid-template-columns: 0.95fr 1fr; gap: 58px; border-bottom: 1px solid var(--line); }
.section-copy { font-size: 17px; }
.section-heading { max-width: 800px; margin-bottom: 32px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  position: relative;
  min-height: 196px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 18px; border-radius: 11px; color: var(--blue); background: #eff6ff; font-weight: 900; }
.card code { position: absolute; left: 24px; bottom: 18px; color: var(--blue-dark); font-size: 12px; }

.lifecycle-section { border-bottom: 1px solid var(--line); }
.lifecycle-grid { display: grid; grid-template-columns: minmax(360px, 0.85fr) 1fr; gap: 42px; align-items: start; }
.lifecycle-visual { position: sticky; top: 110px; padding: 18px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,0.84); box-shadow: var(--shadow); }
.status-card { padding: 20px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #111827, #1f3f73); }
.status-label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.78; }
.status-card strong { display: block; font-size: 34px; line-height: 1; letter-spacing: -0.04em; }
.status-card small { display: block; margin-top: 8px; opacity: 0.82; }
.mini-map { display: grid; grid-template-columns: 1fr 18px 1fr 18px 1fr 18px 1fr 18px 1fr; align-items: center; margin: 18px 0; }
.mini-node { display: grid; place-items: center; min-height: 58px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 800; transition: 0.25s ease; }
.mini-node.is-active { color: #fff; border-color: var(--blue); background: var(--blue); box-shadow: 0 10px 28px rgba(56,126,209,0.24); }
.mini-link { height: 2px; background: var(--line); }
.payload-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #111827; }
.payload-topline { display: flex; justify-content: space-between; padding: 12px 14px; color: #9ca3af; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 12px; }
.payload-topline code { color: #93c5fd; }
.payload-card pre { margin: 0; padding: 16px; color: #d7e1ff; background: transparent; box-shadow: none; }
.lifecycle-steps { display: grid; gap: 16px; }
.life-step { min-height: 220px; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,0.72); transition: 0.25s ease; }
.life-step span { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 34px; border-radius: 12px; color: var(--blue); background: #eff6ff; font-weight: 900; }
.life-step.is-active { border-color: rgba(56,126,209,0.5); background: #fff; box-shadow: 0 18px 50px rgba(20,37,63,0.08); transform: translateX(-4px); }

.architecture { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.architecture-grid { padding: 28px; border: 1px solid var(--line); border-radius: 28px; background: var(--soft); }
.arch-node { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: center; font-weight: 750; transition: 0.45s ease; }
.arch-node.strong { border-color: rgba(56, 126, 209, 0.45); color: var(--blue-dark); background: #f3f8ff; }
.arch-spine { height: 42px; display: grid; place-items: center; }
.arch-spine span { width: 2px; height: 0; background: var(--blue); transition: height 0.7s ease; }
.architecture-grid.is-visible .arch-spine span { height: 42px; }
.arch-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; height: 36px; align-items: end; }
.arch-split span { justify-self: center; width: 2px; height: 0; background: var(--blue); transition: height 0.7s ease 0.2s; }
.architecture-grid.is-visible .arch-split span { height: 36px; }
.arch-branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.arch-note { margin-top: 18px; padding: 18px; border-left: 3px solid var(--blue); color: var(--muted); background: #fff; border-radius: 12px; }

.quickstart { display: grid; grid-template-columns: 0.85fr 1fr; gap: 36px; align-items: center; }
pre { overflow-x: auto; margin: 0; padding: 24px; border-radius: 20px; color: #d7e1ff; background: #111827; box-shadow: var(--shadow); }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 14px; }
.prompt { display: inline; user-select: none; color: #6b7280; }
.timeline { display: grid; gap: 14px; }
.timeline-item { display: grid; grid-template-columns: 56px 1fr; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.84); }
.timeline-item span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; background: var(--ink); font-weight: 850; }
.timeline-item p { margin-bottom: 0; }
.footer { display: flex; justify-content: space-between; gap: 24px; padding: 34px 0 48px; border-top: 1px solid var(--line); }
.footer strong, .footer span { display: block; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

@keyframes dashFlow { to { stroke-dashoffset: -160; } }
@keyframes nodeBreathe { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes railMove { to { transform: translateX(-50%); } }
@keyframes floatGlow { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-10vw,-8vh,0) scale(1.12); } }

@media (max-width: 980px) {
  .site-header { align-items: flex-start; gap: 18px; }
  .nav-links { justify-content: flex-end; flex-wrap: wrap; gap: 12px 18px; }
  .hero, .split, .quickstart, .lifecycle-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 42px; }
  .orchestration-card { max-width: 620px; margin-inline: auto; }
  .strip, .grid, .arch-branches { grid-template-columns: 1fr; }
  .arch-split { display: none; }
  .lifecycle-visual { position: relative; top: auto; }
}

@media (max-width: 680px) {
  h1 { font-size: clamp(32px, 7vw, 42px); }
  h2 { font-size: clamp(24px, 6vw, 34px); }
  .lead { font-size: 17px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.1em; }
  .section { padding: 52px 0; }
  .hero { padding-top: 28px; padding-bottom: 32px; }
  .header-inner { width: min(100% - 28px, 1120px); padding-inline: 0; }
  .site-header.is-scrolled .header-inner { padding-inline: 0; }
  .hero, .strip, .section, .footer { width: min(100% - 28px, 1120px); }
  .footer { flex-direction: column; }

  /* Hamburger -> fullscreen menu */
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 0;
    padding-inline: 24px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(24px);
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 30;
  }
  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav-links a {
    min-height: 56px;
    display: flex;
    align-items: center;
    font-size: clamp(22px, 6vw, 32px);
    font-weight: 700;
    letter-spacing: -0.03em;
    width: 100%;
    color: var(--ink);
    border-bottom: 1px solid rgba(229,233,240,0.6);
  }
  .nav-links a:last-of-type { border-bottom: none; }

  /* More compact GitHub button in mobile fullscreen menu */
  .nav-links .nav-cta {
    display: inline-flex !important;
    width: auto !important;
    min-height: 36px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    border: 1px solid var(--line) !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.7) !important;
    margin-top: 12px;
  }
  .nav-links .nav-cta svg { width: 10px; height: 10px; }

  /* Flow map mobile */
  .flow-map { min-height: 340px; }
  .flow-node { width: 88px; padding: 8px; border-radius: 10px; }
  .flow-node strong { font-size: 13px; }
  .flow-node small { font-size: 10px; }
  .node-kicker { font-size: 8px; letter-spacing: 0.08em; margin-bottom: 2px; }
  .clean-flow .node-document { left: 10px; top: 18px; }
  .clean-flow .node-core { left: calc(50% - 44px); top: 18px; }
  .clean-flow .node-provider { right: 10px; top: 18px; }
  .clean-flow .node-inbound { left: calc(50% - 44px); top: 100px; }
  .clean-flow .node-reconcile { left: 10px; bottom: 14px; }
  .clean-flow .node-outbound { right: 10px; bottom: 14px; }
  .orchestration-card { border-radius: 16px; padding: 12px; }
  .orchestration-card .panel-header { padding: 4px 2px 10px; }
  .trace-log { gap: 4px; margin-top: 8px; }
  .trace-row { padding: 7px 8px; font-size: 11px; }

  /* Lifecycle mobile */
  .lifecycle-visual { display: none; }
  .lifecycle-grid { gap: 20px; }
  .life-step { min-height: auto; padding: 20px; border-radius: 16px; }
  .life-step.is-active { transform: translateX(0); }

  /* Architecture mobile */
  .arch-branches { flex-direction: column; gap: 12px; padding-top: 20px; }
  .arch-node { padding: 12px 16px; border-radius: 14px; }
  .arch-node::before { display: none; }

  /* Quickstart */
  pre { padding: 20px; border-radius: 16px; font-size: 13px; }

  /* Buttons */
  .button { min-height: 48px; font-size: 15px; }
}

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