/* Base reset & tokens */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --fg: #ffffff;
  --glass-bg: rgba(0,0,0,0.15);
  --cta: rgb(31, 200, 212);
  --maxw: 64rem;                  /* 1024px */
  --pad: clamp(0.75rem, 2vw, 1.25rem);
  --radius: 12px;
  --hero-gap: clamp(0.5rem, 1.5vw, 1rem);
  --footer-bg: rgba(50,50,50,0.7);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --fs-base: clamp(14px, 1.1vw + 10px, 18px);
  --fs-h1: clamp(1.6rem, 4vw, 3rem);
  --fs-p: clamp(0.95rem, 1.2vw, 1.15rem);
  --hero-bg: rgba(20, 40, 60, 0.6);
  --footer-h: 56px;
}

/* Full-bleed background */
html, body { height: 100%; overflow: hidden; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--fg); }

.bg-wrap { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-poster, .bg-video { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.bg-video { opacity: 0; transition: opacity .35s ease; }
.bg-video.ready { opacity: 1; }

.glass {
  position: absolute; inset: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(2px) saturate(120%);
  -webkit-backdrop-filter: blur(2px) saturate(120%);
}

/* Content */
#content-layer {
  position: relative; z-index: 1;
  min-height: 100vh;   /* legacy fallback */
  min-height: 100svh;  /* small viewport (iOS URL bar) */
  min-height: 100dvh;  /* dynamic viewport (most modern browsers) */
  display: grid; place-items: center;
  padding: var(--pad);
  text-align: center;
  overflow: hidden;
}

/* HERO: topbar + scrollable content */
.hero {
  width: min(100%, var(--maxw));
  display: flex;
  flex-direction: column;
  gap: var(--hero-gap);
  background: var(--hero-bg);
  border-radius: 16px;
  padding: 0 var(--pad) var(--pad);          /* no top padding */
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px) saturate(140%);
  -webkit-backdrop-filter: blur(4px) saturate(140%);
  max-height: calc(100dvh - var(--footer-h) - 8rem);
  overflow: hidden;                           /* scroll happens in .hero-scroll */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Sticky top bar flush with hero top */
.hero-topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 0;                           /* inherits side padding from .hero */
  /* backdrop-filter: blur(4px) saturate(120%);
  -webkit-backdrop-filter: blur(4px) saturate(120%); */
  z-index: 1;
}

/* Minimal links on the top bar */
.toplink {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  opacity: .95;
}
.toplink:hover { text-decoration: underline; }
.backlink { }
.cta-top  { }

/* Scrollable content area below top bar */
.hero-scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding-top: var(--pad);
  padding-bottom: .25rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.0) 0, rgba(0,0,0,1) 16px);
}

h1 { font-size: var(--fs-h1); line-height: 1.1; text-shadow: var(--shadow); }
.hero-body { font-size: var(--fs-p); opacity: 0.95; margin-top: 0.75rem; }

/* Home CTA */
.cta-button {
  display: inline-block; margin-top: 1rem;
  background: var(--cta); color: #fff; text-decoration: none; font-weight: 700;
  padding: .75rem 1.25rem; border-radius: 10px; box-shadow: var(--shadow);
  transition: transform .12s ease, filter .12s ease;
  cursor: pointer;
}
.cta-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.cta-button:active { transform: translateY(0); }


/* Row of primary + secondary CTAs on home hero */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Secondary CTAs (portal, Google) */
.cta-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: none;
  font-weight: 600;
}
.cta-secondary:hover {
  background: rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

/* Topbar right-side group */
.hero-top-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toplink-separator {
  opacity: 0.7;
}

/* Portal view spacing */
.portal-auth-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.portal-text {
  margin-top: 1rem;
}


/* Features marquee */
.features-banner { 
  position: relative; 
  width: 100%; 
  overflow: hidden;
  margin-top: 1rem;
}
.marquee { white-space: nowrap; overflow: hidden; width: 100%;}
.marquee__track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: marquee-loop 18s linear infinite;
}
/* Tune speed by changing duration; translate by half (two copies) */
@keyframes marquee-loop {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Footer */
#footer {
  position: fixed;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 2;
  font-size: var(--fs-base);
  opacity: 0.9;
}
#tabs {
  background: var(--footer-bg); color: #fff; padding: .5rem .75rem;
  border-radius: 10px; box-shadow: var(--shadow);
}
#tabs a { color: #fff; text-decoration: none; }
#tabs .tab { margin: 0 .5rem; }
#tabs .contact { margin-top: .35rem; font-size: 0.85em; opacity: .95; }

