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

:root {
  --bg-dark: #0F172C;
  --bg-darker: #0A0F1E;
  --bg-card: #162040;
  --bg-card-hover: #1C2A52;
  --accent: #F5C542;
  --accent-dim: #C49A2A;
  --text: #E8ECF4;
  --text-dim: #8B95AD;
  --pixel-font: "Silkscreen", cursive;
  --body-font: "Inter", system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body-font);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #fff;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-family: var(--pixel-font);
  font-size: clamp(1.4rem, 4vw, 2rem);
  text-align: center;
  margin-bottom: 48px;
  color: var(--accent);
  letter-spacing: 1px;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, padding 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
  background: rgba(15, 23, 44, 0.92);
  backdrop-filter: blur(12px);
  padding: 10px 0;
  border-bottom: 1px solid rgba(245, 197, 66, 0.1);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--pixel-font);
  font-size: 1.1rem;
  color: var(--accent) !important;
  letter-spacing: 2px;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

.nav-cta {
  background: var(--accent);
  color: var(--bg-dark) !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600 !important;
}

.nav-cta:hover {
  background: #fff;
  color: var(--bg-dark) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 100px 24px 60px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0A0F1E 0%, #0F172C 30%, #1A2744 60%, #2A3A5C 100%);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 25% 8%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 45% 22%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 60% 5%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 75% 18%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 85% 12%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 15% 35%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 50% 30%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 90% 28%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 35% 40%, rgba(255,255,255,0.4), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.clouds {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.cloud-1 {
  width: 300px;
  height: 60px;
  bottom: 30%;
  left: -5%;
  animation: float 20s ease-in-out infinite;
}

.cloud-2 {
  width: 200px;
  height: 40px;
  bottom: 45%;
  right: 10%;
  animation: float 25s ease-in-out infinite reverse;
}

.cloud-3 {
  width: 250px;
  height: 50px;
  bottom: 20%;
  left: 40%;
  animation: float 22s ease-in-out infinite 3s;
}

@keyframes float {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(30px); }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 60px;
  max-width: 1100px;
  width: 100%;
}

.hero-text {
  flex: 1;
}

.hero-title {
  font-family: var(--pixel-font);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: 3px;
  text-shadow: 0 0 40px rgba(245, 197, 66, 0.3);
}

.hero-tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.appstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s, opacity 0.2s;
}

.appstore-btn:hover {
  transform: scale(1.05);
}

.appstore-badge {
  width: 160px;
  height: auto;
}

.coming-soon-badge {
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  color: var(--accent);
  background: rgba(245, 197, 66, 0.12);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(245, 197, 66, 0.25);
  letter-spacing: 1px;
}

.hero-phone {
  flex-shrink: 0;
}

.phone-frame {
  position: relative;
  width: 280px;
  background: #1a1a2e;
  border-radius: 36px;
  padding: 12px;
  border: 3px solid #2a2a4a;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 25px 60px rgba(0,0,0,0.5),
    0 0 80px rgba(245, 197, 66, 0.08);
  animation: phoneFadeIn 1s ease-out 0.3s both;
}

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

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 22px;
  background: #1a1a2e;
  border-radius: 0 0 16px 16px;
  z-index: 3;
}

.phone-screen {
  width: 100%;
  border-radius: 24px;
  image-rendering: auto;
}

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  opacity: 0.5;
  transition: opacity 0.3s;
  animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-hint span {
  font-size: 0.7rem;
  font-family: var(--pixel-font);
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-arrow {
  width: 16px;
  height: 16px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

.scroll-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===== About ===== */
.about {
  padding: 100px 0;
  background: var(--bg-darker);
  position: relative;
}

.about::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,197,66,0.2), transparent);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.about-card {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.3s, border-color 0.3s;
}

.about-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 197, 66, 0.2);
}

.about-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--accent);
}

.about-card h3 {
  font-family: var(--pixel-font);
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--accent);
}

.about-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ===== Features ===== */
.features {
  padding: 100px 0;
  background: var(--bg-dark);
  position: relative;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 32px 24px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  text-align: center;
  transition: transform 0.3s, border-color 0.3s, background 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 197, 66, 0.15);
  background: var(--bg-card-hover);
}

.feature-number {
  font-family: var(--pixel-font);
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 8px;
  line-height: 1;
}

.feature-icon-physics {
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  color: var(--accent);
}

.feature-card h3 {
  font-family: var(--pixel-font);
  font-size: 0.85rem;
  margin-bottom: 12px;
  color: #fff;
  letter-spacing: 0.5px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ===== Screenshots ===== */
.screenshots {
  padding: 100px 0 60px;
  background: var(--bg-darker);
  position: relative;
  overflow: hidden;
}

.screenshots::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,197,66,0.2), transparent);
}

.screenshots-track {
  display: flex;
  gap: 24px;
  padding: 0 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.screenshots-track::-webkit-scrollbar {
  display: none;
}

.screenshots-track:active {
  cursor: grabbing;
}

.screenshot-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
  width: 260px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.06);
  transition: transform 0.3s, border-color 0.3s;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.screenshot-item:first-child {
  margin-left: max(24px, calc((100vw - 1100px) / 2));
}

.screenshot-item:last-child {
  margin-right: max(24px, calc((100vw - 1100px) / 2));
}

.screenshot-item:hover {
  transform: scale(1.03);
  border-color: rgba(245, 197, 66, 0.25);
}

.screenshot-item img {
  width: 100%;
  height: auto;
}

.screenshots-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.screenshots-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.screenshots-dots .dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ===== Buildings ===== */
.buildings {
  padding: 100px 0;
  background: var(--bg-dark);
}

.buildings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.building-card {
  text-align: center;
  padding: 32px 16px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.3s, border-color 0.3s;
}

.building-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 197, 66, 0.2);
}

.building-img-wrap {
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 20px;
}

.building-img-wrap img {
  max-height: 170px;
  width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  transition: transform 0.3s;
}

.building-card:hover .building-img-wrap img {
  transform: scale(1.08);
}

.building-card h3 {
  font-family: var(--pixel-font);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.building-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.building-dot {
  width: 3px;
  height: 3px;
  background: var(--text-dim);
  border-radius: 50%;
}

.building-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ===== Download CTA ===== */
.download {
  padding: 100px 0;
  background: var(--bg-darker);
  position: relative;
}

.download::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,197,66,0.2), transparent);
}

.download-content {
  text-align: center;
}

.download-content p {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.appstore-btn-large {
  justify-content: center;
}

.appstore-btn-large .appstore-badge {
  width: 200px;
}

/* ===== Footer ===== */
.footer {
  padding: 32px 0;
  background: var(--bg-darker);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  font-family: var(--pixel-font);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 2px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-links a:hover {
  color: var(--accent);
}

/* ===== Animations (scroll-triggered via JS) ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-text {
    order: 1;
  }

  .hero-phone {
    order: 2;
  }

  .appstore-btn {
    justify-content: center;
  }

  .phone-frame {
    width: 220px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .buildings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(15, 23, 44, 0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 1px solid rgba(245,197,66,0.1);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
    z-index: 101;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .buildings-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .hero {
    padding: 80px 24px 40px;
    min-height: auto;
  }

  .phone-frame {
    width: 200px;
  }

  .section-title {
    margin-bottom: 32px;
  }

  .about, .features, .buildings, .download, .screenshots {
    padding: 64px 0;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .screenshot-item {
    width: 220px;
  }
}

@media (max-width: 400px) {
  .buildings-grid {
    grid-template-columns: 1fr;
  }
}
