/* SpaceGuard / Hero v7 — independent, tested animation in app.js (requestAnimationFrame).
   Keep this file loaded AFTER styles.css. */

/* Manual navigation animation: write scrollTop every frame without
   the browser trying to apply a second CSS smooth scroll. */
html.sg-controlled-scroll, html.sg-controlled-scroll:focus-within {
  scroll-behavior: auto !important;
}

/* ATOM POSITION — EDIT THESE 5 PAIRS TO MOVE THE ATOM.
   left: bigger number = further right; top: smaller number = higher.
   Desktop/tablet: percentages relative to .hero-visual.
   Mobile: left values use calc(50% + Npx), calculated from the mascot center
   and the SVG size. This keeps the atom above the palm at any viewport width.
   Increase N to move right, decrease N to move left.
   Mobile 'top' remains a percentage of .hero-visual height. */
:root {
  --sg-atom-left-desktop: 64%;
  --sg-atom-top-desktop: 25.3%;
  --sg-atom-left-laptop: 64.5%;
  --sg-atom-top-laptop: 24.9%;
  --sg-atom-left-tablet: 65.5%;
  --sg-atom-top-tablet: 24.3%;
  --sg-atom-left-mobile: calc(50% + 49px);
  --sg-atom-top-mobile: 20.7%;
  --sg-atom-left-small: calc(50% + 39px);
  --sg-atom-top-small: 20.7%;
}

