/* Iridex homepage — page-specific components (site-header, hero, footer,
   feature grid). Design tokens and generic components live in base.css. */

body { overflow-x: hidden; }

/* ---- Header login state (see assets/js/auth-nav.js) ----
   Identical to the dashboard's — same component (user-menu.js), same look,
   since it's the same session. */
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.user-menu-trigger:hover { background: var(--surface-alt); border-color: var(--border); }
.user-menu-trigger img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); }
.user-menu-trigger svg { width: 14px; height: 14px; color: var(--text-dim); transition: transform 0.18s var(--ease-out); }
.user-menu-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-lg);
}
.user-menu-dropdown a {
  display: block;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--text-md);
  text-decoration: none;
  transition: background-color 0.15s var(--ease-out);
}
.user-menu-dropdown a:hover { background: var(--surface-alt); }

/* Fixed engineering-grid backdrop, masked to a soft glow near the top of the
   page — the same trick aboutcapy.dev uses so the grid never competes with
   content lower down. Sits behind everything, never eats clicks. */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--grid-lines);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 78%);
}
.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% -8%, rgba(255, 255, 255, 0.05), transparent 70%);
}
main, .site-header, .site-footer { position: relative; z-index: 1; }

/* ================= SITE HEADER ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0.85rem var(--space-6);
  background: rgba(8, 8, 10, 0.82);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  transition: background-color 0.2s var(--ease-out);
}
:root[data-theme="light"] .site-header { background: rgba(247, 247, 246, 0.86); }

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  text-decoration: none;
  white-space: nowrap;
}
.logo-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0b0b0c;
  border: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-badge img { width: 14px; }

.site-header .nav-links { margin-right: auto; margin-left: var(--space-6); gap: var(--space-5); }
.site-header .nav-links a { font-size: var(--text-md); }

/* ================= TYPE / KICKER OVERRIDES ================= */
.brand-font { font-family: var(--font-display); font-weight: 700; }

/* ================= HERO ================= */
.hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 6vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-copy .badge {
  margin-bottom: var(--space-5);
}
.hero h1 {
  font-size: var(--text-5xl);
  line-height: 1.03;
  margin: 0 0 var(--space-5);
}
.hero h1 .muted { color: var(--text-dim); }
.hero-sub {
  max-width: 52ch;
  margin: 0 0 var(--space-8);
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.65;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero-trust {
  margin-top: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust svg { width: 14px; height: 14px; color: var(--success); }

/* ---- Terminal panel: a real product shot of what /help looks like from a
   terminal's point of view. Mirrors aboutcapy.dev's terminal component. ---- */
.terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-solid), var(--bg-subtle));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  /* Shell output stays left-to-right even on an RTL page (Arabic, etc.) —
     it's rendering commands, not prose, and flipping it reads as broken
     rather than translated. */
  direction: ltr;
  text-align: left;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-hi); flex: none; }
.terminal-bar i:nth-child(2) { background: var(--border); }
.terminal-bar i:nth-child(3) { background: rgba(255, 255, 255, 0.05); }
.terminal-bar span {
  margin-left: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-body {
  padding: 1.1rem 1.2rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.85;
}
.terminal-body .ln { display: flex; gap: 0.65rem; overflow-wrap: anywhere; }
.terminal-body .pr { color: var(--text-dim); flex: none; }
.terminal-body .cmd { color: var(--text-bright); }
.terminal-body .out { color: var(--text-muted); }
.terminal-body .ok { color: var(--success); }
.cursor {
  display: inline-block;
  width: 0.56ch;
  height: 1em;
  margin-left: 0.1em;
  background: var(--accent);
  vertical-align: -0.12em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Product shot: what Iridex actually posts in-channel, shown beneath the
   terminal so the hero demonstrates both the CLI-ish feel and the real UI. */
.preview-wrap { margin-top: var(--space-5); }
.discord-preview {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #313338;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.dc-titlebar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #232428; border-bottom: 1px solid rgba(0, 0, 0, 0.25); }
.dc-dot { width: 10px; height: 10px; border-radius: 50%; }
.dc-dot.r { background: #ed6a5f; } .dc-dot.y { background: #f4bf50; } .dc-dot.g { background: #61c554; }
.dc-channel { margin-left: 6px; color: #949ba4; font-size: var(--text-sm); font-weight: 600; }
.dc-channel b { color: #dbdee1; font-weight: 700; }
.dc-body { padding: var(--space-4) var(--space-5) var(--space-5); }
.dc-msg { display: flex; gap: 14px; }
.dc-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; background: #0b0b0c; border: 1px solid rgba(255, 255, 255, 0.12); display: flex; align-items: center; justify-content: center; }
.dc-avatar img { width: 20px; }
.dc-msg-body { flex: 1; min-width: 0; }
.dc-author { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.dc-name { color: #f2f3f5; font-weight: 600; font-size: var(--text-md); font-family: var(--font); }
.dc-tag { background: #4e5058; color: #dbdee1; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; letter-spacing: 0.02em; text-transform: uppercase; }
.dc-time { color: #949ba4; font-size: var(--text-xs); }
.dc-container { border-left: 4px solid #6b6b73; background: #2b2d31; border-radius: 4px; padding: 12px 15px; margin-top: 2px; }
.dc-container h4 { margin: 0 0 7px; color: #f2f3f5; font-size: var(--text-base); font-family: var(--font-display); }
.dc-container p { margin: 0; color: #b5bac1; font-size: var(--text-md); line-height: 1.5; }
.dc-mention { color: #d9dbe0; background: rgba(255, 255, 255, 0.09); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dc-btn { font-family: var(--font); font-size: var(--text-sm); font-weight: 600; padding: 6px 14px; border-radius: 4px; border: none; color: #fff; }
.dc-btn.primary { background: #5865f2; }
.dc-btn.success { background: #248046; }
.dc-btn.secondary { background: #4e5058; }
.dc-btn.danger { background: #da373c; }

/* ================= SECTION SHELL ================= */
.section { padding: var(--space-20) 0; scroll-margin-top: 90px; }
.section-head { margin-bottom: var(--space-10); }
.section-head.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.section-head.center .kicker { justify-content: center; }
.section-head.center .section-sub { text-align: center; }

/* ================= FEATURE GRID ================= */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-4); }
.bento > * { grid-column: span 2; }
.bento .span-3 { grid-column: span 3; }
.bento .span-4 { grid-column: span 4; }
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento > *, .bento .span-3, .bento .span-4 { grid-column: span 1; }
}
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } }

.feature-card { display: flex; flex-direction: column; gap: var(--space-3); min-height: 100%; }
.feature-card h3 { margin: 0; font-size: var(--text-lg); }
.feature-card p { margin: 0; color: var(--text-muted); font-size: var(--text-md); line-height: 1.6; }
.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-1);
}
.feature-icon svg { width: 20px; height: 20px; stroke: var(--text) !important; }
.feature-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: var(--space-3); }
.feature-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px 9px;
}

/* ================= STEPS ================= */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: var(--space-6); }
.step-card {
  text-align: center;
  padding: var(--space-8) var(--space-6) var(--space-7);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.step-num {
  width: 38px; height: 38px;
  margin: 0 auto var(--space-5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: var(--text-md);
  color: var(--text-bright);
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  /* A faint halo so the number reads as a marker on the card rather than a
     second, smaller card sitting on top of it. */
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.025), 0 10px 24px -18px #000;
}
.step-card:hover .step-num { border-color: var(--edge-hi); }
.step-card h3 { margin: 0 0 var(--space-2); font-size: var(--text-lg); }
.step-card p { color: var(--text-muted); font-size: var(--text-md); margin: 0; }
.step-card code { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text); }

/* ================= STAT STRIP ================= */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--border);
  overflow: hidden;
}
.stat { padding: var(--space-5); background: var(--bg-subtle); text-align: left; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}
.stat-label {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ================= CTA ================= */
.cta-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-16) var(--space-6);
  text-align: center;
  background: var(--surface);
}
.cta-card h2 { margin: 0 0 var(--space-3); font-size: var(--text-3xl); }
.cta-card p { color: var(--text-muted); max-width: 48ch; margin: 0 auto; }
.cta-card .hero-ctas { margin-top: var(--space-8); justify-content: center; }

/* ================= DESKTOP APP DOWNLOAD ================= */
.app-download-card {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  background: var(--surface);
  /* This card is a whole-card link to /download now, not just a div with a
     button in it — reset the anchor defaults so it doesn't look/act like a
     text link, and give it its own hover state like the rest of the site's
     card-interactive elements. */
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.app-download-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}
.app-download-card .app-download-action .btn {
  pointer-events: none; /* the whole card is the click target */
}
.app-download-card-standalone { pointer-events: auto; cursor: default; }
.app-download-card-standalone:hover { border-color: var(--border); transform: none; }
.app-download-card-standalone .app-download-action .btn { pointer-events: auto; }
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
}
.app-download-icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-download-icon img { width: 40px; height: 40px; }
.app-download-copy { flex: 1; min-width: 0; }
.app-download-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-2);
}
.app-download-copy h3 { margin: 0 0 var(--space-2); font-size: var(--text-2xl); }
.app-download-copy p { color: var(--text-muted); margin: 0; max-width: 56ch; }
.app-download-action { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.app-download-action .btn svg { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }
.app-download-meta { font-size: var(--text-xs); color: var(--text-dim); text-align: center; }

/* The homepage teaser links out to /download for the full pitch, so it
   only needs to read at a glance — smaller than the standalone page's
   version of the same card. */
.app-download-card-compact { gap: var(--space-5); padding: var(--space-5) var(--space-6); }
.app-download-card-compact .app-download-icon { width: 48px; height: 48px; }
.app-download-card-compact .app-download-icon img { width: 26px; height: 26px; }
.app-download-card-compact .app-download-copy h3 { font-size: var(--text-lg); margin-bottom: 4px; }
.app-download-card-compact .app-download-copy p { font-size: var(--text-sm); max-width: 46ch; }
.app-download-card-compact .app-download-eyebrow { display: none; }
.app-download-card-compact .app-download-action .btn { padding: 10px 18px; font-size: var(--text-sm); }
.app-download-card-compact .app-download-action .btn svg { width: 15px; height: 15px; }
.app-download-smartscreen {
  max-width: 640px;
  margin: var(--space-4) auto 0;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
}
.app-download-smartscreen strong { color: var(--text); }

@media (max-width: 760px) {
  .app-download-card { flex-direction: column; text-align: center; }
  .app-download-copy p { max-width: none; }
}

/* ================= SITE FOOTER ================= */
.site-footer {
  margin-top: auto; /* sticky footer */
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
}
:root[data-theme="light"] .site-footer { background: rgba(0, 0, 0, 0.012); }
.footer-grid {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
  gap: var(--space-8);
  padding: var(--space-10) var(--space-6) var(--space-6);
}
.footer-brand-row { display: flex; align-items: center; gap: 9px; }
.footer-brand strong { font-family: var(--font-mono); font-size: var(--text-lg); color: var(--text-bright); }
.footer-brand p { color: var(--text-muted); margin-top: var(--space-3); max-width: 34ch; font-size: var(--text-md); }
.footer-status { display: flex; align-items: center; gap: 7px; margin-top: var(--space-3); font-size: var(--text-xs); color: var(--text-dim); text-decoration: none; transition: color 0.16s var(--ease-out); }
.footer-status:hover { color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.footer-col h4 {
  font-family: var(--font-mono);
  margin: 0 0 var(--space-2);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 500;
}
.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-md);
  padding: 3px 0;
  transition: color 0.16s var(--ease-out);
}
.footer-col a:hover { color: var(--text-bright); }
.footer-disclaimer {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-6) var(--space-8);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  border-top: 1px solid var(--border);
}

/* Sits alone in its own strip below the disclaimer — every page's footer
   gets one, filled in by assets/js/locale.js so a new language is a one-line
   change there instead of an edit to every page. */
.lang-switch {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-8);
}
.lang-switch-widget { position: relative; display: inline-block; }
.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
}
.lang-switch-btn:hover,
.lang-switch-widget.is-open .lang-switch-btn { color: var(--text-bright); border-color: var(--border-hi); }
.lang-switch-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-switch-btn svg {
  width: 11px;
  height: 11px;
  flex: none;
  transition: transform 0.15s var(--ease-out);
}
.lang-switch-widget.is-open .lang-switch-btn svg { transform: rotate(180deg); }
/* position: fixed and appended to <body> (not inside .lang-switch-widget)
   on purpose — left/top/bottom set from JS via the button's own
   getBoundingClientRect(). This is the one thing that survives opening the
   widget inside a scrolling container like the account modal's
   .acct-modal-body: an absolutely-positioned list there gets clipped the
   moment it crosses that container's edge, no matter the z-index. */