@media (max-width: 420px) {
  #tabs {
    white-space: nowrap;
    font-size: clamp(10px, 3vw, 13px);
    padding: .35rem .55rem;
  }
  #tabs .tab { margin: 0 .35rem; }
}

/* Accessibility: reduce motion/data */
@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; }
  .bg-video { transition: none; }
}

/* Swap animation */
.hero.fade-out { opacity: 0; transition: opacity .12s ease; }
.hero.fade-in  { opacity: 1; transition: opacity .18s ease; }

/* Focus ring only for keyboard users */
:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(255,255,255,0.9); outline-offset: 2px; }

.policy-text {
  text-align: left;
  line-height: 1.6;
  margin-top: 1rem;
  width: 100%;
}

.policy-text h1,
.policy-text h2,
.policy-text h3 { 
  text-align: left;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}

.policy-text p {
  margin-bottom: 0.9em;
}

.policy-text a {
  color: var(--cta);
  text-decoration: none;
  font-weight: 600;
}
.policy-text a:hover {
  text-decoration: underline;
}


/* TEAM section */
.team-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.member {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
}

/* responsive scale on smaller screens */
@media (max-width: 576px) {
  .avatar {
    width: 56px;
    height: 56px;
  }
}

@media (min-width: 577px) {
  .team-list {
    margin-bottom: 1rem;
  }
}


.reviewer-notice {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--cta);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.95em;
  text-align: left;
  line-height: 1.5;
}

.reviewer-notice a {
  color: var(--cta);
  text-decoration: none;
  font-weight: 600;
}
.reviewer-notice a:hover {
  text-decoration: underline;
}

.portal-section {
  margin-top: 2rem;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-section__title {
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
  margin: 0 0 1rem;
}

.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.account-row:first-child {
  border-top: none;
}

.account-row__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar__fallback {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.85;
}

.account-meta {
  display: flex;
  flex-direction: column;
}

.account-meta__provider {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  text-align: left;
}

.account-meta__name {
  font-size: 0.95rem;
  font-weight: 500;
}

.account-row__right {
  flex-shrink: 0;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}

.account-chip--connected {
  background: rgba(76, 217, 100, 0.16); /* greenish */
  border: 1px solid rgba(76, 217, 100, 0.6);
}

.account-chip--action {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: white;
  cursor: pointer;
}

.account-chip--action:hover {
  background: rgba(255, 255, 255, 0.28);
}

.portal-section {
  margin-top: 2rem;
}

.portal-section h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.portal-section__hint {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 0.75rem;
}

.portal-loading,
.portal-error,
.portal-empty {
  font-size: 0.95rem;
  opacity: 0.9;
}

.community-group {
  margin-top: 1rem;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.community-group__header {
  width: 100%;
  display: flex;
  justify-content: space-between; /* keep label left, everything else right */
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
}

.community-group__right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.community-group__meta {
  opacity: 0.8;
}

.community-group__chevron {
  opacity: 0.8;
}

.community-group__body {
  padding: 0.5rem 0.75rem 0.75rem;
}

.community-group__body.is-collapsed {
  display: none;
}

.community-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.community-card:last-child {
  border-bottom: none;
}

.community-main {
  flex: 2;
}

.community-status {
  flex: 1.3;
  text-align: right;
  font-size: 0.85rem;
}

.community-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.community-name {
  font-weight: 600;
}

.community-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.community-meta {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 0.15rem;
  text-align: left !important;
  justify-content: flex-start !important;
}

.community-meta span {
  display: inline-block;
}

.community-status-line {
  margin-bottom: 0.25rem;
}


.portal-section {
  margin-top: 1.5rem;
}

.portal-create-form {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-create-form h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.portal-create-form p {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  opacity: 0.85;
}

.portal-create-form .field-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.portal-create-form label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.portal-create-form input[type="text"],
.portal-create-form input[type="email"] {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.85rem;
}

.portal-create-form small {
  font-size: 0.75rem;
  opacity: 0.7;
}
