/*
  GlobalRiftCss.css | Rift
  Copyright (c) 2026 ModemINC. All rights reserved.
  Rift and ModemINC are trademarks of ModemINC.
  Unauthorized copying, distribution, or modification of this file is prohibited.
*/
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@300;400;500&display=swap');

/* Smooth cross-document page transitions (View Transitions API). Same-origin
   navigations (login → dashboard, etc.) fade between pages. Ignored gracefully on
   browsers that don't support it. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: rift-page-out .22s ease both; }
::view-transition-new(root) { animation: rift-page-in .28s ease both; }
@keyframes rift-page-out { to { opacity: 0; transform: translateY(-6px) scale(.995); } }
@keyframes rift-page-in  { from { opacity: 0; transform: translateY(8px) scale(.995); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

:root {
  /* Dark mode palette (per spec): chrome (rail / channel list / top bar / folder bar)
     = #2C2D32, raised (folder dropdowns/cards) = #393A3F, elevated/empty server icons
     = #44454A, separator lines = #3C3D42, channel text = #999AA0. */
  --bg-void: #2C2D32;   /* server rail */
  --bg-deep: #2C2D32;   /* channel list - same #2C2D32 as the rails */
  --bg-base: #2C2D32;   /* folder rail */
  --bg-surface: #393A3F;
  --bg-raised: #393A3F;
  --bg-elevated: #44454A;
  --bg-hover: #ffffff0a;
  --bg-active: #ffffff14;
  /* Always-opaque panel colour for utility surfaces (admin/discovery) so their
     dense muted-grey text stays readable even over a custom background - this one
     is intentionally NOT made transparent by [data-bg="gradient"]. */
  --bg-admin: #2C2D32;
  /* Chat + members area - lighter than the #2C2D32 rails/sidebar. */
  --bg-chat: #323339;

  --accent: #6c63ff;
  --accent-bright: #7c74ff;
  --accent-dim: #6c63ff33;
  --accent-glow: #6c63ff22;

  --green: #3ba55d;
  --red: #ed4245;
  --yellow: #faa61a;
  --blue: #5865f2;

  --text-primary: #eceef5;
  --text-secondary: #999AA0;
  --text-muted: #72757d;
  --text-link: #7c74ff;

  --border: #3C3D4288;
  --border-strong: #3C3D42;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --shadow-sm: 0 1px 3px #00000045;
  --shadow-md: 0 4px 16px #00000055, 0 1px 4px #00000035;
  --shadow-lg: 0 16px 48px #00000070, 0 4px 12px #00000040;
  --shadow-accent: 0 0 40px #6c63ff18;

  /* Motion - shared easing tokens so every animation feels consistent */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.45, 0.05, 0.25, 1);
}

/* ── THEMES ─────────────────────────────────────────────────────── */
/* The lighter chat is a dark-mode-only touch; other themes keep chat = base. */
[data-theme] { --bg-chat: var(--bg-base); }

[data-theme="light"] {
  --bg-void: #f0f2f5;
  --bg-deep: #ffffff;
  --bg-base: #f5f6fa;
  --bg-surface: #ffffff;
  --bg-raised: #e8eaed80;
  --bg-elevated: #e8eaed;
  --bg-hover: #00000008;
  --bg-active: #00000012;
  --bg-admin: #f0f2f5;
  --text-primary: #060607;
  --text-secondary: #4e5058;
  --text-muted: #80848e;
  --border: #00000012;
  --border-strong: #0000001f;
}

[data-theme="core"] {
  --accent: #06b6d4;
  --accent-bright: #22d3ee;
  --accent-dim: #06b6d433;
  --accent-glow: #06b6d422;
  --text-link: #22d3ee;
  --shadow-accent: 0 0 40px #06b6d428;
  --bg-void: #050d10;
  --bg-deep: #07131a;
  --bg-base: #0c1d24;
  --bg-surface: #11252e;
  --bg-elevated: #152d38;
  --bg-hover: #06b6d410;
  --bg-active: #06b6d420;
  --border: #06b6d420;
  --border-strong: #06b6d435;
}

[data-theme="quantum"] {
  --accent: #a855f7;
  --accent-bright: #c084fc;
  --accent-dim: #a855f733;
  --accent-glow: #a855f722;
  --text-link: #c084fc;
  --shadow-accent: 0 0 40px #a855f728;
  --bg-void: #07050f;
  --bg-deep: #0e0b1a;
  --bg-base: #130f22;
  --bg-surface: #18132c;
  --bg-elevated: #1e1836;
  --bg-hover: #a855f710;
  --bg-active: #a855f720;
  --border: #a855f720;
  --border-strong: #a855f735;
  --quantum-grad-a: #07050f;
  --quantum-grad-b: #1a0a3e;
}

/* ── LOFI VIBES ──────────────────────────────────────────────── */
[data-theme="lofi"] {
  --accent: #f59e0b;
  --accent-bright: #fbbf24;
  --accent-dim: #f59e0b33;
  --accent-glow: #f59e0b22;
  --text-link: #fbbf24;
  --shadow-accent: 0 0 40px #f59e0b28;
  --bg-void: #0f0d09;
  --bg-deep: #1a1610;
  --bg-base: #211d14;
  --bg-surface: #28231a;
  --bg-elevated: #302a1f;
  --bg-hover: #f59e0b10;
  --bg-active: #f59e0b20;
  --border: #f59e0b18;
  --border-strong: #f59e0b28;
}

