/* ==========================================================================
   TESLA STUDIO — PURE-COLOUR CINEMATIC LIVING FOOTER (#colophon)
   Zero background photos, zero clutter tabs — ONLY rich painted sky colour
   gradients + fluid 60fps panoramic student workshop animations, locked 100%
   inside #colophon!
   ========================================================================== */
html, body { overscroll-behavior-y: none; }

#colophon {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate !important;
  contain: layout paint;
  color: #ffffff;
  background-color: #1c2d4a;
}

/* Extend dotted CTA dock seamlessly underneath #colophon's curved wave (zero straight cut, zero clipped shadow!) */
body:has(.sfs-white-outro, .sp-dock-band) #colophon {
  margin-top: -96px !important;
  z-index: 10;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0,62 C240,12 480,108 740,56 C1000,4 1230,92 1440,36 L1440,120 L0,120 Z'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
  -webkit-mask-size: 100% 96px, 100% calc(100% - 94px);
  -webkit-mask-position: top center, 0 94px;
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0,62 C240,12 480,108 740,56 C1000,4 1230,92 1440,36 L1440,120 L0,120 Z'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
  mask-size: 100% 96px, 100% calc(100% - 94px);
  mask-position: top center, 0 94px;
  mask-repeat: no-repeat, no-repeat;
}

body:has(.sfs-white-outro, .sp-dock-band) #colophon .hfe-before-footer-wrap .elementor-shape-top {
  display: none !important;
}

body:has(.sfs-white-outro, .sp-dock-band) #colophon[data-activity] .hfe-before-footer-wrap [data-id="0c25525"] {
  padding-top: clamp(78px, 7.5vw, 104px) !important;
}

/* ==========================================================================
   PURE-COLOUR LUMINOUS SKY PALETTES (SMOOTH @property GRADIENT MORPH!)
   ========================================================================== */
@property --sky-top { syntax: '<color>'; inherits: true; initial-value: #183663; }
@property --sky-mid { syntax: '<color>'; inherits: true; initial-value: #2c6294; }
@property --sky-bot { syntax: '<color>'; inherits: true; initial-value: #6598b0; }
@property --sky-glow { syntax: '<color>'; inherits: true; initial-value: rgba(255, 212, 130, 0.52); }
@property --ground-bot { syntax: '<color>'; inherits: true; initial-value: #1f6d4a; }

#colophon[data-activity] {
  background-color: var(--sky-top, #183663);
  background-image:
    radial-gradient(ellipse 75% 58% at 50% 92%, var(--sky-glow, rgba(255, 212, 130, 0.52)), transparent 68%),
    linear-gradient(180deg, var(--sky-top, #183663) 0%, var(--sky-mid, #2c6294) 54%, var(--sky-bot, #6598b0) 100%);
}

@media (prefers-reduced-motion: no-preference) {
  #colophon[data-activity] {
    transition:
      --sky-top 1.2s ease,
      --sky-mid 1.2s ease,
      --sky-bot 1.2s ease,
      --sky-glow 1.2s ease,
      --ground-bot 1.2s ease,
      background-color 1.2s ease;
  }
}

/* 1. Golden-Hour Water Rocket Sky */
#colophon[data-activity="rocket"] {
  --sky-top: #183663;
  --sky-mid: #2c6294;
  --sky-bot: #6598b0;
  --sky-glow: rgba(255, 212, 130, 0.52);
  --ground-bot: #1f6d4a;
}

/* 2. STEM Robotics Aurora Teal */
#colophon[data-activity="rover"] {
  --sky-top: #102a42;
  --sky-mid: #164e63;
  --sky-bot: #1e6b7b;
  --sky-glow: rgba(103, 232, 249, 0.36);
  --ground-bot: #0b202e;
}

/* 3. Magical Science Lab Cosmic Violet */
#colophon[data-activity="science"] {
  --sky-top: #23164d;
  --sky-mid: #43237d;
  --sky-bot: #6b2e8e;
  --sky-glow: rgba(244, 114, 182, 0.4);
  --ground-bot: #130b2c;
}

/* 4. Sunlit Hydroponic Emerald Polyhouse */
#colophon[data-activity="garden"] {
  --sky-top: #133b30;
  --sky-mid: #1d634d;
  --sky-bot: #2f8a68;
  --sky-glow: rgba(187, 247, 208, 0.42);
  --ground-bot: #0e3025;
}

/* 5. Sunset Art & Paper Gliders Warm Amber-Coral */
#colophon[data-activity="craft"] {
  --sky-top: #451e3e;
  --sky-mid: #7d324d;
  --sky-bot: #b95a4b;
  --sky-glow: rgba(253, 216, 138, 0.46);
  --ground-bot: #29121e;
}

