/* ==========================================================================
   CUEVANCE Apps Portal - Design System & Styles
   Mobile-First | Triple Liquid Themes | Multi-Language | Fluid Motion
   ========================================================================== */

:root {
  --font-brand: 'Audiowide', cursive, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-heading: 'Kosugi', 'Noto Sans SC', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   THEME 1: NEON (Dark Spatial Liquid)
   WCAG AAA / Universal Design Compliant
   -------------------------------------------------------------------------- */
body.theme-neon,
body.theme-cyber-neon {
  --bg-page: #080c1a;
  --bg-gradient: radial-gradient(ellipse at 20% 0%, rgba(56, 189, 248, 0.14) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 10%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
                 radial-gradient(ellipse at 50% 90%, rgba(52, 211, 153, 0.10) 0%, transparent 50%);
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  
  --card-bg: rgba(12, 18, 38, 0.78);
  --card-border: rgba(255, 255, 255, 0.14);
  --card-hover-border: rgba(56, 189, 248, 0.65);
  --card-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.55), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
  --card-glow: 0 0 35px -5px rgba(56, 189, 248, 0.3);
  
  --orb-1: rgba(56, 189, 248, 0.22);
  --orb-2: rgba(139, 92, 246, 0.18);
  --orb-3: rgba(52, 211, 153, 0.15);
  --grid-opacity: 0.035;
  
  --accent-cyan: #38bdf8;
  --accent-emerald: #34d399;
  --accent-purple: #a78bfa;
  --accent-amber: #fbbf24;
  
  --badge-live-bg: rgba(52, 211, 153, 0.18);
  --badge-live-border: rgba(52, 211, 153, 0.5);
  --badge-live-text: #34d399;
  
  --badge-beta-bg: rgba(56, 189, 248, 0.18);
  --badge-beta-border: rgba(56, 189, 248, 0.5);
  --badge-beta-text: #38bdf8;
  
  --badge-concept-bg: rgba(167, 139, 250, 0.18);
  --badge-concept-border: rgba(167, 139, 250, 0.5);
  --badge-concept-text: #c084fc;
  
  --nav-bg: rgba(8, 12, 26, 0.82);
  --input-bg: rgba(15, 23, 42, 0.75);
  --input-border: rgba(255, 255, 255, 0.16);
  --spotlight-color: rgba(56, 189, 248, 0.14);
}

/* --------------------------------------------------------------------------
   THEME 2: STUDIO (Light Organic Glass)
   WCAG AAA / Universal Design Compliant
   -------------------------------------------------------------------------- */
body.theme-studio,
body.theme-warm-studio {
  --bg-page: #f8fafc;
  --bg-gradient: radial-gradient(ellipse at 10% 0%, rgba(13, 148, 136, 0.08) 0%, transparent 45%),
                 radial-gradient(ellipse at 90% 15%, rgba(99, 102, 241, 0.06) 0%, transparent 45%),
                 radial-gradient(ellipse at 50% 95%, rgba(245, 158, 11, 0.05) 0%, transparent 45%);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(203, 213, 225, 0.95);
  --card-hover-border: rgba(13, 148, 136, 0.7);
  --card-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.08), inset 0 1px 1px 0 rgba(255, 255, 255, 1.0);
  --card-glow: 0 0 28px -5px rgba(13, 148, 136, 0.25);
  
  --orb-1: rgba(13, 148, 136, 0.12);
  --orb-2: rgba(99, 102, 241, 0.08);
  --orb-3: rgba(245, 158, 11, 0.06);
  --grid-opacity: 0.02;
  
  --accent-cyan: #0d9488;
  --accent-emerald: #059669;
  --accent-purple: #4f46e5;
  --accent-amber: #d97706;
  
  --badge-live-bg: rgba(5, 150, 105, 0.12);
  --badge-live-border: rgba(5, 150, 105, 0.45);
  --badge-live-text: #047857;
  
  --badge-beta-bg: rgba(13, 148, 136, 0.12);
  --badge-beta-border: rgba(13, 148, 136, 0.45);
  --badge-beta-text: #0f766e;
  
  --badge-concept-bg: rgba(99, 102, 241, 0.12);
  --badge-concept-border: rgba(99, 102, 241, 0.45);
  --badge-concept-text: #4338ca;
  
  --nav-bg: rgba(255, 255, 255, 0.88);
  --input-bg: rgba(241, 245, 249, 0.95);
  --input-border: rgba(203, 213, 225, 0.95);
  --spotlight-color: rgba(13, 148, 136, 0.08);
}