/* ── CRIMSON MOON ───────────────────────────────────────────── */
[data-theme="crimson"] {
  --accent: #e11d48;
  --accent-bright: #f43f5e;
  --accent-dim: #e11d4833;
  --accent-glow: #e11d4822;
  --text-link: #f43f5e;
  --shadow-accent: 0 0 40px #e11d4828;
  --bg-void: #0f0509;
  --bg-deep: #1a0810;
  --bg-base: #220d17;
  --bg-surface: #2b1020;
  --bg-elevated: #34152a;
  --bg-hover: #e11d4810;
  --bg-active: #e11d4820;
  --border: #e11d4820;
  --border-strong: #e11d4835;
}

/* ── MIDNIGHT PURPLE ─────────────────────────────────────────── */
[data-theme="midnight"] {
  --accent: #7c3aed;
  --accent-bright: #8b5cf6;
  --accent-dim: #7c3aed33;
  --accent-glow: #7c3aed22;
  --text-link: #8b5cf6;
  --shadow-accent: 0 0 40px #7c3aed28;
  --bg-void: #06040f;
  --bg-deep: #0c0820;
  --bg-base: #100c2a;
  --bg-surface: #150f35;
  --bg-elevated: #1c1442;
  --bg-hover: #7c3aed10;
  --bg-active: #7c3aed20;
  --border: #7c3aed20;
  --border-strong: #7c3aed35;
}

/* ── FOREST ──────────────────────────────────────────────────── */
[data-theme="forest"] {
  --accent: #16a34a;
  --accent-bright: #22c55e;
  --accent-dim: #16a34a33;
  --accent-glow: #16a34a22;
  --text-link: #22c55e;
  --shadow-accent: 0 0 40px #16a34a28;
  --bg-void: #040d08;
  --bg-deep: #071510;
  --bg-base: #0b1d14;
  --bg-surface: #0f261b;
  --bg-elevated: #142e22;
  --bg-hover: #16a34a10;
  --bg-active: #16a34a20;
  --border: #16a34a20;
  --border-strong: #16a34a35;
}

/* ── CANDY ───────────────────────────────────────────────────── */
[data-theme="candy"] {
  --accent: #ec4899;
  --accent-bright: #f472b6;
  --accent-dim: #ec489933;
  --accent-glow: #ec489922;
  --text-link: #f472b6;
  --shadow-accent: 0 0 40px #ec489928;
  --bg-void: #0f070d;
  --bg-deep: #1a0d16;
  --bg-base: #22101d;
  --bg-surface: #2a1425;
  --bg-elevated: #34192e;
  --bg-hover: #ec489910;
  --bg-active: #ec489920;
  --border: #ec489920;
  --border-strong: #ec489935;
}

/* ── CUSTOM (user gradient) ─────────────────────────────────── */
[data-theme="core"] #riftQuantumBg,
[data-theme="custom"] #riftQuantumBg,
[data-theme="quantum"] #riftQuantumBg { display: block; }
#riftQuantumBg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at top left, var(--quantum-grad-b, #1a0a3e) 0%, var(--quantum-grad-a, #07050f) 60%);
  pointer-events: none;
  overflow: hidden;
}

@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --bg-void: #f0f2f5;
    --bg-deep: #ffffff;
    --bg-base: #f5f6fa;
    --bg-surface: #ffffff;
    --bg-raised: #e8eaed80;
    --bg-elevated: #e8eaed;
    --bg-hover: #00000008;
    --bg-active: #00000012;
    --text-primary: #060607;
    --text-secondary: #4e5058;
    --text-muted: #80848e;
    --border: #00000012;
    --border-strong: #0000001f;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; outline: none; }
input, textarea { font-family: var(--font-body); outline: none; }

::selection { background: var(--accent-dim); color: var(--text-primary); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Shared utility classes */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-primary:hover { background: var(--accent-bright); transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-dim); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }

.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
}
.btn-danger:hover { filter: brightness(1.1); }

.input-field {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-void);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.logo-mark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.5px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}



/* --- Pricing & Themes --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 800px;
  margin: 40px auto;
  padding: 0 16px;
}
.pricing-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.quantum::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #ff512f, #f09819);
}
.pricing-card.core::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #5865f2, #9b59b6);
}
.pricing-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.pricing-price { font-size: 40px; font-weight: 800; margin: 16px 0; }
.pricing-price span { font-size: 16px; font-weight: 400; color: var(--text-secondary); }
.pricing-features { list-style: none; margin: 16px 0 24px; flex: 1; }
.pricing-features li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.pricing-features li::before { content: '✓'; color: var(--green); font-weight: bold; }

/* --- Comparison Table --- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  background: var(--bg-base);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.comparison-table th, .comparison-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.comparison-table th { background: var(--bg-surface); color: var(--text-primary); font-weight: 600; }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table .check { color: var(--green); font-weight: bold; }
.comparison-table .cross { color: var(--text-muted); }

/* --- Reviews Section --- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.review-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--bg-hover); display: flex; align-items: center; justify-content: center; font-weight: bold; }
.review-author { font-weight: 600; color: var(--text-primary); }
.review-role { font-size: 12px; color: var(--text-muted); }
.review-quote { font-style: italic; color: var(--text-secondary); line-height: 1.5; }

/* --- Multi-step Form Logic --- */
.form-step { display: none; }
.form-step.active { display: block; animation: fadeUp 0.3s ease; }
.step-nav { display: flex; gap: 12px; margin-top: 20px; }
.age-warning { color: var(--yellow); font-size: 12px; margin-top: 4px; display: none; }

