/* ==========================================================================
   NEXUS PORTAL — ULTRA-MODERN FROSTED GLASSMORPHISM EDITION
   Inspired by Reference Aesthetic:
   • Deep Velvet Obsidian Void (#0A0406)
   • Rich Crimson, Ruby & Carmine Animated Floating Spheres
   • Pure Frosted Glass with Specular Edge Light & Inset Reflections
   • High-Contrast Editorial Poster Typography (Plus Jakarta Sans 800)
   • Prominent, Tactile Glowing Action Buttons, Icons & Grid Chooser
   ========================================================================== */

:root {
  /* Dark Mode Palette (Default / Image Reference Match) */
  --bg-canvas: #090305;
  --bg-card-glass: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 60%, rgba(0, 0, 0, 0.35) 100%);
  --bg-nav-glass: rgba(16, 7, 10, 0.72);
  --bg-pill: rgba(255, 255, 255, 0.07);

  /* Text & Accents */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent-ruby: #E11D48;
  --accent-dot: #FF2E5B;

  /* Frosted Glass Borders & Lighting */
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-top: rgba(255, 255, 255, 0.32);
  --glass-border-hover: rgba(255, 255, 255, 0.4);
  --glass-shadow: 
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.45),
    0 24px 50px -12px rgba(0, 0, 0, 0.75),
    0 4px 16px rgba(0, 0, 0, 0.35);
  --glass-shadow-hover: 
    inset 0 2px 2px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.45),
    0 32px 64px -16px rgba(225, 29, 72, 0.35),
    0 16px 36px rgba(0, 0, 0, 0.85);

  /* Geometry & Motion */
  --card-radius: 32px;
  --radius-pill: 9999px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* LIGHT THEME (WARM FROSTED ALABASTER & AMBER) */
body:not(.dark-theme) {
  --bg-canvas: #EBE6DF;
  --bg-card-glass: linear-gradient(145deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 244, 238, 0.75) 100%);
  --bg-nav-glass: rgba(235, 230, 223, 0.88);
  --bg-pill: rgba(20, 18, 16, 0.06);

  --text-primary: #151210;
  --text-secondary: rgba(20, 18, 16, 0.75);
  --text-muted: rgba(20, 18, 16, 0.5);
  --accent-ruby: #D67A32;
  --accent-dot: #D67A32;

  --glass-border: rgba(20, 18, 16, 0.1);
  --glass-border-top: rgba(255, 255, 255, 0.9);
  --glass-border-hover: rgba(214, 122, 50, 0.5);
  --glass-shadow: 
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95),
    0 20px 40px -12px rgba(20, 18, 16, 0.08);
  --glass-shadow-hover: 
    inset 0 2px 2px 0 rgba(255, 255, 255, 1),
    0 28px 56px -12px rgba(214, 122, 50, 0.25);
}

/* ==========================================================================
   RESET & GLOBAL
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-canvas);
  overflow-x: hidden;
  width: 100%;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  transition: background-color 0.4s var(--transition-smooth), color 0.4s var(--transition-smooth);
}

a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:active, .portal-card:active {
  transform: scale(0.98);
}

/* ==========================================================================
   ANIMATED AMBIENT BACKGROUND SPHERES (MOVING WITH ZERO EDGE GAPS)
   ========================================================================== */
.ambient-spheres {
  position: fixed;
  top: -120px;
  left: -120px;
  width: calc(100vw + 240px);
  height: calc(100vh + 240px);
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  will-change: transform;
  background: radial-gradient(ellipse at 50% 45%, #18060B 0%, #0C0306 50%, #060103 100%);
}

body:not(.dark-theme) .ambient-spheres {
  background: radial-gradient(ellipse at 50% 45%, #F7F3EC 0%, #EBE6DF 55%, #DDD6CB 100%);
}

/* Edge-anchored gradient washes so borders NEVER show raw empty seams */
.ambient-spheres::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 95% 45%, rgba(225, 29, 72, 0.45) 0%, rgba(136, 19, 55, 0.22) 35%, transparent 68%),
    radial-gradient(ellipse at 50% 95%, rgba(159, 18, 57, 0.4) 0%, rgba(76, 5, 25, 0.18) 42%, transparent 72%),
    radial-gradient(ellipse at 5% 5%, rgba(12, 3, 6, 0.95) 0%, transparent 55%);
  pointer-events: none;
  z-index: 1;
}

