.logo-square.large {
  width: 320px;
  height: 320px;
  border-radius: 24px;
  padding: 0;
  background: #181a1b; /* solid backdrop; image will be the <img> element */
}
/* Ensure the image inside the large square is fully visible without cropping */
.logo-square.large img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Square logo container for homepage */
.logo-square {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #181a1b;
  border-radius: 16px;
  overflow: hidden;
  margin: 0;
}
.logo-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* default fill for small squares */
  object-position: center;
  background: #181a1b;
  border-radius: 0;
  border: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px); background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display:flex; align-items:center; gap:16px; padding: 12px 24px; }
.brand { display:flex; align-items:center; gap:12px; }
.brand img { width:40px; height:40px; border-radius:9999px; border:1px solid var(--border); object-fit:cover; }
.brand .org { font-size:12px; text-transform:uppercase; letter-spacing:.24em; color: var(--text-dim); }
.brand .title { font-size:18px; font-weight:600; }

.nav a { padding: 8px 12px; border-radius: 12px; color: var(--text-dim); transition: .2s; display:inline-block; }
.nav a:hover { background: rgba(28,33,38,0.6); color: var(--text); }
/* Animated underline for active tab */
.nav a { position: relative; }
.nav a::after { content:""; position:absolute; left:10px; right:10px; bottom:2px; height:2px; background: var(--primary-soft); border-radius:9999px; transform: scaleX(0); transform-origin: left; transition: transform .25s ease, opacity .25s ease; opacity: 0; }
.nav a.active { color: var(--primary-soft); }
.nav a.active::after { transform: scaleX(1); opacity: 1; }

.main { position: relative; min-height: 100vh; z-index: 1; }
.section { padding: 80px 0 100px; display:none; }
.section.active { display:block; animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

/* Staggered reveal for grids/lists when a section becomes active */
.anim-stagger > * { opacity: 0; transform: translateY(8px); animation: rise .35s ease forwards; }
.anim-stagger > *:nth-child(1) { animation-delay: 40ms; }
.anim-stagger > *:nth-child(2) { animation-delay: 80ms; }
.anim-stagger > *:nth-child(3) { animation-delay: 120ms; }
.anim-stagger > *:nth-child(4) { animation-delay: 160ms; }
.anim-stagger > *:nth-child(5) { animation-delay: 200ms; }
.anim-stagger > *:nth-child(6) { animation-delay: 240ms; }
.anim-stagger > *:nth-child(7) { animation-delay: 280ms; }
.anim-stagger > *:nth-child(8) { animation-delay: 320ms; }
.anim-stagger > *:nth-child(9) { animation-delay: 360ms; }
.anim-stagger > *:nth-child(10) { animation-delay: 400ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.h1 { font-size: clamp(28px, 4vw, 48px); font-weight: 650; letter-spacing:-0.02em; }
.sub { margin-top: 12px; color: var(--text-dim); max-width: 900px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(1, minmax(0,1fr)); }
@media (min-width: 1000px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.badge { background: rgba(28,33,38,0.6); border:1px solid var(--border); color: var(--text); border-radius:9999px; padding:8px 12px; font-size: 12px; display:inline-flex; align-items:center; gap:8px; }
.btn { background: var(--primary); color: black; border:none; border-radius: 16px; padding: 14px 18px; font-weight:600; cursor:pointer; }
.btn:hover { background: var(--primary-soft); }
.btn.secondary { background: transparent; color: var(--text); border:1px solid var(--border); }
.btn.secondary:hover { background: rgba(28,33,38,0.6); }

.kpi { border: 1px solid var(--border); background: var(--surface); border-radius: 16px; padding: 16px; }
.kpi .label { text-transform: uppercase; font-size: 11px; letter-spacing: .2em; color: var(--text-dim); }
.kpi .value { font-size: 24px; font-weight: 600; margin-top: 4px; }

.footer { border-top:1px solid var(--border); background: var(--surface); padding-top: 20px; margin-top: 60px; position: relative; z-index: 1; }
.footer .cols { display:grid; gap:24px; }
@media (min-width: 900px) { .footer .cols { grid-template-columns: 1.2fr .8fr .8fr; } }
.footer .tiny { color: var(--text-dim); text-align:center; font-size: 12px; padding: 16px 0; border-top:1px solid var(--border); margin-top: 16px; }

/* Footer link styling */
.footer a { color: var(--text); text-decoration: none; transition: color .2s ease; }
.footer a:hover { color: var(--primary-soft); text-decoration: underline; }

/* Starfield covers entire viewport and sits behind content */ 
.canvas-wrap { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.vignette { position:absolute; inset:0; background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.55) 100%); }

/* Toast notifications */
.toast-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000; /* above header/footer and canvas */
  pointer-events: none; /* clicks pass through except on toast */
}
.toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  padding: 12px 14px;
  border-radius: 12px;
  min-width: 260px;
  max-width: min(92vw, 480px);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease, border-color .2s ease;
}
.toast.active { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--primary-soft); }
.toast.error { border-color: var(--primary-soft); }
.toast.info { border-color: var(--accent); }

@media (max-width: 640px) {
  .toast-wrap { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: auto; width: 100%; }
}

/* =============================
   Mobile tweaks (<= 640px wide)
   ============================= */
@media (max-width: 640px) {
  html, body { font-size: 16px; line-height: 1.5; }
  .container { padding: 0 16px; }
  .header-inner { padding: 10px 16px; gap: 10px; }
  .brand img { width: 32px; height: 32px; }
  .brand .title { font-size: 16px; }
  .brand .org { font-size: 11px; }

  /* Make the nav horizontally scrollable if it overflows */
  .nav { margin-left: 0 !important; width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .nav a { padding: 8px 10px; }
  .nav a::after { left: 8px; right: 8px; }

  .section { padding: 56px 0 72px; }
  .grid { gap: 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .sub { font-size: 15px; }
  .h1 { font-size: clamp(24px, 6vw, 32px); }

  /* Make primary actions easier to tap */
  .btn { width: 100%; padding: 14px 16px; }
  .btn.secondary { width: 100%; }
  /* Flex buttons in hero/join sections wrap to full width */
  .container a.btn { flex: 1 1 100%; }

  /* Comfortable form fields */
  form input, form select, form textarea { min-height: 44px; font-size: 16px; }

  /* Footer spacing a bit tighter on mobile */
  .footer { margin-top: 40px; }
  .footer .tiny { font-size: 11px; padding: 12px 0; }
}
