/* =========================
   Reset & Base
========================= */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5faff;
  --ink: #2b3a42;
  --primary: #0aa3ff;
  --primary-weak: #bfeaff;
  --white: #ffffff;
  --glass: rgba(255,255,255,0.75);
  --shadow: 0 10px 30px rgba(0, 90, 150, 0.15);
  --radius: 14px;

  /* hero day/night */
  --hero-img: url('sky-bg-day.jpg');
  --hero-tint: rgba(0, 40, 80, 0.22);
}

html { scroll-behavior: smooth; }
body {
  font-family: "M PLUS Rounded 1c", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* =========================
   Intro Animation
========================= */
#intro {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #aee2ff, #e0f7ff);
  z-index: 9999;
  overflow: hidden;
  animation: introFade 3.3s ease-in-out forwards 0.3s;
}
.intro-bg {
  position: absolute;
  inset: -10%;
  background: url('./img/intro.png') repeat-x center;
  background-size: 1200px auto;
  opacity: 0.35;
  animation: cloudsMove 30s linear infinite;
  filter: blur(1px);
}
#intro .logo {
  width: 200px;
  animation: float 3s ease-in-out infinite, logoGlow 2.2s ease-in-out infinite alternate;
}
#intro .flare {
  position: absolute;
  height: 2px;
  width: 180%;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  transform: rotate(18deg) translateX(-50%);
  top: 50%;
  left: 50%;
  opacity: 0;
  animation: flare 1.6s ease 1.2s forwards;
}