.lang-switch-list {
  position: fixed;
  /* Above .acct-modal (z-index: 300) — this list is meant to render on top
     of the account modal when opened from its Preferences row. */
  z-index: 320;
  width: max-content;
  max-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface-solid);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.lang-switch-list[hidden] { display: none; }
.lang-switch-option {
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}
.lang-switch-option:hover { background: var(--surface-alt); color: var(--text-bright); }
.lang-switch-option.is-active { background: var(--surface-hi); color: var(--text-bright); }

/* Offer-once banner from assets/js/locale.js — bottom-anchored so it never
   pushes page content around or covers the header/nav. */
.lang-banner {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  transform: translate(-50%, 16px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: calc(100% - var(--space-6) * 2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  /* --surface is a ~2.5% tint meant to sit over the page's own solid
     background — fine for a card in normal flow, but this banner floats
     fixed on top of whatever's scrolled behind it, so that tint alone read
     as see-through. --bg-subtle (same token the account modal uses) is
     genuinely opaque. */
  background: var(--bg-subtle);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.lang-banner.is-open { opacity: 1; transform: translate(-50%, 0); }
.lang-banner-text { color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; }
.lang-banner-text strong { color: var(--text-bright); }
.lang-banner-close {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.lang-banner-close:hover { color: var(--text-bright); }
@media (max-width: 640px) {
  .lang-banner { flex-wrap: wrap; justify-content: center; text-align: center; }
  .lang-banner-text { white-space: normal; }
}

/* ================= MOBILE NAV ================= */
.nav-toggle {
  display: none;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle svg { width: 17px; height: 17px; }
.nav-toggle .icon-close { display: none; }
.site-header.is-open .nav-toggle .icon-open { display: none; }
.site-header.is-open .nav-toggle .icon-close { display: block; }

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-header { position: sticky; gap: var(--space-3); }
  .nav-toggle { display: flex; }
  .site-header .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: var(--space-3);
    background: rgba(8, 8, 10, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
  }
  :root[data-theme="light"] .site-header .nav-links { background: rgba(247, 247, 246, 0.98); }
  .site-header.is-open .nav-links { display: flex; }
  .site-header .nav-links li { width: 100%; }
  .site-header .nav-links a { display: block; width: 100%; padding: 11px 10px; border-radius: var(--radius-sm); }
  .site-header .nav-links a:hover { background: var(--surface); }
  .site-header > .btn { margin-left: auto; }
}

@media (max-width: 520px) {
  .site-header > .btn { display: none; }
  .site-header > #dashboardLink {
    display: inline-flex;
    width: 34px;
    height: 34px;
    margin-left: auto;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  .site-header > #dashboardLink::before {
    content: "↗";
    font-size: 1.1rem;
    line-height: 1;
  }
  .site-header > #loginBtn {
    display: inline-flex;
    width: 34px;
    height: 34px;
    margin-left: 0;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  .site-header > #loginBtn::before {
    content: "↪";
    font-size: 1.1rem;
    line-height: 1;
  }
  /* The logged-in profile control stays (unlike the CTA buttons above) —
     logging out should still be reachable on mobile — just compacted down
     to avatar+chevron so a long username can't push the header wider than
     the viewport next to the brand and hamburger toggle. */
  .site-header .user-menu-trigger span { display: none; }
  .site-header .user-menu-trigger { padding: 4px; gap: 0; }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .bento .span-3, .bento .span-4 { grid-column: span 2; }
}
@media (max-width: 620px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================= PAGE HEAD (subpages) ================= */
/* Replaces a full hero band on secondary pages — a page title sitting
   directly on the grid backdrop, the way aboutcapy's inner pages just start
   with an <h1> rather than a promotional banner. */
.page-head {
  padding: clamp(2.5rem, 6vw, 4rem) 0 var(--space-8);
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: var(--text-4xl); margin: 0; }
.page-head > p { color: var(--text-muted); margin-top: var(--space-3); font-size: var(--text-lg); }

.category-nav { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; margin-top: var(--space-6); }
.category-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--surface);
  border: 1px solid var(--border-hi);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.category-nav a:hover { border-color: var(--accent); color: var(--text-bright); transform: translateY(-2px); }

/* ================= FEATURES PAGE ================= */
.feature-page { padding-top: var(--space-12); }
.feature-block { margin-bottom: var(--space-16); scroll-margin-top: 90px; }
.feature-block-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.feature-block-head h2 { margin: 0 0 var(--space-1); font-size: var(--text-2xl); }
.feature-block-head p { margin: 0; font-size: var(--text-md); }
.feature-block-head .feature-icon { margin-bottom: 0; flex-shrink: 0; }
.feature-detail h3 { margin: 0 0 var(--space-2); font-size: var(--text-base); font-family: var(--font-display); }
.feature-detail p { margin: 0; color: var(--text-muted); font-size: var(--text-md); }
.feature-detail code { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text); }
.feature-detail .feature-tags { margin-top: var(--space-4); padding-top: 0; }

/* ================= WIKI / COMMANDS PAGES (mirrored onto the homepage) ================= */
.commands-page { width: 100%; padding: var(--space-12) var(--space-6) var(--space-24); max-width: 940px; margin: 0 auto; }
.category-section { margin-bottom: var(--space-16); scroll-margin-top: 90px; }
.category-section h2 {
  font-size: var(--text-2xl);
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.category-section h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.command-card { scroll-margin-top: 90px; }
.command-card h3 { margin: 0; font-family: var(--font-mono); font-size: var(--text-base); font-weight: 500; color: var(--text-bright); letter-spacing: 0; }
.command-card > p { color: var(--text-muted); margin: var(--space-2) 0 0; }
/* Wide content (the 4-column option table) scrolls inside its own
   container on narrow viewports instead of pushing the whole page wider
   than the screen. */
.table-scroll { width: 100%; overflow-x: auto; }
.opt-table { width: 100%; border-collapse: collapse; margin-top: var(--space-4); font-size: var(--text-md); }
.opt-table th, .opt-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.opt-table th { color: var(--text-dim); font-weight: 700; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.07em; }
.opt-table td { color: var(--text-muted); }
.opt-table tr:last-child td { border-bottom: none; }
.opt-table code, .command-card .hint code { color: var(--text-bright); }

.wiki-page { width: 100%; padding: var(--space-12) var(--space-6) var(--space-24); max-width: 1000px; margin: 0 auto; }
.wiki-card { text-decoration: none; display: flex; flex-direction: column; gap: var(--space-2); }
.wiki-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-2);
}
.wiki-icon svg { width: 21px; height: 21px; stroke: var(--text) !important; }
.wiki-card h3 { margin: 0; font-size: var(--text-lg); }
.wiki-card p { margin: 0; color: var(--text-muted); font-size: var(--text-md); }

