body.apt-clarity-spatial-home { margin: 0; background: #080d16; }

#apt-spatial {
  --space-ink: #080d16;
  --space-white: #f3f7ff;
  --space-soft: #c2cede;
  --space-muted: #a0afc4;
  --space-blue: #bddbff;
  --space-border: #a9c9ff35;
  --space-display: 'Instrument Serif', 'Iowan Old Style', Baskerville, Georgia, serif;
  --space-ui: 'Instrument Sans', 'Inter', system-ui, sans-serif;
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: #080d16;
  color: var(--space-white);
  font: 16px/1.45 var(--space-ui);
}
#apt-spatial *, #apt-spatial *::before, #apt-spatial *::after { box-sizing: border-box; }
#apt-spatial [hidden] { display: none !important; }
#apt-spatial h1, #apt-spatial h2, #apt-spatial p { margin: 0; }
#apt-spatial :is(button, a) { font-family: inherit; }
#apt-spatial a { color: inherit; text-decoration: none; }
#apt-spatial button { color: inherit; cursor: pointer; }
#apt-spatial :is(button, a, iframe):focus-visible { outline: 2px solid #d6e8ff; outline-offset: 4px; }
#apt-spatial :is(a, button) { -webkit-tap-highlight-color: transparent; }
#apt-spatial .space-skip { position: absolute; z-index: 9; left: 20px; top: 10px; padding: 10px; background: #0a1829; transform: translateY(-160%); }
#apt-spatial .space-skip:focus { transform: none; }

#apt-spatial .space-top {
  position: relative;
  z-index: 4;
  min-height: 81px;
  margin-inline: clamp(20px, 5.2vw, 86px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px;
  border-bottom: 1px solid #bcdaff2b;
}
#apt-spatial .space-brand { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; line-height: 1.18; font-weight: 650; letter-spacing: .035em; white-space: nowrap; }
#apt-spatial .space-mark { position: relative; display: grid; place-items: center; width: 31px; height: 31px; }
#apt-spatial .space-mark i { position: absolute; width: 26px; height: 13px; border: 1.2px solid #d1e5ff; border-radius: 50%; transform: rotate(42deg); }
#apt-spatial .space-mark i:nth-child(2) { transform: rotate(-42deg); }
#apt-spatial .space-mark i:nth-child(3) { width: 4px; height: 4px; border-radius: 50%; background: #d1e5ff; box-shadow: 0 0 8px #b0cdff; }
#apt-spatial .space-arrow { display:inline-block; position:relative; width:9px; height:9px; opacity:.78; }
#apt-spatial .space-arrow::before { content:""; position:absolute; right:1px; top:1px; width:6px; height:6px; border:1px solid currentColor; border-left:0; border-bottom:0; }
#apt-spatial .space-arrow::after { content:""; position:absolute; right:1px; top:1px; width:9px; height:1px; background:currentColor; transform:rotate(-45deg); transform-origin:right center; }
#apt-spatial .space-nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); color: var(--space-soft); font-size: 13px; }
#apt-spatial .space-nav a, #apt-spatial .space-footer a { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; }
#apt-spatial :is(.space-nav, .space-footer) a:hover { color: #fff; }
#apt-spatial .space-motion { width: 40px; height: 40px; border: 1px solid var(--space-border); border-radius: 50%; display: grid; place-items: center; background: #11213780; }
#apt-spatial .space-motion > span:first-child { width: 9px; height: 11px; border-inline: 2px solid #d3e3ff; }
#apt-spatial .space-motion[aria-pressed='true'] > span:first-child { width: 0; height: 0; border: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid #d3e3ff; margin-left: 2px; }
#apt-spatial .space-motion-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

#apt-spatial .space-room {
  min-height: max(650px, calc(100svh - 145px));
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: end;
  padding: 0 clamp(20px, 5.2vw, 86px) 34px;
  perspective: 1500px;
}
#apt-spatial .space-scene { position: absolute; z-index: -1; inset: -82px 0 -59px; overflow: hidden; pointer-events: none; }
#apt-spatial .space-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #080d16 0%, #080d1640 27%, #080d1633 65%, #080d16cc 100%),
    radial-gradient(ellipse at 53% 49%, transparent 13%, #06101a22 41%, #080d16b8 89%),
    url('clarity-observatory.webp') center 51% / cover no-repeat,
    radial-gradient(ellipse at 50% 48%, #63869d 0%, #193650 27%, #0a1629 57%, #080d16 87%);
  transition: filter .55s ease;
}
#apt-spatial .space-horizon {
  position: absolute;
  left: 50%;
  top: 69%;
  width: min(55vw, 810px);
  height: 16%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, #a8e5ff51, #a8e5ff00 66%);
  filter: blur(22px);
  mix-blend-mode: screen;
}
#apt-spatial .space-ribbon {
  position: absolute;
  inset: 2% 4% 4%;
  transform: translate(2%, 0);
  transition: transform .7s cubic-bezier(.16,.72,.26,1), opacity .5s ease;
}
#apt-spatial .space-ribbon-light {
  position: absolute;
  inset: 26% 22% 27%;
  background: radial-gradient(ellipse at 51% 45%, #88bbff35, #6275b715 50%, transparent 72%);
  filter: blur(30px);
}
#apt-spatial .space-ribbon-still { position: absolute; inset: 18% 14% 17%; background: url('clarity-ribbon.webp') center / contain no-repeat; opacity: .92; transition: opacity .35s ease; }
#apt-spatial .space-ribbon:has(canvas[data-ready='true']) .space-ribbon-still { opacity: 0; }
#apt-spatial .space-ribbon canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

