/* ============================================================
   Deen First Tech — Aurora theme
   Dusky sky, one continuous aurora curtain, planet carousel
   ============================================================ */

:root {
  --ink: #f2efff;
  --ink-dim: rgba(242, 239, 255, 0.72);
  --ink-faint: rgba(242, 239, 255, 0.5);
  --on-stream: #14122e;          /* deep indigo text on bright ribbons */
  --accent: #ffc96b;
  --header-h: 76px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 85% -10%, #3b2f6e 0%, transparent 55%),
    linear-gradient(180deg,
      #1b1940 0%,
      #232159 34%,
      #2f2a68 58%,
      #453881 80%,
      #5a4a9b 100%);
  overflow: hidden;
}

::selection { background: rgba(244, 91, 168, 0.4); }

/* ---------------- Sky, stars, moon ---------------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.stars { position: absolute; inset: 0; }

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: 0.2;
  animation: twinkle var(--tw, 4s) ease-in-out var(--twd, 0s) infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50%      { opacity: 0.95; transform: scale(1.15); }
}

.moon {
  position: absolute;
  top: clamp(64px, 12vh, 120px);
  right: clamp(44px, 8vw, 130px);
  width: clamp(60px, 6.5vw, 92px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 233, 196, 0.16) 0%,
    rgba(255, 233, 196, 0.05) 55%,
    transparent 72%);
  box-shadow: inset -20px 9px 0 0 #ffe9c4;
  filter: drop-shadow(0 0 18px rgba(255, 222, 160, 0.75))
          drop-shadow(0 0 46px rgba(255, 201, 107, 0.35));
  transform: rotate(-18deg);
}

.shooting-star {
  position: absolute;
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.95), transparent);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.8));
  opacity: 0;
  transform: rotate(-32deg);
}

.shooting-star.fly { animation: shoot 1.1s var(--ease-out) forwards; }

@keyframes shoot {
  0%   { opacity: 0; transform: translate(0, 0) rotate(-32deg); }
  8%   { opacity: 1; }
  100% { opacity: 0; transform: translate(-42vw, 26vh) rotate(-32deg); }
}

.horizon-glow {
  position: absolute;
  right: -20vw;
  bottom: -24vh;
  width: 90vw;
  height: 70vh;
  background: radial-gradient(50% 60% at 70% 90%,
    rgba(244, 91, 168, 0.26),
    rgba(139, 124, 255, 0.20) 42%,
    rgba(51, 196, 240, 0.10) 64%,
    transparent 78%);
}

/* ---------------- Header ---------------- */

.site-header {
  position: relative;
  z-index: 4;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", serif;
  font-weight: 650;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  filter: drop-shadow(0 0 8px rgba(139, 124, 255, 0.5));
}

.site-nav { display: flex; gap: clamp(16px, 3vw, 34px); }

.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
}

/* ---------------- Hero: just the title ---------------- */

main { position: relative; z-index: 3; pointer-events: none; }

.hero {
  padding: clamp(48px, 10vh, 112px) clamp(20px, 5vw, 64px) 0;
  max-width: 760px;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-weight: 620;
  font-size: clamp(2.5rem, 5.4vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 30px rgba(27, 25, 64, 0.55);
  animation: rise 0.9s var(--ease-out) 0.2s backwards;
}

.hero h1 em {
  font-style: italic;
  background: linear-gradient(92deg, #2de3a7, #33c4f0 35%, #8b7cff 68%, #f45ba8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

/* ---------------- Aurora curtain ---------------- */

.rivers {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.rivers-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.rivers-glow {
  filter: blur(22px) saturate(1.3);
  opacity: 0.5;
}

.rivers-main path {
  pointer-events: auto;
  cursor: pointer;
  outline: none;
  opacity: 0.94;
  transition: opacity 0.4s ease;
}

.rivers-main path.dim { opacity: 0.45; }
.rivers-main path.active { opacity: 1; }

.rivers-main path:focus-visible {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
}

.rivers-glow path { transition: opacity 0.4s ease; }
.rivers-glow path.dim { opacity: 0.45; }

/* Radiant source the curtain pours out of */
.source-glow {
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 240, 214, 0.7) 12%,
    rgba(51, 196, 240, 0.32) 32%,
    rgba(139, 124, 255, 0.22) 50%,
    rgba(244, 91, 168, 0.12) 66%,
    transparent 76%);
  filter: blur(8px);
  animation: sourcePulse 6s ease-in-out infinite;
}

@keyframes sourcePulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.1); opacity: 1; }
}

/* Labels + app icons riding each stream */
.river-labels { position: absolute; inset: 0; }

.river-label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(20, 18, 46, 0.9);
  white-space: nowrap;
  transition: opacity 0.3s ease;
  will-change: transform;
}