/* 6. Deep Space Observatory Night (STRICTLY INSIDE #colophon ONLY!) */
#colophon[data-activity="night"] {
  --sky-top: #07091c;
  --sky-mid: #13163b;
  --sky-bot: #241f54;
  --sky-glow: rgba(165, 148, 249, 0.38);
  --ground-bot: #23284f;
}

/* Starry night-sky overlay scoped STRICTLY INSIDE #colophon */
#colophon .studio-night-sky {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background-image:
    radial-gradient(1.2px 1.2px at 17% 29%, #ffffff, transparent),
    radial-gradient(1.2px 1.2px at 69% 83%, #bbe5ff, transparent),
    radial-gradient(1.6px 1.6px at 38% 51%, #e9dcff, transparent),
    radial-gradient(1px 1px at 84% 22%, #fde68a, transparent),
    linear-gradient(145deg, #6269a41a, transparent 52%, #745aa12a);
  background-size: 103px 123px, 173px 139px, 261px 207px, 197px 157px, cover;
}

#colophon.is-footer-space .studio-night-sky {
  visibility: visible;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  #colophon .studio-night-sky { transition: opacity 0.7s ease, visibility 0s 0.7s; }
  #colophon.is-footer-space .studio-night-sky { transition-delay: 0s; }
  #colophon.is-footer-space .studio-night-sky i {
    position: absolute;
    left: var(--start-x, 78%);
    top: var(--start-y, 8%);
    width: clamp(56px, 8vw, 140px);
    height: 2px;
    border-radius: 100%;
    opacity: 0;
    transform-origin: right center;
    background: linear-gradient(90deg, transparent, #91bdff88 56%, #fff);
    animation: studio-meteor 7.5s linear infinite;
    animation-delay: var(--delay, 0.4s);
  }
  #colophon.is-footer-space .studio-night-sky i::after {
    content: "";
    position: absolute;
    right: 0;
    top: -1px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff5df;
    box-shadow: 0 0 8px 2px #bad5ff;
  }
  #colophon.is-footer-space .studio-night-sky i:nth-child(2) { --start-x: 46%; --start-y: 22%; --delay: 1.6s; }
  #colophon.is-footer-space .studio-night-sky i:nth-child(3) { --start-x: 92%; --start-y: 44%; --delay: 3.1s; }
  #colophon.is-footer-space .studio-night-sky i:nth-child(4) { --start-x: 58%; --start-y: 6%;  --delay: 4.8s; }
  #colophon.is-footer-space .studio-night-sky i:nth-child(5) { --start-x: 32%; --start-y: 35%; --delay: 6.1s; }
  @keyframes studio-meteor {
    0% { transform: translate(0, 0) rotate(145deg); opacity: 0; }
    3% { opacity: 0.96; }
    16%, 100% { transform: translate(-37vmin, 26vmin) rotate(145deg); opacity: 0; }
  }
}

/* ==========================================================================
   CLEAN ELEVATED FOOTER CONTENT (ZERO TABS, ZERO CLUTTER)
   ========================================================================== */
#colophon[data-activity] .hfe-before-footer-wrap { position: relative; z-index: 3; }
#colophon[data-activity] .hfe-before-footer-wrap [data-id="0c25525"] { background: none; padding-top: clamp(28px, 3.8vw, 52px); }
#colophon .hfe-before-footer-wrap [data-id="0c25525"] > .elementor-background-overlay { background: none; }

#colophon[data-activity] .site-primary-footer-wrap,
#colophon[data-activity] .site-below-footer-wrap {
  position: relative;
  z-index: 4;
  background: transparent !important;
}

#colophon[data-activity] .site-primary-footer-wrap {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

#colophon[data-activity] #media_image-3 {
  margin-bottom: 10px !important;
  text-align: center;
}

