/* ============================================================
   Ecosystem Tooling DAO — Dark + Gold theme
   ============================================================ */

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg: #08080a;
  --bg-card: #111113;
  --bg-card-hover: rgba(52, 211, 153, 0.05);
  --gold: #34d399;
  --gold-dark: #10b981;
  --gold-light: #d1fae5;
  --gold-glow: rgba(52, 211, 153, 0.1);
  --text: #e5e5e5;
  --text-muted: #a3a3a3;
  --line: rgba(52, 211, 153, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  background: var(--bg);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Loading overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition:
    opacity 0.6s ease,
    visibility 0.6s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  animation: logo-pulse 1s ease-in-out;
}

@keyframes logo-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Page shell --- */
.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 56px;
}

/* --- Header / Nav --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 18px;
  z-index: 50;
  margin-bottom: 28px;
  padding: 12px 18px;
  background: rgba(17, 17, 19, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.site-header.header-hidden {
  transform: translateY(-120%);
  opacity: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 44px;
  width: auto;
}

.brand span {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--gold-light);
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-size: 0.96rem;
}

.nav a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--gold);
}

.nav-cta {
  padding: 10px 16px;
  color: #000 !important;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 999px;
  transition: box-shadow 0.2s ease;
}

.nav-cta:hover {
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
}

/* --- Hero --- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
  margin-bottom: 28px;
  padding: 48px 40px;
  background: linear-gradient(
    180deg,
    rgba(17, 17, 19, 0.9),
    rgba(8, 8, 10, 0.95)
  );
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.1), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(52, 211, 153, 0.08),
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-stats {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-glow),
    rgba(52, 211, 153, 0.3),
    var(--gold-glow),
    transparent
  );
  z-index: 1;
}

/* --- Eyebrow --- */
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* --- Headings --- */
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1,
h2 {
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
  line-height: 1.1;
  color: var(--gold-light);
}

h1 {
  font-size: clamp(2.8rem, 4.8vw, 4.2rem);
  overflow-wrap: anywhere;
}

h2 {
  max-width: 14ch;
  font-size: clamp(2.5rem, 4vw, 4.4rem);
}

h3 {
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--gold-light);
}

/* --- Lede --- */
.lede {
  max-width: 62ch;
  margin: 18px 0 0;
  font-size: 1.08rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* --- Buttons --- */
.hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

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

.button-primary {
  color: #000;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
}

.button-primary:hover {
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.35);
}

.button-secondary {
  color: var(--gold-light);
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.button-secondary:hover {
  background: rgba(52, 211, 153, 0.1);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.15);
}

/* --- Hero stats --- */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  padding: 20px;
  background: rgba(52, 211, 153, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: background 0.2s ease;
}

.stat-card:hover {
  background: var(--bg-card-hover);
}

.stat-number {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  color: var(--text);
}

.stat-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Logo band --- */
.logo-band {
  margin-bottom: 24px;
  padding: 24px 0;
  overflow: hidden;
}

.logo-band-label {
  margin: 0 0 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.logo-marquee {
  overflow: hidden;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 10%,
    #000 90%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 10%,
    #000 90%,
    transparent
  );
}

.logo-marquee-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: marquee-scroll 12s linear infinite;
}

.logo-marquee-track img {
  width: 160px;
  height: 90px;
  object-fit: contain;
  padding: 16px;
  background: rgba(52, 211, 153, 0.03);
  border: 1px dashed rgba(52, 211, 153, 0.12);
  border-radius: 16px;
  flex-shrink: 0;
}

@keyframes marquee-scroll {
  to {
    transform: translateX(-50%);
  }
}

/* --- Sections --- */
.section {
  margin-bottom: 24px;
  padding: 40px 34px;
  background: rgba(17, 17, 19, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
}

.section-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

/* --- Member grid --- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.member-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease;
}

.member-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--gradient-angle),
    var(--gold),
    transparent 40%,
    transparent 60%,
    var(--gold)
  );
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.member-card:hover::before {
  opacity: 1;
  animation: rotate-gradient 3s linear infinite;
}

@keyframes rotate-gradient {
  to {
    --gradient-angle: 360deg;
  }
}

.member-card.featured {
  background: linear-gradient(
    180deg,
    rgba(52, 211, 153, 0.08),
    rgba(52, 211, 153, 0.02)
  );
}

.member-logo {
  display: grid;
  place-items: center;
  aspect-ratio: 1.8 / 1;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(52, 211, 153, 0.04);
  border: 1px dashed rgba(52, 211, 153, 0.12);
  border-radius: var(--radius-md);
}

.member-icon {
  margin-bottom: 16px;
  font-size: 2.4rem;
  color: var(--accent);
}

.member-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

/* --- Mission grid --- */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.mission-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: background 0.2s ease;
}

.mission-card:hover {
  background: var(--bg-card-hover);
}

.mission-card p {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

/* --- Governance --- */
.governance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  position: relative;
}

.governance-line {
  position: absolute;
  top: 40px;
  left: 48px;
  right: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-glow));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.2s ease;
  z-index: -1;
}

.governance-grid.active .governance-line {
  transform: scaleX(1);
}

.governance-card {
  padding: 24px;
  background: rgba(17, 17, 19, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 1;
  transition: background 0.2s ease;
}

.governance-card:hover {
  background: rgba(22, 30, 27, 0.97);
}

.gov-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  color: var(--gold);
  font-weight: 800;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.governance-card p {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

/* --- CTA --- */
.cta-section {
  background: none;
  border: none;
  padding: 0;
  backdrop-filter: none;
}

.cta-panel {
  text-align: center;
  padding: 56px 40px;
  background: linear-gradient(
    180deg,
    rgba(17, 17, 19, 0.8),
    rgba(52, 211, 153, 0.04)
  );
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.cta-panel::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(
    ellipse,
    rgba(52, 211, 153, 0.08),
    transparent 70%
  );
  pointer-events: none;
}

.cta-panel h2 {
  max-width: 20ch;
  margin: 0 auto;
}

.cta-panel p {
  max-width: 60ch;
  margin: 16px auto 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.cta-panel .cta-actions {
  justify-content: center;
}

/* --- Footer --- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto 28px;
  padding: 0 0 18px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* --- Scroll reveal --- */
.reveal,
.reveal-stagger {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.visible,
.reveal-stagger.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 3D tilt highlight --- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease;
}

.tilt-card .tilt-highlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(52, 211, 153, 0.08),
    transparent 60%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tilt-card:hover .tilt-highlight {
  opacity: 1;
}

/* --- Responsive: tablet --- */
@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .member-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .governance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .governance-line {
    display: none;
  }
}

/* --- Responsive: mobile --- */
@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 14px;
  }

  .site-header {
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-radius: 28px;
  }

  .nav a:not(.nav-cta) {
    display: none;
  }

  .hero {
    padding: 28px 22px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.4rem, 10vw, 3.4rem);
  }

  h2 {
    font-size: clamp(2.2rem, 12vw, 3.2rem);
  }

  .section {
    padding: 28px 22px;
  }

  .member-grid,
  .mission-grid,
  .governance-grid {
    grid-template-columns: 1fr;
  }

  .governance-line {
    display: none;
  }

  .hero-actions,
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .site-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-panel {
    padding: 32px 22px;
  }

  .hero-particles {
    display: none;
  }
}