@keyframes float { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-10px) } }
@keyframes cloudsMove { from{ background-position: 0 50% } to{ background-position: -1200px 50% } }
@keyframes logoGlow { from{ filter: drop-shadow(0 0 6px #fff) } to{ filter: drop-shadow(0 0 22px #b3ecff) } }
@keyframes flare { 0%{ opacity: 0; transform: rotate(18deg) translateX(-60%)} 40%{ opacity: 1 } 100%{ opacity: 0; transform: rotate(18deg) translateX(60%)} }
@keyframes introFade { 0%,72%{ opacity: 1 } 100%{ opacity: 0; visibility: hidden } }

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #intro, .intro-bg, #intro .logo, #intro .flare,
  .hero-content h1, .layer-clouds {
    animation: none !important;
  }
}

/* =========================
   Header / Nav
========================= */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(180,220,255,0.5);
  z-index: 1000;
}
.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.logo-small img { width: 120px; display: block; }

.menu-toggle {
  background: none; border: none; padding: 8px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.menu-toggle span { width: 26px; height: 3px; background: #1b2a33; border-radius: 2px; }

.nav {
  position: fixed;
  top: 0; right: -100%;
  width: 260px; height: 100vh;
  background: var(--white);
  padding-top: 5.5rem;
  transition: right .35s ease;
  box-shadow: var(--shadow);
}
.nav.open { right: 0; }
.nav ul { list-style: none; }
.nav li + li { margin-top: .8rem; }
.nav a {
  color: #0b3550; text-decoration: none; font-size: 1.08rem;
  padding: .6rem 1.2rem; display: block; border-radius: 8px;
}
.nav a:hover, .nav a.active { background: var(--primary-weak); color: #01578e; }

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .nav {
    position: static; width: auto; height: auto; background: transparent;
    padding: 0; box-shadow: none; right: 0 !important;
  }
  .nav ul { display: flex; gap: 1.2rem; }
  .nav li + li { margin-top: 0; }
  .nav a { padding: .4rem .8rem; border-radius: 10px; }
}

/* =========================
   Main spacing
========================= */
main { padding-top: 78px; }

/* =========================
   Hero
========================= */
#hero {
  position: relative;
  height: 92vh;
  min-height: 560px;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}
.layer.layer-back {
  position: absolute; inset: 0;
  background: var(--hero-img) center / cover fixed no-repeat;
  transform: translateZ(0);
}
.layer.layer-clouds {
  position: absolute; inset: -5% 0 0 0;
  background: url('./img/hero.png') repeat-x center;
  background-size: 1200px auto;
  opacity: 0.28;
  animation: cloudsMove 45s linear infinite;
}
#hero::after {
  content: ""; position: absolute; inset: 0; background: var(--hero-tint);
}
.hero-content { position: relative; z-index: 1; padding: 0 1rem; }

.hero-content h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: .02em;
  background: linear-gradient(90deg, #ffffff, #b3ecff, #ffffff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { 0%{background-position:0% 50%} 100%{background-position:200% 50%} }

.hero-content p {
  color: #e9f6ff;
  margin: 1rem auto 1.5rem;
  max-width: 38ch;
  text-shadow: 0 2px 6px rgba(0,0,0,.35);
}

.btn {
  display: inline-block;
  background: #ffffffdd;
  color: #006bbf;
  padding: .7rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .3s ease, background .3s ease;
  box-shadow: 0 6px 18px rgba(0, 120, 200, .25);
}
.btn:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,120,200,.28); }
.discord-btn { background: #5865f2; color: #fff; box-shadow: 0 8px 22px rgba(88,101,242,.35); }
.discord-btn:hover { background: #6b76ff; }

/* =========================
   Sections
========================= */
.section { padding: 4.5rem 1rem; }
.section .section-inner { max-width: 1100px; margin: 0 auto; }
.section .center { text-align: center; }

.glass {
  background: var(--glass);
  border: 1px solid rgba(200,230,255,.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 2rem 1.4rem;
}

.section h2 {
  color: #006bbf;
  margin-bottom: 1rem;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

/* Steps */
.steps { counter-reset: step; display: grid; gap: 1.2rem; }
.steps li {
  list-style: none;
  background: #fff;
  border: 1px solid #e4f4ff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 16px rgba(0,80,140,0.06);
}
.steps li h3 {
  position: relative; padding-left: 2.2rem; font-size: 1.05rem; margin-bottom: .4rem;
}
.steps li h3::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: #b3ecff; color: #014061; display: grid; place-items: center; font-weight: 800;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.gallery-item {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; cursor: pointer;
  border-radius: 12px;
  transition: transform .35s ease, box-shadow .35s ease, filter .35s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}
.gallery-item:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 14px 28px rgba(0,0,0,.14); filter: saturate(1.05); }

/* Timeline */
.timeline {
  position: relative; margin: 2rem 0; padding-left: 1.5rem; border-left: 2px solid #cceeff;
}
.timeline-item { position: relative; margin-bottom: 1.4rem; }
.timeline-item time {
  display: block; font-size: .95rem; color: #006bbf; margin-bottom: .3rem; font-weight: 700;
}
.timeline-item::before {
  content: ""; position: absolute; left: -9px; top: 6px;
  width: 12px; height: 12px; background: #aee2ff; border-radius: 50%;
}

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 2000;
}
.modal.open { display: flex; }
.modal-img { max-width: 90vw; max-height: 82vh; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  font-size: 1.8rem; color: #fff; background: transparent; border: none; cursor: pointer; line-height: 1;
}

/* Footer */
.footer { padding: 2rem 1rem; color: #557; }
.footer .container { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.footer-link { color: #0b5fa1; text-decoration: none; }

/* Scroll-reveal */
.section { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s ease; }
.section.visible { opacity: 1; transform: translateY(0); }

/* Active link highlight on scroll */
.nav a.active { background: var(--primary-weak); }

/* =========================
   Day/Night theme (auto)
========================= */
:root.night {
  --hero-img: url('sky-bg-night.jpg');
  --hero-tint: rgba(0, 8, 40, 0.35);
}

/* =========================
   Responsive
========================= */
@media (min-width: 768px) {
  .section { padding: 5rem 1.5rem; }
  .glass { padding: 2.2rem 2rem; }
}
