/* go-ndarray landing — emerald palette, sibling of the go-* family pages.
   Same token shape as the other org landings; only the hex values change
   so the pages read as one family. Accent: emerald (#059669 green-600). */
:root {
  --fg:        #052e22;
  --bg:        #f0fdf9;
  --bg-2:      #d1fae5;
  --muted:     #047857;
  --accent:    #059669;
  --accent-2:  #10b981;
  --accent-3:  #6ee7b7;
  --code-bg:   #d1fae5;
  --border:    #a7f3d0;
  --thread:    #059669;
  --mesh-edge:        rgba(5, 150, 105, 0.32);
  --mesh-edge-hi:     rgba(5, 150, 105, 0.85);
  --mesh-arch-fill:   #059669;
  --mesh-arch-halo:   rgba(5, 150, 105, 0.30);
  --mesh-distro-fill: #10b981;
  --mesh-distro-halo: rgba(245, 158, 11, 0.22);
  --mesh-hub-fill:    #b45309;
  --mesh-hub-halo:    rgba(180, 83, 9, 0.36);
  --mesh-label-fg:    #78350f;
  --mesh-container-dc-fill:     rgba(5, 150, 105, 0.06);
  --mesh-container-dc-stroke:   rgba(5, 150, 105, 0.55);
  --mesh-container-rack-fill:   rgba(5, 150, 105, 0.14);
  --mesh-container-rack-stroke: rgba(5, 150, 105, 0.45);
  --mesh-container-label-fg:    rgba(120, 53, 15, 0.85);
  --hero-gradient-1:  rgba(110, 231, 183, 0.30);
  --hero-gradient-2:  rgba(5, 150, 105, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg:        #d1fae5;
    --bg:        #04130d;
    --bg-2:      #052e22;
    --muted:     #6ee7b7;
    --accent:    #34d399;
    --accent-2:  #6ee7b7;
    --accent-3:  #a7f3d0;
    --code-bg:   #06291c;
    --border:    #0a3d2a;
    --thread:    #34d399;
    --mesh-edge:        rgba(110, 231, 183, 0.32);
    --mesh-edge-hi:     rgba(253, 230, 138, 0.85);
    --mesh-arch-fill:   #6ee7b7;
    --mesh-arch-halo:   rgba(110, 231, 183, 0.30);
    --mesh-distro-fill: #34d399;
    --mesh-distro-halo: rgba(251, 191, 36, 0.22);
    --mesh-hub-fill:    #a7f3d0;
    --mesh-hub-halo:    rgba(253, 230, 138, 0.36);
    --mesh-label-fg:    #a7f3d0;
    --mesh-container-dc-fill:     rgba(110, 231, 183, 0.08);
    --mesh-container-dc-stroke:   rgba(110, 231, 183, 0.65);
    --mesh-container-rack-fill:   rgba(110, 231, 183, 0.15);
    --mesh-container-rack-stroke: rgba(110, 231, 183, 0.55);
    --mesh-container-label-fg:    rgba(254, 243, 199, 0.95);
    --hero-gradient-1:  rgba(110, 231, 183, 0.22);
    --hero-gradient-2:  rgba(5, 150, 105, 0.30);
  }
}
/* Explicit overrides for the manual toggle (button in nav), independent of
   the OS-level prefers-color-scheme media query above. No [data-theme]
   attribute = "system", which the media query already handles. */
:root[data-theme="dark"] {
    --fg:        #d1fae5;
    --bg:        #04130d;
    --bg-2:      #052e22;
    --muted:     #6ee7b7;
    --accent:    #34d399;
    --accent-2:  #6ee7b7;
    --accent-3:  #a7f3d0;
    --code-bg:   #06291c;
    --border:    #0a3d2a;
    --thread:    #34d399;
    --mesh-edge:        rgba(110, 231, 183, 0.32);
    --mesh-edge-hi:     rgba(253, 230, 138, 0.85);
    --mesh-arch-fill:   #6ee7b7;
    --mesh-arch-halo:   rgba(110, 231, 183, 0.30);
    --mesh-distro-fill: #34d399;
    --mesh-distro-halo: rgba(251, 191, 36, 0.22);
    --mesh-hub-fill:    #a7f3d0;
    --mesh-hub-halo:    rgba(253, 230, 138, 0.36);
    --mesh-label-fg:    #a7f3d0;
    --mesh-container-dc-fill:     rgba(110, 231, 183, 0.08);
    --mesh-container-dc-stroke:   rgba(110, 231, 183, 0.65);
    --mesh-container-rack-fill:   rgba(110, 231, 183, 0.15);
    --mesh-container-rack-stroke: rgba(110, 231, 183, 0.55);
    --mesh-container-label-fg:    rgba(254, 243, 199, 0.95);
    --hero-gradient-1:  rgba(110, 231, 183, 0.22);
    --hero-gradient-2:  rgba(5, 150, 105, 0.30);
  
}
:root[data-theme="light"] {
  --fg:        #052e22;
  --bg:        #f0fdf9;
  --bg-2:      #d1fae5;
  --muted:     #047857;
  --accent:    #059669;
  --accent-2:  #10b981;
  --accent-3:  #6ee7b7;
  --code-bg:   #d1fae5;
  --border:    #a7f3d0;
  --thread:    #059669;
  --mesh-edge:        rgba(5, 150, 105, 0.32);
  --mesh-edge-hi:     rgba(5, 150, 105, 0.85);
  --mesh-arch-fill:   #059669;
  --mesh-arch-halo:   rgba(5, 150, 105, 0.30);
  --mesh-distro-fill: #10b981;
  --mesh-distro-halo: rgba(245, 158, 11, 0.22);
  --mesh-hub-fill:    #b45309;
  --mesh-hub-halo:    rgba(180, 83, 9, 0.36);
  --mesh-label-fg:    #78350f;
  --mesh-container-dc-fill:     rgba(5, 150, 105, 0.06);
  --mesh-container-dc-stroke:   rgba(5, 150, 105, 0.55);
  --mesh-container-rack-fill:   rgba(5, 150, 105, 0.14);
  --mesh-container-rack-stroke: rgba(5, 150, 105, 0.45);
  --mesh-container-label-fg:    rgba(120, 53, 15, 0.85);
  --hero-gradient-1:  rgba(110, 231, 183, 0.30);
  --hero-gradient-2:  rgba(5, 150, 105, 0.18);
}

