/* ============================================================================
   Ants Projects Hub — Mesh Glow theme
   Single source of truth for all styling. Re-skin via the :root tokens below.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #08080c;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-border: rgba(255, 255, 255, 0.11);

  /* Text (all meet WCAG AA on --bg) */
  --text: #eef0f6;
  --text-muted: #c4c6d4;
  --text-dim: #9a9cad;

  /* Accents */
  --teal: #5eead4;
  --teal-soft: rgba(94, 234, 212, 0.16);
  --violet: #c4b5fd;
  --amber: #fbbf24;
  --rose: #fda4af;

  /* Blob colours */
  --blob-1: #2dd4bf;
  --blob-2: #a855f7;
  --blob-3: #f43f5e;

  /* Status colours */
  --live: #5eead4;
  --beta: #fbbf24;
  --wip: #c4b5fd;
  --soon: #9a9cad;

  /* Geometry & motion */
  --radius: 14px;
  --radius-lg: 18px;
  --maxw: 1140px;
  --gap: 14px;
  --blur: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
}

/* ---- Reset / base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--teal);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--teal);
  color: #02201b;
  padding: 0.6rem 1rem;
  font-weight: 700;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ---- Layout ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.25rem);
}
main {
  position: relative;
  z-index: 1;
}

/* ---- Roaming glow background ---- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.5;
  will-change: transform;
}
.blob--1 {
  width: clamp(280px, 34vw, 460px);
  aspect-ratio: 1;
  left: 4%;
  top: 2%;
  background: var(--blob-1);
  animation: roam-a 50s ease-in-out infinite;
}
.blob--2 {
  width: clamp(300px, 38vw, 500px);
  aspect-ratio: 1;
  right: 2%;
  top: 6%;
  background: var(--blob-2);
  animation: roam-b 62s ease-in-out infinite;
}
.blob--3 {
  width: clamp(260px, 30vw, 420px);
  aspect-ratio: 1;
  left: 40%;
  top: 50%;
  background: var(--blob-3);
  animation: roam-c 56s ease-in-out infinite;
}
.bg-blobs::after {
  /* slow hue drift over the whole field */
  content: "";
  position: absolute;
  inset: 0;
  animation: hue 18s linear infinite;
  mix-blend-mode: overlay;
}

@keyframes roam-a {
  0% { transform: translate(0, 0); }
  18% { transform: translate(34vw, 18vh); }
  36% { transform: translate(52vw, 5vh); }
  54% { transform: translate(26vw, 26vh); }
  72% { transform: translate(8vw, 12vh); }
  100% { transform: translate(0, 0); }
}
@keyframes roam-b {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-30vw, 20vh); }
  42% { transform: translate(-50vw, 7vh); }
  64% { transform: translate(-22vw, 26vh); }
  84% { transform: translate(-11vw, 10vh); }
  100% { transform: translate(0, 0); }
}
@keyframes roam-c {
  0% { transform: translate(0, 0); }
  22% { transform: translate(-26vw, -16vh); }
  44% { transform: translate(22vw, -8vh); }
  66% { transform: translate(38vw, 17vh); }
  84% { transform: translate(13vw, 7vh); }
  100% { transform: translate(0, 0); }
}
@keyframes hue {
  to { filter: hue-rotate(360deg); }
}