.category-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.category-pill {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  background: var(--surface-alt);
  border: 1px solid var(--border-hi);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.category-pill:hover { border-color: var(--accent); color: var(--text-bright); transform: translateY(-2px); }

/* ================= UPDATES ================= */
.updates-list { width: 100%; padding: var(--space-12) var(--space-6) var(--space-24); max-width: 760px; margin: 0 auto; }
.update-card { margin-bottom: var(--space-5); }
.news-detail, .news-comments { width: 100%; max-width: 100%; box-sizing: border-box; }
/* The whole card is the link, but the anchor is the title: a post body can
   contain links, and anchors cannot nest. .news-title::after covers the card
   so clicking anywhere on it opens the post. */
.news-card { display: block; position: relative; color: inherit; transition: border-color 160ms ease, transform 160ms ease; }
.news-card:hover { border-color: var(--text-bright); transform: translateY(-2px); }
.news-title { color: inherit; text-decoration: none; }
.news-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
/* Anything in the card that is its own control stays above that cover. */
.news-card .news-person, .news-card .news-more { position: relative; z-index: 1; }
/* Links inside the teaser are part of the excerpt, not destinations - the
   card is where the click goes. */
.news-preview a { color: var(--text-bright); text-decoration: none; pointer-events: none; }
.update-card time { color: var(--text-dim); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.update-card h3 { margin: var(--space-2) 0 var(--space-3); font-size: var(--text-xl); }
.update-card > div { color: var(--text-muted); }
.update-card a { color: var(--text-bright); }
.news-detail-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.news-back { display: inline-block; }
.news-detail h2 { margin: 0 0 var(--space-4); }
.news-byline { color: var(--text-muted); margin-bottom: var(--space-2); }
.news-collaborators { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; margin-bottom: var(--space-5); color: var(--text-muted); }
.news-person { display: inline-flex; align-items: center; gap: .45rem; margin-right: .75rem; }
.news-person img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.news-person-compact { gap: .3rem; margin-right: 0; font-size: var(--text-sm); }
.news-person-compact img { width: 20px; height: 20px; }
.news-person-compact .news-badge { display: none; }
.news-badge { display: inline-block; margin-left: .35rem; padding: .1rem .35rem; border: 1px solid var(--border); border-radius: 3px; color: var(--text-dim); font-size: var(--text-xs); }
.news-content .news-line { display: block; margin: 0 0 var(--space-3); line-height: 1.65; }
.news-content .news-break { display: block; height: var(--space-3); }
.news-content blockquote { border-left: 3px solid var(--text-dim); margin: 0 0 var(--space-3); padding-left: var(--space-4); color: var(--text-muted); }
.news-content code { padding: .1rem .3rem; border-radius: 3px; background: var(--surface-2); font-family: var(--font-mono); }
.news-actions { display: flex; gap: var(--space-3); margin: var(--space-6) 0; }
.news-actions button { min-width: 116px; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease; }
.news-actions .news-vote { min-width: 58px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
.news-actions .news-vote svg { width: 15px; height: 15px; fill: currentColor; }
.news-vote-status { min-width: 92px; color: var(--text-dim); font-size: var(--text-xs); align-self: center; }
.news-actions button:hover { transform: translateY(-1px); }
.news-actions button:active { transform: translateY(0); }
.news-actions button.is-selected { border-color: var(--border-hi); background: var(--surface-hi); color: var(--text-bright); }
.news-actions button.is-pending { opacity: .6; pointer-events: none; }
.news-person { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.news-person:hover { color: var(--text-bright); }
.profile-pop { background: #08080a; }
.news-badge svg { width: 10px; height: 10px; vertical-align: -1px; }
.news-comments { margin-top: var(--space-6); }
.news-comments h2 { margin: 0 0 var(--space-5); }
.news-comment { border-bottom: 1px solid var(--border); padding: var(--space-4) 0; }
.news-comment time { margin-left: .5rem; }
.news-comment p { margin: var(--space-2) 0 0; }
.news-comments form { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
@media (max-width: 520px) {
  .news-detail-top { align-items: flex-start; flex-direction: column; gap: var(--space-2); }
  .news-collaborators { padding-left: 0; }
}

.subscribe-card {
  max-width: 520px;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.subscribe-icon {
  width: 46px; height: 46px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  display: flex; align-items: center; justify-content: center;
}
.subscribe-icon svg { width: 21px; height: 21px; stroke: var(--text) !important; }
.subscribe-card h3 { margin: 0 0 var(--space-2); font-size: var(--text-xl); }
.subscribe-card .btn { margin-top: var(--space-4); }

/* ================= LEGAL ================= */
.legal { width: 100%; padding: var(--space-10) var(--space-6) var(--space-24); max-width: 760px; margin: 0 auto; }
.legal p, .legal li { color: var(--text-muted); }
.legal h2 { margin-top: var(--space-10); font-size: var(--text-xl); color: var(--text-bright); }
.legal a { color: var(--text-bright); text-decoration-color: var(--border-hi); }
.legal code { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text); }
.legal ul, .legal ol { padding-left: 1.2em; }
.legal li { margin-bottom: var(--space-2); }

/* ================= MOTION ================= */
/* Shared interaction polish across the sites — hover lift on anything
   card-like, a press response on buttons, and a soft entrance for content
   that appears after load. All of it collapses under prefers-reduced-motion
   at the bottom of this block. */
@keyframes fade-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card, .portal-card, .command-card, .wiki-card, .feature-detail, .category-pill {
  transition: border-color 0.22s var(--ease-out), background-color 0.22s var(--ease-out),
    transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}
.card:hover, .command-card:hover, .feature-detail:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.category-pill:hover { transform: translateY(-1px); }

.btn { transition: background-color 0.16s var(--ease-out), border-color 0.16s var(--ease-out), color 0.16s var(--ease-out), transform 0.12s var(--ease-out), box-shadow 0.16s var(--ease-out); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

/* Nav links get an underline that grows from the left rather than snapping in. */
.nav-links a { position: relative; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* Leaderboard rows / log rows stream in instead of appearing all at once. */
.lb-row, .list-row { animation: fade-rise 0.3s var(--ease-out) both; }
.lb-row:nth-child(2), .list-row:nth-child(2) { animation-delay: 0.03s; }
.lb-row:nth-child(3), .list-row:nth-child(3) { animation-delay: 0.06s; }
.lb-row:nth-child(4), .list-row:nth-child(4) { animation-delay: 0.09s; }
.lb-row:nth-child(5), .list-row:nth-child(5) { animation-delay: 0.12s; }
.lb-row:nth-child(n + 6), .list-row:nth-child(n + 6) { animation-delay: 0.15s; }

@media (prefers-reduced-motion: reduce) {
  .card:hover, .command-card:hover, .feature-detail:hover, .category-pill:hover, .btn:hover, .btn:active { transform: none; }
  .nav-links a::after { transition: none; }
  .lb-row, .list-row { animation: none; }
}

/* Partners --------------------------------------------------------------
   Two stacked panels: the (currently empty) list, then the call to action.
   The empty state is centred and generous rather than a thin notice, so the
   page does not read as broken. */
.partner-empty, .partner-cta {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-8) var(--space-7);
  text-align: center;
}

.partner-empty-mark {
  display: block;
  font-size: 2rem;
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}
.partner-empty h2, .partner-cta h2 { margin: 0 0 var(--space-2); }
.partner-empty p, .partner-cta p { margin: 0 auto; max-width: 46ch; color: var(--text-muted); }
.partner-cta .btn { margin-top: var(--space-5); }

/* A future partner list drops straight into this grid. */
/* Capped: one partner should not stretch across the full page width. */
/* One column width for the whole page. The grid used to be capped 60px
   narrower than the block beneath it, so their left edges disagreed. */
.partner-grid,
.partner-cta,
.partner-empty { max-width: 1100px; margin-inline: auto; }
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--space-5);
  /* Separates the list from the call to action below it, which were
     touching with no gap at all. */
  margin-bottom: var(--space-8);
  justify-items: start;
}

/* Page transition ---------------------------------------------------------
   Covers the viewport while a page loads and while navigating away, so a
   click reads as a transition instead of a blank flash. Kept short: a loader
   that outlasts its page is worse than none. */
.page-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  opacity: 1;
  transition: opacity 0.3s ease;
}
.page-loader-overlay.is-done {
  opacity: 0;
  pointer-events: none;
}

.page-loader-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
}
.page-loader-mark svg {
  width: 26px;
  height: 26px;
  fill: var(--text);
  animation: loaderPulse 1.4s ease-in-out infinite;
}
/* The ring is a bordered circle with one edge coloured, spun. Cheaper than an
   SVG stroke animation and it matches the wordmark's diamond. */
.page-loader-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: loaderSpin 0.9s linear infinite;
}
/* Empty and takes no space until a caller passes a message (e.g. locale.js
   switching languages) — most page loads never show any text here. */
.page-loader-text {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 16px;
  white-space: nowrap;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.page-loader-text:empty { display: none; }

@keyframes loaderSpin { to { transform: rotate(360deg); } }
@keyframes loaderPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1); }
}