/* --------------------------------------------------------------------------
   THEME 3: Cyber (Hyper Neon & Frosted Matrix)
   WCAG AAA / Universal Design Compliant
   -------------------------------------------------------------------------- */
body.theme-cyber,
body.theme-cyberpunk-glass {
  --bg-page: #030308;
  --bg-gradient: radial-gradient(ellipse at 15% 0%, rgba(255, 0, 128, 0.22) 0%, transparent 45%),
                 radial-gradient(ellipse at 85% 15%, rgba(0, 240, 255, 0.20) 0%, transparent 45%),
                 radial-gradient(ellipse at 50% 85%, rgba(168, 85, 247, 0.18) 0%, transparent 50%),
                 radial-gradient(ellipse at 70% 60%, rgba(252, 238, 10, 0.08) 0%, transparent 40%);
  --text-primary: #ffffff;
  --text-secondary: #f1f5f9;
  --text-muted: #c7d2fe;
  
  --card-bg: rgba(10, 8, 26, 0.72);
  --card-border: rgba(255, 0, 128, 0.35);
  --card-hover-border: rgba(0, 240, 255, 0.95);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.75), inset 0 1px 1px 0 rgba(255, 255, 255, 0.3), 0 0 1px 1px rgba(255, 0, 128, 0.25);
  --card-glow: 0 0 35px -2px rgba(0, 240, 255, 0.5), 0 0 20px rgba(255, 0, 128, 0.4);
  
  --orb-1: rgba(255, 0, 128, 0.30);
  --orb-2: rgba(0, 240, 255, 0.26);
  --orb-3: rgba(168, 85, 247, 0.24);
  --grid-opacity: 0.08;
  
  --accent-cyan: #00f0ff;
  --accent-emerald: #00ff9f;
  --accent-purple: #ff007f;
  --accent-amber: #fcee0a;
  
  --badge-live-bg: rgba(0, 255, 159, 0.18);
  --badge-live-border: rgba(0, 255, 159, 0.7);
  --badge-live-text: #00ff9f;
  
  --badge-beta-bg: rgba(0, 240, 255, 0.18);
  --badge-beta-border: rgba(0, 240, 255, 0.7);
  --badge-beta-text: #00f0ff;
  
  --badge-concept-bg: rgba(255, 0, 128, 0.18);
  --badge-concept-border: rgba(255, 0, 128, 0.7);
  --badge-concept-text: #ff40a0;
  
  --nav-bg: rgba(6, 5, 18, 0.84);
  --input-bg: rgba(15, 12, 36, 0.8);
  --input-border: rgba(255, 0, 128, 0.4);
  --spotlight-color: rgba(0, 240, 255, 0.22);
}

/* --------------------------------------------------------------------------
   BASE RESETS & UNIVERSAL ACCESSIBILITY
   -------------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Accessible Focus Ring for Keyboard Users */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
}

/* High Contrast Form Placeholders */
::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/* Accessibility: Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   AMBIENT BACKGROUND
   -------------------------------------------------------------------------- */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.85;
  will-change: transform;
  mix-blend-mode: screen;
  transition: background 0.8s ease;
}