#apt-spatial .space-intro { position: absolute; z-index: 1; top: 22%; left: clamp(21px, 7vw, 112px); max-width: 300px; transition: opacity .3s ease, transform .5s ease; }
#apt-spatial .space-intro h1 { color: #f4f7ff; font: 400 clamp(86px, 12.2vw, 182px)/.78 var(--space-display); letter-spacing: -.09em; text-shadow: 0 8px 50px #081221bf; }
#apt-spatial .space-intro h1 span { color: #9ecefe; }
#apt-spatial .space-intro p { color: var(--space-soft); margin-top: 24px; max-width: 225px; font-size: clamp(14px, 1.45vw, 19px); text-wrap: pretty; text-shadow: 0 2px 18px #050e20; }

#apt-spatial .space-voice-zone { position: relative; z-index: 3; width: min(100%, 520px); justify-self: center; text-align: center; }
#apt-spatial .space-talk {
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  gap: 16px;
  padding: 7px 24px 7px 8px;
  color: #0b2038;
  border: 1px solid #e4f0ff;
  border-radius: 100px;
  background: linear-gradient(180deg, #f0f7ff, #badbff);
  box-shadow: 0 0 0 5px #a4caff1f, 0 0 43px #6eaeff5c, 0 12px 46px #030b19b3;
  font-size: 17px;
  font-weight: 730;
  transition: transform .2s ease, box-shadow .2s ease;
}
#apt-spatial .space-talk:hover { transform: translateY(-3px); box-shadow: 0 0 0 6px #a4caff36, 0 0 45px #6eaeff84, 0 12px 46px #030b19b3; }
#apt-spatial .space-mic { width: 46px; height: 46px; display: grid; place-items: center; position: relative; background: #0b2038; border-radius: 50%; color: #d7e9ff; }
#apt-spatial .space-mic i { width: 8px; height: 14px; border: 1.6px solid currentColor; border-radius: 6px; margin-top: -4px; }
#apt-spatial .space-mic::before { content: ''; width: 14px; height: 11px; position: absolute; top: 20px; border: 1.6px solid currentColor; border-top: 0; border-radius: 0 0 9px 9px; }
#apt-spatial .space-mic::after { content: ''; width: 1.6px; height: 4px; position: absolute; top: 31px; background: currentColor; }
#apt-spatial #space-voice-note { margin-top: 13px; color: var(--space-soft); font-size: 12px; }
#apt-spatial .space-account { margin-top: 7px; color: var(--space-soft); font-size: 12px; }
#apt-spatial .space-account a { color: var(--space-blue); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
#apt-spatial .space-account a:hover { color: var(--space-white); }
#apt-spatial .space-live:empty { display: none; }
#apt-spatial.is-voice-active .space-voice-entry { display: none; }
#apt-spatial .space-no-script { margin: 8px 0; }

