/* ─── Brand hero — animated MizCode logo intro ─── */
[id] {
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.hero-brand {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 32px) 0 48px;
  overflow: hidden;
  text-align: center;
}

.hero-brand-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-brand-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  animation: orbFloat 20s ease-in-out infinite;
}

.hero-brand-orb-1 {
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  top: -12%;
  left: -8%;
  background: rgba(99, 102, 241, 0.28);
}

.hero-brand-orb-2 {
  width: min(360px, 60vw);
  height: min(360px, 60vw);
  bottom: -10%;
  right: -6%;
  background: rgba(34, 197, 94, 0.18);
  animation-delay: -8s;
}

.hero-brand-orb-3 {
  width: min(240px, 45vw);
  height: min(240px, 45vw);
  top: 40%;
  right: 20%;
  background: rgba(255, 179, 71, 0.14);
  animation-delay: -4s;
}

.hero-brand-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 75%);
}

.hero-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 720px;
}

.hero-logo-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(180px, 40vw, 280px);
  height: clamp(180px, 40vw, 280px);
  transform: translate(-50%, -58%);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 68%);
  animation: heroGlowPulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -58%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -58%) scale(1.08); }
}

.hero-logo-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(200px, 48vw, 300px);
  height: clamp(200px, 48vw, 300px);
  transform: translate(-50%, -62%);
  animation: heroOrbitSpin 24s linear infinite;
  pointer-events: none;
}

.hero-orbit-item {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ds-primary-soft);
  background: linear-gradient(145deg, var(--color-bg-card), var(--color-bg-soft));
  border: 2px solid rgba(129, 140, 248, 0.35);
  border-radius: 10px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15), var(--clay-shadow-in);
}

.hero-orbit-item:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.hero-orbit-item:nth-child(2) { top: 50%; right: 0; transform: translateY(-50%); }
.hero-orbit-item:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); }
.hero-orbit-item:nth-child(4) { top: 50%; left: 0; transform: translateY(-50%); }
.hero-orbit-item:nth-child(5) { top: 14%; right: 14%; }
.hero-orbit-item:nth-child(6) { bottom: 14%; left: 14%; }

@keyframes heroOrbitSpin {
  from { transform: translate(-50%, -62%) rotate(0deg); }
  to { transform: translate(-50%, -62%) rotate(360deg); }
}

.logo-icon-wrap.logo-icon-hero {
  width: clamp(100px, 22vw, 148px);
  height: clamp(100px, 22vw, 148px);
  margin-bottom: 20px;
  padding: 6px;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.15), rgba(28, 22, 52, 0.6));
  border: 3px solid rgba(129, 140, 248, 0.4);
  border-radius: 28px;
  box-shadow:
    0 10px 0 rgba(0, 0, 0, 0.18),
    0 20px 50px rgba(99, 102, 241, 0.25),
    var(--clay-shadow-in);
  animation: heroLogoFloat 5s ease-in-out infinite;
}

@keyframes heroLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.logo-mark--hero .logo-bg-ring {
  animation: logoRingPulse 3s ease-in-out infinite;
}

@keyframes logoRingPulse {
  0%, 100% { opacity: 0.25; stroke-width: 1.5; }
  50% { opacity: 0.55; stroke-width: 2; }
}

.logo-mark--hero .lb {
  opacity: 0;
  animation:
    heroBlockSnap 0.65s cubic-bezier(0.34, 1.4, 0.64, 1) forwards,
    logoBlock 2.8s ease-in-out 1.4s infinite;
}

.logo-mark--hero .lb1 { --snap-x: -14px; --snap-y: -10px; animation-delay: 0.15s, 1.55s; }
.logo-mark--hero .lb2 { --snap-x: -12px; --snap-y: 14px; animation-delay: 0.28s, 1.68s; }
.logo-mark--hero .lb3 { --snap-x: 0px; --snap-y: 8px; animation-delay: 0.42s, 1.82s; }
.logo-mark--hero .lb4 { --snap-x: 14px; --snap-y: -10px; animation-delay: 0.55s, 1.95s; }
.logo-mark--hero .lb5 { --snap-x: 12px; --snap-y: 14px; animation-delay: 0.68s, 2.08s; }

