/* ============================================================
   WarpBeacon — Core Styles
   Grimdark aesthetic, modern web design
   ============================================================ */

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

/* --- Custom Properties --- */
:root {
  /* Backgrounds */
  --bg-void: #06060a;
  --bg-primary: #0a0a10;
  --bg-secondary: #10101a;
  --bg-tertiary: #161622;
  --bg-card: #1a1a28;
  --bg-card-hover: #22222f;

  /* Borders */
  --border-subtle: #1a1a2a;
  --border-default: #2a2a3a;
  --border-strong: #3a3a4d;

  /* Imperial Gold */
  --gold: #c9a84c;
  --gold-dim: #8a7535;
  --gold-bright: #e0c060;
  --gold-glow: rgba(201, 168, 76, 0.12);

  /* Blood */
  --red: #8b1a1a;
  --red-bright: #c0392b;

  /* Warp */
  --purple: #6b2fa0;

  /* Text */
  --text-primary: #e8e6e3;
  --text-secondary: #8a889a;
  --text-dim: #55556a;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;

  /* Sizing */
  --max-width: 1200px;
  --nav-height: 70px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-default: 300ms ease;
  --transition-slow: 600ms ease;

  /* Fonts */
  --font-heading: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'Rajdhani', 'Segoe UI', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--gold-bright);
}

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

/* --- Noise Overlay (global) --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Scan Lines (subtle) --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

p {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.text-gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  background: rgba(6, 6, 10, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-default);
}

.navbar.scrolled {
  background: rgba(6, 6, 10, 0.95);
  border-bottom-color: var(--border-default);
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-md);
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  padding: 0.3em 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--transition-default);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  transition: all var(--transition-fast);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(201, 168, 76, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(107, 47, 160, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(139, 26, 26, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-void) 0%, var(--bg-primary) 50%, var(--bg-void) 100%);
  z-index: -1;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 7rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow:
    0 0 40px rgba(201, 168, 76, 0.3),
    0 0 80px rgba(201, 168, 76, 0.1);
  animation: fadeInUp 1s ease forwards;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: var(--space-sm);
  animation: fadeInUp 1s ease 0.2s forwards;
  opacity: 0;
}

.hero-divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: var(--space-md) auto;
  animation: fadeInUp 1s ease 0.4s forwards;
  opacity: 0;
}

.hero-tagline {
  max-width: 600px;
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-top: var(--space-sm);
  animation: fadeInUp 1s ease 0.6s forwards;
  opacity: 0;
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  animation: fadeInUp 1s ease 0.8s forwards, float 3s ease-in-out infinite 1.8s;
  opacity: 0;
}

.scroll-indicator span {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.scroll-indicator .arrow {
  width: 20px;
  height: 20px;
  border-right: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
  transform: rotate(45deg);
}

/* --- Sections --- */
.section {
  padding: var(--space-xl) var(--space-md);
  position: relative;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-header .section-line {
  width: 60px;
  height: 1px;
  background: var(--gold-dim);
  margin: var(--space-sm) auto;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
}

/* Alternating section backgrounds */
.section--dark {
  background: var(--bg-primary);
}

.section--darker {
  background: var(--bg-void);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  transition: all var(--transition-default);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-default);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card-body {
  padding: var(--space-md);
}

/* --- Crusade Card (landing page) --- */
.crusade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}

.crusade-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  transition: all var(--transition-default);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.crusade-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-6px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 30px var(--gold-glow);
}

.crusade-card:hover .crusade-card__image {
  transform: scale(1.05);
}

.crusade-card__image-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.crusade-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

/* Placeholder gradient for cards without images */
.crusade-card__image--placeholder {
  width: 100%;
  height: 100%;
  transition: transform var(--transition-slow);
}

.crusade-card__image-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(transparent, var(--bg-card));
  pointer-events: none;
}

.crusade-card__badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3em 0.8em;
  border-radius: 2px;
  z-index: 2;
}

.crusade-card__badge--active {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

.crusade-card__badge--completed {
  background: rgba(100, 100, 120, 0.15);
  color: var(--text-dim);
  border: 1px solid var(--border-default);
}

.crusade-card__content {
  padding: var(--space-md);
}

.crusade-card__title {
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.crusade-card__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}

.crusade-card__meta {
  display: flex;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.crusade-card__meta span {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.crusade-card__enter {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  transition: color var(--transition-fast);
}

.crusade-card:hover .crusade-card__enter {
  color: var(--gold);
}

.crusade-card__enter .arrow {
  transition: transform var(--transition-fast);
}

.crusade-card:hover .crusade-card__enter .arrow {
  transform: translateX(4px);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.8em 2em;
  border: 1px solid var(--border-default);
  border-radius: 2px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-default);
}

.btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
}

.btn--gold {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.btn--gold:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold);
}

/* --- Footer --- */
.footer {
  padding: var(--space-lg) var(--space-md);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

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

.footer-line {
  width: 40px;
  height: 1px;
  background: var(--border-default);
  margin: var(--space-sm) auto;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: calc(var(--nav-height) + var(--space-md)) var(--space-md) 0;
  max-width: var(--max-width);
  margin: 0 auto;
}

.breadcrumb a {
  color: var(--text-dim);
}

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb .sep {
  color: var(--border-default);
}

/* --- Grid Utilities --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px var(--gold-glow); }
  50% { box-shadow: 0 0 30px var(--gold-glow), 0 0 60px rgba(201, 168, 76, 0.05); }
}

/* Scroll-triggered animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --space-xl: 4rem;
    --space-2xl: 6rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(6, 6, 10, 0.98);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-sm) var(--space-md);
    gap: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    padding: var(--space-xs) 0;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-title {
    letter-spacing: 0.1em;
  }

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

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
}
