/* Where Did You Enter? | Ad Astra public depth experience */

:root {
  --wdye-safe-top: env(safe-area-inset-top, 0px);
  --wdye-safe-bottom: env(safe-area-inset-bottom, 0px);
  --wdye-safe-left: env(safe-area-inset-left, 0px);
  --wdye-safe-right: env(safe-area-inset-right, 0px);
  --wdye-ease: cubic-bezier(0.22, 0.68, 0.18, 1);
  --wdye-chrome-pad: calc(var(--aa-chrome-header-height, 150px) + var(--wdye-safe-top));
  --wdye-ink: #e9edf3;
  --wdye-ink-strong: #f6f8fb;
  --wdye-muted: rgba(186, 198, 212, 0.9);
  --wdye-faint: rgba(150, 164, 180, 0.72);
  --wdye-bg: #0a0e14;
  --wdye-glow: rgba(48, 78, 104, 0.22);
  --wdye-accent: #5fa8c9;
  --wdye-accent-soft: rgba(95, 168, 201, 0.14);
  --wdye-edge: rgba(186, 214, 238, 0.16);
  --wdye-focus: #79bdf1;
  --wdye-rail: min(680px, 100%);
}

html[data-theme="light"] {
  --wdye-ink: #16191e;
  --wdye-ink-strong: #0f1216;
  --wdye-muted: #4e545c;
  --wdye-faint: #6c727a;
  --wdye-bg: #ffffff;
  --wdye-glow: rgba(198, 230, 255, 0.55);
  --wdye-accent: #1f5f73;
  --wdye-accent-soft: rgba(31, 95, 115, 0.1);
  --wdye-edge: rgba(148, 188, 220, 0.42);
}

html[data-theme="stellar"] {
  --wdye-ink: #eef3ff;
  --wdye-ink-strong: #f7faff;
  --wdye-muted: #c2d2ee;
  --wdye-faint: #93a6c8;
  --wdye-bg: #03070c;
  --wdye-glow: rgba(72, 108, 168, 0.28);
  --wdye-accent: #6fb6e6;
  --wdye-accent-soft: rgba(111, 182, 230, 0.12);
  --wdye-edge: rgba(120, 168, 255, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body.wdye-page {
  min-height: 100svh;
  min-height: 100dvh;
  background: var(--wdye-bg);
  color: var(--wdye-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

html[data-theme="dark"] body.wdye-page,
html:not([data-theme]) body.wdye-page {
  background:
    radial-gradient(ellipse 120% 70% at 88% -8%, var(--wdye-glow), transparent 58%),
    radial-gradient(ellipse 80% 50% at 0% 100%, rgba(28, 48, 68, 0.18), transparent 54%),
    linear-gradient(180deg, #070b10 0%, var(--wdye-bg) 48%, #060a0f 100%);
}

html[data-theme="light"] body.wdye-page {
  background:
    radial-gradient(ellipse 130% 70% at 88% -4%, var(--wdye-glow), transparent 56%),
    radial-gradient(ellipse 90% 54% at 0% 100%, rgba(220, 242, 255, 0.58), transparent 52%),
    linear-gradient(180deg, #ffffff 0%, #f9fcff 46%, #eef7ff 100%);
}

html[data-theme="stellar"] body.wdye-page {
  background:
    radial-gradient(ellipse 100% 60% at 80% 4%, var(--wdye-glow), transparent 56%),
    radial-gradient(ellipse 70% 44% at 8% 92%, rgba(40, 72, 120, 0.22), transparent 52%),
    radial-gradient(circle at 50% 120%, rgba(18, 36, 72, 0.4), transparent 42%),
    linear-gradient(180deg, #02060b 0%, var(--wdye-bg) 50%, #010408 100%);
}

body.wdye-page .aa-chrome-header-spacer {
  min-height: var(--wdye-chrome-pad);
}

.wdye-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wdye-main {
  position: relative;
  width: min(var(--wdye-rail), 100%);
  max-width: 100%;
  margin: 0 auto;
  padding:
    calc(var(--wdye-chrome-pad) + 12px)
    calc(18px + var(--wdye-safe-right))
    calc(28px + var(--wdye-safe-bottom))
    calc(18px + var(--wdye-safe-left));
  min-height: calc(100svh - 40px);
  min-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 6vw, 48px);
}

.wdye-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(220px, 42svh, 420px);
}

.wdye-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 3vw, 22px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 0.42s var(--wdye-ease),
    transform 0.42s var(--wdye-ease),
    visibility 0.42s;
}

.wdye-panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  z-index: 2;
}

.wdye-era-tag {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--wdye-faint);
}

.wdye-line {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.85rem, 6.4vw, 3.35rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--wdye-ink-strong);
  text-transform: lowercase;
  overflow-wrap: anywhere;
}

.wdye-line--hero {
  max-width: 14ch;
  font-size: clamp(2.1rem, 8vw, 4rem);
}

.wdye-body {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(1rem, 2.8vw, 1.125rem);
  line-height: 1.55;
  color: var(--wdye-muted);
}

.wdye-reveal {
  opacity: 1;
  transform: none;
}

body.wdye-ready:not([data-wdye-reduced="1"]) .wdye-panel[data-step="open"].is-active .wdye-reveal {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  animation: wdye-reveal-in 0.9s var(--wdye-ease) 0.12s forwards;
}

@keyframes wdye-reveal-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.wdye-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--wdye-edge);
}