/* In-page busy state, for work with no page load behind it (opening a module
   pane). The target dims and shows the same ring. */
.is-busy {
  position: relative;
  pointer-events: none;
}
.is-busy > * { opacity: 0.35; transition: opacity 0.15s ease; }
.is-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: loaderSpin 0.75s linear infinite;
}

/* An overlay that cannot animate away is a trap, so reduced-motion drops the
   whole thing rather than showing a static block. */
@media (prefers-reduced-motion: reduce) {
  .page-loader-overlay { display: none; }
  .is-busy::after { animation: none; }
  .is-busy > * { opacity: 1; }
  .is-busy { pointer-events: auto; }
}

/* Early supporter claim page ----------------------------------------------------
   One card, centred, doing one job. Deliberately celebratory: it is the
   only page on the site whose whole purpose is to say well done. */
.congrats-card {
  max-width: 620px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(139, 92, 246, 0.12), transparent 62%),
    var(--surface);
  padding: var(--space-8) var(--space-7);
  text-align: center;
}
.congrats-loading { display: grid; place-items: center; gap: var(--space-4); }
.congrats-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: var(--space-4);
}
.congrats-body h1 { margin: 0 0 var(--space-2); font-size: var(--text-3xl); }
.congrats-sub { color: var(--text-muted); margin: 0 auto var(--space-5); max-width: 40ch; }

/* How far into the hundred they were. Purely illustrative, so it is hidden
   from assistive tech rather than announced as data. */
.congrats-meter {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-hi);
  overflow: hidden;
  margin-bottom: var(--space-6);
}
.congrats-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}
.congrats-action { margin-bottom: var(--space-7); }
.congrats-done { color: #7dd3a0; margin-bottom: var(--space-4); }

.congrats-share {
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
}
.congrats-share h2 { font-size: var(--text-lg); margin: 0 0 var(--space-2); }
.congrats-share p { color: var(--text-muted); margin: 0 0 var(--space-4); }
.congrats-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.congrats-copy code {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: var(--text-sm);
  user-select: all;
}

.congrats-empty { display: grid; gap: var(--space-3); justify-items: center; }
.congrats-mark { font-size: 2rem; color: var(--text-dim); }
.congrats-empty h1 { margin: 0; font-size: var(--text-2xl); }
.congrats-empty p { color: var(--text-muted); max-width: 44ch; margin: 0 0 var(--space-4); }

/* Account menu ------------------------------------------------------------
   The dropdown was a single unlabelled "Log out" link in a bare box. It now
   carries the account it belongs to, the plan, and the account actions, so it
   reads as a menu rather than a stray link. */
.user-menu-dropdown { min-width: 236px; padding: 8px; }

.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
}
.user-menu-head img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.user-menu-name {
  font-weight: 600;
  font-size: var(--text-md);
  /* A long username should truncate rather than widen the whole panel. */
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-plan { margin-top: 3px; }

.plan-chip {
  display: inline-block;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hi);
  color: var(--text-muted);
}
.plan-chip.is-loading { opacity: 0.6; }
/* Supporter gets the brand accent, so the difference is visible at a glance
   without needing to read the label. */
.plan-chip.is-supporter {
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.14);
}