.river-label svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: currentColor;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.3));
}

.river-label img {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(20, 18, 46, 0.35);
}

.river-label span {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.river-label.dim { opacity: 0.35; }

/* ---------------- Planet carousel ----------------
   Each app's planet card sits on an invisible ring centered
   below the screen; switching apps swings the ring until the
   active planet arrives at the front. */

.planet-stage {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.planet-card {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  transition:
    transform 0.95s var(--ease-out),
    opacity 0.45s ease;
  will-change: transform;
}

/* The planet itself */
.planet {
  position: relative;
  width: 118px;
  height: 118px;
  flex: none;
}

.planet-sphere {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%,
    color-mix(in srgb, var(--pc) 42%, #ffffff) 0%,
    var(--pc) 46%,
    color-mix(in srgb, var(--pc) 52%, #14122e) 100%);
  box-shadow:
    inset -16px -12px 34px rgba(10, 8, 30, 0.5),
    inset 6px 6px 18px rgba(255, 255, 255, 0.22),
    0 0 54px color-mix(in srgb, var(--pc) 55%, transparent);
}

/* Craters / surface texture */
.planet-sphere::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 58%, rgba(255, 255, 255, 0.14) 0 7%, transparent 8%),
    radial-gradient(circle at 40% 66%, rgba(20, 18, 46, 0.14) 0 11%, transparent 12%),
    radial-gradient(circle at 68% 36%, rgba(20, 18, 46, 0.12) 0 6%, transparent 7%);
}

.planet-ring {
  position: absolute;
  left: -34%;
  top: 31%;
  width: 168%;
  height: 38%;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--pc) 35%, rgba(255, 255, 255, 0.55));
  transform: rotate(-16deg);
  opacity: 0.65;
}

/* Orbiting moonlet carrying the app's icon (kept upright by counter-rotation) */
.planet-moon {
  position: absolute;
  inset: -26px;
  animation: orbit 16s linear infinite;
}

.planet-moon span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  border-radius: 50%;
  background: rgba(18, 16, 44, 0.9);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.5), 0 2px 8px rgba(10, 8, 30, 0.5);
  animation: orbit 16s linear infinite reverse;
}

.planet-moon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.planet-moon svg {
  width: 58%;
  height: 58%;
  fill: #e8ecff;
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

/* Info floating beside the planet — no card chrome, just a soft halo */
.planet-info {
  position: relative;
  margin-left: 30px;
  max-width: 320px;
}

.planet-info::before {
  content: "";
  position: absolute;
  inset: -46px -64px;
  background: radial-gradient(closest-side,
    rgba(18, 16, 44, 0.62),
    rgba(18, 16, 44, 0.28) 55%,
    transparent 78%);
  filter: blur(6px);
  z-index: -1;
}

.planet-info h2 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.65rem;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.planet-info h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--pc);
  box-shadow: 0 0 12px var(--pc);
}

.planet-info p {
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--ink-dim);
  margin-bottom: 14px;
}

.planet-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.planet-badges span {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pc) 70%, rgba(255, 255, 255, 0.5));
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.planet-link {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 2px solid var(--pc);
  padding-bottom: 2px;
  transition: opacity 0.25s;
}

.planet-link:hover { opacity: 0.75; }

/* ---------------- Stream takeover ----------------
   When a stream linked to an external site is clicked, its stripe grows
   to swallow the screen, then this overlay fades its color into the
   destination site's background before navigation. */

.takeover {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #14122e;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.takeover.on { opacity: 1; }

body.takeover-active .site-header,
body.takeover-active .hero,
body.takeover-active .river-labels,
body.takeover-active .planet-stage,
body.takeover-active .source-glow {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .river-label { font-size: 11px; letter-spacing: 0.12em; gap: 6px; }
  .river-label svg { width: 16px; height: 16px; }
  .river-label img { width: 16px; height: 16px; border-radius: 4px; }

  .moon {
    top: 72px;
    right: 20px;
    width: 44px;
    box-shadow: inset -13px 6px 0 0 #ffe9c4;
  }

  .planet { width: 84px; height: 84px; }
  .planet-moon { inset: -18px; }
  .planet-moon span { width: 18px; height: 18px; margin-left: -9px; }
  .planet-info { margin-left: 20px; max-width: 240px; }
  .planet-info h2 { font-size: 1.3rem; }
  .planet-info p { font-size: 0.85rem; margin-bottom: 10px; }
  .planet-info::before {
    inset: -44px -56px;
    background: radial-gradient(closest-side,
      rgba(18, 16, 44, 0.78),
      rgba(18, 16, 44, 0.42) 55%,
      transparent 80%);
  }

  .source-glow {
    right: -120px;
    bottom: -120px;
    width: 300px;
    height: 300px;
  }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }
  html { scroll-behavior: auto; }
}