/* ── GRADIENT BACKGROUND - must be last to override all theme rules ── */
[data-bg="gradient"] {
  /* Semi-transparent versions of the #2C2D32 palette so a custom background shows
     through every panel (chat + member list use --bg-chat, so it must be here too).
     Kept LIGHT so the image shows through vividly instead of behind a heavy grey veil
     - the panels are just a faint tint now, not a wash. */
  --bg-void:     rgba(44, 45, 50, 0.34);
  --bg-deep:     rgba(44, 45, 50, 0.34);
  --bg-base:     rgba(44, 45, 50, 0.34);
  --bg-chat:     rgba(49, 51, 56, 0.34);
  --bg-surface:  rgba(57, 58, 63, 0.42);
  --bg-elevated: rgba(68, 69, 74, 0.46);
  --bg-raised:   rgba(57, 58, 63, 0.30);
  --bg-hover:    rgba(255, 255, 255, 0.07);
  --bg-active:   rgba(255, 255, 255, 0.12);
}
/* The floating user panel + voice bar stay (nearly) opaque even over a custom
   background, so channels never bleed through them. */
[data-bg="gradient"] .user-panel,
[data-bg="gradient"] .voice-bar { background-color: rgba(57, 58, 63, 0.97) !important; }
/* Custom "full paint" theme: the user panel + voice bar follow the tinted palette
   instead of the neutral-grey override above. Use the near-opaque elevated tint so
   channels never bleed through them, and they read as the theme colour. */
body.custom-paint .user-panel,
body.custom-paint .voice-bar { background-color: var(--bg-elevated) !important; }
/* Popups (profile card, menus) read as the theme COLOUR - nearly opaque tinted - while
   the main app panels stay see-through so the gradient shows through them. */
body.custom-paint .profile-popup,
body.custom-paint #customThemePanel { background-color: var(--bg-elevated) !important; }

/* Light mode with gradient bg - semi-transparent light surfaces (lighter veil so the
   image shows through, matching dark mode). */
[data-theme="light"][data-bg="gradient"] {
  --bg-void:     rgba(240, 242, 245, 0.48);
  --bg-deep:     rgba(255, 255, 255, 0.54);
  --bg-base:     rgba(245, 246, 250, 0.48);
  --bg-surface:  rgba(255, 255, 255, 0.56);
  --bg-elevated: rgba(232, 234, 237, 0.54);
  --bg-raised:   rgba(232, 234, 237, 0.38);
  --bg-hover:    rgba(0, 0, 0, 0.05);
  --bg-active:   rgba(0, 0, 0, 0.09);
  --text-primary: #060607;
  --text-secondary: #4e5058;
  --text-muted: #80848e;
}

/* ── Sidebar text legibility on custom / gradient / light backgrounds ──────────
   Channel & category names use muted gray, which blends into busy, gray or
   light backgrounds (the sidebar goes semi-transparent over a custom background).
   Boost their contrast and add an outline whose colour flips with the theme, so
   the text auto-adjusts and stays readable regardless of the chosen background. */
:root                { --readable-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
[data-theme="light"] { --readable-shadow: 0 1px 2px rgba(255, 255, 255, 0.85); }

[data-bg="gradient"] .ch-name,
[data-bg="gradient"] .ch-category-name,
[data-theme="light"] .ch-name,
[data-theme="light"] .ch-category-name {
  color: var(--text-secondary);
  text-shadow: var(--readable-shadow);
}
/* Channel-type icons are SVGs (and the text-channel "#" glyph). text-shadow
   doesn't apply to SVG paint, so use a drop-shadow filter - it outlines both the
   SVG strokes and the "#" - and bump the icon colour to match the names. */
[data-bg="gradient"] .ch-icon,
[data-theme="light"] .ch-icon,
[data-bg="gradient"] .ch-muted-icon,
[data-theme="light"] .ch-muted-icon {
  color: var(--text-secondary);
  filter: drop-shadow(var(--readable-shadow));
}

/* Keep the active/hovered channel fully prominent on these backgrounds too. */
[data-bg="gradient"] .ch-item.active .ch-name,
[data-bg="gradient"] .ch-item:hover .ch-name { color: var(--text-primary); }
[data-bg="gradient"] .ch-item.active .ch-icon,
[data-bg="gradient"] .ch-item:hover .ch-icon { color: var(--text-primary); filter: drop-shadow(var(--readable-shadow)); }