.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* Overrides the plain anchor rule above: these are icon + label rows. */
.user-menu-dropdown .user-menu-item {
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.user-menu-dropdown .user-menu-item:hover { background: var(--surface-alt); color: var(--text); }
.user-menu-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.user-menu-item.is-danger { color: #e5a3a3; }
.user-menu-item.is-danger:hover { background: rgba(229, 72, 77, 0.12); color: #ff8b8b; }

/* The caret needs its own selector now that the menu contains other svgs. */
.user-menu-trigger .user-menu-caret { width: 14px; height: 14px; }

/* Plans -----------------------------------------------------------------
   Two cards. Supporter is distinguished with the brand accent and a soft
   glow rather than by making Free look deficient: the free tier is the
   product, so it should not read as the punishment option. */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-5);
  max-width: 880px;
  margin: 0 auto var(--space-8);
}
.plan-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
}
.plan-card.is-supporter {
  border-color: rgba(139, 92, 246, 0.4);
  background:
    radial-gradient(130% 80% at 50% 0%, rgba(139, 92, 246, 0.14), transparent 60%),
    var(--surface);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.12), 0 18px 50px -24px rgba(139, 92, 246, 0.55);
}
.plan-card.is-current { outline: 1px solid var(--border-hi); }
/* The flag sits in the border, so the card it labels needs room for it or
   it lands on top of the heading. */

/* Inline, not floated over the border. Absolute positioning put it on
   top of the plan name at every width. */
.plan-flag {
  display: inline-block;
  margin-bottom: var(--space-3);
  align-self: flex-start;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  color: #0b0b0e;
  background: linear-gradient(90deg, #a78bfa, #8b5cf6);
}
.plan-flag.is-spacer { visibility: hidden; }
.plan-name { margin: 0 0 var(--space-2); font-size: var(--text-xl); }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: var(--space-2); }
.plan-price strong { font-size: var(--text-3xl); line-height: 1; }
.plan-price span { color: var(--text-dim); font-size: var(--text-sm); }
.plan-tagline { color: var(--text-muted); margin: 0 0 var(--space-5); }

.plan-features { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; gap: 10px; }
.plan-features li { display: flex; align-items: flex-start; gap: 10px; font-size: var(--text-sm); }
.plan-features svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.plan-features .is-in { color: var(--text); }
.plan-features .is-in svg { color: #7dd3a0; }
/* Excluded items stay listed rather than hidden, so the difference between
   the plans is legible instead of implied. */
.plan-features .is-out { color: var(--text-dim); }
.plan-features .is-out svg { color: var(--text-dim); }

.plan-action { margin-top: auto; }
.plan-cta { width: 100%; justify-content: center; }
.plan-current {
  display: block;
  text-align: center;
  padding: 10px;
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.plan-fineprint { color: var(--text-dim); font-size: var(--text-xs); margin: 8px 0 0; text-align: center; }

.plans-loading { display: flex; justify-content: center; }

/* Same shape and material as .btn throughout the rest of the site (8px
   radius, --surface background, --border-hi border) rather than an
   unrelated fully-rounded pill — two buttons side by side, not a separate
   widget style. */
.plan-interval-toggle {
  display: flex;
  gap: 4px;
  max-width: 300px;
  margin: 0 auto var(--space-7);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-sm) + 4px);
  background: var(--surface);
}
.plan-interval-toggle .plan-interval-btn { border-color: transparent; background: transparent; }
.plan-interval-toggle .plan-interval-btn.is-active { background: var(--accent); border-color: var(--accent); }
.plan-interval-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.25;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .1s ease;
}
.plan-interval-btn:hover:not(.is-active) { border-color: var(--accent); background: var(--surface-alt); color: var(--text-bright); }
.plan-interval-btn:active { transform: scale(0.98); }
.plan-interval-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-contrast);
  font-weight: 700;
}
.plan-interval-save { font-size: 11px; font-weight: 500; opacity: .7; }
.plan-interval-btn.is-active .plan-interval-save { opacity: .85; font-weight: 600; }

.plan-price { transition: opacity .15s ease, transform .15s ease; }
.plan-price.is-swapping { opacity: 0; transform: translateY(3px); }

.plan-note {
  max-width: 880px;
  margin: 0 auto var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-6);
}
.plan-note h2 { margin: 0 0 var(--space-2); font-size: var(--text-lg); }
.plan-note p { color: var(--text-muted); margin: 0 0 var(--space-3); }
.plan-note p:last-child { margin-bottom: 0; }

/* Settings + badges -----------------------------------------------------
   A badge states what it is, why it was earned and when. A bare icon with a
   name means nothing to someone who has forgotten how they got it. */
.settings-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}
.settings-panel h2 { margin: 0 0 var(--space-3); font-size: var(--text-lg); }
.settings-panel > p:last-child { margin-bottom: 0; }

.settings-identity { display: flex; align-items: center; gap: var(--space-4); }
.settings-identity img { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--border-hi); }
.settings-identity h2 { margin: 0 0 2px; }
.settings-identity code { font-size: var(--text-xs); }

.settings-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.settings-plan-actions { display: flex; gap: 8px; }
.settings-empty { display: grid; justify-items: center; gap: var(--space-3); text-align: center; padding: var(--space-8) 0; }