.hero { padding-bottom: 22px; }
.hero-inner.hero-layout-swap {
  display: grid;
  grid-template-columns: minmax(0, .97fr) minmax(0, 1.03fr);
  gap: clamp(12px, 2.5vw, 42px);
  min-height: 755px;
  align-items: center;
}
.hero-copy.hero-copy-right {
  grid-column: 2;
  grid-row: 1;
  order: 2;
  z-index: 4;
  padding: 32px 0 52px 0;
  justify-self: stretch;
  min-width: 0;
}
.hero-copy-right h1 {
  white-space: normal;
  letter-spacing: -.078em;
  font-size: clamp(49px, 5.05vw, 78px);
  line-height: 1.07;
  overflow-wrap: normal;
}
.hero-copy-right .hero-description { max-width: 565px; }
.hero-visual.hero-visual-refined {
  grid-column: 1;
  grid-row: 1;
  order: 1;
  min-height: 755px;
  width: 100%;
  height: 100%;
  position: relative;
  isolation: isolate;
  overflow: visible;
}
.hero-visual-refined .hero-glow {
  position: absolute;
  width: min(660px, 110%);
  height: 680px;
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #d89c3522 0%, #d89c3511 40%, transparent 73%);
  z-index: -1;
}
/* Perfectly concentric background circles, no transform skew. */
.hero-visual-refined .hero-orbit {
  position: absolute;
  left: 50%;
  top: 49%;
  border: 1px solid #bf92302b;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  width: auto;
  height: auto;
  aspect-ratio: 1;
}
.hero-visual-refined .hero-orbit-1 { width: 104%; border-color: #b98b302b; }
.hero-visual-refined .hero-orbit-2 { width: 80%; border-color: #be91312b; }
.hero-visual-refined .hero-orbit-3 { width: 57%; border-color: #c99f4130; }
.hero-visual-refined .hero-mascot.hero-mascot-enhanced {
  position: absolute;
  z-index: 2;
  left: 48.5%;
  bottom: 39px;
  right: auto;
  width: auto;
  height: 690px;
  max-width: none;
  object-fit: contain;
  transform: translateX(-50%);
  mask-image: none;
  -webkit-mask-image: none;
  filter: contrast(1.045) saturate(1.03) drop-shadow(0 20px 34px #0008) drop-shadow(0 0 20px #d89b301b);
}
.hero-visual-refined .floating-label { z-index: 6; }
.hero-visual-refined .floating-label-refined {
  position: absolute;
  top: 8%;
  left: 4%;
  bottom: auto;
  right: auto;
}
.hero-visual-refined .floating-label-refined-2 {
  position: absolute;
  top: 71%;
  left: 69%;
  bottom: auto;
  right: auto;
}
.sg-motion-toggle {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
  outline-offset: 4px;
}
.sg-motion-toggle:hover { background: #29241d; border-color: #d6ac56; }
.sg-motion-toggle:focus-visible { outline: 2px solid #ffdc7f; }
.sg-motion-toggle[aria-pressed="false"] { border-color: #6c6051; color: #aaa4a1; }
.sg-motion-state { display: inline; }
/* The atom uses fixed SVG orbits. JavaScript moves only the electron circles
   along those ellipse paths, keeping the trajectories stationary. */
.hero-visual-refined .hero-hand-atom {
  position: absolute;
  display: block;
  z-index: 5;
  width: 132px;
  height: 132px;
  left: var(--sg-atom-left-desktop);
  top: var(--sg-atom-top-desktop);
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 12px #ffca5c9e) drop-shadow(0 0 25px #ffb73766);
  will-change: transform;
}
.hero-bottom {
  z-index: 9;
  position: relative;
  padding: 18px 0 14px;
}
.hero-bottom span:first-child { margin-left: 8px; }

@media(max-width:1200px) {
  .hero-inner.hero-layout-swap { min-height: 690px; grid-template-columns: .96fr 1.04fr; gap: 16px; }
  .hero-visual.hero-visual-refined { min-height: 690px; }
  .hero-visual-refined .hero-mascot.hero-mascot-enhanced { height: 636px; bottom: 39px; left: 48%; }
  .hero-visual-refined .hero-hand-atom { width: 122px; height: 122px; left: var(--sg-atom-left-laptop); top: var(--sg-atom-top-laptop); }
  .hero-copy-right h1 { font-size: clamp(45px, 5.05vw, 66px); }
  .hero-visual-refined .floating-label-refined-2 { left: 66%; top: 72%; }
}
@media(max-width:1000px) {
  .hero-inner.hero-layout-swap { min-height: 620px; grid-template-columns: .92fr 1.08fr; }
  .hero-visual.hero-visual-refined { min-height: 620px; }
  .hero-visual-refined .hero-mascot.hero-mascot-enhanced { height: 565px; bottom: 40px; }
  .hero-visual-refined .hero-hand-atom { width: 107px; height: 107px; left: var(--sg-atom-left-tablet); top: var(--sg-atom-top-tablet); }
  .hero-copy-right h1 { font-size: clamp(40px, 5.25vw, 54px); }
  .hero-visual-refined .floating-label-refined-2 { left: 64%; top: 72%; }
  .hero-visual-refined .hero-orbit-1 { width: 108%; }
}
@media(max-width:760px) {
  .hero-inner.hero-layout-swap { display: flex; flex-direction: column; gap: 0; min-height: 0; align-items: stretch; }
  .hero-copy.hero-copy-right { order: 1; padding: 64px 0 10px; width: 100%; }
  .hero-copy-right h1 { font-size: clamp(43px, 9.4vw, 71px); }
  .hero-visual.hero-visual-refined { order: 2; grid-column: auto; grid-row: auto; min-height: 540px; height: 540px; }
  .hero-visual-refined .hero-mascot.hero-mascot-enhanced { left: 50%; height: 522px; bottom: 36px; }
  .hero-visual-refined .hero-glow { height: 540px; }
  .hero-visual-refined .hero-orbit-1 { width: min(510px, 105%); }
  .hero-visual-refined .hero-orbit-2 { width: min(400px, 83%); }
  .hero-visual-refined .hero-orbit-3 { width: min(270px, 59%); }
  .hero-visual-refined .hero-hand-atom { left: var(--sg-atom-left-mobile); top: var(--sg-atom-top-mobile); width: 104px; height: 104px; }
  .hero-visual-refined .floating-label-refined { top: 5%; left: 6%; }
  .hero-visual-refined .floating-label-refined-2 { left: 65%; top: 76%; }
  .hero-bottom { padding-top: 12px; }
}
@media(max-width:520px) {
  .hero-copy.hero-copy-right { padding: 54px 0 10px; }
  .hero-copy-right h1 { font-size: clamp(41px, 10vw, 55px); }
  .hero-visual.hero-visual-refined { min-height: 435px; height: 435px; }
  .hero-visual-refined .hero-mascot.hero-mascot-enhanced { height: 421px; bottom: 27px; }
  .hero-visual-refined .hero-glow { height: 435px; }
  .hero-visual-refined .hero-orbit-1 { width: min(420px, 106%); }
  .hero-visual-refined .hero-orbit-2 { width: min(300px, 81%); }
  .hero-visual-refined .hero-orbit-3 { width: min(210px, 55%); }
  .hero-visual-refined .hero-hand-atom { width: 82px; height: 82px; left: var(--sg-atom-left-small); top: var(--sg-atom-top-small); }
  .hero-visual-refined .floating-label-refined { top: 4%; left: 2%; }
  .hero-visual-refined .floating-label-refined-2 { left: 57%; top: 77%; }
  .hero-bottom span:first-child { font-size: 8px; letter-spacing: .13em; margin-left: 0; }
}

/* Keep badges off the character at all widths. */
@media(min-width:761px) {
  .hero-visual-refined .floating-label-refined { top: 2%; left: 0; }
}
@media(max-width:760px) {
  /* Keep the decorative badge in the upper-right empty sky, away from the palm and atom. */
  .hero-visual-refined .floating-label-refined-2 { top: 5%; left: auto; right: 2%; }
}
@media(max-width:520px) {
  .hero-visual-refined .floating-label-refined-2 { top: 4%; left: auto; right: 1%; font-size: 7px; padding: 7px 8px; gap: 5px; }
  .hero-visual-refined .floating-label-refined-2 svg { width: 12px; height: 12px; }
}


/* SpaceGuard v15: transparent logo mark and subtle floor beneath the mascot. */
.brand-icon.brand-icon-mascot,
.brand:hover .brand-icon.brand-icon-mascot {
  width: 44px;
  height: 47px;
  min-width: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}
.brand-icon.brand-icon-mascot img {
  display: block;
  width: 42px;
  height: 45px;
  max-width: none;
  object-fit: contain;
  object-position: center;
  transform: none;
  margin: auto;
  filter: drop-shadow(0 0 4px rgba(239,188,85,.17));
}
@media (max-width: 520px) {
  .brand-icon.brand-icon-mascot,
  .brand:hover .brand-icon.brand-icon-mascot { width: 36px; min-width: 36px; height: 40px; }
  .brand-icon.brand-icon-mascot img { width: 35px; height: 39px; }
}

/* A flat, understated illuminated landing pad inspired by the supplied reference.
   z-index:1 leaves boots and the animated atom clearly in front. */
.hero-visual-refined .sg-stage-floor {
  position: absolute;
  z-index: 1;
  left: 48.5%;
  bottom: 4px;
  width: min(680px, 122%);
  height: 146px;
  transform: translateX(-50%);
  pointer-events: none;
  overflow: visible;
  opacity: .95;
}
.sg-stage-floor-aura,
.sg-stage-floor-rim,
.sg-stage-floor-contact { position: absolute; display: block; left: 50%; transform: translateX(-50%); border-radius: 50%; }
.sg-stage-floor-aura {
  bottom: 0;
  width: 100%; height: 133px;
  background: radial-gradient(ellipse at 50% 73%,rgba(255,192,75,.24) 0%,rgba(188,115,30,.13) 23%,rgba(104,55,13,.065) 48%,transparent 74%);
  filter: blur(15px);
}
.sg-stage-floor-rim {
  bottom: 27px;
  width: 83%; height: 61px;
  border: 1.5px solid rgba(226,168,69,.54);
  background: radial-gradient(ellipse at 50% 68%,rgba(244,163,46,.13),rgba(34,23,12,.05) 46%,transparent 72%);
  box-shadow: 0 0 16px rgba(247,172,60,.12),inset 0 0 18px rgba(255,200,89,.10);
}
.sg-stage-floor-rim::before {
  content: '';
  position: absolute;
  left: 12%; right: 12%; top: 5px; height: 33px;
  border-top: 1px solid rgba(255,213,125,.30);
  border-radius: 50%;
}
.sg-stage-floor-contact {
  bottom: 33px;
  width: 73%; height: 25px;
  background: radial-gradient(ellipse at center,rgba(255,184,67,.21) 0%,rgba(127,73,17,.15) 32%,transparent 78%);
  filter: blur(6px);
}
@media (max-width: 1200px) {
  .hero-visual-refined .sg-stage-floor { left: 48%; width: min(610px, 123%); bottom: 6px; }
}
@media (max-width: 760px) {
  .hero-visual-refined .sg-stage-floor { left: 50%; width: min(590px, 120%); bottom: 2px; height: 117px; }
  .sg-stage-floor-rim { height: 53px; bottom: 24px; }
  .sg-stage-floor-aura { height: 105px; }
}
@media (max-width: 520px) {
  .hero-visual-refined .sg-stage-floor { left: 50%; width: 120%; bottom: 0; height: 90px; opacity: .82; }
  .sg-stage-floor-rim { bottom: 16px; height: 42px; }
  .sg-stage-floor-aura { height: 80px; filter: blur(12px); }
  .sg-stage-floor-contact { bottom: 20px; height: 20px; }
}
