/* ==========================================
   COSMORIA MAIN STYLESHEET
   ========================================== */

:root {
  --navy-deep: #0a0e1f;
  --navy: #131a3a;
  --navy-soft: #1c2452;
  --purple: #8b7cf6;
  --purple-dim: #4c3f9e;
  --gold: #e8b94a;
  --white: #f2f1fa;
  --muted: #9aa0c4;
  --line: rgba(242, 241, 250, 0.10);
  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--navy-deep);
  color: var(--white);
  font-family: var(--body);
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Starfield background ---------- */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 120px 80px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 200px 150px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 300px 40px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 400px 200px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 80px 250px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 500px 100px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 600px 300px, rgba(255, 255, 255, 0.35), transparent);
  background-repeat: repeat;
  background-size: 650px 400px;
  opacity: 0.7;
}

/* ---------- Nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw;
  background: rgba(10, 14, 31, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand svg {
  width: 34px;
  height: 34px;
}

.brand span {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2.2rem;
}

nav a {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--white);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 6vw 4rem;
}

.hero-eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.6rem;
  font-weight: 600;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -1px;
  max-width: 16ch;
}

.hero h1 .accent {
  color: var(--purple);
}

.hero p {
  margin-top: 1.6rem;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-cta {
  margin-top: 2.4rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--gold);
  color: #221a05;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 185, 74, 0.25);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--white);
}

.btn-ghost:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
}

/* Orbit signature */
.orbit-wrap {
  position: relative;
  width: min(360px, 60vw);
  aspect-ratio: 1;
  margin: 3.2rem auto 0;
}

.planet {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #b9a6ff, var(--purple) 55%, var(--purple-dim) 100%);
  box-shadow: 0 0 60px rgba(139, 124, 246, 0.35);
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(-18deg);
  border: 1.5px solid rgba(232, 185, 74, 0.55);
  border-radius: 50%;
}

.moon {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(232, 185, 74, 0.8);
  top: 50%;
  left: 50%;
  animation: orbit 9s linear infinite;
}

@keyframes orbit {
  from {
    transform: translate(-50%, -50%) rotate(-18deg) translateX(calc(min(360px, 60vw) / 2)) rotate(18deg) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(-18deg) translateX(calc(min(360px, 60vw) / 2)) rotate(18deg) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .moon {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Section shell ---------- */
section {
  position: relative;
  z-index: 1;
  padding: 6rem 6vw;
}

.section-head {
  max-width: 640px;
  margin-bottom: 3rem;
}

.section-eyebrow {
  font-size: 0.76rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.section-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: -0.5px;
}

.section-head p {
  color: var(--muted);
  margin-top: 0.9rem;
  font-size: 1.02rem;
}

/* ---------- Pillars (education) ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.pillar {
  background: linear-gradient(165deg, var(--navy), var(--navy-soft));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.2rem 1.8rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pillar:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 124, 246, 0.4);
}

.pillar .mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 124, 246, 0.14);
  margin-bottom: 1.3rem;
}

.pillar h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.pillar p {
  color: var(--muted);
  font-size: 0.94rem;
}

.pillar .tag {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.4px;
}

/* Timeline search teaser */
.timeline-teaser {
  margin-top: 2.6rem;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-teaser input {
  flex: 1;
  min-width: 220px;
  background: var(--navy-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--white);
  font-family: var(--body);
  font-size: 0.92rem;
}

.timeline-teaser input::placeholder {
  color: var(--muted);
}

.timeline-teaser .hint {
  width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.4rem;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.gallery-grid figure {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--navy-soft);
}

.gallery-grid figure:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-grid figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.7rem 0.8rem;
  background: linear-gradient(0deg, rgba(10, 14, 31, 0.9), transparent);
  font-size: 0.76rem;
  color: var(--muted);
}

.gallery-grid figcaption b {
  color: var(--white);
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
}

/* ---------- Community ---------- */
.community {
  background: var(--navy);
  border-radius: 24px;
  padding: 4rem 5vw;
}

.age-tiers {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.age-tier {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.age-tier b {
  color: var(--white);
}

.age-tier.guarded {
  border-color: rgba(232, 185, 74, 0.4);
  color: var(--gold);
}

.community-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 2.4rem;
}

.group-card {
  background: var(--navy-deep);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
}

.group-card .members {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.group-card h4 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
}

/* ---------- Movies ---------- */
.movie-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.movie-card {
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
}

.movie-poster {
  aspect-ratio: 2/3;
  background: linear-gradient(160deg, var(--navy-soft), var(--navy-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.movie-info {
  padding: 0.9rem 1rem 1.1rem;
}

.movie-info h4 {
  font-size: 0.94rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.movie-rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--gold);
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 1;
  padding: 3rem 6vw;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer .brand span {
  font-size: 1rem;
}

footer p {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  nav {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .pillars {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid figure:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
  }
  .community-groups {
    grid-template-columns: 1fr;
  }
  .movie-row {
    grid-template-columns: repeat(2, 1fr);
  }
}