/* ==========================================================================
   MAKERSTUDIO3D.COM — UNIFIED DESIGN SYSTEM & STYLESHEET
   Aesthetics: Obsidian Dark Maker Theme, Neon Cyan/Violet Accents, Glassmorphism
   ========================================================================== */

:root,
[data-theme="light"] {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-arabic: 'Tajawal', 'Cairo', -apple-system, sans-serif;

  /* Color Palette — Light Mode (Default: Clean White Studio Aesthetic) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-input: #ffffff;

  --border-subtle: rgba(15, 23, 42, 0.09);
  --border-glow: rgba(2, 132, 199, 0.28);
  --border-focus: #0284c7;

  --accent-cyan: #0284c7;
  --accent-cyan-dim: rgba(2, 132, 199, 0.1);
  --accent-violet: #7c3aed;
  --accent-violet-dim: rgba(124, 58, 237, 0.1);
  --accent-amber: #d97706;
  --accent-amber-dim: rgba(217, 119, 6, 0.1);
  --accent-rose: #e11d48;
  --accent-emerald: #059669;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.09);
  --shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.12);
  --shadow-neon: 0 0 20px rgba(2, 132, 199, 0.18);

  --nav-bg: rgba(255, 255, 255, 0.9);
  --body-gradient: radial-gradient(circle at 15% 15%, rgba(2, 132, 199, 0.05) 0%, transparent 45%),
                   radial-gradient(circle at 85% 85%, rgba(124, 58, 237, 0.04) 0%, transparent 50%);
  --modal-overlay-bg: rgba(15, 23, 42, 0.5);
  --card-hover-shadow: 0 10px 25px rgba(15, 23, 42, 0.1), 0 0 15px rgba(2, 132, 199, 0.15);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  --container-max: 1280px;
  --nav-height: 72px;
}

/* Dark Theme — Obsidian Neon Cyber Aesthetic */
[data-theme="dark"] {
  --bg-primary: #070a12;
  --bg-secondary: #0c1220;
  --bg-tertiary: #131d31;
  --bg-card: rgba(18, 28, 48, 0.7);
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-input: rgba(10, 16, 28, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.25);
  --border-focus: #00f0ff;

  --accent-cyan: #00f0ff;
  --accent-cyan-dim: rgba(0, 240, 255, 0.15);
  --accent-violet: #8b5cf6;
  --accent-violet-dim: rgba(139, 92, 246, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.15);
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #030712;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.75);
  --shadow-neon: 0 0 24px rgba(0, 240, 255, 0.25);

  --nav-bg: rgba(7, 10, 18, 0.85);
  --body-gradient: radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
                   radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.06) 0%, transparent 45%);
  --modal-overlay-bg: rgba(3, 7, 18, 0.75);
  --card-hover-shadow: var(--shadow-lg), 0 0 20px rgba(0, 240, 255, 0.1);
}

/* Extravagant Theme — Imperial Purple, 24K Gold & Neon Fuchsia */
[data-theme="extravagant"] {
  --bg-primary: #090214;
  --bg-secondary: #140426;
  --bg-tertiary: #23083e;
  --bg-card: rgba(30, 8, 54, 0.72);
  --bg-glass: rgba(24, 6, 44, 0.82);
  --bg-input: rgba(18, 3, 32, 0.9);

  --border-subtle: rgba(251, 191, 36, 0.16);
  --border-glow: rgba(251, 191, 36, 0.45);
  --border-focus: #ffd700;

  --accent-cyan: #fbbf24;
  --accent-cyan-dim: rgba(251, 191, 36, 0.16);
  --accent-violet: #ff007f;
  --accent-violet-dim: rgba(255, 0, 127, 0.16);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.18);
  --accent-rose: #ff1493;
  --accent-emerald: #10b981;

  --text-primary: #fffdf5;
  --text-secondary: #d8b4fe;
  --text-muted: #c084fc;
  --text-inverse: #090214;

  --shadow-sm: 0 2px 10px rgba(9, 2, 20, 0.5);
  --shadow-md: 0 8px 30px rgba(9, 2, 20, 0.7);
  --shadow-lg: 0 16px 45px rgba(9, 2, 20, 0.85);
  --shadow-xl: 0 24px 60px rgba(9, 2, 20, 0.95);
  --shadow-neon: 0 0 28px rgba(251, 191, 36, 0.35);

  --nav-bg: rgba(9, 2, 20, 0.9);
  --body-gradient: radial-gradient(circle at 10% 15%, rgba(251, 191, 36, 0.08) 0%, transparent 40%),
                   radial-gradient(circle at 90% 85%, rgba(255, 0, 127, 0.1) 0%, transparent 45%),
                   radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  --modal-overlay-bg: rgba(9, 2, 20, 0.82);
  --card-hover-shadow: var(--shadow-lg), 0 0 25px rgba(251, 191, 36, 0.25);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  background-image: var(--body-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.25rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #70f7ff;
}