.theme-toggle {
  margin-left: 1.25rem;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition: border-color 0.18s, color 0.18s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle-icon::before { content: "\1F310"; font-size: 0.95rem; } /* system: globe */
.theme-toggle[data-mode="light"] .theme-toggle-icon::before { content: "\2600\FE0F"; } /* sun */
.theme-toggle[data-mode="dark"] .theme-toggle-icon::before { content: "\1F319"; } /* moon */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  line-height: 1.6;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.hero .container { max-width: 1500px; }
nav {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  font-size: 0.9rem;
  background: var(--bg);
}
nav .container { display: flex; justify-content: space-between; align-items: center; }
nav .brand { font-weight: 600; letter-spacing: -0.01em; color: var(--accent); display: inline-flex; align-items: center; gap: 0.5rem; }
nav .brand-logo { width: 28px; height: 28px; border-radius: 7px; vertical-align: middle; }
nav a { color: var(--muted); text-decoration: none; margin-left: 1.25rem; }
nav a:hover { color: var(--fg); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 3.5rem 0 2rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -10% 30% -10%;
  background:
    radial-gradient(60% 60% at 20% 30%, var(--hero-gradient-1) 0%, transparent 70%),
    radial-gradient(50% 50% at 80% 70%, var(--hero-gradient-2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 0 1.25rem;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.35);
}
.hero h1 {
  font-size: 3rem;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent) 20%, var(--accent-2) 60%, var(--accent-3) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.hero .tag {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 1.6rem;
  font-style: italic;
}
.hero .intro p {
  font-size: 1.05rem;
  margin: 0 0 1.2rem;
  max-width: 72ch;
}

/* ---------- MESH ---------- */
.mesh {
  position: relative;
  margin: 2rem 0 1rem;
  padding: 1rem 0 0.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, transparent 0%, var(--bg-2) 60%, transparent 100%);
}
.mesh svg {
  display: block;
  width: 100%;
  height: auto;
}
.mesh-caption {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
}
.mesh-caption strong { color: var(--accent); }

.mesh .edge    { stroke: var(--mesh-edge);    stroke-width: 1.4; fill: none; stroke-linecap: round; }
.mesh .edge.hi { stroke: var(--mesh-edge-hi); stroke-width: 2.2; }
.mesh .label   { fill: var(--mesh-label-fg); font: 600 13px "Inter", ui-sans-serif, system-ui, sans-serif; text-anchor: middle; letter-spacing: 0.04em; }

.mesh .container-dc {
  fill:   var(--mesh-container-dc-fill);
  stroke: var(--mesh-container-dc-stroke);
  stroke-width: 1.5;
  stroke-dasharray: 5 6;
}
.mesh .container-rack {
  fill:   var(--mesh-container-rack-fill);
  stroke: var(--mesh-container-rack-stroke);
  stroke-width: 1;
}
.mesh .container-label {
  fill: var(--mesh-container-label-fg);
  font: 700 14px "Inter", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.mesh .container-label-rack {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: none;
}

.mesh .kind-arch   .halo { fill: var(--mesh-arch-halo);   animation: nodepulse 3.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.mesh .kind-arch   .core { fill: var(--mesh-arch-fill); }
.mesh .kind-distro .halo { fill: var(--mesh-distro-halo); animation: nodepulse 4s   ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.mesh .kind-distro .core { fill: var(--mesh-distro-fill); }
.mesh .kind-hub    .halo { fill: var(--mesh-hub-halo);    animation: nodepulse 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.mesh .kind-hub    .core { fill: var(--mesh-hub-fill); }

@keyframes nodepulse {
  0%, 100% { transform: scale(1);   opacity: 0.85; }
  50%      { transform: scale(1.45); opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .mesh .halo { animation: none; }
  .mesh animateMotion { display: none; }
}

/* ---------- BODY SECTIONS ---------- */
h2 {
  margin-top: 3rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
h3 { font-size: 1.05rem; margin-top: 1.5rem; }
code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}
pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid var(--border);
}
pre code { background: none; padding: 0; font-size: 1em; }
ul.features { padding-left: 1.2rem; }
ul.features li { margin-bottom: 0.5rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card {
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  background: var(--bg);
  transition: border-color 0.18s, transform 0.18s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card h4 { margin: 0 0 0.3rem; font-size: 0.95rem; font-weight: 600; }
.card p  { margin: 0; font-size: 0.88rem; color: var(--muted); }
.card h4 a { color: inherit; text-decoration: none; }
.card h4 a:hover { color: var(--accent); }

.status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  background: var(--thread);
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 0.5rem;
  vertical-align: middle;
}
footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}
a { color: var(--accent); }
a:hover { color: var(--accent-2); }