/* ---- Header / nav ---- */
.site-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}
.site-head a {
  color: var(--text);
}
.brand {
  font-weight: 800;
  letter-spacing: 0.3px;
}
.brand:hover {
  text-decoration: none;
  color: var(--teal);
}
.nav-back {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  text-align: center;
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(1.75rem, 5vw, 2.75rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -2% -10%;
  z-index: -1;
  background: radial-gradient(
    ellipse 60% 78% at 50% 42%,
    rgba(0, 0, 0, 0.6),
    rgba(0, 0, 0, 0) 72%
  );
}
.kicker {
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal);
}
.hero h1 {
  margin: 0.5rem 0;
  font-size: clamp(2.3rem, 7vw, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.4px;
  line-height: 1.05;
  background: linear-gradient(
    90deg,
    #ccfbf1,
    #ffffff,
    #cffafe,
    #ffffff,
    #fce7f3,
    #ccfbf1
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: title-flow 10s linear infinite;
  filter: drop-shadow(0 1px 12px rgba(103, 232, 249, 0.4));
}
@keyframes title-flow {
  to { background-position: 300% center; }
}
.hero .tagline {
  max-width: 34rem;
  margin: 0.75rem auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2.4vw, 1.12rem);
}
.stats {
  display: flex;
  gap: clamp(1.25rem, 4vw, 2rem);
  justify-content: center;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}
.stat b {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}
.stat span {
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---- Section heading ---- */
.section-label {
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 2rem 0 1rem;
}

/* ---- Project grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: var(--gap);
  margin-bottom: 2.5rem;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem;
  background: var(--surface);
  border: 1.5px solid var(--surface-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  color: var(--text);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease), background 0.18s var(--ease),
    backdrop-filter 0.18s var(--ease);
}
a.card:hover {
  text-decoration: none;
  transform: translateY(-6px) scale(1.015);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-color: var(--teal);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(94, 234, 212, 0.55), 0 10px 46px rgba(94, 234, 212, 0.28);
}
a.card:hover .card__name {
  color: #bff7ec;
}
.card--soon {
  opacity: 0.66;
}
.card__name {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 750;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  transition: color 0.18s var(--ease);
}
.card__fork {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-left: 0.4rem;
}
.card__desc {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
  flex: 1;
}
.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ---- Status pill + platform tags ---- */
.pill {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.pill--live { background: var(--teal-soft); color: var(--live); border: 1px solid rgba(94, 234, 212, 0.35); }
.pill--beta { background: rgba(251, 191, 36, 0.15); color: var(--beta); border: 1px solid rgba(251, 191, 36, 0.32); }
.pill--wip { background: rgba(196, 181, 253, 0.15); color: var(--wip); border: 1px solid rgba(196, 181, 253, 0.32); }
.pill--soon { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.12); }

.plats {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.plat {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---- Support ---- */
.support {
  text-align: center;
  margin: 1rem 0 3rem;
}
.support__row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.support__btn {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
}
.support__btn:hover {
  text-decoration: none;
  border-color: var(--teal);
}
.support__btn--primary {
  background: linear-gradient(
    120deg,
    rgba(94, 234, 212, 0.22),
    rgba(196, 181, 253, 0.22)
  );
  border-color: rgba(94, 234, 212, 0.4);
}
.support__btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.support__btn .note {
  color: var(--text-dim);
  font-weight: 500;
}

/* ---- Project detail page ---- */
.detail-head {
  padding-block: clamp(1.75rem, 5vw, 2.75rem) 1rem;
}
.detail-head h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 850;
  margin: 0.4rem 0 0.5rem;
  color: #fff;
}
.detail-sub {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--text-muted);
}
.detail-sub .version {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
}
.btn:hover {
  text-decoration: none;
  border-color: var(--teal);
}
.btn--primary {
  background: linear-gradient(120deg, rgba(94, 234, 212, 0.25), rgba(196, 181, 253, 0.22));
  border-color: rgba(94, 234, 212, 0.45);
  color: #eafffb;
}
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn--ghost {
  background: transparent;
}

.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
}

/* Changelog + README prose */
.panel {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
}
.panel > h2:first-child {
  margin-top: 0;
}
.prose {
  color: var(--text);
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.prose h2 { font-size: 1.4rem; margin-top: 1.8rem; }
.prose h3 { font-size: 1.15rem; margin-top: 1.5rem; }
.prose h2, .prose h3, .prose h4 { color: #fff; line-height: 1.3; }
.prose a { color: var(--teal); }
.prose code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  font-size: 0.9em;
}
.prose pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: 8px; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--surface-border); padding: 0.4rem 0.6rem; }
.prose blockquote {
  border-left: 3px solid var(--teal);
  margin-inline: 0;
  padding-left: 1rem;
  color: var(--text-muted);
}

/* ---- 404 ---- */
.notfound {
  text-align: center;
  padding-block: clamp(3rem, 12vw, 7rem);
}
.notfound h1 {
  font-size: clamp(3rem, 14vw, 6rem);
  margin: 0;
  color: #fff;
}

/* ---- Footer ---- */
.site-foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--surface-border);
  margin-top: 2rem;
  padding-block: 1.75rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---- Motion: static unless the user allows motion ---- */
@media (prefers-reduced-motion: no-preference) {
  /* (animations already declared above run only here) */
}
@media (prefers-reduced-motion: reduce) {
  .blob,
  .bg-blobs::after,
  .hero h1 {
    animation: none !important;
  }
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
