/* ============================================================
   NWA (Nowhere Anime) — Website Styles
   Colors match the app theme: src/theme/colors.ts
   ============================================================ */

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

:root {
  /* Core palette — matches app exactly */
  --bg: #0D1117;
  --panel: #161B22;
  --surface-alt: #1C2333;
  --ink: #E6EDF3;
  --muted: #8B949E;
  --line: #30363D;

  /* Brand gradient */
  --brand-blue: #58A6FF;
  --brand-purple: #7C3AED;
  --brand-glow: rgba(88, 166, 255, 0.15);

  /* Semantic */
  --success: #3FB950;
  --error: #F85149;

  /* Layout */
  --max-width: 1100px;
  --nav-height: 64px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: #79C0FF;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Gradient Text Utility --- */
.gradient-text {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Navigation --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-links a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

/* Mobile menu toggle */
.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(--ink);
  border-radius: 2px;
  transition: all 0.3s ease;
}

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

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

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

/* --- Sections --- */
section {
  padding: 100px 0;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--brand-blue);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 48px;
}

/* --- Hero --- */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

/* Ambient glow behind hero */
#hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(88, 166, 255, 0.08), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-logo {
  margin: 0 auto 32px;
  width: 96px;
  height: 96px;
}

.hero-logo-img {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: 0 0 40px rgba(88, 166, 255, 0.2);
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: 8px;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.25s ease;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.badge-link:hover {
  border-color: var(--brand-blue);
  background: var(--surface-alt);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.12);
}

.badge-link svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.badge-link.primary {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
  border-color: transparent;
  color: #fff;
}

.badge-link.primary:hover {
  box-shadow: 0 8px 32px rgba(88, 166, 255, 0.3);
  transform: translateY(-2px);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: fadeBounce 2s ease-in-out infinite;
}

.scroll-indicator .arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}

@keyframes fadeBounce {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* --- Features --- */
#features {
  background: var(--panel);
}

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

.feature-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.25s ease;
}

.feature-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--ink);
}

.feature-card p {
  color: var(--muted);
  font-size: 0.925rem;
  line-height: 1.7;
}

/* --- About --- */
#about {
  background: var(--bg);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-icon-large {
  width: 200px;
  height: 200px;
  border-radius: 32px;
  box-shadow: 0 0 60px rgba(88, 166, 255, 0.15);
}

/* --- Download --- */
#download {
  background: var(--panel);
  text-align: center;
}

.download-badges {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

.download-alt {
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.download-alt a {
  color: var(--brand-blue);
}

/* --- Contact / Social --- */
#contact {
  background: var(--bg);
}

.social-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.social-link:hover {
  border-color: var(--brand-blue);
  color: var(--ink);
  transform: translateY(-2px);
}

.social-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

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

.footer-copy {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* --- Privacy Page --- */
.privacy-page {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 80px;
  max-width: 760px;
  margin: 0 auto;
}

.privacy-page h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.privacy-page .last-updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.privacy-page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--ink);
}

.privacy-page p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.privacy-page .placeholder-box {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  margin: 32px 0;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .about-text .section-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-title {
    font-size: 3rem;
    letter-spacing: 4px;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  section {
    padding: 64px 0;
  }

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

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.25rem;
    letter-spacing: 3px;
  }

  .badge-link {
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  .privacy-page {
    padding: calc(var(--nav-height) + 32px) 16px 48px;
  }

  .privacy-page h1 {
    font-size: 1.75rem;
  }
}