.badge-grid { display: grid; gap: var(--space-4); }
.badge-card {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  background: var(--surface-alt);
  padding: var(--space-4);
}
.badge-medal {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.badge-medal svg { width: 20px; height: 20px; }
/* Each badge gets its own colour so they are distinguishable at leaderboard
   size, where the label is not shown. */
.badge-card.is-supporter .badge-medal { color: #c4b5fd; border-color: rgba(139,92,246,0.45); background: rgba(139,92,246,0.14); }
.badge-card.is-early .badge-medal { color: #7dd3a0; border-color: rgba(125,211,160,0.4); background: rgba(125,211,160,0.12); }
.badge-title { font-weight: 600; margin-bottom: 2px; }
.badge-reason { color: var(--text-muted); font-size: var(--text-sm); margin: 0 0 4px; }
.badge-date { color: var(--text-dim); font-size: var(--text-xs); margin: 0; }

/* Leaderboard badges + hover card ---------------------------------------
   Inline badges next to a name, and a card on hover with the live Discord
   avatar and the full badge list. */
.lb-badges { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.lb-badge {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.lb-badge svg { width: 10px; height: 10px; }
.lb-badge.is-supporter { color: #c4b5fd; border-color: rgba(139,92,246,0.45); background: rgba(139,92,246,0.16); }
.lb-badge.is-early { color: #7dd3a0; border-color: rgba(125,211,160,0.4); background: rgba(125,211,160,0.14); }

.profile-pop {
  position: fixed;
  z-index: 200;
  width: 268px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md, 14px);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.profile-pop.is-open { opacity: 1; transform: translateY(0); }
.profile-pop-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-3); }
.profile-pop-head img { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); }
.profile-pop-name { font-weight: 600; }
.profile-pop-id { color: var(--text-dim); font-size: var(--text-xs); }
.profile-pop-badges { display: grid; gap: 8px; }
.profile-pop-badge { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--text-muted); }
.profile-pop-badge .lb-badge { width: 20px; height: 20px; }
.profile-pop-badge .lb-badge svg { width: 12px; height: 12px; }
.profile-pop-none { color: var(--text-dim); font-size: var(--text-xs); }

@media (prefers-reduced-motion: reduce) { .profile-pop { transition: none; } }

/* Account modal, logout veil, spacing corrections ------------------------- */

.acct-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.acct-modal.is-open { opacity: 1; }

.acct-modal-card {
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.18s ease;
}
.acct-modal.is-open .acct-modal-card { transform: none; }

.acct-modal-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.acct-modal-head img {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-hi); flex-shrink: 0;
}
.acct-modal-name { font-weight: 600; }
.acct-modal-id { color: var(--text-dim); font-size: var(--text-xs); }
.acct-modal-x {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 26px; line-height: 1;
  padding: 0 4px; transition: color 0.15s ease;
}
.acct-modal-x:hover { color: var(--text); }

/* A subbar under the header: one tab per section, instead of one long
   scroll. Every tab's data still starts loading the instant the modal
   opens (see user-menu.js), so switching tabs is never itself a wait. */
.acct-tabs {
  display: flex;
  gap: 4px;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.acct-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.acct-tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.acct-tab:hover { color: var(--text); }
.acct-tab.is-active { color: var(--text); border-bottom-color: #8b5cf6; }

/* The body scrolls, the header and footer do not, so Save is always reachable
   however many badges someone has. */
.acct-modal-body { overflow-y: auto; padding: var(--space-6); }
.acct-section { margin-bottom: var(--space-6); }
.acct-section:last-child { margin-bottom: 0; }
.acct-section h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.acct-subhead {
  margin: var(--space-5) 0 var(--space-3);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.acct-section .acct-subhead:first-child { margin-top: 0; }
.acct-muted { margin: 0; font-size: var(--text-sm); }
.acct-plan-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
}

.acct-invoice-list { display: flex; flex-direction: column; gap: 2px; }
.acct-invoice-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.acct-invoice-row:last-child { border-bottom: none; }
.acct-invoice-date { flex: 1; color: var(--text-muted); }
.acct-invoice-amount { font-family: var(--font-mono); font-weight: 600; }
.acct-invoice-status {
  font-size: var(--text-xs);
  text-transform: capitalize;
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.acct-invoice-status.is-paid { color: #7dd3a0; border-color: rgba(125, 211, 160, 0.4); }
.acct-invoice-status.is-open { color: #f0b429; border-color: rgba(240, 180, 41, 0.4); }
.acct-invoice-link { color: #c4b5fd; text-decoration: none; font-weight: 500; }
.acct-invoice-link:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .acct-invoice-row { flex-wrap: wrap; }
  .acct-invoice-date { flex-basis: 100%; }
}

.acct-pref {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.acct-pref:last-child { border-bottom: none; padding-bottom: 0; }
.acct-pref span { display: grid; gap: 2px; }
.acct-pref em { font-style: normal; color: var(--text-dim); font-size: var(--text-xs); }
.acct-pref input { width: 17px; height: 17px; flex-shrink: 0; accent-color: #8b5cf6; }

.acct-modal-foot {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.acct-foot-right { margin-left: auto; display: flex; gap: 8px; }
.acct-saved { color: #7dd3a0; font-size: var(--text-xs); width: 100%; text-align: right; }
.acct-app-version {
  margin: 0;
  padding: var(--space-2) var(--space-6) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-align: center;
}

/* Logout ------------------------------------------------------------------
   Signing out ends the session, so it gets a moment of acknowledgement
   rather than an abrupt reload. */
.logout-veil {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.logout-veil.is-open { opacity: 1; }
.logout-mark { display: grid; justify-items: center; gap: var(--space-4); color: var(--text); }
.logout-mark svg { width: 32px; height: 32px; animation: logoutSlide 0.9s ease-in-out infinite; }
.logout-mark p { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
@keyframes logoutSlide {
  0%, 100% { transform: translateX(-3px); opacity: 0.55; }
  50%      { transform: translateX(3px);  opacity: 1; }
}

/* A saved "reduce motion" preference must win over the site's own defaults,
   which is what the class on <html> is for. */
.force-reduce-motion *,
.force-reduce-motion *::before,
.force-reduce-motion *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

@media (prefers-reduced-motion: reduce) {
  .acct-modal, .acct-modal-card, .logout-veil { transition: none; }
  .logout-mark svg { animation: none; }
}

/* Spacing ----------------------------------------------------------------
   Panels were butting into each other and into their own borders. These set
   consistent internal padding and outer rhythm rather than relying on each
   component to remember. */
.section { padding-block: var(--space-7); }
.page-head { padding-block: var(--space-7) var(--space-6); }

.card, .settings-group, .pane {
  /* A border with content pressed against it reads as broken, which is what
     several panels were doing. */
  padding: var(--space-6);
}
.settings-group + .settings-group { margin-top: var(--space-5); }
.pane > h2 { margin: 0 0 var(--space-5); }
.pane-grid { gap: var(--space-6); }

.field { margin-bottom: var(--space-5); }
.field:last-child { margin-bottom: 0; }
.field label { display: block; margin-bottom: 8px; }
.hint { margin: 8px 0 0; }

.toggle-field { padding-block: var(--space-3); }

@media (max-width: 640px) {
  .card, .settings-group, .pane { padding: var(--space-5); }
  .acct-modal { padding: var(--space-3); }
  .acct-modal-head, .acct-modal-body, .acct-modal-foot { padding-inline: var(--space-5); }
}

/* Profile popup, opened by clicking a leaderboard row. */
.lb-row.is-clickable { cursor: pointer; }
.profile-pop { pointer-events: auto; }
.profile-pop-badge { align-items: flex-start; gap: 10px; }
.profile-pop-badge strong { display: block; color: var(--text); font-size: var(--text-sm); }
.profile-pop-reason { display: block; color: var(--text-dim); font-size: var(--text-xs); margin-top: 2px; }
.profile-pop-badges { gap: 12px; }

/* The Settings entry is a button (it opens a modal) sitting among links, so
   it inherits the browser's button chrome unless it is reset to match. */
/* Only what a <button> needs on top of the shared item styling above: the
   browser gives it its own background, border, font and centred text. */
.user-menu-dropdown button.user-menu-item {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.user-menu-dropdown button.user-menu-item:focus-visible { outline: 2px solid var(--border-hi); outline-offset: -2px; }

/* Default checkboxes are a bright white square against a dark panel. These
   are drawn to match the rest of the UI. */
.acct-pref input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: var(--surface-hi);
  position: relative;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.acct-pref input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.16s ease, background 0.16s ease;
}
.acct-pref input[type="checkbox"]:checked {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.6);
}
.acct-pref input[type="checkbox"]:checked::after {
  transform: translateX(18px);
  background: #c4b5fd;
}
.acct-pref input[type="checkbox"]:focus-visible { outline: 2px solid var(--border-hi); outline-offset: 2px; }

/* Section headings inside the modal were flush against the panel edge on the
   left because the body padding was the only inset. */
.acct-section h3 { margin-top: 0; }
.acct-modal-body > .acct-section + .acct-section { padding-top: var(--space-5); border-top: 1px solid var(--border); }

/* Report form ------------------------------------------------------------
   A single column: every field is required reading, and a two-column form
   invites skipping one. */
.report-form { display: block; }
.report-form textarea { min-height: 140px; resize: none; }
.report-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
/* The remaining-quota line is reassurance, not an instruction, so it sits
   quietly below the action rather than above the fields. */
.report-quota { margin-top: var(--space-4); color: var(--text-dim); }

/* Without JS nothing removes the overlay, so it only covers the page once a
   script has confirmed JS is running. */
html:not(.js) .page-loader-overlay { display: none; }

/* Paused invites --------------------------------------------------------
   Neutralised rather than hidden: someone who came to add the bot needs to
   be told why they cannot, not left hunting for a button that vanished. */
.is-invite-paused {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Server lookup on the report form -------------------------------------- */
.lookup-panel {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  display: grid;
  gap: 8px;
}
.lookup-row { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--text-sm); }
.lookup-row span { color: var(--text-dim); }
.lookup-row strong { font-weight: 600; text-align: right; }
.lookup-row code { font-size: var(--text-xs); }
.lookup-line { margin: 0; font-size: var(--text-sm); }
/* Amber, not red: these are things to double-check, not errors. */
.is-warn { color: #f0b429; }
.is-yes { color: #7dd3a0; }

/* Report strip on the homepage ------------------------------------------
   Quiet on purpose. It has to be findable by someone who was not looking
   for it, without competing with the actual call to action above it. */
.report-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-5) var(--space-6);
}
.report-cta h3 { margin: 0 0 4px; font-size: var(--text-md); }
.report-cta p { margin: 0; color: var(--text-muted); font-size: var(--text-sm); max-width: 60ch; }

/* Partner cards ---------------------------------------------------------
   Banner, icon, live counts and the owner. Everything comes from Discord at
   request time, so these render whatever a partner currently looks like. */
.pt-card {
  /* Capped so a lone partner in a collapsed grid track stays card-sized
     rather than stretching the full 1100px. */
  max-width: 560px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pt-banner {
  /* Discord serves banners at 16:9-ish; this keeps one legible rather than
     cropping it to a strip. */
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}
/* Soft fade at the bottom so the icon that overlaps it has something calm to sit on. */
.pt-body { position: relative; z-index: 1; }
.pt-banner { z-index: 0; }
.pt-banner:not(.is-empty)::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--surface) 70%, transparent));
}
.pt-banner.is-empty { aspect-ratio: auto; height: 120px; }
/* A server with no banner gets the site grid rather than a blank slab. */
.pt-banner.is-empty {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.5;
}
.pt-body {
  padding: var(--space-5) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1;
}
/* flex-end sits the name on the icon's bottom edge. Centring aligned it to
   an element pulled 52px upward, which read as a misaligned heading. */
.pt-head { display: flex; align-items: flex-end; gap: var(--space-4); }
.pt-icon {
  width: 76px; height: 76px; border-radius: 22px; flex-shrink: 0;
  border: 3px solid var(--bg); object-fit: cover;
  /* Pulled up over the banner, the way Discord itself presents a server.
     The thick border is the ring that separates it from the artwork. */
  margin-top: -52px;
  background: var(--bg);
}
.pt-icon-fallback {
  display: grid; place-items: center;
  font-size: var(--text-xl); font-weight: 600; color: var(--text-muted);
  background: var(--surface-hi);
}
.pt-head h3 { margin: 0 0 2px; font-size: var(--text-xl); }
.pt-id { font-size: var(--text-xs); color: var(--text-dim); }
.pt-desc { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }

/* Counts get their own bordered row: they are the thing people scan for,
   and inline text made them disappear into the description. */
.pt-counts {
  display: flex;
  gap: var(--space-5);
  font-size: var(--text-md);
  flex-wrap: wrap;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.pt-counts strong { font-weight: 600; }
.pt-online { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.pt-online i { width: 8px; height: 8px; border-radius: 50%; background: #7dd3a0; display: inline-block; }

.pt-owner { display: flex; align-items: center; gap: 10px; }
.pt-owner img { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); }
.pt-owner span { display: block; color: var(--text-dim); font-size: var(--text-xs); }
.pt-owner strong { display: block; font-size: var(--text-md); }
.pt-join { margin-top: auto; align-self: flex-start; }
.pt-desc + .pt-counts { margin-top: 0; }

/* The server's own description, sitting under its name. */
.pt-tagline {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Operator and partner badges. Each kind gets its own colour so they stay
   distinguishable at leaderboard size, where the label is not shown. */
.badge-card.is-operator .badge-medal,
.lb-badge.is-operator {
  color: #f0b429;
  border-color: rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.14);
}
.badge-card.is-partner .badge-medal,
.lb-badge.is-partner {
  color: #6ec8f5;
  border-color: rgba(110, 200, 245, 0.45);
  background: rgba(110, 200, 245, 0.14);
}
.badge-card.is-voter .badge-medal,
.lb-badge.is-voter {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.14);
}

/* ================= CUSTOM SELECT ================= */
/* A native select's open option list is drawn by the OS and can't be styled —
   it rendered as a white system menu on this dark UI. assets/js/customSelect.js
   keeps the real <select> as the source of truth and draws this listbox over
   it. */
.cs { position: relative; }
.cs-native {
  /* Not display:none — a hidden-but-present select keeps working with
     .value/.dispatchEvent and stays in the accessibility tree. */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-md);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.cs-trigger:hover { border-color: var(--border-hi); }
.cs-trigger[aria-expanded="true"] { border-color: var(--accent); }
.cs-trigger:disabled { opacity: 0.6; cursor: not-allowed; }
.cs-trigger svg { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; transition: transform 0.18s var(--ease-out); }
.cs-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.cs-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-placeholder { color: var(--text-faint); }

.cs-list {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cs-in 0.14s var(--ease-out);
}
@keyframes cs-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cs-search { padding: 8px; border-bottom: 1px solid var(--border); }
.cs-search input { padding: 7px 10px; font-size: var(--text-sm); }
.cs-options { overflow-y: auto; padding: 5px; }
.cs-option {
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-option:hover { background: var(--surface-alt); }
.cs-option.is-selected { background: var(--surface-hi); color: var(--text-bright); font-weight: 600; }
.cs-empty { padding: 12px; text-align: center; color: var(--text-dim); font-size: var(--text-sm); }
@media (prefers-reduced-motion: reduce) { .cs-list { animation: none; } .cs-trigger[aria-expanded="true"] svg { transition: none; } }
.cs-list { background-color: var(--surface-solid); }
/* Dropdown lists are attached to <body> and placed by customSelect.js, so they
   can't be clipped by a scrolling parent. This wins over the earlier
   absolute-position rule and the per-group stacking workaround. */
.cs-list.cs-floating {
  position: fixed;
  right: auto;
  z-index: 10000;
  background-color: var(--surface-solid);
}

/* Discord community card -------------------------------------------------- */
.discord-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--space-8);
  padding: var(--space-8);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg, 18px);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.07), transparent 55%),
    var(--surface-solid);
  overflow: hidden;
}
.discord-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }
.discord-head h2 { margin: 0; font-size: var(--text-3xl); }
.discord-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--surface-alt, #17171b); border: 1px solid var(--border-hi);
}
.discord-icon img { width: 28px; height: 28px; }
.discord-kicker { margin: 0 0 2px; font-family: var(--font-mono, monospace); font-size: var(--text-xs, 12px); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.discord-body { color: var(--text-muted); max-width: 52ch; margin: 0 0 var(--space-5); }
.discord-stats { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-bottom: var(--space-5); color: var(--text-muted); }
.discord-stats strong { color: var(--text-bright, var(--text)); }
.discord-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--text-faint, #6b6b75); }
.discord-dot-online { background: #3ecf8e; box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.18); }
.discord-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); align-content: center; }
.discord-perks li {
  display: grid; gap: 2px; padding: var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-md, 12px);
  background: rgba(255, 255, 255, 0.025);
}
.discord-perks strong { color: var(--text-bright, var(--text)); }
.discord-perks span { color: var(--text-muted); font-size: var(--text-sm); }
@media (max-width: 820px) {
  .discord-card { grid-template-columns: 1fr; padding: var(--space-6); gap: var(--space-6); }
}

/* Homepage: team / vote / report as three equal cards. */
.link-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--space-5); }
.link-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); padding: var(--space-6);
  transition: border-color 0.2s var(--ease-out);
}
.link-card:hover { border-color: var(--border-hi); }
.link-card h3 { margin: 0; font-size: var(--text-md); }
.link-card p { margin: 0; color: var(--text-muted); font-size: var(--text-sm); flex: 1; }
.link-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* Contact address in the footer brand block. */
.footer-email { display: inline-block; margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-muted); text-decoration: none; transition: color 0.16s var(--ease-out); }
.footer-email:hover { color: var(--text-bright, var(--text)); text-decoration: underline; }
.footer-email + .footer-status { margin-top: var(--space-2); }