.orb-1 {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -80px;
  background: var(--orb-1);
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 340px;
  height: 340px;
  top: 25%;
  right: -100px;
  background: var(--orb-2);
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

.orb-3 {
  width: 380px;
  height: 380px;
  bottom: -100px;
  left: 10%;
  background: var(--orb-3);
  animation: floatOrb3 20s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(60px, 40px, 0) scale(1.1); }
  100% { transform: translate3d(30px, 80px, 0) scale(0.95); }
}

@keyframes floatOrb2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-50px, 60px, 0) scale(1.08); }
  100% { transform: translate3d(-80px, -30px, 0) scale(0.92); }
}

@keyframes floatOrb3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-40px, -50px, 0) scale(1.12); }
  100% { transform: translate3d(50px, -30px, 0) scale(1.02); }
}

.cyber-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, var(--grid-opacity)) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, var(--grid-opacity)) 1px, transparent 1px);
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 40%, transparent 85%);
}

/* --------------------------------------------------------------------------
   HEADER & NAVBAR (Mobile First)
   -------------------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all var(--transition-normal);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.theme-cyber .brand-logo,
body.theme-cyberpunk-glass .brand-logo {
  filter: drop-shadow(0 0 10px #ff007f) drop-shadow(0 0 16px #00f0ff);
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-left: 0.2rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  display: inline-block;
}

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

/* Language Selector */
.lang-switcher {
  display: inline-flex;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 2px;
  gap: 1px;
  backdrop-filter: blur(12px);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.lang-btn.active {
  background: var(--card-hover-border);
  color: #ffffff;
  box-shadow: 0 0 10px var(--card-hover-border);
}

body.theme-studio .lang-btn.active,
body.theme-warm-studio .lang-btn.active {
  background: var(--accent-cyan);
  color: #ffffff;
}

/* About Brand link (Hidden on mobile header, available in footer) */
.nav-link {
  display: none;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Theme Switcher Button */
.theme-switch-btn {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  backdrop-filter: blur(12px);
  user-select: none;
  flex-shrink: 0;
}

.theme-switch-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px var(--card-hover-border);
}

.theme-icon {
  font-size: 1rem;
}

.theme-label {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   HERO SECTION (Mobile First)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.25rem 1rem 1.75rem;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--badge-beta-bg);
  border: 1px solid var(--badge-beta-border);
  color: var(--badge-beta-text);
  margin-bottom: 1.25rem;
  box-shadow: 0 0 16px var(--badge-beta-bg);
  animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 8px transparent; }
  100% { box-shadow: 0 0 18px var(--card-hover-border); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 6.2vw, 2.3rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 1.1rem;
  word-break: normal;
  overflow-wrap: break-word;
}

.hero-line {
  display: block;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 50%, var(--accent-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 2px 14px var(--card-hover-border));
  margin-top: 0.25rem;
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto 1.5rem;
  line-height: 1.65;
  word-break: normal;
  overflow-wrap: break-word;
}

.hero-desc span {
  display: inline;
}

/* --------------------------------------------------------------------------
   3 CORE ENGINEERING PILLARS (In-Browser / 100% Privacy / Offline-Ready)
   -------------------------------------------------------------------------- */
.pillars-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
  text-align: left;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.pillar-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 0.9rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.pillar-card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -2px var(--card-hover-border), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.pillar-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
  filter: drop-shadow(0 0 8px var(--card-hover-border));
}

.pillar-body {
  flex: 1;
}

.pillar-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pillar-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.48;
}

body.theme-warm-studio .pillar-card {
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), inset 0 1px 1px rgba(255, 255, 255, 1.0);
}

.br-desktop {
  display: none;
}

/* --------------------------------------------------------------------------
   SEARCH & FILTER BAR (Mobile First)
   -------------------------------------------------------------------------- */
.controls-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto 1.75rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.9rem;
}

.search-input {
  width: 100%;
  padding: 0.7rem 0.85rem 0.7rem 2.4rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  backdrop-filter: blur(16px);
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--badge-beta-bg), 0 0 16px var(--card-hover-border);
}