body:not(.dark-theme) .ambient-spheres::before {
  background: 
    radial-gradient(ellipse at 95% 45%, rgba(214, 122, 50, 0.25) 0%, transparent 65%),
    radial-gradient(ellipse at 50% 95%, rgba(241, 182, 98, 0.2) 0%, transparent 70%);
}

/* Top-Left Dark Curved Silhouette - Slow Floating */
.sphere-top-left {
  position: absolute;
  width: 820px;
  height: 820px;
  border-radius: 50%;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle at 62% 62%, #050103 20%, #150308 55%, #2B0510 85%, #3D0716 100%);
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.9);
  animation: floatOrbTopLeft 22s ease-in-out infinite alternate;
  will-change: transform;
  z-index: 2;
}

/* Center-Right Glowing Crimson Sphere - Gentle Drifting & Breathing */
.sphere-center-right {
  position: absolute;
  width: 1040px;
  height: 1040px;
  border-radius: 50%;
  top: 5%;
  right: -220px;
  background: radial-gradient(circle at 38% 38%, #E11D48 0%, #BE123C 32%, #881337 58%, #4C0519 82%, #140207 100%);
  filter: blur(2px);
  opacity: 0.95;
  animation: floatOrbCenterRight 18s ease-in-out infinite alternate;
  will-change: transform;
  z-index: 2;
}

/* Bottom-Left Deep Ruby Sphere - Slow Floating */
.sphere-bottom-left {
  position: absolute;
  width: 920px;
  height: 920px;
  border-radius: 50%;
  bottom: -220px;
  left: -80px;
  background: radial-gradient(circle at 42% 38%, #9F1239 0%, #881337 40%, #4C0519 75%, #100205 100%);
  opacity: 0.88;
  animation: floatOrbBottomLeft 25s ease-in-out infinite alternate;
  will-change: transform;
  z-index: 2;
}

/* Bottom Center Soft Diffuse Curve - Breathing Glow */
.sphere-bottom-curve {
  position: absolute;
  width: 1320px;
  height: 560px;
  border-radius: 50%;
  bottom: -260px;
  left: 15%;
  background: radial-gradient(ellipse at 50% 50%, #4C0519 0%, #1E0309 60%, transparent 80%);
  filter: blur(48px);
  opacity: 0.85;
  animation: floatCurveGlow 26s ease-in-out infinite alternate;
  will-change: transform, opacity;
  z-index: 2;
}

/* SPHERE KEYFRAME ANIMATIONS (ORGANIC DRIFT) */
@keyframes floatOrbTopLeft {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(24px, 16px) scale(1.03);
  }
  100% {
    transform: translate(-14px, 28px) scale(0.98);
  }
}

@keyframes floatOrbCenterRight {
  0% {
    transform: translate(0, 0) scale(1);
  }
  35% {
    transform: translate(-28px, -18px) scale(1.04);
  }
  70% {
    transform: translate(-12px, 22px) scale(1.02);
  }
  100% {
    transform: translate(-36px, -10px) scale(1.05);
  }
}

@keyframes floatOrbBottomLeft {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(22px, -24px) scale(1.03);
  }
  100% {
    transform: translate(-16px, -10px) scale(0.98);
  }
}

@keyframes floatCurveGlow {
  0% {
    transform: scale(1) translateY(0);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05) translateY(-20px);
    opacity: 0.95;
  }
  100% {
    transform: scale(0.97) translateY(10px);
    opacity: 0.75;
  }
}

/* Ambient Canvas overlay for subtle drifting motes */
.ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.nav-container {
  position: fixed;
  top: 18px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1000;
  padding: 0 16px;
}

.nav-pill {
  background: var(--bg-nav-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.nav-pill.scrolled {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  border-color: var(--glass-border-hover);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dot);
  box-shadow: 0 0 10px var(--accent-dot);
}

.brand-title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-primary);
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-pill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: #FFFFFF;
  color: #0A0406;
}