/* ---- Hero: a single soft light source behind the headline, and the second
   line rendered in a gradient so the pair reads as one designed lockup
   rather than white text with a grey line under it. ---- */
.hero { position: relative; }
.hero::before {
  content: "";
  position: absolute;
  left: -10%;
  top: -20%;
  width: 70%;
  height: 130%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(60% 50% at 30% 40%, rgba(255, 255, 255, 0.07), transparent 70%);
  filter: blur(8px);
}
.hero h1 .muted {
  color: transparent;
  background: linear-gradient(100deg, #8b8b96 0%, #56565e 60%);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero .badge {
  border-color: var(--edge-hi);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}

/* The stat strip is a headline number, so give the numbers room and weight. */
.stat-strip { box-shadow: var(--lift), var(--shadow-soft); }
.stat-num { letter-spacing: -0.03em; }

/* The big closing call to action: lit from below rather than flat. */
.cta-card {
  background:
    radial-gradient(120% 140% at 50% 120%, rgba(255, 255, 255, 0.05), transparent 60%),
    var(--card-bg);
}

/* =====================================================================
   IRIDEX POLISH LAYER
   Iridex's own palette — near-black ground, white accent, colour reserved
   for the few places that already earn it (Supporter, previews, status).
   What this layer adds is depth and rhythm, not hue: surfaces that catch
   light at their top edge, a glass header, heavier headings, and clear
   focus and hover states. A finishing pass over the existing rules, so
   every component keeps its structure.
   ===================================================================== */
:root {
  --edge: rgba(255, 255, 255, 0.09);
  --edge-hi: rgba(255, 255, 255, 0.2);
  --card-bg: #0c0c0f;

  --shadow-near: 0 1px 0 rgba(255, 255, 255, 0.045) inset;
  --shadow-drop: 0 30px 80px -40px rgba(0, 0, 0, 0.95);
  --shadow-bloom: 0 0 60px -24px rgba(255, 255, 255, 0.1);
}

/* ---- Ground: one soft light overhead, no colour cast ---------------- */
body {
  background:
    radial-gradient(95% 55% at 50% -12%, rgba(255, 255, 255, 0.045), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}

/* ---- Type ---------------------------------------------------------- */
h1, .hero h1 { font-weight: 800; letter-spacing: -0.035em; }
h2, .section-title, .page-head h1 { font-weight: 800; letter-spacing: -0.03em; }
h3 { letter-spacing: -0.015em; }

/* ---- Surfaces ------------------------------------------------------ */
.card,
.feature-detail,
.step-card,
.plan-card,
.pt-card,
.link-card,
.discord-card,
.cta-card,
.settings-panel,
.plan-note,
.report-cta,
.hub-section,
.portal-card,
.stat-strip,
.app-download-card,
.lb-columns > div,
.op-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)), var(--card-bg);
  border-color: var(--edge);
  box-shadow: var(--shadow-near), var(--shadow-drop);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.card:hover,
