/*
 * The landing page's styles (ADR-0046), shared by index.html and 404.html.
 *
 * The colors are the docs' dark scheme (docs/stylesheets/brand.css): near-black navy
 * pages, navy cards, light text, and the brand's purple and blue. The page font is
 * Inter, as in the docs.
 */

:root {
  --bg: #000211;
  --surface: #010a20;
  --surface-2: #08152c;
  --line: #13244a;
  --text: #f3faff;
  --muted: #8d9fbe;
  --link: #54a2ff;
  --purple: #ac4bff;
  --blue: #3080ff;
  --gradient: linear-gradient(to right, var(--text), var(--purple), var(--blue));
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: #c07eff;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 6px;
}

code,
pre {
  font-family: var(--mono);
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

/* The header: translucent navy that blurs the page under it, like the docs' header. */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(1, 10, 32, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-2);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 30px;
  height: 30px;
}

.nav a:not(.brand) {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav a:not(.brand):hover {
  color: var(--text);
}

/* Buttons: a gradient primary and an outlined secondary. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  transition: border-color 0.2s, transform 0.2s;
}

.button:hover {
  color: var(--text);
  border-color: var(--purple);
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--purple), var(--blue));
}

.nav .button {
  padding: 7px 14px;
  font-size: 0.88rem;
}

.nav a.button {
  color: var(--text);
}

/* Section scaffolding. */
section {
  padding: 96px 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--purple);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  max-width: 22ch;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.lead {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.gradient-text {
  color: transparent;
  background-image: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
}

/* The hero. */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 88px;
  text-align: center;
  background: radial-gradient(ellipse 60% 50% at 50% 18%, rgba(172, 75, 255, 0.2), rgba(48, 128, 255, 0.07) 55%, transparent 80%);
}

/*
 * Two strands, purple and blue in opposite phase, run across the hero behind the
 * logo, as in the README banner, crossing it at the heights of its crossbars. Each
 * wave is 80 units long, so sliding the strands left by 80 units loops without a
 * seam. The edges fade out with a mask.
 */
.hero-mark {
  position: relative;
  margin: 40px 0 40px;
}

.strands {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 120px;
  transform: translateY(-50%);
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 35%, #000 65%, transparent 96%);
  mask-image: linear-gradient(90deg, transparent 4%, #000 35%, #000 65%, transparent 96%);
  pointer-events: none;
}

.strands g {
  animation: weave 6s linear infinite;
}

@keyframes weave {
  to {
    transform: translateX(-80px);
  }
}

.hero-logo {
  position: relative;
  display: block;
  width: 104px;
  height: 104px;
  margin: 0 auto;
  border-radius: 24px;
  box-shadow: 0 0 0 10px var(--bg), 0 20px 60px rgba(172, 75, 255, 0.35);
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
}

.hero .lead {
  margin-inline: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

/* The install commands, each with a copy button. */
.install {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: min(560px, 100%);
  margin: 40px auto 0;
  text-align: left;
}

.install-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.install-line span {
  min-width: 82px;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.install-line code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.install-line code::before {
  content: "$ ";
  color: var(--purple);
}

.copy {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font: 600 0.75rem Inter, system-ui, sans-serif;
  cursor: pointer;
}

.copy:hover {
  color: var(--text);
  border-color: var(--purple);
}

.badges {
  margin-top: 28px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* "One spec": the explanation beside a code card. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
}

.checks {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
}

.checks li::before {
  content: "";
  position: absolute;
  top: 0.45em;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
}

.checks strong {
  color: var(--text);
  font-weight: 600;
}

.code {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.code-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.code-title i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.code-title i:last-of-type {
  margin-right: 8px;
}

.code pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.7;
}

/* Hand-written YAML and Python highlighting. */
.k {
  color: #6aa8ff;
}

.s {
  color: #d3a6ff;
}

.c {
  color: #5f739a;
}

.n {
  color: #7ee0c3;
}

/* How it works: three columns, layers, hook points and outcomes. */
.how {
  border-top: 1px solid var(--surface-2);
  border-bottom: 1px solid var(--surface-2);
  background: linear-gradient(180deg, var(--surface), var(--bg));
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(1, 10, 32, 0.6);
}

.panel p {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.step {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--purple);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.76rem;
  white-space: nowrap;
}

/* The outcomes, most severe first: the border fades from purple to the plain line. */
.outcomes li:nth-child(1) {
  border-color: var(--purple);
}

.outcomes li:nth-child(2) {
  border-color: #8a5cff;
}

.outcomes li:nth-child(3) {
  border-color: #6a6cff;
}

.outcomes li:nth-child(4) {
  border-color: #4a78ff;
}

/* The qualities: a bento grid of seven cards in three columns. */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: rgba(172, 75, 255, 0.6);
}

.card.wide {
  grid-column: span 2;
}

.card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card .glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: rgba(172, 75, 255, 0.12);
  color: #c07eff;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

/* The controls in the box: a dense list with a gradient rule above each. */
.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 32px;
  margin: 48px 0 0;
}

.controls div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.controls dt {
  font-weight: 700;
}

.controls dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* "Not an agent framework": a quiet band with one big sentence. */
.statement {
  text-align: center;
}

.statement h2 {
  max-width: none;
}

.statement h2 span {
  display: block;
}

.statement .lead {
  margin-inline: auto;
}

/* The packages, in two columns: PyPI and npm. */
.packages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.packages ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.packages li {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--surface-2);
  font-size: 0.92rem;
}

.packages li a {
  font-family: var(--mono);
  white-space: nowrap;
}

.packages li span {
  color: var(--muted);
  text-align: right;
}

/* The closing call to action. */
.cta {
  padding: 64px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
  background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(172, 75, 255, 0.18), transparent 70%), var(--surface);
}

.cta h2 {
  max-width: none;
}

.cta .lead {
  margin-inline: auto;
}

footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--surface-2);
  color: var(--muted);
  font-size: 0.9rem;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
}

footer .brand {
  font-size: 0.95rem;
}

footer .brand img {
  width: 24px;
  height: 24px;
}

footer a:not(.brand) {
  color: var(--muted);
}

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

/* The 404 page: one centered message. */
.not-found {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 61px);
  padding: 48px 0;
  text-align: center;
}

.not-found h1 {
  font-size: clamp(4rem, 14vw, 8rem);
}

.not-found .lead {
  margin-inline: auto;
}

/* Tablets: one column for the side-by-side parts, two for the grids. */
@media (max-width: 900px) {
  .split,
  .how-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bento,
  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card.wide {
    grid-column: span 2;
  }
}

/* Phones: one column everywhere, and only the docs and GitHub links in the header. */
@media (max-width: 640px) {
  section {
    padding: 72px 0;
  }

  .nav .optional {
    display: none;
  }

  .nav .wrap {
    gap: 16px;
  }

  .bento,
  .controls,
  .packages {
    grid-template-columns: minmax(0, 1fr);
  }

  .card.wide {
    grid-column: auto;
  }

  .install-line {
    font-size: 0.78rem;
  }

  .install-line span {
    display: none;
  }

  .packages li {
    flex-direction: column;
    gap: 2px;
  }

  .packages li span {
    text-align: left;
  }

  .cta {
    padding: 48px 20px;
  }
}

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

  .strands g {
    animation: none;
  }

  .button,
  .card {
    transition: none;
  }
}
