/* ==========================================================================
   Effat Jahan — Mesmerizing Digital Presence
   Designed with Modern Web Standards, Dynamic Viewports, and GPU Accelerations
   ========================================================================== */

/* --- 1. Design Tokens & Theme Palettes --- */
:root {
  /* Default Theme: Cosmic Midnight */
  --bg-primary: #05060f;
  --bg-secondary: #0c0e22;
  --text-main: #f8fafc;
  --text-muted: rgba(226, 232, 240, 0.7);
  --text-sparkle: #e0e7ff;
  
  --aurora-1: rgba(99, 102, 241, 0.45);   /* Indigo / Electric Violet */
  --aurora-2: rgba(56, 189, 248, 0.35);   /* Cyan / Sky */
  --aurora-3: rgba(236, 72, 153, 0.3);    /* Magenta Pink */
  --aurora-core: rgba(168, 85, 247, 0.25);

  --card-bg: rgba(15, 23, 42, 0.45);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-border-glow: rgba(129, 140, 248, 0.35);
  --card-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.75), 0 0 60px 0 rgba(99, 102, 241, 0.15);

  --accent-gold-1: #ffffff;
  --accent-gold-2: #e0e7ff;
  --accent-gold-3: #818cf8;
  --name-gradient: linear-gradient(135deg, #ffffff 0%, #e2e8f0 30%, #a5b4fc 65%, #c084fc 100%);
  --name-glow: rgba(165, 180, 252, 0.5);

  --dock-bg: rgba(15, 23, 42, 0.7);
  --dock-border: rgba(255, 255, 255, 0.12);
  --dock-hover: rgba(255, 255, 255, 0.15);

  --font-serif: 'Cinzel Decorative', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Theme 2: Starlight Gold */
body[data-theme="gold"] {
  --bg-primary: #0a0907;
  --bg-secondary: #181510;
  --text-main: #fffdfa;
  --text-muted: rgba(254, 243, 199, 0.75);
  --text-sparkle: #fde68a;

  --aurora-1: rgba(217, 119, 6, 0.4);     /* Deep Amber */
  --aurora-2: rgba(245, 158, 11, 0.35);    /* Warm Gold */
  --aurora-3: rgba(251, 191, 36, 0.25);   /* Radiant Sun */
  --aurora-core: rgba(245, 158, 11, 0.2);

  --card-bg: rgba(24, 21, 16, 0.48);
  --card-border: rgba(251, 191, 36, 0.2);
  --card-border-glow: rgba(245, 158, 11, 0.45);
  --card-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8), 0 0 60px 0 rgba(245, 158, 11, 0.2);

  --name-gradient: linear-gradient(135deg, #ffffff 0%, #fef3c7 35%, #fbbf24 70%, #d97706 100%);
  --name-glow: rgba(251, 191, 36, 0.55);

  --dock-bg: rgba(24, 21, 16, 0.75);
  --dock-border: rgba(251, 191, 36, 0.25);
  --dock-hover: rgba(251, 191, 36, 0.15);
}

/* Theme 3: Rose Quartz & Pearl */
body[data-theme="rose"] {
  --bg-primary: #0d060c;
  --bg-secondary: #1a0b18;
  --text-main: #fff5fb;
  --text-muted: rgba(253, 230, 243, 0.75);
  --text-sparkle: #fbcfe8;

  --aurora-1: rgba(244, 63, 94, 0.35);    /* Rose */
  --aurora-2: rgba(217, 70, 239, 0.35);   /* Orchid */
  --aurora-3: rgba(251, 113, 133, 0.3);   /* Petal Glow */
  --aurora-core: rgba(236, 72, 153, 0.25);

  --card-bg: rgba(26, 11, 24, 0.48);
  --card-border: rgba(244, 114, 182, 0.22);
  --card-border-glow: rgba(244, 63, 94, 0.4);
  --card-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8), 0 0 60px 0 rgba(244, 63, 94, 0.2);

  --name-gradient: linear-gradient(135deg, #ffffff 0%, #fce7f3 35%, #f472b6 70%, #e11d48 100%);
  --name-glow: rgba(244, 114, 182, 0.55);

  --dock-bg: rgba(26, 11, 24, 0.75);
  --dock-border: rgba(244, 114, 182, 0.25);
  --dock-hover: rgba(244, 114, 182, 0.15);
}

/* Theme 4: Emerald Borealis */
body[data-theme="emerald"] {
  --bg-primary: #030d09;
  --bg-secondary: #071a13;
  --text-main: #f0fdf4;
  --text-muted: rgba(220, 252, 231, 0.75);
  --text-sparkle: #a7f3d0;

  --aurora-1: rgba(16, 185, 129, 0.35);   /* Emerald */
  --aurora-2: rgba(45, 212, 191, 0.35);   /* Teal */
  --aurora-3: rgba(6, 182, 212, 0.28);    /* Cyan Stream */
  --aurora-core: rgba(16, 185, 129, 0.2);

  --card-bg: rgba(7, 26, 19, 0.5);
  --card-border: rgba(52, 211, 153, 0.22);
  --card-border-glow: rgba(16, 185, 129, 0.4);
  --card-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8), 0 0 60px 0 rgba(16, 185, 129, 0.2);

  --name-gradient: linear-gradient(135deg, #ffffff 0%, #d1fae5 35%, #34d399 70%, #059669 100%);
  --name-glow: rgba(52, 211, 153, 0.55);

  --dock-bg: rgba(7, 26, 19, 0.75);
  --dock-border: rgba(52, 211, 153, 0.25);
  --dock-hover: rgba(52, 211, 153, 0.15);
}

/* --- 2. Base Reset & Layout --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-size: 16px;
  background-color: var(--bg-primary);
  color-scheme: dark;
}

body {
  width: 100vw;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1), color 0.8s ease;
  user-select: none;
  -webkit-user-select: none;
}

/* Background Canvas Layer */
#celestial-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 1;
}

