/* SYLORA Lumen v5 — light cosmic AI ecosystem */
:root {
  --canvas: #f3f7ff;
  --canvas-soft: #eaf1ff;
  --pearl: #fafcff;
  --milk: #fffff8;
  --ink: #161b33;
  --ink-soft: #4a5378;
  --ink-mute: #7a84a8;
  --ion: #38b7ff;
  --aqua: #2ed9c2;
  --violet: #7b6cff;
  --petal: #ff6bcb;
  --mist: #b8c4ff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-stroke: rgba(255, 255, 255, 0.55);
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", sans-serif;
  --radius: 1.15rem;
  --safe-x: max(1rem, env(safe-area-inset-left), env(safe-area-inset-right));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body.sylora-aether-active { overflow: hidden; }

body.sylora-aether-active flt-glass-pane,
body.sylora-aether-active flutter-view,
body.sylora-aether-active flt-scene-host {
  opacity: 0 !important;
  pointer-events: none !important;
}

#sylora-aether {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 18% 20%, rgba(56, 183, 255, 0.22), transparent 60%),
    radial-gradient(70% 55% at 82% 18%, rgba(255, 107, 203, 0.16), transparent 58%),
    radial-gradient(90% 70% at 50% 90%, rgba(123, 108, 255, 0.18), transparent 62%),
    linear-gradient(160deg, #f8fbff 0%, #eaf1ff 42%, #f4ebff 72%, #e8fbff 100%);
}

body.sylora-aether-active #sylora-aether { display: block; }

#sylora-aether canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 0;
}

.aether-wave {
  position: absolute;
  inset: -10% -5%;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(40% 28% at 30% 40%, rgba(46, 217, 194, 0.16), transparent 70%),
    radial-gradient(36% 26% at 70% 55%, rgba(123, 108, 255, 0.14), transparent 70%);
  filter: blur(8px);
  animation: waveDrift 14s ease-in-out infinite alternate;
  will-change: transform;
}

.aether-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(243, 247, 255, 0.15) 0%, transparent 28%, transparent 62%, rgba(243, 247, 255, 0.55) 100%);
}

.aether-scroll {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.aether-hud {
  width: min(100%, 72rem);
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding:
    max(0.85rem, env(safe-area-inset-top))
    var(--safe-x)
    max(1.1rem, env(safe-area-inset-bottom))
    var(--safe-x);
}

.aether-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  opacity: 0;
  transform: translateY(12px);
}

.aether-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.aether-mark {
  width: clamp(1.7rem, 5vw, 2.15rem);
  height: clamp(1.7rem, 5vw, 2.15rem);
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0%, #eaf6ff 42%, transparent 43%),
    conic-gradient(from 210deg, #38b7ff, #7b6cff, #ff6bcb, #2ed9c2, #38b7ff);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.7),
    0 8px 22px rgba(123, 108, 255, 0.28);
  position: relative;
  overflow: hidden;
}

.aether-mark::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #eef4ff 70%, #c9d8ff 100%);
  box-shadow: 0 0 12px rgba(56, 183, 255, 0.45);
}

.aether-brand-mini {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  letter-spacing: 0.18em;
  color: var(--ink);
  white-space: nowrap;
}