body:not(.dark-theme) .tab-btn.active {
  background: #151210;
  color: #FFFFFF;
}

/* Nav View Switcher (Option 1 & 2) */
.view-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-pill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.view-btn {
  width: 30px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.view-btn:hover {
  color: var(--text-primary);
}

.view-btn.active {
  background: #FFFFFF;
  color: #0A0406;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

body:not(.dark-theme) .view-btn.active {
  background: #151210;
  color: #FFFFFF;
}

.nav-actions {
  display: flex;
  align-items: center;
}

.theme-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-pill);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
}

.theme-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFFFFF 50%, #E11D48 50%);
}

body:not(.dark-theme) .theme-indicator {
  background: linear-gradient(135deg, #151210 50%, #D67A32 50%);
}

/* ==========================================================================
   MAIN CONTAINER & HEADER
   ========================================================================== */
.main-wrapper {
  margin: 0 auto;
  padding: 104px 24px 60px;
  position: relative;
  z-index: 2;
  transition: max-width 0.35s var(--transition-smooth);
}

.main-wrapper.view-grid-3-mode {
  max-width: 1260px;
}

.main-wrapper.view-grid-2-mode {
  max-width: 960px;
}

.main-wrapper.view-list-mode {
  max-width: 840px;
}

.portal-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 36px;
}

.portal-title {
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
  color: var(--text-primary);
}

.title-glow-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-dot);
  box-shadow: 0 0 10px var(--accent-dot), 0 0 20px rgba(225, 29, 72, 0.6);
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
}

.portal-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 480px;
  margin: 0 auto 24px;
}

/* ==========================================================================
   PROMINENT CONTROLS TOOLBAR (GRID CHOOSER)
   ========================================================================== */
.portal-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin: 16px auto 0;
  width: fit-content;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.view-switcher-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-pill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 3px;
}

