/* ============================================================
   SPACE THEME  —  dark, futuristic, AI-age backdrop for HOME.
   Scoped to [data-theme="space"] so untouched stub pages keep
   the light placeholder identity until each is designed.

   SINGLE SOURCE OF TRUTH for the dark palette. Re-theming the
   hero = editing the variables in this one block. The shared
   shell (header/footer/nav) re-colors automatically because it
   reads the same --color-* tokens defined in src/input.css.
   ============================================================ */

[data-theme="space"] {
  /* Shell tokens overridden for dark mode (shared header/footer/nav) */
  --color-paper:       #080B14;   /* deep space navy-black          */
  --color-surface:     #0E1526;   /* raised panels                  */
  --color-ink:         #EAF2FF;   /* primary text — near white      */
  --color-muted:       #8CA0BF;   /* secondary text — cool grey     */
  --color-line:        rgba(150, 180, 220, 0.14); /* hairlines      */
  --color-accent:      #38E1FF;   /* electric cyan                  */
  --color-accent-dark: #12B6D8;   /* cyan pressed                   */
  --color-highlight:   #A78BFA;   /* violet spark — used sparingly  */

  /* Background-engine palette (read by background.js) */
  --bg-star:  #9FB4CC;
  --bg-node:  #38E1FF;
  --bg-node2: #A78BFA;
  --bg-link:  56, 225, 255;       /* rgb triplet for line alpha     */
  --bg-comet: #67E8F9;

  color-scheme: dark;
  background-color: var(--color-paper);
}

/* ---- Depth stack: canvas + overlays sit behind the shell ---- */
[data-theme="space"] #bg-canvas,
[data-theme="space"] .bg-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Base cosmic gradient beneath the stars */
[data-theme="space"] .bg-base {
  background:
    radial-gradient(1200px 800px at 72% -10%, rgba(56, 225, 255, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 12% 8%, rgba(167, 139, 250, 0.12), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(18, 182, 216, 0.10), transparent 60%),
    linear-gradient(180deg, #05070E 0%, #080B14 45%, #060910 100%);
}

/* Perspective tech-grid horizon fading up from the bottom */
[data-theme="space"] .bg-grid {
  background-image:
    linear-gradient(to right, rgba(56, 225, 255, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 225, 255, 0.22) 1px, transparent 1px);
  background-size: 46px 46px;
  background-position: center bottom;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0,0,0,0.35) 22%, transparent 42%);
          mask-image: linear-gradient(to top, #000 0%, rgba(0,0,0,0.35) 22%, transparent 42%);
  transform: perspective(520px) rotateX(64deg);
  transform-origin: bottom center;
  opacity: 0.5;
  animation: grid-flow 18s linear infinite;
}
@keyframes grid-flow {
  to { background-position: center calc(100% + 46px); }
}

/* Vignette + subtle scanline sheen to frame the content */
[data-theme="space"] .bg-vignette {
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(2, 4, 10, 0.72) 100%);
}

/* Soft aurora glow that breathes behind the hero copy */
[data-theme="space"] .bg-aurora {
  background:
    radial-gradient(600px 320px at 30% 42%, rgba(56, 225, 255, 0.14), transparent 70%),
    radial-gradient(520px 300px at 68% 52%, rgba(167, 139, 250, 0.14), transparent 70%);
  animation: aurora-pulse 9s ease-in-out infinite alternate;
}
@keyframes aurora-pulse {
  from { opacity: 0.55; transform: translateY(0) scale(1); }
  to   { opacity: 0.95; transform: translateY(-10px) scale(1.05); }
}

/* ---- Keep the real site above the background ---- */
[data-theme="space"] body > header,
[data-theme="space"] body > main,
[data-theme="space"] body > footer {
  position: relative;
  z-index: 1;
}

/* Header glass tuned for dark */
[data-theme="space"] #site-header .backdrop-blur { backdrop-filter: blur(10px); }

/* Hero headline: luminous gradient text with a faint glow */
[data-theme="space"] .hero-title {
  background: linear-gradient(100deg, #EAF2FF 0%, #9BE9FF 42%, #C4B5FD 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 0 42px rgba(56, 225, 255, 0.18);
}
[data-theme="space"] .hero-eyebrow { color: var(--color-accent); }

/* Two-column hero: copy on the left, portrait on the right */
[data-theme="space"] .hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 820px) {
  [data-theme="space"] .hero-grid { grid-template-columns: 1fr; gap: 2.75rem; }
  [data-theme="space"] .hero-portrait { order: -1; }   /* photo above copy on mobile */
}

/* Portrait placeholder — glowing gradient frame to match the theme */
[data-theme="space"] .hero-portrait {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
  padding: 1.5px;                       /* reveals the gradient border */
  border-radius: 1.5rem;
  background: linear-gradient(150deg, var(--color-accent), rgba(167,139,250,0.65), rgba(56,225,255,0.12));
  box-shadow: 0 0 55px rgba(56, 225, 255, 0.16);
  animation: portrait-float 6.5s ease-in-out infinite alternate;
}
@keyframes portrait-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-12px); }
}
[data-theme="space"] .photo-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: calc(1.5rem - 1.5px);
  background: radial-gradient(120% 120% at 50% 0%, rgba(56,225,255,0.10), rgba(14,21,38,0.94) 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: 1.5rem;
}
/* The real portrait fills the frame; sits above the placeholder */
[data-theme="space"] .portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  border-radius: calc(1.5rem - 1.5px);
}
[data-theme="space"] .photo-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
[data-theme="space"] .photo-frame .avatar {
  width: 62px; height: 62px;
  color: var(--color-accent);
  opacity: .9;
}
[data-theme="space"] .photo-ph-text {
  margin: 0;
  color: var(--color-muted);
  font-size: .95rem;
}
@media (prefers-reduced-motion: reduce) {
  [data-theme="space"] .hero-portrait { animation: none; }
}

/* Hero call-to-action buttons */
[data-theme="space"] .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 2.25rem;
}
[data-theme="space"] .btn-primary,
[data-theme="space"] .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border-radius: .65rem;
  padding: .8rem 1.5rem;
  font-size: .98rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
[data-theme="space"] .btn-primary {
  background: var(--color-accent);
  color: var(--color-paper);
  box-shadow: 0 0 28px rgba(56, 225, 255, 0.22);
}
[data-theme="space"] .btn-primary:hover { background: var(--color-accent-dark); }
[data-theme="space"] .btn-ghost {
  color: var(--color-ink);
  border: 1px solid var(--color-line);
}
[data-theme="space"] .btn-ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* "TBA" placeholder chip — marks slots awaiting real content */
[data-theme="space"] .tba {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .6em;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-highlight);
  -webkit-text-fill-color: var(--color-highlight); /* show through gradient text */
  border: 1px dashed color-mix(in srgb, var(--color-highlight) 55%, transparent);
  border-radius: .4rem;
  padding: .15em .5em;
  margin-left: .5em;
  vertical-align: middle;
  text-shadow: none;
}

/* Respect reduced motion: still beautiful, just still */
@media (prefers-reduced-motion: reduce) {
  [data-theme="space"] .bg-grid,
  [data-theme="space"] .bg-aurora { animation: none; }
}
