:root {
  --bg-deep: #091022;
  --bg-mid: #131f3f;
  --bg-horizon: #1e294f;
  --card-bg: rgba(11, 18, 36, 0.64);
  --card-border: rgba(203, 224, 255, 0.2);
  --card-highlight: rgba(255, 255, 255, 0.08);
  --text-main: #f4f7ff;
  --text-soft: #cfd9ee;
  --text-muted: #9eb0d1;
  --accent-sky: #7dd3fc;
  --accent-rose: #f9a8d4;
  --accent-gold: #fcd34d;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.viewport-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}

/* Base midnight gradient + responsive image hook */
.backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(120% 80% at 75% 15%, rgba(92, 138, 214, 0.24), transparent 55%),
    radial-gradient(90% 70% at 20% 85%, rgba(244, 168, 212, 0.14), transparent 60%),
    linear-gradient(180deg, #070d1c 0%, #101b39 52%, #192344 100%);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Desktop / landscape artwork */
@media (min-width: 768px) and (orientation: landscape) {
  .backdrop {
    background-image:
      url("/assets/bg-desktop.jpg"),
      radial-gradient(120% 80% at 75% 15%, rgba(92, 138, 214, 0.24), transparent 55%),
      linear-gradient(180deg, #070d1c 0%, #101b39 52%, #192344 100%);
    background-position: right center, center center, center center;
  }
}

/* Mobile / portrait artwork */
@media (max-width: 767px), (orientation: portrait) {
  .backdrop {
    background-image:
      url("/assets/bg-mobile.jpg"),
      radial-gradient(120% 80% at 50% 18%, rgba(92, 138, 214, 0.24), transparent 55%),
      linear-gradient(180deg, #070d1c 0%, #101b39 52%, #192344 100%);
    background-position: center center, center center, center center;
  }
}

/* Sky effects: gentle stars & diagonal shooting stars across upper night sky */
.sky-effects {
  position: absolute;
  inset: 0 0 42% 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.starfield {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}

.starfield--far {
  opacity: 0.45;
  background-image:
    radial-gradient(1px 1px at 14% 22%, #ffffff, transparent),
    radial-gradient(1px 1px at 31% 14%, #dbeafe, transparent),
    radial-gradient(1.2px 1.2px at 49% 32%, #ffffff, transparent),
    radial-gradient(1px 1.2px at 67% 19%, #fce7f3, transparent),
    radial-gradient(1px 1px at 84% 28%, #e0f2fe, transparent),
    radial-gradient(1px 1px at 22% 58%, #ffffff, transparent),
    radial-gradient(1.2px 1.2px at 73% 48%, #ffffff, transparent),
    radial-gradient(1px 1px at 91% 12%, #dbeafe, transparent);
  background-size: 420px 260px;
}

.starfield--near {
  opacity: 0.65;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 35%, #e0f2fe, transparent),
    radial-gradient(1.5px 1.5px at 57% 21%, #ffffff, transparent),
    radial-gradient(1.8px 1.8px at 79% 38%, #fbcfe8, transparent),
    radial-gradient(1.4px 1.4px at 38% 64%, #fef3c7, transparent);
  background-size: 560px 320px;
  animation: star-twinkle 6s ease-in-out infinite alternate;
}

.meteor {
  position: absolute;
  width: clamp(100px, 13vw, 185px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(125, 211, 252, 0.85) 58%, #ffffff 100%);
  box-shadow: 0 0 12px rgba(186, 230, 253, 0.92);
  opacity: 0;
  transform: rotate(28deg) translate3d(-160px, 0, 0);
  will-change: transform, opacity;
}

.meteor::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  box-shadow: 0 0 14px 3px rgba(186, 230, 253, 0.98);
}

.meteor--1 {
  top: 11%;
  left: 18%;
  animation: meteor-streak 6.2s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s infinite;
}

.meteor--2 {
  top: 19%;
  left: 52%;
  animation: meteor-streak 7.4s cubic-bezier(0.22, 0.61, 0.36, 1) 1.9s infinite;
}

.meteor--3 {
  top: 7%;
  left: 68%;
  animation: meteor-streak 8.2s cubic-bezier(0.22, 0.61, 0.36, 1) 3.7s infinite;
}

.meteor--4 {
  top: 24%;
  left: 34%;
  animation: meteor-streak 9.0s cubic-bezier(0.22, 0.61, 0.36, 1) 5.4s infinite;
}

@keyframes star-twinkle {
  from { opacity: 0.42; }
  to { opacity: 0.82; }
}

@keyframes meteor-streak {
  0%, 58% {
    opacity: 0;
    transform: rotate(28deg) translate3d(-120px, 0, 0) scaleX(0.65);
  }
  64% {
    opacity: 1;
  }
  84% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: rotate(28deg) translate3d(340px, 0, 0) scaleX(1.1);
  }
}

/* Soft contrast scrim preserving central/right artwork */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    95deg,
    rgba(7, 12, 26, 0.66) 0%,
    rgba(7, 12, 26, 0.36) 44%,
    rgba(7, 12, 26, 0.14) 100%
  );
}

@media (max-width: 767px), (orientation: portrait) {
  .scrim {
    background: linear-gradient(
      180deg,
      rgba(7, 12, 26, 0.18) 0%,
      rgba(7, 12, 26, 0.15) 48%,
      rgba(7, 12, 26, 0.72) 100%
    );
  }
}

/* Card placement: fills 100% viewport cleanly without scroll */
.card-shell {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding:
    max(1rem, env(safe-area-inset-top))
    clamp(1rem, 4vw, 4.5rem)
    max(1rem, env(safe-area-inset-bottom))
    clamp(1rem, 4.5vw, 5rem);
}

@media (max-width: 767px), (orientation: portrait) {
  .card-shell {
    align-items: flex-end;
    justify-content: center;
    padding:
      max(0.75rem, env(safe-area-inset-top))
      max(0.85rem, env(safe-area-inset-right))
      max(0.9rem, env(safe-area-inset-bottom))
      max(0.85rem, env(safe-area-inset-left));
  }
}

.card {
  width: min(100%, 490px);
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 2.3vh, 1.85rem) clamp(1.1rem, 2.6vw, 2rem);
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow:
    0 24px 60px rgba(3, 7, 18, 0.56),
    inset 0 1px 0 var(--card-highlight);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 1.4vh, 1.05rem);
}

.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  font-size: clamp(0.72rem, 1.1vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e0f2fe;
  background: rgba(125, 211, 252, 0.14);
  border: 1px solid rgba(125, 211, 252, 0.34);
}

.status-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-rose));
  box-shadow: 0 0 8px rgba(125, 211, 252, 0.85);
}

.domain-tag {
  margin: 0;
  font-size: clamp(0.78rem, 1.2vw, 0.88rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-rose);
}

.card__title {
  margin: 0;
  font-size: clamp(1.25rem, 2.3vw, 1.85rem);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.015em;
  background: linear-gradient(120deg, #ffffff 0%, #dbeafe 62%, #fbcfe8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card__lead {
  margin: 0;
  font-size: clamp(0.875rem, 1.35vw, 0.98rem);
  line-height: 1.5;
  color: var(--text-soft);
}

.pillars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(0.42rem, 0.9vh, 0.65rem);
}

.pillar {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: clamp(0.45rem, 1vh, 0.65rem) 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pillar__label {
  font-size: clamp(0.78rem, 1.15vw, 0.86rem);
  font-weight: 600;
  color: var(--accent-sky);
}

.pillar__desc {
  font-size: clamp(0.75rem, 1.1vw, 0.83rem);
  line-height: 1.38;
  color: var(--text-soft);
}

.card__footer {
  padding-top: clamp(0.45rem, 1vh, 0.75rem);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.card__note {
  margin: 0;
  font-size: clamp(0.76rem, 1.1vw, 0.84rem);
  line-height: 1.42;
  color: var(--text-soft);
}

.card__privacy {
  margin: 0;
  font-size: clamp(0.68rem, 0.95vw, 0.75rem);
  color: var(--text-muted);
}

/* Extra compactness on portrait/mobile screens so statue, library & starry sky remain clearly visible */
@media (max-width: 767px), (orientation: portrait) {
  .scrim {
    background: linear-gradient(
      180deg,
      rgba(7, 12, 26, 0.08) 0%,
      rgba(7, 12, 26, 0.08) 62%,
      rgba(7, 12, 26, 0.72) 100%
    );
  }

  .card {
    background: rgba(10, 17, 34, 0.64);
    padding: 0.8rem 0.95rem;
    gap: 0.48rem;
    border-radius: 18px;
  }

  .card__title {
    font-size: clamp(1.06rem, 4.3vw, 1.32rem);
    line-height: 1.2;
  }

  .card__lead {
    font-size: clamp(0.78rem, 3.1vw, 0.86rem);
    line-height: 1.38;
  }

  .pillars {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
  }

  .pillar {
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: rgba(125, 211, 252, 0.09);
    border-color: rgba(125, 211, 252, 0.24);
  }

  .pillar__label {
    font-size: 0.72rem;
  }

  /* Keep full pillar descriptions accessible to assistive tech while letting mobile users see the full sculpture */
  .pillar__desc {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .card__footer {
    padding-top: 0.42rem;
    gap: 0.18rem;
  }

  .card__note {
    font-size: 0.73rem;
    line-height: 1.32;
  }

  .card__privacy {
    font-size: 0.65rem;
  }
}

/* Extra compactness on short laptop or small phone screens so zero scroll always holds */
@media (max-height: 690px) {
  .card {
    padding: 0.85rem 1.05rem;
    gap: 0.5rem;
  }

  .card__title {
    font-size: clamp(1.1rem, 2.2vh, 1.45rem);
  }

  .card__lead {
    font-size: 0.84rem;
    line-height: 1.38;
  }

  .pillar {
    padding: 0.36rem 0.65rem;
  }

  .pillar__desc {
    font-size: 0.74rem;
    line-height: 1.28;
  }
}

@media (prefers-reduced-motion: reduce) {
  .starfield--near,
  .meteor {
    animation: none;
  }
  .meteor {
    opacity: 0;
  }
}