/* Aurora Mesh Lighting */
.aurora-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.85;
  transform: translateZ(0);
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform, opacity;
  transition: background 1.2s ease;
}

.orb-1 {
  width: min(70vw, 650px);
  height: min(70vw, 650px);
  top: -15%;
  left: -10%;
  background: radial-gradient(circle, var(--aurora-1) 0%, transparent 70%);
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: min(80vw, 750px);
  height: min(80vw, 750px);
  bottom: -20%;
  right: -15%;
  background: radial-gradient(circle, var(--aurora-2) 0%, transparent 70%);
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

.orb-3 {
  width: min(60vw, 550px);
  height: min(60vw, 550px);
  top: 40%;
  right: 25%;
  background: radial-gradient(circle, var(--aurora-3) 0%, transparent 70%);
  animation: floatOrb3 15s ease-in-out infinite alternate;
}

.aurora-glow-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(50vw, 450px);
  height: min(50vw, 450px);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--aurora-core) 0%, transparent 75%);
  animation: pulseCore 8s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(120px, 80px, 0) scale(1.15); }
}

@keyframes floatOrb2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-100px, -90px, 0) scale(1.1); }
}

@keyframes floatOrb3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-70px, 110px, 0) scale(1.2); }
}

@keyframes pulseCore {
  0% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.25); }
}

/* Subtle Film Grain */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 2;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- 3. Viewport Stage --- */
.viewport-stage {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: clamp(1rem, 2.5dvh, 2rem) clamp(1rem, 3dvw, 2.5rem);
}

/* --- 4. Top Header --- */
.top-bar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pulsing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulseDot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.monogram-emblem {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}

.monogram-emblem:hover {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--card-border-glow);
}

.monogram-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--name-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.monogram-halo {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  animation: rotateHalo 20s linear infinite;
}

@keyframes rotateHalo {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.time-badge {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
}

/* --- 5. Hero Stage & 3D Interactive Card --- */
.hero-stage {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  padding: 1rem 0;
}

.card-wrapper {
  position: relative;
  width: 100%;
  max-width: 860px;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.glass-card {
  position: relative;
  width: 100%;
  padding: clamp(2.5rem, 6dvh, 4.8rem) clamp(1.5rem, 4dvw, 4rem);
  background: var(--card-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.8s ease, box-shadow 0.8s ease;
  transform-style: preserve-3d;
}

/* Specular Glare / Holographic sheen */
.card-glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.05) 30%,
    transparent 65%
  );
  pointer-events: none;
  opacity: 0.8;
  mix-blend-mode: overlay;
  transition: opacity 0.3s ease;
}

/* Luxury Corner Flourishes */
.corner-flourish {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  transition: border-color 0.4s ease;
}

.corner-tl { top: 16px; left: 16px; border-top: 1px solid; border-left: 1px solid; }
.corner-tr { top: 16px; right: 16px; border-top: 1px solid; border-right: 1px solid; }
.corner-bl { bottom: 16px; left: 16px; border-bottom: 1px solid; border-left: 1px solid; }
.corner-br { bottom: 16px; right: 16px; border-bottom: 1px solid; border-right: 1px solid; }

.glass-card:hover .corner-flourish {
  border-color: var(--card-border-glow);
}

/* Overhead Tag */
.overhead-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: clamp(1rem, 2.5dvh, 1.8rem);
  transform: translateZ(30px);
}