/* Matching Animated Teslastudio KINDERSPACE Vector Logo inside Footer */
#colophon .ts-footer-brand {
  display: inline-block;
  width: clamp(205px, 23vw, 272px);
  max-width: 82vw;
  aspect-ratio: 1478 / 732;
  margin: 0 auto;
  overflow: visible;
}

#colophon .ts-footer-brand-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 6px 18px rgba(6, 8, 26, 0.45));
}

#colophon .ts-footer-brand-svg .ts-logo-sh {
  fill: #ffffff !important;
}

#colophon .ts-footer-brand-svg .ts-footer-studio-blue path {
  fill: #9ba7ff !important;
}

#colophon .ts-footer-brand-svg,
#colophon .ts-footer-brand-svg * {
  transition: none !important;
}

#colophon[data-activity] #text-3 {
  max-width: 650px;
  margin: 0 auto 14px !important;
}

#colophon[data-activity] #text-3 p {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
  font-size: clamp(0.92rem, 1.25vw, 1.04rem) !important;
  line-height: 1.62 !important;
  color: rgba(248, 246, 255, 0.92) !important;
  text-shadow: 0 2px 10px rgba(8, 10, 26, 0.32);
}

#colophon .studio-footer-menu {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 10px !important;
  flex-wrap: wrap;
  margin-top: 12px !important;
}

#colophon .studio-footer-menu a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px !important;
  padding: 6px 18px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.13) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  color: #ffffff !important;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  text-decoration: none !important;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

#colophon .studio-footer-menu a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.24) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}

/* Dark / Light Mode Animated Slider Toggle harmoniously integrated into Footer Pill Row */
#colophon .ts-footer-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

#colophon .ts-footer-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 3px 5px 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#colophon .ts-footer-theme-pill:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

#colophon .ts-footer-theme-label {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.94) !important;
  line-height: 1 !important;
  user-select: none;
  cursor: pointer;
}

#colophon .ts-theme-btn {
  width: 58px !important;
  height: 28px !important;
  padding: 2.5px !important;
  box-shadow: 0 2px 10px rgba(8, 12, 32, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.28) !important;
}

#colophon .ts-theme-btn .ts-toggle-knob {
  width: 23px !important;
  height: 23px !important;
}

#colophon .ts-theme-btn .ts-ico-sun,
#colophon .ts-theme-btn .ts-ico-moon {
  width: 16px !important;
  height: 16px !important;
}

html[data-theme="dark"] #colophon .ts-theme-btn .ts-toggle-knob {
  transform: translateX(30px) !important;
}

@media (max-width: 540px) {
  #colophon .ts-footer-divider {
    display: none;
  }
}

/* ==========================================================================
   FULL-WIDTH PANORAMIC CINEMATIC ANIMATED STAGE
   ========================================================================== */
#colophon .footer-activity {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  height: clamp(235px, 31vw, 350px);
  margin: -10px 0 0;
  pointer-events: none;
  overflow: hidden;
}

#colophon[data-activity] .site-below-footer-wrap {
  border: 0 !important;
  min-height: 0 !important;
  margin-top: -2px !important;
  padding: 10px 20px 14px !important;
  background: linear-gradient(180deg, var(--ground-bot, #18233a) 0%, color-mix(in srgb, var(--ground-bot, #18233a), #050610 42%) 100%) !important;
}

#colophon[data-activity] .site-below-footer-inner-wrap {
  min-height: 0 !important;
}

#colophon[data-activity] .ast-footer-copyright p,
#colophon[data-activity] .ast-builder-html-element p {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif !important;
  font-size: 0.78rem !important;
  color: rgba(244, 242, 255, 0.88) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Keep page canvas clean in Light & Dark Mode — never bleed footer night color onto html */
html[data-studio-page] { background-color: #ffffff; }
html[data-theme="dark"][data-studio-page] { background-color: #0f0c1f; }

/* Only the launching water rocket crosses the footer boundary */
.footer-rocket-flight {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
  overflow: hidden;
  visibility: hidden;
}

@media (max-width: 640px) {
  #colophon .footer-activity {
    height: clamp(205px, 50vw, 260px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-rocket-flight { display: none; }
}
