@import url("./fonts.css");

:root {
  --bg: hsl(270 22% 4%);
  --bg-elev: hsl(270 18% 7%);
  --fg: hsl(0 0% 97%);
  --muted: hsl(270 8% 62%);
  --line: hsla(0, 0%, 100%, 0.08);
  --accent: hsl(268 62% 64%);
  --accent-2: hsl(199 89% 58%);
  --accent-dim: hsla(268, 62%, 64%, 0.14);
  --accent-ink: hsl(270 40% 12%);
  --warn: hsl(38 85% 68%);
  --sans: "Outfit", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glow: 0 12px 40px -12px hsla(268, 62%, 54%, 0.45);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #c4b5fd;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: #c4b5fd;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 15% -10%, hsla(268, 70%, 45%, 0.28), transparent 55%),
    radial-gradient(ellipse 55% 45% at 90% 8%, hsla(199, 85%, 45%, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 40% at 70% 85%, hsla(290, 55%, 35%, 0.12), transparent 55%),
    linear-gradient(165deg, hsl(270 24% 5%) 0%, var(--bg) 45%, hsl(270 28% 3%) 100%);
}

.atmosphere::before,
.atmosphere::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  pointer-events: none;
  animation: orb 22s var(--ease) infinite alternate;
}

.atmosphere::before {
  width: min(52vw, 420px);
  height: min(52vw, 420px);
  top: 12%;
  left: -8%;
  background: hsla(268, 70%, 50%, 0.22);
}

.atmosphere::after {
  width: min(40vw, 320px);
  height: min(40vw, 320px);
  right: -4%;
  bottom: 18%;
  background: hsla(199, 80%, 50%, 0.14);
  animation-delay: -8s;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.045;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes orb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4%, 6%) scale(1.08); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: hsla(270, 22%, 4%, 0.72);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.45rem;
  object-fit: contain;
  background: #000;
  box-shadow: var(--glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  border-radius: 0.45rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--fg);
  background: transparent;
}

.btn-ghost:hover {
  border-color: hsla(268, 62%, 64%, 0.45);
  color: #ddd6fe;
}

.btn-accent {
  border: 1px solid transparent;
  background: linear-gradient(135deg, hsl(268 62% 58%), hsl(250 70% 52%));
  color: #fff;
  box-shadow: var(--glow);
}

.btn-accent:hover {
  color: #fff;
  filter: brightness(1.06);
}

.shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.25rem 0 4.5rem;
}

.hero {
  padding: 1.25rem 0 2rem;
  animation: panel-in 0.7s var(--ease);
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #fff 10%, #c4b5fd 45%, #67e8f9 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.35rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  background: hsla(270, 18%, 8%, 0.55);
}

a.chip {
  border-color: hsla(268, 62%, 64%, 0.4);
  color: #ddd6fe;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.5rem 0 1.75rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: hsla(270, 18%, 7%, 0.72);
  position: sticky;
  top: 3.6rem;
  z-index: 30;
  backdrop-filter: blur(12px);
}

.tab {
  appearance: none;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab:hover {
  color: var(--fg);
}

.tab.is-active {
  color: var(--accent-ink);
  background: linear-gradient(135deg, #c4b5fd, #a78bfa);
}

.panel[hidden] {
  display: none;
}

.panel.is-active {
  animation: panel-in 0.45s var(--ease);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.prose h2 {
  margin: 0 0 0.85rem;
  font-family: var(--sans);
  font-size: clamp(1.55rem, 3vw, 1.95rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 1.75rem 0 0.55rem;
  font-size: 1.12rem;
  font-weight: 650;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose p strong,
.prose li strong {
  color: var(--fg);
  font-weight: 600;
}

.flow-list {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
}

.flow-list li {
  margin: 0.45rem 0;
}

.principle-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.principle-strip > div {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.principle-strip .num {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.text-tab-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.pipeline {
  display: grid;
  gap: 1rem;
}

.step {
  padding: 1.15rem 1.2rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: hsla(270, 18%, 7%, 0.55);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), border-color 0.2s ease;
}

.step.is-in {
  opacity: 1;
  transform: none;
}

.step:hover {
  border-color: hsla(268, 62%, 64%, 0.35);
}

.step header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1rem;
  margin-bottom: 0.55rem;
}

.step-id {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.step h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.step p,
.step li {
  color: var(--muted);
  margin: 0.4rem 0;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
}

.tool-row li {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  font-size: 0.8rem;
  background: hsla(270, 16%, 9%, 0.8);
}

.why {
  margin-top: 0.85rem !important;
  padding-left: 0.85rem;
  border-left: 2px solid var(--accent);
}

.arch-block {
  margin: 0 0 2.5rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.arch-block.is-in {
  opacity: 1;
  transform: none;
}

.arch-block h3 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
}

.arch-canvas {
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: hsla(270, 18%, 7%, 0.55);
  overflow-x: auto;
}

.flow-map {
  display: grid;
  gap: 0.85rem;
  min-width: 280px;
}

.flow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.flow-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid hsla(268, 62%, 64%, 0.35);
  border-radius: 0.45rem;
  background: hsl(270 18% 8%);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.flow-node.muted {
  border-color: var(--line);
  color: var(--muted);
  font-weight: 500;
}

.flow-node.accent {
  background: linear-gradient(135deg, hsla(268, 62%, 40%, 0.35), hsla(199, 80%, 40%, 0.2));
  border-color: hsla(268, 62%, 64%, 0.55);
}

.flow-arrow {
  color: var(--accent);
  font-size: 1.1rem;
  opacity: 0.85;
}

.arch-caption {
  margin: 0.85rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.seq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
}

.seq-step {
  padding: 0.85rem 0.65rem;
  border-top: 2px solid var(--accent);
  border-radius: 0 0 0.35rem 0.35rem;
  background: var(--accent-dim);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  opacity: 0;
  animation: seq-in 0.5s var(--ease) forwards;
  animation-delay: calc(var(--i) * 0.1s);
}

.seq-step span {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
}

@keyframes seq-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.arch-note {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.runtime {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem;
}

.rt-box {
  flex: 1 1 140px;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: hsl(270 18% 8%);
}

.rt-box strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
}

.rt-box span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.rt-box.app {
  border-color: hsla(268, 62%, 64%, 0.45);
}

.rt-box.app.pulse {
  animation: pulse 2.8s ease-in-out infinite;
}

.rt-arrow {
  align-self: center;
  color: var(--accent);
  font-weight: 700;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 hsla(268, 62%, 64%, 0.25); }
  50% { box-shadow: 0 0 0 8px hsla(268, 62%, 64%, 0); }
}

.incident {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: hsla(270, 16%, 8%, 0.65);
}

.incident h3 {
  margin: 0 0 0.45rem;
}

.check-grid {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}

.code-block {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: #0a070f;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #ddd6fe;
}

.stack {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

.stack th,
.stack td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.stack th {
  color: var(--fg);
  font-weight: 650;
}

.stack caption {
  caption-side: top;
  text-align: left;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.adapt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.5rem;
}

.adapt-card {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: hsla(270, 18%, 7%, 0.55);
}

.adapt-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.adapt-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .principle-strip {
    grid-template-columns: 1fr;
  }

  .topbar-actions .btn {
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }

  .tabs {
    top: 3.45rem;
  }

  .rt-arrow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere::before,
  .atmosphere::after,
  .hero,
  .panel.is-active,
  .seq-step,
  .rt-box.app.pulse {
    animation: none;
  }

  .step,
  .arch-block,
  .tab,
  .btn {
    transition: none;
  }
}