/* Horizontally Scrollable Category Filter Chips on Mobile */
.filter-tags {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
  scrollbar-width: none;
  width: 100%;
}

.filter-tags::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
  padding: 0.42rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.filter-btn.active {
  background: var(--accent-cyan);
  color: #020617;
  border-color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: 0 0 14px var(--card-hover-border);
}

/* --------------------------------------------------------------------------
   APPS GRID & CARDS (Mobile First)
   -------------------------------------------------------------------------- */
.main-content {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem 3.5rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.app-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

/* Mouse Follow Ambient Spotlight */
.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--spotlight-color), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.app-card:hover::before {
  opacity: 1;
}

/* Top Edge Specular Highlight Line */
.app-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255, 255, 255, 0.4) 50%, transparent 95%);
  pointer-events: none;
  z-index: 2;
  transition: background 0.35s ease;
}

.app-card:hover::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.9) 30%, var(--accent-cyan) 70%, transparent 100%);
  box-shadow: 0 1px 8px var(--accent-cyan);
}

/* Luminous Border Beam on Hover */
.card-border-beam {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, transparent 15%, var(--accent-cyan) 45%, var(--accent-purple) 65%, transparent 85%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 2;
}

.app-card:hover .card-border-beam {
  opacity: 1;
  background-size: 200% 200%;
  animation: borderBeamRotate 3s ease infinite alternate;
}

@keyframes borderBeamRotate {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* Diagonal Sheen Sweep (キラリと走る閃光) */
.card-sheen-sweep {
  position: absolute;
  top: -50%;
  left: -100%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 20%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0.08) 80%,
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.app-card:hover .card-sheen-sweep {
  animation: sheenSweep 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sheenSweep {
  0% {
    left: -80%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    left: 180%;
    opacity: 0;
  }
}

.app-card:hover {
  transform: translateY(-5px) scale(1.008);
  border-color: var(--card-hover-border);
  box-shadow: var(--card-glow),
              inset 0 1.5px 2px 0 rgba(255, 255, 255, 0.5),
              inset 0 -1px 2px 0 rgba(0, 0, 0, 0.3),
              0 14px 30px -6px rgba(0, 0, 0, 0.5);
}

.app-card:hover .app-icon {
  transform: translateY(-2px) scale(1.12) rotate(-6deg);
}

.app-card:hover .launch-arrow {
  transform: translateX(6px);
}

/* Theme specific Border Beam Colors */
body.theme-studio .card-border-beam,
body.theme-warm-studio .card-border-beam {
  background: linear-gradient(135deg, transparent 15%, #0d9488 45%, #d97706 70%, transparent 85%);
}

body.theme-cyber .card-border-beam,
body.theme-cyberpunk-glass .card-border-beam {
  background: linear-gradient(135deg, transparent 10%, #ff007f 35%, #00f0ff 65%, #fcee0a 85%, transparent 100%);
  filter: drop-shadow(0 0 4px #ff007f);
}

body.theme-cyber .card-sheen-sweep,
body.theme-cyberpunk-glass .card-sheen-sweep {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 0, 128, 0.15) 25%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(0, 240, 255, 0.25) 75%,
    transparent 100%
  );
}

.app-card:active {
  transform: scale(0.98);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid;
  backdrop-filter: blur(8px);
}

.status-badge.live {
  background: var(--badge-live-bg);
  border-color: var(--badge-live-border);
  color: var(--badge-live-text);
  box-shadow: 0 0 10px var(--badge-live-bg);
}

.status-badge.beta {
  background: var(--badge-beta-bg);
  border-color: var(--badge-beta-border);
  color: var(--badge-beta-text);
  box-shadow: 0 0 10px var(--badge-beta-bg);
}

.status-badge.concept {
  background: var(--badge-concept-bg);
  border-color: var(--badge-concept-border);
  color: var(--badge-concept-text);
}

.app-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.app-domain {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  z-index: 1;
}

.app-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  flex: 1;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

.tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

body.theme-warm-studio .tag {
  color: #334155;
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.15);
}

body.theme-cyberpunk-glass .tag {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
}

.launch-arrow {
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

/* Card Animation */
.app-card-animated {
  animation: cardFadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardFadeUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-card.disabled {
  opacity: 0.75;
  cursor: default;
}

/* --------------------------------------------------------------------------
   FUTURISTIC ENGINEERING FOOTER (Mobile First & Universal Accessibility)
   -------------------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--card-border);
  background: var(--nav-bg);
  margin-top: auto;
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  overflow: hidden;
}

/* Luminous Top Glow Line */
.footer-glow-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-cyan) 30%, var(--accent-purple) 70%, transparent 100%);
  box-shadow: 0 0 12px var(--card-hover-border);
  pointer-events: none;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  margin-bottom: 2.5rem;
}

.footer-col-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-brand {
  margin-bottom: 0.25rem;
}

.footer-tagline {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0.75rem 0 1.2rem;
  max-width: 380px;
}

/* System Telemetry Operational Chip */
.system-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  user-select: none;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseLed 2s ease-in-out infinite alternate;
}