.wdye-controls__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wdye-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: #0a1018;
  background: linear-gradient(180deg, #f4f8fc 0%, #e8f0f8 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .wdye-btn {
  color: #f8fbff;
  background: linear-gradient(180deg, #1f5f73 0%, #184f62 100%);
  box-shadow: 0 8px 22px rgba(16, 40, 52, 0.16);
}

.wdye-btn--ghost {
  color: var(--wdye-ink);
  background: transparent;
  border: 1px solid var(--wdye-edge);
  box-shadow: none;
}

.wdye-btn:focus-visible,
.wdye-picker:focus-visible,
.wdye-return__link:focus-visible {
  outline: 2px solid var(--wdye-focus);
  outline-offset: 3px;
}

.wdye-btn[hidden] {
  display: none !important;
}

.wdye-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wdye-picker-label {
  font-size: 0.82rem;
  color: var(--wdye-faint);
}

.wdye-picker {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--wdye-edge);
  background: rgba(8, 12, 18, 0.42);
  color: var(--wdye-ink);
  font: inherit;
  font-size: 0.95rem;
}

html[data-theme="light"] .wdye-picker {
  background: rgba(255, 255, 255, 0.86);
  color: var(--wdye-ink-strong);
}

.wdye-picker-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--wdye-faint);
}

.wdye-return {
  margin: 0;
}

.wdye-return__link {
  font-size: 0.84rem;
  color: var(--wdye-faint);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.wdye-return__link:hover,
.wdye-return__link:focus-visible {
  color: var(--wdye-accent);
  border-bottom-color: currentColor;
}

body[data-wdye-kind="reflect"] .wdye-line,
body[data-wdye-kind="close"] .wdye-line {
  max-width: 22ch;
}

body[data-wdye-step="open"] .wdye-controls {
  border-top-color: transparent;
}

body[data-wdye-tone="phosphor"] .wdye-panel.is-active .wdye-line {
  text-shadow: 0 0 28px rgba(72, 220, 120, 0.12);
}

body[data-wdye-tone="signal"] .wdye-panel.is-active .wdye-line {
  text-shadow: 0 0 32px rgba(95, 168, 201, 0.16);
}

.wdye-noscript {
  max-width: 42rem;
  margin: 2rem auto;
  padding: 1rem 1.25rem;
  color: var(--wdye-ink);
}

.wdye-noscript h1 {
  text-transform: lowercase;
  font-weight: 400;
}

@media (min-width: 768px) {
  .wdye-main {
    padding-left: calc(28px + var(--wdye-safe-left));
    padding-right: calc(28px + var(--wdye-safe-right));
  }

  .wdye-controls__row {
    justify-content: flex-start;
  }

  .wdye-picker {
    max-width: 360px;
  }
}

@media (min-width: 1024px) {
  :root {
    --wdye-rail: 720px;
  }

  .wdye-main {
    padding-top: calc(var(--wdye-chrome-pad) + 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wdye-panel {
    transition: none;
    transform: none;
  }

  .wdye-reveal {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}
