:root {
  --bg: #000000;
  --surface: #0b0b0f;
  --surface-elevated: #14141a;
  --surface-glass: rgba(12, 12, 16, 0.82);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --green-border: rgba(16, 185, 129, 0.34);
  --radius-card: 18px;
  --max-width: 1180px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-app-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.brand-wordmark {
  height: 22px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.16s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
}

.nav-cta {
  padding: 8px 15px;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Welcome Hero + 3-Column Carousel */
.welcome-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 64px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: #000000;
}

.carousel-stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px;
  max-width: 1360px;
  margin: 0 auto;
  overflow: hidden;
  pointer-events: none;
}

.carousel-column {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.carousel-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  will-change: transform;
}

.group-card {
  position: relative;
  height: 124px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #18181f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex-shrink: 0;
}

.group-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.group-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 0, 0, 0.54) 100%
  );
}

.group-card-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
}

.group-card-info {
  min-width: 0;
  flex: 1;
}

.group-card-title {
  margin: 0 0 2px;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-card-sub {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.84);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.join-pill {
  flex-shrink: 0;
  background: #ffffff;
  color: #000000;
  border-radius: 999px;
  padding: 6.5px 15px;
  min-width: 68px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}

.hero-top-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 220px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    #000000 0%,
    rgba(0, 0, 0, 0.88) 40%,
    rgba(0, 0, 0, 0.45) 75%,
    rgba(0, 0, 0, 0) 100%
  );
}

.hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 360px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    to top,
    #000000 0%,
    rgba(0, 0, 0, 0.92) 42%,
    rgba(0, 0, 0, 0.5) 74%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* Floating Welcome Overlay Card */
.hero-overlay {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 580px;
  margin: auto 16px 36px;
  padding: 30px 26px 26px;
  border-radius: 28px;
  background: rgba(11, 11, 15, 0.84);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
  text-align: center;
}

.hero-brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

.hero-app-icon-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-app-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.hero-wordmark {
  height: 32px;
  width: auto;
  display: block;
}

.hero-tagline {
  margin: 9px 0 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
}

.hero-title {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.7px;
  color: #ffffff;
}

.hero-subtitle {
  margin: 0 auto 22px;
  max-width: 440px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Official Store Buttons */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  min-width: 194px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
  text-align: left;
  border: 1px solid transparent;
}

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

.store-btn-apple {
  background: #ffffff;
  color: #000000;
}

.store-btn-google {
  background: #17171d;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.store-btn-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

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

.store-btn-kicker {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.78;
  letter-spacing: 0.2px;
}

.store-btn-label {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.25px;
}

.hero-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  font-size: 12px;
  font-weight: 700;
  color: #6ee7b7;
  margin-bottom: 14px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

/* All Groups Directory Section */
.directory-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 20px 72px;
}

.directory-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.directory-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.directory-subtitle {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.directory-search-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
}

.directory-search {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: #ffffff;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.directory-search:focus {
  border-color: var(--green);
}

.directory-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 22px;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  color: #ffffff;
  border-color: var(--border-strong);
}

.cat-pill.is-active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.directory-grid .group-card {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.directory-grid .group-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.24);
}

.directory-more-wrap {
  margin-top: 26px;
  text-align: center;
}

.directory-more-btn {
  padding: 11px 24px;
  border-radius: 999px;
  background: var(--surface-elevated);
  color: #ffffff;
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.directory-more-btn:hover {
  background: #1e1e26;
}

/* Legal Document Pages (/terms & /privacy) */
.legal-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px 20px 72px;
}

.legal-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.legal-sidebar {
  position: sticky;
  top: 86px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
}

.legal-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.legal-tab {
  display: block;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.legal-tab.is-active {
  background: var(--green-soft);
  color: #6ee7b7;
  border: 1px solid var(--green-border);
}

.toc-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 58vh;
  overflow-y: auto;
}

.toc-list a {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-secondary);
  display: block;
  padding: 3px 0;
}

.toc-list a:hover {
  color: #ffffff;
}

.legal-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 34px 34px 40px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.legal-meta {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--green);
  margin: 0 0 10px;
}

.legal-h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.8px;
}

.legal-notice {
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 22px;
}

.legal-notice-title {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
}

.legal-notice-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.legal-intro {
  font-size: 15.5px;
  line-height: 1.7;
  color: #e4e4e7;
  margin: 0 0 14px;
}

.legal-section {
  scroll-margin-top: 86px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.legal-section p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.72;
  color: #d4d4d8;
}

.legal-section p.is-uppercase {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
  color: #e4e4e7;
}

.legal-section ul {
  margin: 8px 0 14px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.legal-section li {
  font-size: 14.5px;
  line-height: 1.68;
  color: #d4d4d8;
}

.legal-section li strong {
  color: #ffffff;
}

.legal-callout {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  margin-top: 10px;
}

.legal-callout-title {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
}

.legal-callout-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-line;
}

.legal-download-strip {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Simple Footer */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: #050507;
  padding: 36px 20px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: #ffffff;
}

/* Modal / Toast */
.store-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 80;
  background: #14141a;
  color: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 13px 18px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
  font-size: 13.5px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.store-toast.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 960px) {
  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-shell {
    grid-template-columns: 1fr;
  }

  .legal-sidebar {
    position: static;
  }

  .toc-list {
    max-height: 220px;
  }
}

@media (max-width: 680px) {
  .header-inner {
    padding: 10px 14px;
    gap: 10px;
  }

  .brand-app-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .brand-wordmark {
    height: 18px;
  }

  .nav-links {
    gap: 11px;
  }

  .nav-link {
    font-size: 13px;
  }

  .nav-cta {
    display: none;
  }

  .welcome-hero {
    padding-top: 56px;
  }

  .carousel-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 10px;
  }

  .carousel-column[data-col="2"] {
    display: none;
  }

  .carousel-stage .group-card-bottom {
    padding: 10px 11px;
    gap: 8px;
  }

  .carousel-stage .group-card-title {
    font-size: 14.5px;
  }

  .carousel-stage .group-card-sub {
    font-size: 11.5px;
  }

  .carousel-stage .join-pill {
    padding: 5px 10px;
    min-width: 52px;
    font-size: 11.5px;
  }

  .hero-overlay {
    width: calc(100% - 24px);
    margin: auto 12px 20px;
    padding: 22px 16px 20px;
    border-radius: 22px;
  }

  .hero-app-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    border-color: rgba(255, 255, 255, 0.24);
  }

  .hero-wordmark {
    height: 26px;
  }

  .hero-subtitle {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .store-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .store-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .directory-section {
    padding: 44px 14px 52px;
  }

  .directory-search-wrap {
    max-width: none;
  }

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

  .legal-main {
    padding: 78px 14px 52px;
  }

  .legal-tabs {
    flex-direction: row;
  }

  .legal-tab {
    flex: 1;
    text-align: center;
  }

  .legal-article {
    padding: 22px 16px 26px;
    border-radius: 18px;
  }

  .legal-download-strip {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .site-footer {
    padding: 28px 14px;
  }

  .footer-links {
    gap: 14px;
  }
}