@keyframes pulseLed {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 4px var(--accent-emerald)); }
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-nav-list a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-nav-list a:hover {
  color: var(--accent-cyan);
  transform: translateX(4px);
}

.footer-link-muted {
  color: var(--text-muted) !important;
  cursor: default;
}

.tag-mini {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-purple);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.05em;
}

/* Bottom Status & Copyright Bar */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
}

.footer-bottom .copyright {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-telemetry {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.telemetry-badge {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-secondary);
  font-weight: 700;
}

.telemetry-badge.edge {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
}

.telemetry-dot {
  color: var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   RESPONSIVE ENHANCEMENTS (Tablet & Desktop)
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .navbar {
    padding: 0.85rem 1.5rem;
  }
  
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  
  .brand-name {
    font-size: 1.2rem;
  }

  .brand-sub {
    font-size: 0.72rem;
    padding: 0.12rem 0.4rem;
  }

  .nav-actions {
    gap: 0.65rem;
  }

  .lang-btn {
    font-size: 0.74rem;
    padding: 0.3rem 0.55rem;
  }

  .nav-link {
    display: flex;
  }

  .theme-switch-btn {
    width: auto;
    height: auto;
    padding: 0.4rem 0.75rem;
    gap: 0.4rem;
  }

  .theme-label {
    display: inline;
  }

  .hero {
    padding: 3.5rem 1.5rem 2.2rem;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 0.35rem 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-title {
    font-size: clamp(1.8rem, 4.8vw, 2.8rem);
    line-height: 1.32;
    margin-bottom: 1.3rem;
  }

  .hero-desc {
    font-size: 1rem;
    line-height: 1.75;
  }

  .pillars-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2.2rem;
  }

  .pillar-card {
    padding: 1.1rem 1.2rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .pillar-title {
    font-size: 0.96rem;
  }

  .controls-wrapper {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    margin-bottom: 2.2rem;
  }

  .search-box {
    flex: 1;
    max-width: 380px;
  }

  .filter-tags {
    width: auto;
    flex-wrap: wrap;
    padding-bottom: 0;
  }

  .main-content {
    padding: 0 1.5rem 4rem;
  }

  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .app-card {
    padding: 1.6rem;
    border-radius: 18px;
  }

  .app-icon {
    width: 52px;
    height: 52px;
    font-size: 1.65rem;
  }

  .footer-container {
    padding: 3.5rem 1.5rem 2rem;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 2.5rem;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .navbar {
    padding: 1rem 2rem;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .hero {
    padding: 5rem 1.5rem 2.8rem;
  }

  .hero-title {
    font-size: clamp(2.2rem, 3.8vw, 3.4rem);
    line-height: 1.32;
    margin-bottom: 1.5rem;
  }

  .hero-desc {
    font-size: 1.08rem;
    line-height: 1.8;
    margin-bottom: 2rem;
  }

  .pillars-container {
    gap: 1.25rem;
    margin-top: 2.75rem;
  }

  .pillar-card {
    padding: 1.25rem 1.4rem;
    border-radius: 16px;
  }

  .pillar-title {
    font-size: 1.02rem;
  }

  .pillar-desc {
    font-size: 0.84rem;
    line-height: 1.55;
  }

  .br-desktop {
    display: inline;
  }

  .controls-wrapper {
    max-width: 1200px;
    padding: 0 1.5rem;
    margin-bottom: 2.5rem;
  }

  .search-box {
    max-width: 460px;
  }

  .search-input {
    font-size: 0.95rem;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
  }

  .filter-btn {
    font-size: 0.85rem;
    padding: 0.48rem 0.95rem;
  }

  .main-content {
    padding: 0 1.5rem 5rem;
  }

  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
  }

  .app-card {
    padding: 1.85rem;
    border-radius: 20px;
  }

  .app-card:hover {
    transform: translateY(-6px) scale(1.01);
  }

  .app-card:hover .app-icon {
    transform: translateY(-3px) scale(1.14) rotate(-6deg);
  }

  .app-card:hover .launch-arrow {
    transform: translateX(6px);
  }

  .orb-1 {
    width: 500px;
    height: 500px;
  }

  .orb-2 {
    width: 550px;
    height: 550px;
  }

  .orb-3 {
    width: 600px;
    height: 600px;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 4rem;
  }
}

/* ==========================================================================
   LEGAL & DOCUMENTATION PAGES (Terms of Service / Privacy Policy)
   ========================================================================== */
.legal-page-wrapper {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
  position: relative;
  z-index: 1;
}

.legal-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.legal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all var(--transition-fast);
}

.legal-back-link:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--card-glow);
  transform: translateX(-3px);
}