/* PROMINENT LABELED GRID BUTTONS */
.view-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  height: 32px;
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.view-btn-pill.active {
  background: #FFFFFF;
  color: #0A0406;
  border-color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

body:not(.dark-theme) .view-btn-pill.active {
  background: #151210;
  color: #FFFFFF;
  border-color: #151210;
}

/* ==========================================================================
   CARDS STACK & VIEW MODES
   ========================================================================== */
.sorted-cards-stack {
  display: grid;
  transition: all 0.35s ease;
}

/* OPTION 3: 3-COLUMN GRID (PROPORTIONED TO FIT CORRECT & GOOD) */
.sorted-cards-stack.view-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.sorted-cards-stack.view-grid-3 .portal-card {
  min-height: 410px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
}

.sorted-cards-stack.view-grid-3 .glass-hero-section {
  padding: 24px 0 20px;
}

.sorted-cards-stack.view-grid-3 .glass-hero-title {
  font-size: clamp(1.5rem, 1.95vw, 1.92rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.sorted-cards-stack.view-grid-3 .glass-icon-badge {
  width: 36px;
  height: 36px;
}

.sorted-cards-stack.view-grid-3 .card-launch-btn {
  padding: 7px 14px;
  font-size: 0.78rem;
}

/* OPTION 2: 2-COLUMN GRID — PORTRAIT POSTER PROPORTIONS */
.sorted-cards-stack.view-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.sorted-cards-stack.view-grid-2 .portal-card {
  min-height: 440px;
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
}

/* OPTION 1: 1-COLUMN LIST VIEW */
.sorted-cards-stack.view-list {
  grid-template-columns: 1fr;
  gap: 16px;
}

.sorted-cards-stack.view-list .portal-card {
  min-height: auto;
  padding: 24px 30px;
  display: block;
}

.sorted-cards-stack.view-list .card-glass-body {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 24px;
}

.sorted-cards-stack.view-list .glass-hero-section {
  padding: 0;
}

.sorted-cards-stack.view-list .glass-hero-title {
  font-size: 1.45rem;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
}

.sorted-cards-stack.view-list .glass-bottom-row {
  margin-top: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* ==========================================================================
   FROSTED GLASSMORPHISM CARD COMPONENT (IMAGE MATCH)
   ========================================================================== */
.portal-card {
  position: relative;
  background: var(--bg-card-glass);
  backdrop-filter: blur(42px) saturate(190%);
  -webkit-backdrop-filter: blur(42px) saturate(190%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-left: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--card-radius);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s var(--transition-smooth), 
              box-shadow 0.35s var(--transition-smooth), 
              border-color 0.25s ease;
}

.portal-card:hover {
  transform: translateY(-8px) scale(1.015);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
}

.portal-card.filtered-out {
  display: none !important;
}

/* Internal Crimson Sphere Glow Refraction (Matches Reference Photo) */
.card-inner-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 82% 86%, rgba(225, 29, 72, 0.48) 0%, rgba(159, 18, 57, 0.2) 42%, rgba(0, 0, 0, 0) 74%);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

body:not(.dark-theme) .card-inner-glow {
  background: radial-gradient(circle at 82% 86%, rgba(214, 122, 50, 0.25) 0%, rgba(241, 182, 98, 0.12) 42%, transparent 74%);
}

.portal-card:hover .card-inner-glow {
  transform: scale(1.08);
  opacity: 1;
}

/* Dynamic Mouse-Tracking Ambient Specular Highlight */
.glow-card::after {
  content: '';
  position: absolute;
  top: var(--mouse-y, -150px);
  left: var(--mouse-x, -150px);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.glow-card:hover::after {
  opacity: 1;
}

/* Content Container Inside Glass */
.card-glass-body {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Top Meta Row: Icon + Label Stack on Left, Action Pill Button on Right */
.glass-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.glass-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* CATEGORY MATCHING FROSTED ICON BADGE */
.glass-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  transition: all 0.3s var(--transition-smooth);
}

.glass-icon-badge svg {
  display: block;
}

.portal-card:hover .glass-icon-badge {
  background: rgba(225, 29, 72, 0.22);
  border-color: rgba(255, 77, 109, 0.6);
  color: #FF4D6D;
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(225, 29, 72, 0.5);
}

body:not(.dark-theme) .glass-icon-badge {
  background: rgba(20, 18, 16, 0.05);
  border-color: rgba(20, 18, 16, 0.12);
  color: var(--text-primary);
}

body:not(.dark-theme) .portal-card:hover .glass-icon-badge {
  background: rgba(214, 122, 50, 0.18);
  border-color: rgba(214, 122, 50, 0.5);
  color: #D67A32;
}

.glass-tag-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.glass-tag-bold {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.glass-tag-sub {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-secondary);
  opacity: 0.85;
}

/* TOP-RIGHT GLASS PILL BUTTON */
.glass-pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.portal-card:hover .glass-pill-btn {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

/* HERO SECTION (EDITORIAL POSTER TYPOGRAPHY) */
.glass-hero-section {
  padding: 34px 0 28px;
}

.glass-hero-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.038em;
  color: var(--text-primary);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.hero-line {
  display: block;
}

.glass-dot {
  color: var(--accent-dot);
  text-shadow: 0 0 12px rgba(255, 46, 91, 0.8);
}

/* BOTTOM ROW: HANDLE & PROMINENT LAUNCH BUTTON */
.glass-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 12px;
}

.glass-handle {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* HIGH-CONTRAST TACTILE LAUNCH BUTTON ON EVERY CARD */
.card-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFFFFF;
  transition: all 0.25s var(--transition-smooth);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.card-launch-btn .btn-arrow {
  font-size: 1rem;
  font-weight: 800;
  transition: transform 0.2s ease;
}

.portal-card:hover .card-launch-btn {
  background: #E11D48;
  border-color: #FF4D6D;
  box-shadow: 0 0 20px rgba(225, 29, 72, 0.65);
  transform: translateY(-1px);
}

.portal-card:hover .card-launch-btn .btn-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer-container {
  max-width: 1260px;
  margin: 0 auto 36px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
  transition: max-width 0.35s var(--transition-smooth);
}

.footer-card {
  background: var(--bg-card-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--glass-shadow);
}

.footer-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.footer-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #E2E8F0;
}

.palette-dots {
  display: flex;
  gap: 6px;
}

.palette-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.footer-copy {
  font-size: 0.82rem;
  font-weight: 600;
  color: #CBD5E1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-copy:hover {
  color: #FFFFFF;
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN SYSTEM
   ========================================================================== */
.mobile-category-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 4px 16px;
  margin: 12px auto 20px;
  width: 100%;
  max-width: 600px;
  scroll-snap-type: x proximity;
}

.mobile-category-bar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.84rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cat-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.cat-pill.active {
  background: linear-gradient(135deg, #FF1A4B 0%, #E11D48 100%);
  border-color: #FF5C7F;
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.55);
}

body:not(.dark-theme) .cat-pill {
  background: rgba(20, 18, 16, 0.06);
  border-color: rgba(20, 18, 16, 0.12);
  color: #151210;
}

body:not(.dark-theme) .cat-pill.active {
  background: linear-gradient(135deg, #D67A32 0%, #B85F1B 100%);
  border-color: #E8904D;
  color: #FFFFFF;
}

@media (max-width: 1080px) {
  .sorted-cards-stack.view-grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .nav-container {
    top: max(12px, env(safe-area-inset-top, 12px));
    padding: 0 12px;
  }

  .nav-pill {
    width: calc(100% - 8px);
    max-width: 500px;
    padding: 8px 14px;
    justify-content: space-between;
  }

  .category-tabs {
    display: none; /* Replaced by swipeable .mobile-category-bar below header */
  }

  .main-wrapper {
    padding: calc(72px + env(safe-area-inset-top, 12px)) 16px 40px;
    width: 100%;
  }

  .portal-header {
    margin-bottom: 24px;
  }

  .portal-title {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .portal-subtitle {
    font-size: 0.95rem;
    padding: 0 8px;
  }

  .portal-toolbar {
    width: 100%;
    padding: 10px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .portal-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-group {
    width: 100%;
    justify-content: space-between;
  }

  .sorted-cards-stack.view-grid-3,
  .sorted-cards-stack.view-grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sorted-cards-stack.view-grid-3 .portal-card,
  .sorted-cards-stack.view-grid-2 .portal-card {
    min-height: auto;
    padding: 24px 20px;
    border-radius: 24px;
  }

  .glass-hero-section {
    padding: 18px 0 14px !important;
  }

  .glass-hero-title {
    font-size: clamp(1.4rem, 5.5vw, 1.85rem) !important;
  }

  .card-launch-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    font-size: 0.85rem;
  }

  .sorted-cards-stack.view-list .card-glass-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .sorted-cards-stack.view-list .glass-bottom-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .footer-card { 
    padding: 20px 18px;
    gap: 14px;
    border-radius: 24px;
  }
}

@media (max-width: 480px) {
  .portal-toolbar .toolbar-label {
    display: none;
  }

  .view-switcher-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .view-btn-pill {
    padding: 0 8px;
    font-size: 0.72rem;
    justify-content: center;
  }

  .view-btn-pill span {
    font-size: 0.7rem;
  }
}

/* Touchscreens: Prevent sticky hover states on tap */
@media (hover: none) and (pointer: coarse) {
  .portal-card:hover {
    transform: none;
    box-shadow: var(--glass-shadow);
    border-color: var(--glass-border);
  }
  .portal-card:active {
    transform: scale(0.98);
  }
}

/* ==========================================================================
   LEGAL COMPLIANCE & SAFE HARBOR FOOTER BAR
   ========================================================================== */
.footer-compliance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.footer-legal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-pill-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.80rem;
  font-weight: 700;
  color: #F8FAFC;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.legal-pill-btn:hover {
  background: rgba(225, 29, 72, 0.25);
  border-color: #FF2E5B;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.legal-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FF2E5B;
  box-shadow: 0 0 6px #FF2E5B;
  display: inline-block;
}

.footer-safeharbor-note {
  font-size: 0.78rem;
  font-weight: 500;
  color: #94A3B8;
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   INTERACTIVE LEGAL & DMCA MODAL (READABLE, CRISP & PREMIUM)
   ========================================================================== */
.legal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 7, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.legal-modal-card {
  background: #110B14;
  background: linear-gradient(170deg, #170F1A 0%, #0E0812 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: 1px solid rgba(255, 77, 109, 0.6);
  border-radius: 24px;
  max-width: 840px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 
    0 32px 80px rgba(0, 0, 0, 0.98),
    0 0 50px rgba(225, 29, 72, 0.2);
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(225, 29, 72, 0.16);
  border: 1px solid rgba(255, 77, 109, 0.45);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #FFA3B8;
}

.legal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF2E5B;
  box-shadow: 0 0 10px #FF2E5B;
}

.btn-close-legal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-legal:hover {
  background: #E11D48;
  border-color: #FF4D6D;
  transform: scale(1.08);
}

.legal-tabs-nav {
  display: flex;
  gap: 10px;
  padding: 14px 28px;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  scrollbar-width: none;
}

.legal-tabs-nav::-webkit-scrollbar {
  display: none;
}

.legal-tab-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #E2E8F0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.legal-tab-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.legal-tab-btn.active {
  background: linear-gradient(135deg, #FF1A4B 0%, #E11D48 100%);
  border-color: #FF5C7F;
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.5);
}

.legal-content-body {
  padding: 28px 32px;
  overflow-y: auto;
  max-height: 56vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 46, 91, 0.5) transparent;
}

.legal-tab-panel {
  display: none;
}

.legal-tab-panel.active {
  display: block;
  animation: fadeInPanel 0.2s ease;
}

.legal-panel-title {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 16px;
  line-height: 1.3;
}

.legal-subheading {
  font-size: 1.10rem;
  font-weight: 800;
  color: #FF7597;
  margin: 24px 0 10px;
  letter-spacing: -0.01em;
}

.legal-text {
  font-size: 1.0rem;
  font-weight: 400;
  line-height: 1.75;
  color: #F8FAFC;
  margin-bottom: 16px;
}

.legal-text strong {
  color: #FFFFFF;
  font-weight: 700;
}

.legal-list {
  list-style: disc;
  padding-left: 24px;
  margin: 12px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-list li {
  font-size: 0.98rem;
  line-height: 1.65;
  color: #F1F5F9;
}

.legal-contact-callout {
  background: linear-gradient(145deg, rgba(225, 29, 72, 0.16) 0%, rgba(136, 19, 55, 0.26) 100%);
  border: 2px solid #FF4D6D;
  border-radius: 18px;
  padding: 20px 24px;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-label {
  font-size: 0.80rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FF7597;
}

.contact-email {
  font-size: 1.35rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 0.02em;
  font-family: inherit;
}

.contact-note {
  font-size: 0.90rem;
  color: #FCE7F3;
  margin-top: 4px;
  line-height: 1.5;
}

.legal-highlight-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 16px 0;
}

.legal-highlight-text {
  font-size: 1.0rem;
  font-weight: 600;
  line-height: 1.7;
  color: #FFFFFF;
  margin: 0;
}

.legal-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
}

.legal-footer-notice {
  font-size: 0.84rem;
  font-weight: 700;
  color: #94A3B8;
}

.btn-agree-legal {
  background: linear-gradient(135deg, #FF1A4B 0%, #E11D48 100%);
  border: 1px solid #FF5C7F;
  border-radius: var(--radius-pill);
  padding: 10px 26px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.6);
  transition: all 0.2s ease;
}

.btn-agree-legal:hover {
  background: linear-gradient(135deg, #FF3360 0%, #F43F5E 100%);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .footer-primary-row {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .footer-compliance-row {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .legal-modal-card {
    width: 95vw;
    max-height: 86vh;
    border-radius: 22px;
  }

  .legal-modal-header {
    padding: 16px 18px;
  }

  .btn-modal-close {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .legal-tabs-nav {
    padding: 10px 14px;
    gap: 6px;
  }

  .legal-tab-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
  }

  .legal-content-body {
    padding: 18px 16px;
    max-height: 52vh;
  }

  .legal-modal-footer {
    padding: 12px 16px;
  }

  .btn-agree-legal {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    text-align: center;
  }
}

