/*!
 * TempMailG Animated Brand Logo — Stylesheet
 * High-performance, physics-driven logo component for TempMailG.
 * 100% CORS-safe for file:/// and http(s):// environments.
 */

.tempmailg-logo {
  --tm-ink: #221f20;
  --tm-blue: #2080df;
  --tm-cyan: #00e5ff;
  --tm-ring: #00d2ff;
  --tm-gold: #fbb03b;
  --tm-badge-bg: #131a29;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  height: 42px;
  width: calc(42px * 684 / 183);
  line-height: 0;
  user-select: none;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.tempmailg-logo:hover {
  filter: drop-shadow(0 2px 10px rgba(32, 128, 223, 0.2));
}

/* Theme adaptability & Navbar integration:
 * - Default: Light backgrounds & sticky navbar. Letters "Temp" (data-group="ink") are dark #221f20.
 * - Non-sticky navbar inside .header: Background is dark gradient, so "Temp" letters become white.
 * - Sticky navbar (.nav.nav-sticky): Background is white #ffffff, so "Temp" letters are strictly dark.
 * - Explicit dark containers ([data-theme="dark"], body.dark, etc.): Invert to white.
 * Note: prefers-color-scheme is deliberately NOT used because the website navbar is light,
 * which prevented white-on-white text collision when user has OS-level dark mode enabled.
 */

.tempmailg-logo__letter,
.tempmailg-logo__premium {
  transition: filter 0.25s ease;
}

/* 1. Inside dark gradient header (prior to sticky scroll) */
.header .nav:not(.nav-sticky) .tempmailg-logo .tempmailg-logo__letter[data-group="ink"],
.header .nav:not(.nav-sticky) .tempmailg-logo .tempmailg-logo__premium {
  filter: brightness(0) invert(1);
}

/* 2. On sticky navbar (solid white background #ffffff) or explicit light container */
.nav.nav-sticky .tempmailg-logo .tempmailg-logo__letter[data-group="ink"],
.nav.nav-sticky .tempmailg-logo .tempmailg-logo__premium,
.tempmailg-logo[data-theme="light"] .tempmailg-logo__letter[data-group="ink"],
.tempmailg-logo[data-theme="light"] .tempmailg-logo__premium {
  filter: none !important;
}

/* 3. Explicit dark mode container overrides */
.tempmailg-logo[data-theme="dark"],
body.dark .tempmailg-logo,
body.dark-mode .tempmailg-logo,
[data-bs-theme="dark"] .tempmailg-logo,
.dark-theme .tempmailg-logo {
  --tm-ink: #ffffff;
  --tm-blue: #3894f8;
  --tm-cyan: #22e9ff;
  --tm-ring: #38bdf8;
}

.tempmailg-logo[data-theme="dark"] .tempmailg-logo__letter[data-group="ink"],
.tempmailg-logo[data-theme="dark"] .tempmailg-logo__premium,
body.dark .tempmailg-logo .tempmailg-logo__letter[data-group="ink"],
body.dark .tempmailg-logo .tempmailg-logo__premium,
body.dark-mode .tempmailg-logo .tempmailg-logo__letter[data-group="ink"],
body.dark-mode .tempmailg-logo .tempmailg-logo__premium,
[data-bs-theme="dark"] .tempmailg-logo .tempmailg-logo__letter[data-group="ink"],
[data-bs-theme="dark"] .tempmailg-logo .tempmailg-logo__premium,
.dark-theme .tempmailg-logo .tempmailg-logo__letter[data-group="ink"],
.dark-theme .tempmailg-logo .tempmailg-logo__premium {
  filter: brightness(0) invert(1);
}

/* Internal virtual canvas scaling (native coordinates: 684x183) */
.tempmailg-logo__scale {
  position: absolute;
  left: 0;
  top: 0;
  width: 684px;
  height: 183px;
  transform-origin: 0 0;
  pointer-events: auto;
}

.tempmailg-logo__scale > * {
  position: absolute;
}

/* Left Badge (Squircle + Speed Lines + Envelope) */
.tempmailg-logo__badge {
  position: absolute;
  left: 6px;
  top: 19px;
  width: 140px;
  height: 137px;
  opacity: 0;
  transform-origin: 50% 60%;
  pointer-events: none;
}

.tempmailg-logo__badge img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Speed Streak Lines on entrance */
.tempmailg-logo__streak {
  position: absolute;
  left: 2px;
  top: 65px;
  width: 32px;
  height: 38px;
  pointer-events: none;
}

.tempmailg-logo__streak span {
  display: block;
  height: 4px;
  background: var(--tm-cyan);
  border-radius: 4px;
  margin-bottom: 7px;
  box-shadow: 0 0 10px var(--tm-cyan);
  transform-origin: 100% 50%;
  opacity: 0;
}

/* Shockwave expansion rings */
.tempmailg-logo__ring {
  border-radius: 50%;
  border: 3px solid var(--tm-ring);
  opacity: 0;
  box-sizing: border-box;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.45), inset 0 0 10px rgba(0, 210, 255, 0.2);
  will-change: transform, opacity, width, height;
}

/* Wordmark Letters container */
.tempmailg-logo__wm {
  position: absolute;
  left: 0;
  top: 0;
  width: 684px;
  height: 183px;
  overflow: visible;
  pointer-events: none;
}

/* Letter item using img tag (100% CORS-safe in file:/// and http) */
.tempmailg-logo__letter {
  position: absolute;
  opacity: 0;
  transform-origin: 50% 100%;
  pointer-events: none;
  display: block;
  will-change: transform;
}

/* Premium Crown with ample spacing above letter g */
.tempmailg-logo__crown {
  position: absolute;
  left: 610px;
  top: -4px;
  width: 70px;
  height: 62px;
  opacity: 0;
  transform-origin: 50% 100%;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(251, 176, 59, 0.45));
}

.tempmailg-logo__crown img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Premium Text Label */
.tempmailg-logo__premium {
  position: absolute;
  left: 415px;
  top: 125px;
  width: 203px;
  height: 32px;
  opacity: 0;
  transform-origin: 50% 50%;
  pointer-events: none;
}

.tempmailg-logo__premium img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Glint sheen sweep */
.tempmailg-logo__glint {
  position: absolute;
  left: 6px;
  top: 19px;
  width: 140px;
  height: 137px;
  border-radius: 28px;
  pointer-events: none;
  mix-blend-mode: overlay;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.8) 50%, transparent 62%) 200% 0 / 300% 100% no-repeat;
  opacity: 0;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .tempmailg-logo__badge,
  .tempmailg-logo__letter,
  .tempmailg-logo__crown,
  .tempmailg-logo__premium {
    opacity: 1 !important;
    transform: none !important;
  }
  .tempmailg-logo__ring,
  .tempmailg-logo__streak,
  .tempmailg-logo__glint {
    display: none !important;
  }
}