.feature-detail:hover,
.step-card:hover,
.link-card:hover,
.pt-card:hover,
.portal-card:hover,
.app-download-card:hover {
  border-color: var(--edge-hi);
  box-shadow: var(--shadow-near), var(--shadow-drop), var(--shadow-bloom);
}
/* The closing call to action and the community card carry the page, so they
   sit a step brighter than the cards around them. */
.cta-card, .discord-card { border-color: var(--edge-hi); }

/* ---- Buttons: Iridex's own light primary --------------------------- */
.btn-primary, .btn-dark {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 12px 28px -16px rgba(0, 0, 0, 0.95);
}
.btn-primary:hover, .btn-dark:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 16px 34px -16px rgba(0, 0, 0, 1);
}
.btn-light, .btn-outline { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.12); }
.btn-light:hover, .btn-outline:hover {
  border-color: var(--edge-hi);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-bright);
}
.btn { letter-spacing: 0.01em; }

/* ---- Header -------------------------------------------------------- */
.site-header {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
}
.nav-links a:hover { color: var(--text-bright); }
.logo-badge { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 8px 20px -12px rgba(0, 0, 0, 0.9); }

/* ---- Small type ---------------------------------------------------- */
code {
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.92em;
}
pre code { padding: 0; border: 0; background: none; }

/* Contact address in the footer's Legal column: dim grey at rest with a
   faint halo, lighting up on hover — the one spot of glow in the footer, so
   the address reads as an invitation rather than another link in the list. */
.footer-email,
.footer-col a.footer-email {
  display: inline-block;
  margin-top: var(--space-3);
  color: #7c7c86;
  font-size: var(--text-sm);
  text-decoration: none;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
  transition: color 0.22s var(--ease-out), text-shadow 0.22s var(--ease-out);
}
.footer-email:hover,
.footer-col a.footer-email:hover {
  color: var(--text-bright);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.45), 0 0 26px rgba(255, 255, 255, 0.22);
}
:root[data-theme="light"] .footer-email,
:root[data-theme="light"] .footer-col a.footer-email {
  color: #6b6b77;
  text-shadow: 0 0 14px rgba(15, 15, 25, 0.1);
}
:root[data-theme="light"] .footer-email:hover,
:root[data-theme="light"] .footer-col a.footer-email:hover {
  color: #15151c;
  text-shadow: 0 0 10px rgba(15, 15, 25, 0.28);
}

/* ---- Interaction --------------------------------------------------- */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection { background: rgba(255, 255, 255, 0.22); color: var(--text-bright); }

/* ---- Scrollbar ----------------------------------------------------- */
* { scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Light theme --------------------------------------------------- */
:root[data-theme="light"] {
  --card-bg: #ffffff;
  --edge: rgba(15, 15, 20, 0.1);
  --edge-hi: rgba(15, 15, 20, 0.2);
  --shadow-drop: 0 18px 44px -28px rgba(15, 15, 25, 0.35);
  --shadow-near: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --shadow-bloom: 0 0 50px -26px rgba(15, 15, 25, 0.35);
}
:root[data-theme="light"] body {
  background: radial-gradient(95% 55% at 50% -12%, rgba(15, 15, 25, 0.05), transparent 62%), var(--bg);
}
:root[data-theme="light"] .site-header { background: color-mix(in srgb, #fff 78%, transparent); }
:root[data-theme="light"] ::selection { background: rgba(15, 15, 25, 0.16); }

@media (prefers-reduced-motion: reduce) {
  .card, .feature-detail, .step-card, .link-card, .pt-card, .portal-card { transition: none; }
}

/* ---- Footer -------------------------------------------------------- */
/* A quiet slab rather than a continuation of the page: its own dark ground,
   a lit top edge, and one rhythm for every column. */
.site-footer {
  position: relative;
  border-top: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), #0a0a0d;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}
.footer-grid { padding: var(--space-12) var(--space-6) var(--space-8); gap: var(--space-10); }
.footer-brand p { line-height: 1.6; }
.footer-brand-row strong { letter-spacing: 0.02em; }

.footer-col h4 { font-size: 0.68rem; letter-spacing: 0.16em; color: var(--text-faint); margin-bottom: var(--space-3); }
.footer-col a {
  position: relative;
  font-size: var(--text-sm);
  padding: 4px 0;
}
/* A hairline grows in under a link on hover — enough feedback without
   shifting the layout. */
.footer-col a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
  transition: right 0.22s var(--ease-out);
}
.footer-col a:hover::after { right: 0; }
.footer-email::after { display: none; }

/* Status pill: reads as a live indicator, not a stray line of text. */
.footer-status {
  gap: 8px;
  margin-top: var(--space-4);
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  width: fit-content;
}
.footer-status:hover { border-color: var(--edge-hi); color: var(--text); }
.status-dot.online { box-shadow: 0 0 0 3px rgba(125, 211, 160, 0.16); }
.status-dot.offline { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.16); }

.footer-disclaimer { border-top-color: var(--edge); opacity: 0.85; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

:root[data-theme="light"] .site-footer {
  background: linear-gradient(180deg, rgba(15, 15, 25, 0.03), rgba(15, 15, 25, 0)), #f4f4f7;
}
:root[data-theme="light"] .site-footer::before { background: linear-gradient(90deg, transparent, rgba(15, 15, 25, 0.14), transparent); }

/* YouTube alongside the Discord invite in the community card. */
.community-yt { display: inline-flex; align-items: center; gap: 9px; }
.community-yt svg { width: 18px; height: 18px; }
.community-yt:hover { color: var(--text-bright); border-color: var(--edge-hi); }

/* News lists: real bullets instead of lines that begin with a dash. */
.news-content .news-list { margin: 0 0 var(--space-3); padding-left: var(--space-5); display: grid; gap: 6px; }
.news-content .news-list li { line-height: 1.6; }
.news-content .news-list li::marker { color: var(--text-dim); }
.news-content h2 { margin: var(--space-6) 0 var(--space-3); font-size: var(--text-xl); }
.news-content h3 { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-lg); }
.news-content .news-break + h2, .news-content .news-break + h3 { margin-top: var(--space-2); }

/* News list: a preview, not the whole post. The card itself is the link to
   the full story, so "Read more" is a span, not a nested anchor. */
.news-preview {
  position: relative;
  max-height: 260px;
  overflow: hidden;
}
.news-preview.is-clamped::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 90px;
  background: linear-gradient(to bottom, transparent, var(--card-bg));
  pointer-events: none;
}
.news-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-4);
  color: var(--text-bright);
  font-size: var(--text-sm);
  font-weight: 500;
}
.news-more::after { content: "→"; transition: transform 0.16s var(--ease-out); }
.news-card:hover .news-more::after { transform: translateX(3px); }