@keyframes heroBlockSnap {
  from {
    opacity: 0;
    transform: translate(var(--snap-x, 0), var(--snap-y, 0)) scale(0.4) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
}

.logo-mark--hero .logo-spark {
  opacity: 0;
  animation: heroSparkPop 0.5s cubic-bezier(0.34, 1.5, 0.64, 1) 0.9s forwards, logoSpark 3s ease-in-out 1.4s infinite;
  transform-origin: 37px 9px;
}

@keyframes heroSparkPop {
  from { opacity: 0; transform: scale(0) rotate(-30deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.logo-mark--hero .logo-connectors {
  opacity: 0;
  animation: heroConnectors 0.6s ease-out 1s forwards;
}

@keyframes heroConnectors {
  to { opacity: 0.45; }
}

.hero-brand-title {
  margin: 0 0 12px;
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  animation: heroBrandIn 0.8s var(--ease-out) 0.5s both;
}

.hero-brand-wordmark .wm-miz {
  color: #F8FAFC;
}

.hero-brand-wordmark .wm-code {
  background: linear-gradient(90deg, #6EE7B7, #FBBF24, #A78BFA, #6EE7B7);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 4s linear infinite;
}

.hero-brand-tagline {
  margin: 0 0 20px;
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 28ch;
  animation: heroBrandIn 0.8s var(--ease-out) 0.7s both;
}

.hero-brand-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  animation: heroBrandIn 0.8s var(--ease-out) 0.85s both;
}

.hero-brand-chips span {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  background: linear-gradient(145deg, var(--color-bg-card), var(--color-bg-soft));
  border: 2px solid rgba(129, 140, 248, 0.3);
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.hero-brand-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  animation: heroBrandIn 0.8s var(--ease-out) 1s both;
}

.hero-scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s, transform 0.2s;
  animation: heroBrandIn 0.8s var(--ease-out) 1.15s both, heroScrollBounce 2.2s ease-in-out 2s infinite;
}

.hero-scroll-cue:hover {
  color: var(--ds-primary-soft);
}

.hero-scroll-cue svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

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

@keyframes heroScrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-logo-orbit {
    display: none;
  }

  .hero-brand {
    min-height: auto;
    padding: calc(var(--header-height) + 24px) 0 36px;
  }

  .hero-logo-orbit {
    width: clamp(170px, 55vw, 220px);
    height: clamp(170px, 55vw, 220px);
  }

  .hero-orbit-item {
    width: 30px;
    height: 30px;
    font-size: 0.62rem;
    border-radius: 8px;
  }

  .hero-brand-chips span {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .hero-brand-cta {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }

  .hero-brand-cta .btn {
    width: 100%;
    min-height: 48px;
  }
}

@media (max-width: 480px) {
  .hero-orbit-item:nth-child(5),
  .hero-orbit-item:nth-child(6) {
    display: none;
  }

  .hero-logo-orbit {
    animation-duration: 32s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo-orbit,
  .logo-icon-wrap.logo-icon-hero,
  .hero-logo-glow,
  .hero-brand-orb,
  .hero-scroll-cue {
    animation: none;
  }

  .logo-mark--hero .lb {
    opacity: 1;
    animation: logoBlock 2.8s ease-in-out infinite;
  }

  .logo-mark--hero .logo-spark {
    opacity: 1;
    animation: logoSpark 3s ease-in-out infinite;
  }
}

/* Tighter spacing when brand hero flows into content hero */
.hero-brand + .hero-edtech {
  padding-top: 40px;
}

@media (max-width: 768px) {
  .hero-brand + .hero-edtech {
    padding-top: 32px;
  }
}