.aether-link {
  appearance: none;
  border: 1px solid rgba(22, 27, 51, 0.1);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  transition: transform 0.25s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.aether-link:hover,
.aether-link:focus-visible {
  color: var(--ink);
  border-color: rgba(56, 183, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(56, 183, 255, 0.12), 0 10px 24px rgba(123, 108, 255, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.aether-hero {
  flex: 1;
  min-height: calc(100svh - 5.5rem);
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: clamp(1rem, 3vh, 1.75rem);
  padding: clamp(0.5rem, 2vh, 1.5rem) 0 clamp(1.5rem, 4vh, 2.5rem);
  width: 100%;
  max-width: 100%;
}

.aether-kicker,
.aether-brand,
.aether-line,
.aether-cta-wrap,
.aether-orbit-caption,
.aether-robot-wrap {
  opacity: 0;
  transform: translateY(18px);
  max-width: 100%;
}

.aether-kicker {
  margin: 0;
  font-size: clamp(0.72rem, 2.2vw, 0.84rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet);
}

.aether-brand {
  margin: 0;
  width: 100%;
  max-width: 100%;
  padding: 0 0.1em;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 12vw, 6.4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: clamp(0.06em, 1.4vw, 0.16em);
  color: transparent;
  background: linear-gradient(120deg, #161b33 0%, #3a4a8a 35%, #7b6cff 68%, #38b7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
}

.aether-line {
  margin: 0;
  max-width: min(34rem, 100%);
  padding: 0 0.25rem;
  font-size: clamp(0.98rem, 2.8vw, 1.2rem);
  line-height: 1.45;
  font-weight: 500;
  color: var(--ink-soft);
}

.aether-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(28rem, 100%);
}

.aether-portal {
  position: relative;
  appearance: none;
  border: 0;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: clamp(0.86rem, 2.5vw, 0.95rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.95rem 1.55rem;
  border-radius: 999px;
  background: linear-gradient(120deg, #38b7ff, #7b6cff 55%, #ff6bcb);
  box-shadow:
    0 10px 28px rgba(123, 108, 255, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, filter 0.3s ease;
  flex: 1 1 auto;
  min-width: min(11rem, 100%);
}

.aether-portal::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(56, 183, 255, 0.55), rgba(255, 107, 203, 0.45));
  z-index: -1;
  filter: blur(10px);
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

.aether-portal:hover,
.aether-portal:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 16px 36px rgba(123, 108, 255, 0.35),
    0 0 24px rgba(56, 183, 255, 0.35);
  outline: none;
}

.aether-portal:hover::before,
.aether-portal:focus-visible::before { opacity: 0.9; }

.aether-portal:active { transform: translateY(0) scale(0.99); }

.aether-secondary {
  appearance: none;
  border: 1px solid rgba(22, 27, 51, 0.12);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  font-size: clamp(0.86rem, 2.5vw, 0.95rem);
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0.95rem 1.35rem;
  border-radius: 999px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  flex: 1 1 auto;
  min-width: min(9rem, 100%);
}

.aether-secondary:hover,
.aether-secondary:focus-visible {
  border-color: rgba(56, 183, 255, 0.5);
  box-shadow: 0 10px 24px rgba(56, 183, 255, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.aether-orbit-caption {
  margin: 0;
  font-size: clamp(0.72rem, 2vw, 0.8rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 650;
}

.aether-constellation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 0.65rem;
  max-width: min(36rem, 100%);
  width: 100%;
}

.aether-star {
  position: relative;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 20px rgba(123, 108, 255, 0.08);
  color: var(--ink-soft);
  font-size: clamp(0.68rem, 2vw, 0.75rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 650;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.6s ease, transform 0.6s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.aether-space.is-in .aether-star {
  opacity: 1;
  transform: none;
}

.aether-star.is-hot,
.aether-star:hover {
  color: var(--ink);
  border-color: rgba(56, 183, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(56, 183, 255, 0.1), 0 12px 24px rgba(123, 108, 255, 0.14);
}

.aether-space {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 0.25rem 0 1.5rem;
}

.aether-robot-wrap {
  position: relative;
  width: min(9.5rem, 42vw);
  aspect-ratio: 1;
  margin-top: 0.25rem;
}

.aether-robot-halo {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 183, 255, 0.22), transparent 68%);
  animation: haloPulse 3.6s ease-in-out infinite;
}

#aether-robot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.aether-robot-label {
  position: absolute;
  left: 50%;
  bottom: -1.35rem;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 650;
}

.aether-revealed .aether-top { animation: rise 0.9s 0.05s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.aether-revealed .aether-kicker { animation: rise 0.95s 0.12s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.aether-revealed .aether-brand { animation: rise 1s 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.aether-revealed .aether-line { animation: rise 1s 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.aether-revealed .aether-cta-wrap { animation: rise 1s 0.44s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.aether-revealed .aether-orbit-caption { animation: rise 1s 0.56s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.aether-revealed .aether-robot-wrap { animation: rise 1s 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes waveDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.04); }
}

@keyframes haloPulse {
  0%, 100% { opacity: 0.65; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.05); }
}

@media (min-width: 900px) {
  .aether-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(12rem, 0.7fr);
    align-items: center;
    text-align: left;
    justify-items: start;
    gap: 2rem;
  }
  .aether-cta-wrap,
  .aether-constellation { justify-content: flex-start; }
  .aether-robot-wrap {
    justify-self: end;
    width: min(14rem, 28vw);
  }
  .aether-space { align-items: flex-start; }
}

@media (max-width: 360px) {
  .aether-brand {
    font-size: clamp(2.15rem, 13vw, 2.6rem);
    letter-spacing: 0.05em;
  }
  .aether-cta-wrap { flex-direction: column; }
  .aether-portal,
  .aether-secondary { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .aether-wave,
  .aether-robot-halo,
  .aether-revealed .aether-top,
  .aether-revealed .aether-kicker,
  .aether-revealed .aether-brand,
  .aether-revealed .aether-line,
  .aether-revealed .aether-cta-wrap,
  .aether-revealed .aether-orbit-caption,
  .aether-revealed .aether-robot-wrap {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .aether-star {
    opacity: 1 !important;
    transform: none !important;
  }
}