.legal-header {
  margin-bottom: 2.5rem;
}

.legal-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--badge-live-bg);
  border: 1px solid var(--badge-live-border);
  color: var(--badge-live-text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}

.legal-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
  letter-spacing: -0.02em;
}

.legal-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--card-border);
}

.legal-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legal-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.legal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem 2.25rem;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.legal-card:hover {
  border-color: var(--card-hover-border);
}

.legal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
  opacity: 0.6;
}

.legal-disclaimer-box {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

body.theme-studio .legal-disclaimer-box {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.35);
}

.legal-disclaimer-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.legal-disclaimer-content {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.legal-disclaimer-title {
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
}

.legal-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.legal-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--badge-beta-bg);
  border: 1px solid var(--badge-beta-border);
  color: var(--badge-beta-text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.legal-p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.legal-p:last-child {
  margin-bottom: 0;
}

.legal-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legal-list-item {
  position: relative;
  padding-left: 1.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.legal-list-item::before {
  content: "▹";
  position: absolute;
  left: 0.25rem;
  top: 0;
  color: var(--accent-cyan);
  font-weight: bold;
}

.legal-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.legal-link:hover {
  color: var(--accent-emerald);
}

.legal-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.75rem 1.4rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(255, 0, 128, 0.15));
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

body.theme-studio .legal-contact-btn {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), rgba(99, 102, 241, 0.12));
}

.legal-contact-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--card-glow);
  transform: translateY(-2px);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .legal-page-wrapper {
    padding: 1.75rem 1rem 4rem;
  }
  .legal-card {
    padding: 1.4rem 1.25rem;
    border-radius: 16px;
  }
  .legal-section-title {
    font-size: 1.15rem;
  }
  .legal-p, .legal-list-item {
    font-size: 0.9rem;
  }
}