.tag-sparkle {
  color: var(--text-sparkle);
  font-size: 0.85rem;
  animation: sparkleTwinkle 3s ease-in-out infinite alternate;
}

@keyframes sparkleTwinkle {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0.6; }
  100% { transform: scale(1.2) rotate(180deg); opacity: 1; }
}

.tag-label {
  font-family: var(--font-sans);
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- 6. Master Name Display --- */
.master-name {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7.5vw + 0.8rem, 6.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: clamp(0.8rem, 2vw, 2.2rem);
  row-gap: 0.5rem;
  transform: translateZ(50px);
  margin-bottom: clamp(1rem, 2.5dvh, 2rem);
  cursor: default;
}

.first-name, .last-name {
  display: inline-flex;
  white-space: nowrap;
}

/* Interactive Letter Characters */
.char {
  position: relative;
  display: inline-block;
  background: var(--name-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 35px var(--name-glow);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              filter 0.35s ease,
              text-shadow 0.35s ease;
  will-change: transform, filter;
  padding: 0 0.03em;
}

.char:hover, .char.active-glow {
  transform: translateY(-8px) scale(1.12) rotate(-1.5deg);
  filter: brightness(1.3) drop-shadow(0 0 20px var(--name-glow));
}

/* Aesthetic Subtitle */
.aesthetic-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.8vw, 1.6rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.15em;
  color: var(--text-sparkle);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.5rem, 1.2vw, 1.2rem);
  transform: translateZ(35px);
  margin-bottom: clamp(1rem, 2dvh, 1.8rem);
  opacity: 0.9;
}

.bullet {
  font-size: 0.45em;
  color: var(--text-muted);
  vertical-align: middle;
}

/* Interactive Hint */
.interactive-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
  transform: translateZ(20px);
  transition: opacity 0.3s ease;
}

.glass-card:hover .interactive-hint {
  opacity: 0.9;
}

.hint-icon {
  color: var(--text-sparkle);
  font-size: 0.65rem;
}

/* --- 7. Action Dock / Controls --- */
.action-dock {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--dock-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--dock-border);
  border-radius: 9999px;
  box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.6);
  z-index: 10;
  transition: background 0.5s ease, border-color 0.5s ease;
  margin-bottom: 0.5dvh;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  outline: none;
  transition: background-color 0.25s ease, transform 0.2s ease, color 0.25s ease;
  white-space: nowrap;
}

.dock-btn:hover {
  background: var(--dock-hover);
  transform: translateY(-2px);
}

.dock-btn:focus-visible {
  outline: 2px solid var(--card-border-glow);
  outline-offset: 2px;
}

.dock-btn:active {
  transform: translateY(0) scale(0.97);
}

.dock-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: currentColor;
}

.dock-fullscreen .dock-btn {
  padding: 0.45rem 0.55rem;
}

/* --- 8. Footer --- */
.bottom-footer {
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  opacity: 0.65;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.bottom-footer strong {
  font-weight: 600;
  color: var(--text-main);
}

.separator {
  font-size: 0.6rem;
}

/* --- 9. Toast Notification --- */
.toast-notification {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translate(-50%, 20px) scale(0.95);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border-glow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px var(--name-glow);
  padding: 0.6rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.3s;
  z-index: 100;
}

.toast-notification.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.toast-sparkle {
  color: #fbbf24;
}

/* --- 10. Responsive Breakpoints --- */
@media (max-width: 768px) {
  .viewport-stage {
    padding: 1rem 1rem 1.2rem 1rem;
  }

  .status-badge {
    display: none; /* Keep top bar clean on mobile */
  }

  .top-bar {
    justify-content: space-between;
  }

  .glass-card {
    padding: 2.2rem 1.2rem;
    border-radius: 1.5rem;
  }

  .action-dock {
    max-width: 96vw;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.35rem 0.5rem;
  }

  .action-dock::-webkit-scrollbar {
    display: none;
  }

  .dock-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.72rem;
  }

  .dock-fullscreen {
    display: none; /* Native fullscreen often restricted on mobile safari */
  }
}

@media (max-width: 480px) {
  .master-name {
    flex-direction: column;
    row-gap: 0.2rem;
  }

  .name-separator {
    display: none;
  }

  .dock-label {
    display: none; /* Show sleek icon-only buttons on ultra-compact mobile */
  }

  .dock-btn {
    padding: 0.5rem 0.65rem;
  }
}

/* --- 11. Accessibility: Prefers-Reduced-Motion --- */
@media (prefers-reduced-motion: reduce) {
  .aurora-orb, .aurora-glow-center, .pulsing-dot, .monogram-halo, .tag-sparkle {
    animation: none !important;
  }

  .card-wrapper {
    transition: none !important;
  }

  .char {
    transition: none !important;
  }
}
