/* ============================================================
   Nightfire — Global Styles
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Night sky */
  --night-deep: #0a0e1a;
  --night-mid: #111827;
  --night-sky: #1a2744;

  /* Ocean */
  --ocean-deep: #0c1929;
  --ocean-surface: #152238;

  /* Moon */
  --moon-glow: #e8dcc8;
  --moon-halo: rgba(232, 220, 200, 0.15);
  --moonlight: rgba(200, 210, 230, 0.08);

  /* Text */
  --silver: #c0c8d8;
  --silver-bright: #e2e8f0;

  /* Accent */
  --amber: #f0a830;
  --amber-dark: #d4922a;
  --amber-glow: rgba(240, 168, 48, 0.3);

  /* Discord */
  --blurple: #5865F2;
  --blurple-light: #7289da;

  /* Stars */
  --star: #f5f0e0;
  --star-max-opacity: 0.8;

  /* Typography */
  --font-heading: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --section-padding: clamp(4rem, 8vw, 8rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--silver);
  background-color: var(--night-deep);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--silver-bright);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.06em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: 0.04em;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  letter-spacing: 0.02em;
}

p {
  max-width: 65ch;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

section {
  padding: var(--section-padding) 0;
}

/* --- Buttons --- */
.btn-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: var(--night-deep);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow:
    0 0 20px rgba(240, 168, 48, 0.15),
    0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 40px rgba(240, 168, 48, 0.3),
    0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 35%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  pointer-events: none;
}

.btn-primary:hover::after {
  transition: transform 0.6s ease;
  transform: translateX(100%);
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.25);
  border-radius: 14px;
  transition: all 0.3s ease;
}

.btn-discord svg {
  width: 26px;
  height: 26px;
  fill: var(--blurple);
  transition: fill 0.3s ease, transform 0.3s ease;
}

.btn-discord:hover {
  background: rgba(88, 101, 242, 0.22);
  border-color: rgba(88, 101, 242, 0.45);
  box-shadow: 0 0 25px rgba(88, 101, 242, 0.15);
  transform: translateY(-2px);
}

.btn-discord:hover svg {
  fill: var(--blurple-light);
  transform: scale(1.1);
}

/* --- Focus States --- */
.btn-primary:focus-visible,
.btn-discord:focus-visible,
a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* --- Features Section --- */
.features {
  background: var(--night-mid);
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, var(--night-deep), transparent);
  pointer-events: none;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.1);
}

/*
  Feature preview container — 16:10 aspect ratio (1200 × 750px recommended).
  Supports static images (PNG, JPG, WebP) and GIFs.
  To add a preview: paste a direct image/GIF URL into the <img src=""> in the HTML.
*/
.feature-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.feature-image img,
.feature-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.feature-image img[src=""] {
  display: none;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
  display: block;
}

.feature-card h3 {
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: rgba(192, 200, 216, 0.7);
  font-size: 1rem;
  margin: 0 auto;
}

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  padding: var(--section-padding) 0;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  margin: 0 auto 2.5rem;
  color: rgba(192, 200, 216, 0.7);
  font-size: 1.1rem;
}

.cta-section .btn-group {
  justify-content: center;
}

/* --- Divider --- */
.section-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  margin: 0 auto 2rem;
  opacity: 0.5;
}

/* --- Footer --- */
.site-footer {
  padding: 2.5rem 0;
  text-align: center;
  border-top: 1px solid rgba(192, 200, 216, 0.06);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.footer-links a {
  color: rgba(192, 200, 216, 0.3);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: rgba(192, 200, 216, 0.65);
}

/* --- Legal Pages --- */
.legal-page {
  min-height: 100vh;
  padding: 4rem 2rem;
}

.legal-nav {
  max-width: 720px;
  margin: 0 auto 3rem;
}

.legal-nav a {
  color: rgba(192, 200, 216, 0.5);
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.legal-nav a:hover {
  color: var(--silver-bright);
}

.legal-content {
  max-width: 720px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.legal-content .legal-meta {
  color: rgba(192, 200, 216, 0.4);
  font-size: 0.875rem;
  margin-bottom: 3rem;
}

.legal-content h2 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal-content p {
  margin-bottom: 1rem;
  color: rgba(192, 200, 216, 0.75);
  font-size: 1rem;
  line-height: 1.8;
}

.legal-content ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-content li {
  color: rgba(192, 200, 216, 0.75);
  font-size: 1rem;
  line-height: 1.8;
  list-style: disc;
  margin-bottom: 0.25rem;
}

.legal-footer {
  max-width: 720px;
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(192, 200, 216, 0.06);
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.legal-footer a {
  color: rgba(192, 200, 216, 0.35);
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

.legal-footer a:hover {
  color: rgba(192, 200, 216, 0.7);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .btn-group {
    justify-content: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .legal-footer {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