code, pre {
  font-family: var(--font-mono);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.section-spacing {
  padding-block: 5rem;
}

@media (max-width: 768px) {
  .section-spacing {
    padding-block: 3.5rem;
  }
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
}

.portal-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-brand .brand-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  border-radius: var(--radius-sm);
  color: var(--text-inverse);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.nav-brand .brand-text span {
  color: var(--accent-cyan);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  inset-inline: 0;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Studio Nav Dropdown */
.nav-item-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
}

.dropdown-chevron {
  transition: transform var(--transition-fast);
}

.nav-item-dropdown:hover .dropdown-chevron,
.nav-item-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.studio-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 410px;
  max-width: 92vw;
  background: rgba(12, 18, 32, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(0, 240, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1060;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
}

.nav-item-dropdown:hover .studio-dropdown-menu,
.nav-item-dropdown.open .studio-dropdown-menu,
.nav-item-dropdown:focus-within .studio-dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.studio-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  background: rgba(18, 28, 48, 0.4);
}

.studio-dropdown-item:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-1px);
}

.studio-item-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.icon-image3d {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.icon-keychain {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.studio-item-content {
  flex: 1;
  text-align: start;
}

.studio-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.studio-item-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
}

@media (max-width: 960px) {
  .nav-item-dropdown {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .studio-dropdown-menu {
    position: static;
    transform: none;
    width: 100%;
    opacity: 1;
    pointer-events: all;
    display: flex;
    box-shadow: none;
    border-color: var(--border-subtle);
    margin-top: 0.5rem;
  }
  .nav-item-dropdown:hover .studio-dropdown-menu {
    transform: none;
  }
}

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

/* Language Switcher */
.lang-selector-wrap {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  border-color: var(--border-glow);
  background: var(--bg-card);
}

/* Flag-Only Language Button for Top Navigation */
.lang-btn-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.lang-btn-flag:hover {
  border-color: var(--border-glow);
  background: var(--bg-card);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.current-lang-flag {
  font-size: 1.35rem;
  display: inline-block;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.lang-flag-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 175px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  z-index: 1050;
}

.lang-dropdown.show {
  display: block;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: start;
  transition: all var(--transition-fast);
}

.lang-option:hover, .lang-option.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

/* Theme Selector in Navigation */
.theme-selector-wrap {
  position: relative;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-btn:hover {
  border-color: var(--border-glow);
  background: var(--bg-card);
  transform: translateY(-1px);
}

.current-theme-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  z-index: 1050;
}

.theme-dropdown.show {
  display: block;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: start;
  transition: all var(--transition-fast);
}

.theme-option:hover,
.theme-option.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

.theme-badge {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* Mobile Toggle */
.nav-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 960px) {
  .nav-mobile-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    inset-inline-start: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-normal);
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, #00f0ff, #0099ff);
  color: #030712;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2df3ff, #1aa3ff);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.btn-outline:hover {
  background: var(--accent-cyan-dim);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.btn-danger {
  background: var(--accent-rose);
  color: #fff;
}

.btn-danger:hover {
  background: #e11d48;
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-cyan { background: var(--accent-cyan-dim); color: var(--accent-cyan); border: 1px solid rgba(0, 240, 255, 0.3); }
.badge-violet { background: var(--accent-violet-dim); color: var(--accent-violet); border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-amber { background: var(--accent-amber-dim); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }

/* Theme-Specific Button & Component Modifiers */
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

[data-theme="light"] .nav-brand .brand-logo {
  background: linear-gradient(135deg, #0284c7, #7c3aed);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25);
}

[data-theme="extravagant"] .btn-primary {
  background: linear-gradient(135deg, #ffd700, #ff007f);
  color: #090214;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(255, 215, 0, 0.35);
}

[data-theme="extravagant"] .btn-primary:hover {
  background: linear-gradient(135deg, #ffe033, #ff1a8c);
  box-shadow: 0 6px 24px rgba(255, 215, 0, 0.5);
}

[data-theme="extravagant"] .nav-brand .brand-logo {
  background: linear-gradient(135deg, #ffd700, #ff007f);
  color: #090214;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

[data-theme="extravagant"] .badge-cyan {
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

/* ==========================================================================
   AUTH MODAL & FORMS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.2);
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: all var(--transition-slow);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  inset-inline-end: 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.modal-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-tab-btn.active {
  background: var(--bg-secondary);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: start;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
  background: #0a1120;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Auth Gate Notice */
.auth-gate-banner {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-gate-banner .gate-icon {
  font-size: 1.5rem;
  color: var(--accent-amber);
}

/* ==========================================================================
   3D PREVIEW MODAL (THREE.JS)
   ========================================================================== */
.preview-modal-box {
  max-width: 900px;
  width: 95%;
  height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.preview-modal-header {
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.preview-modal-body {
  flex: 1;
  position: relative;
  background: #03060f;
  display: flex;
}

#threejsViewportCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.preview-modal-toolbar {
  position: absolute;
  bottom: 1rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10;
}

.preview-tool-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.preview-tool-btn:hover, .preview-tool-btn.active {
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
}

.preview-modal-footer {
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
}

.model-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 20;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#globalToastContainer {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: all;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 260px;
  max-width: 400px;
}

.toast.toast-success { border-color: var(--accent-emerald); }
.toast.toast-error { border-color: var(--accent-rose); }
.toast.toast-warning { border-color: var(--accent-amber); }
.toast.toast-info { border-color: var(--accent-cyan); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.portal-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-block: 4rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-col h4 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--accent-cyan);
}

/* Footer Preferences Section */
.footer-preferences {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem 1.75rem;
  margin-bottom: 2rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.footer-pref-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-pref-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-pref-label svg {
  color: var(--accent-cyan);
}

/* Dropup for Language Selector in Footer */
.dropup {
  position: relative;
}

.dropup .lang-dropdown {
  top: auto;
  bottom: calc(100% + 8px);
}

.dropup .lang-dropdown.show {
  animation: fadeInUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Segmented Theme Picker in Footer */
.theme-segmented-picker {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  gap: 0.25rem;
}

.theme-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-pill-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.theme-pill-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-glow);
}

[data-theme="light"] .theme-pill-btn.active {
  background: #ffffff;
  color: #0284c7;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

[data-theme="extravagant"] .theme-pill-btn.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 0, 127, 0.15));
  color: #ffd700;
  border-color: #ffd700;
}

.theme-pill-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   STUDIO HUB PAGE (studio.html)
   ========================================================================== */
.studio-hero {
  padding-block: 4.5rem 2.5rem;
  text-align: center;
  position: relative;
}

.studio-hero-content {
  max-width: 820px;
  margin-inline: auto;
}

.studio-showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-top: 2.5rem;
}

@media (max-width: 900px) {
  .studio-showcase-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.studio-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.studio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.studio-card.card-imagemaker::before {
  background: linear-gradient(90deg, var(--accent-cyan), #00b4d8);
}

.studio-card.card-keychain::before {
  background: linear-gradient(90deg, var(--accent-violet), #c77dff);
}

.studio-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-xl), 0 0 35px rgba(0, 240, 255, 0.12);
}

.studio-card.card-keychain:hover {
  box-shadow: var(--shadow-xl), 0 0 35px rgba(123, 44, 191, 0.18);
}

.studio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.studio-card-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
}

.studio-card-icon.icon-cyan {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.studio-card-icon.icon-violet {
  background: rgba(123, 44, 191, 0.15);
  color: #c77dff;
  border: 1px solid rgba(123, 44, 191, 0.35);
}

.studio-card-preview {
  width: 100%;
  height: 200px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.studio-card:hover .studio-card-preview img {
  transform: scale(1.04);
}

.studio-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-secondary);
}

.studio-card-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.studio-card-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
  flex: 1;
}

.studio-card-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

.studio-card-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.studio-card-features svg {
  flex-shrink: 0;
}

.studio-compare-wrap {
  margin-top: 4.5rem;
  padding: 3rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

.studio-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .studio-compare-wrap {
    padding: 1.75rem;
  }
  .studio-compare-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.studio-compare-col {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.studio-compare-col h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.studio-compare-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.studio-compare-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