#apt-spatial .space-panel {
  position: absolute;
  z-index: 3;
  top: 22px;
  right: clamp(20px, 5.2vw, 86px);
  width: min(62vw, 900px);
  height: calc(100% - 46px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #b3d4ff73;
  border-radius: 22px;
  background: #0c1829f2;
  color: var(--space-white);
  box-shadow: 0 22px 95px #000a, 0 0 45px #95c5ff29, inset 0 1px 0 #e5f0ff22;
  backdrop-filter: blur(20px);
  transform-origin: right center;
  animation: space-panel-open .46s cubic-bezier(.16,.73,.22,1) both;
}
@keyframes space-panel-open { from { transform: translateZ(-170px) rotateY(-14deg) translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
#apt-spatial .space-close { border: 1px solid transparent; border-radius: 7px; background: transparent; min-height: 36px; padding-inline: 11px; color: var(--space-soft); font-size: 23px; line-height: 1; }
#apt-spatial .space-close:hover { background: #b0d5ff24; }
#apt-spatial .space-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px 10px; }
#apt-spatial .space-panel-actions { display: flex; align-items: center; gap: 10px; }
#apt-spatial .space-panel-title h2 { font-size: clamp(18px, 2.25vw, 30px); font-weight: 620; letter-spacing: -.045em; }
#apt-spatial .space-panel-title a { color: var(--space-blue); font-size: 11px; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
#apt-spatial .space-settings { padding: 0 18px 9px; color: var(--space-blue); font-size: 12px; }
#apt-spatial .space-frame-wrap { grid-row: 3; background: #131c29; min-height: 0; }
#apt-spatial .space-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; color-scheme: dark; }
#apt-spatial .space-panel-status { grid-row: 4; color: var(--space-blue); font-size: 12px; padding: 8px 18px; background: #102035; }
#apt-spatial.is-panel-open .space-intro { transform: translateY(-30px); top: 18%; }
#apt-spatial.is-panel-open .space-intro h1 { font-size: clamp(60px, 7.6vw, 120px); }
#apt-spatial.is-panel-open .space-intro p { display: none; }
#apt-spatial.is-panel-open .space-ribbon { transform: translate(-32%, 2%) scale(.76); opacity: .9; }
#apt-spatial.is-panel-open .space-scene::before { filter: brightness(.66) saturate(.9); }
#apt-spatial.is-panel-open .space-voice-zone { justify-self: start; width: min(27vw, 375px); }


#apt-spatial .space-footer { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 9px 20px; margin-inline: clamp(20px, 5.2vw, 86px); min-height: 62px; border-top: 1px solid #bcdaff28; color: var(--space-muted); font-size: 12px; }
#apt-spatial .space-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0 20px; }

@media (max-width: 1000px) {
  #apt-spatial .space-intro { top: 18%; }
  #apt-spatial .space-panel { width: min(65vw, 760px); }
  #apt-spatial.is-panel-open .space-voice-zone { width: 24vw; }
}
@media (max-width: 680px) {
  #apt-spatial .space-top { min-height: 66px; margin-inline: 16px; gap: 9px; }
  #apt-spatial .space-brand { gap: 5px; font-size: 10px; }
  #apt-spatial .space-mark { transform: scale(.8); }
  #apt-spatial .space-nav { gap: 12px; font-size: 11px; }
  #apt-spatial .space-motion { width: 35px; height: 35px; }
  #apt-spatial .space-room { min-height: max(620px, calc(100svh - 128px)); padding: 0 16px 19px; row-gap: 16px; }
  #apt-spatial .space-scene { inset: -66px 0 -70px; }
  #apt-spatial .space-scene::before { background-position: center, center, 50% 43%, center; }
  #apt-spatial .space-ribbon { inset: 4% -24% 20%; transform: translate(0, 0); }
  #apt-spatial .space-intro { left: 0; right: 0; top: 38px; max-width: none; text-align: center; }
  #apt-spatial .space-intro h1 { font-size: clamp(70px, 22vw, 106px); line-height: .9; }
  #apt-spatial .space-intro p { margin: 12px auto 0; max-width: 235px; font-size: 14px; }
  #apt-spatial .space-voice-zone { grid-row: 1; }
  #apt-spatial .space-talk { min-height: 57px; font-size: 15px; }
  #apt-spatial .space-mic { width: 39px; height: 39px; }
  #apt-spatial .space-mic::before { top: 16px; }
  #apt-spatial .space-mic::after { top: 27px; }
  #apt-spatial #space-voice-note { margin-top: 9px; }
  #apt-spatial.is-panel-open .space-room { align-content: start; padding-top: 12px; }
  #apt-spatial.is-panel-open .space-intro { display: none; }
  #apt-spatial.is-panel-open .space-ribbon { transform: translate(0, 3%) scale(.65); opacity: .47; }
  #apt-spatial .space-panel { position: relative; inset: auto; grid-row: 1; width: 100%; height: clamp(360px, 60svh, 620px); border-radius: 16px; }
  #apt-spatial .space-panel-title { padding-inline: 10px; }
  #apt-spatial .space-settings { padding-inline: 10px; }
  #apt-spatial.is-panel-open .space-voice-zone { grid-row: 2; width: 100%; justify-self: center; }
  #apt-spatial .space-footer { margin-inline: 16px; font-size: 10px; flex-wrap: wrap; padding-top: 10px; gap: 0 8px; }
  #apt-spatial .space-footer nav { gap: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #apt-spatial *, #apt-spatial *::before, #apt-spatial *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

#apt-spatial:has([data-space-motion][aria-pressed='true']) :is(.space-panel, .space-ribbon, .space-intro) { animation: none; transition: none; }
