/* ============================================================
   CHISELCRAFT CIVILIZATION SMP — styles.css
   Dark gaming theme with glowing gold/ember/rune accents
   ============================================================ */

:root {
  --obsidian: #0a0a0f;
  --stone: #111118;
  --slate: #1a1a26;
  --ember: #e8621a;
  --gold: #d4a017;
  --rune: #5b9cf6;
  --mist: #a0aec0;
  --emerald: #34d399;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--obsidian);
  font-family: 'Crimson Pro', serif;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--obsidian); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; opacity: 0.5; }

/* ─── SELECTION ──────────────────────────────────────────── */
::selection { background: rgba(212,160,23,0.2); color: #fff; }

/* ─── NAVBAR ─────────────────────────────────────────────── */
#navbar {
  background: transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}
#navbar.scrolled {
  background: rgba(10,10,15,0.92);
  border-bottom: 1px solid rgba(212,160,23,0.15);
  backdrop-filter: blur(16px);
}
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 1px;
  background: var(--gold);
  transition: left 0.3s, right 0.3s;
}
.nav-link:hover::after { left: 16px; right: 16px; }

.mobile-menu {
  background: rgba(10,10,15,0.97);
  border-top: 1px solid rgba(212,160,23,0.1);
  backdrop-filter: blur(20px);
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn-discord {
  background: rgba(88,101,242,0.15);
  border: 1px solid rgba(88,101,242,0.4);
  color: #a5b4fc;
  letter-spacing: 0.1em;
}
.btn-discord:hover {
  background: rgba(88,101,242,0.3);
  border-color: rgba(88,101,242,0.7);
  color: #fff;
  box-shadow: 0 0 16px rgba(88,101,242,0.3);
}

.btn-ip {
  background: rgba(212,160,23,0.1);
  border: 1px solid rgba(212,160,23,0.35);
  color: var(--gold);
  letter-spacing: 0.1em;
}
.btn-ip:hover {
  background: rgba(212,160,23,0.2);
  border-color: rgba(212,160,23,0.7);
  color: #fff;
  box-shadow: 0 0 16px rgba(212,160,23,0.25);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(212,160,23,0.2), rgba(232,98,26,0.2));
  border: 1px solid rgba(212,160,23,0.5);
  color: var(--gold);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,160,23,0.4), rgba(232,98,26,0.4));
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
  color: #fff;
  box-shadow: 0 0 30px rgba(212,160,23,0.4), 0 0 60px rgba(212,160,23,0.1);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(212,160,23,0.25);
  color: rgba(160,174,192,0.8);
}
.btn-secondary:hover {
  border-color: rgba(212,160,23,0.5);
  color: var(--gold);
  background: rgba(212,160,23,0.05);
  transform: translateY(-2px);
}

.btn-cta-primary {
  background: linear-gradient(135deg, var(--gold), var(--ember));
  color: var(--obsidian);
  font-weight: 700;
  border: none;
  position: relative;
  overflow: hidden;
}
.btn-cta-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fff3 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-cta-primary:hover::before { opacity: 1; }
.btn-cta-primary:hover {
  box-shadow: 0 0 40px rgba(212,160,23,0.6), 0 8px 32px rgba(232,98,26,0.4);
  transform: translateY(-3px);
}

.btn-cta-secondary {
  background: transparent;
  border: 1px solid rgba(212,160,23,0.4);
  color: rgba(212,160,23,0.8);
}
.btn-cta-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,160,23,0.08);
  box-shadow: 0 0 20px rgba(212,160,23,0.2);
  transform: translateY(-3px);
}

/* ─── HERO ───────────────────────────────────────────────── */
.hero-section { background: var(--obsidian); }

/* Background video in the hero section (visible behind overlay layers) */
#hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0; /* sit above hero-bg but below text/overlays */
}

.hero-bg {
  z-index: -1; /* keep the gradient overlay beneath content but above the video */
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,160,23,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(232,98,26,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 10% 60%, rgba(91,156,246,0.04) 0%, transparent 60%),
    radial-gradient(rgba(10,10,15,0.45), rgba(10,10,15,0.45));
}

.hero-grid { z-index: 1; }
.hero-vignette { z-index: 2; }

.hero-grid {
  background-image:
    linear-gradient(rgba(212,160,23,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,160,23,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 80%);
}

.hero-vignette {
  background: radial-gradient(ellipse 100% 70% at 50% 100%, rgba(10,10,15,0.8) 0%, transparent 50%);
}

/* Floating runes */
.rune-float { animation: runeFloat linear infinite; }
.rune-1 { top: 15%; left: 5%; animation-duration: 20s; animation-delay: 0s; }
.rune-2 { top: 60%; right: 5%; animation-duration: 25s; animation-delay: -8s; }
.rune-3 { top: 30%; right: 15%; animation-duration: 18s; animation-delay: -5s; }

@keyframes runeFloat {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.06; }
  25% { transform: translateY(-30px) rotate(5deg); opacity: 0.12; }
  50% { transform: translateY(-15px) rotate(-3deg); opacity: 0.06; }
  75% { transform: translateY(-45px) rotate(8deg); opacity: 0.1; }
  100% { transform: translateY(0) rotate(0deg); opacity: 0.06; }
}

/* Logo hex */
.logo-hex {
  filter: drop-shadow(0 0 6px rgba(212,160,23,0.4));
}

/* Hero title */
.hero-title {
  font-size: clamp(2.5rem, 8vw, 6rem);
  line-height: 1;
}
.title-line-1 { color: #fff; }
.title-line-2 {
  background: linear-gradient(135deg, var(--gold), var(--ember));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.title-line-3 {
  color: rgba(255,255,255,0.3);
  font-size: 0.85em;
}

/* IP Badge */
.hero-ip-badge {
  background: rgba(212,160,23,0.04);
  border: 1px solid rgba(212,160,23,0.2);
}

/* Scroll Indicator */
.scroll-dot {
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(12px); opacity: 0.2; }
}

/* Hero pretitle */
.hero-pretitle {
  animation: fadeInDown 1s ease 0.3s both;
}
.hero-title { animation: fadeInUp 1s ease 0.5s both; }
.hero-sub { animation: fadeInUp 1s ease 0.7s both; }
.hero-ip-badge { animation: fadeInUp 1s ease 0.9s both; }
.hero-buttons { animation: fadeInUp 1s ease 1.1s both; }
.scroll-indicator { animation: fadeIn 1s ease 1.8s both; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 0.5; }
}

/* ─── SECTIONS BACKGROUNDS ───────────────────────────────── */
.section-bg-about {
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(232,98,26,0.04) 0%, transparent 60%),
    linear-gradient(180deg, var(--obsidian) 0%, rgba(17,17,24,0.5) 50%, var(--obsidian) 100%);
}

.kingdom-bg {
  background:
    radial-gradient(ellipse 70% 50% at 20% 50%, rgba(212,160,23,0.05) 0%, transparent 60%),
    var(--obsidian);
}

.youtube-bg {
  background:
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(232,98,26,0.05) 0%, transparent 60%),
    var(--obsidian);
}

.join-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(17,17,24,1) 0%, var(--obsidian) 100%);
}

.join-radial {
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(212,160,23,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 30% 70%, rgba(232,98,26,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 70% 30%, rgba(91,156,246,0.03) 0%, transparent 60%);
}

/* ─── ABOUT SECTION ──────────────────────────────────────── */
.about-panel {
  animation: panelPulse 4s ease-in-out infinite;
}
@keyframes panelPulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(212,160,23,0.08)); }
  50% { filter: drop-shadow(0 0 40px rgba(212,160,23,0.15)); }
}

.panel-glow {
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(212,160,23,0.06) 0%, transparent 60%);
}

.lore-entry {
  transition: border-color 0.3s, background 0.3s;
  border: 1px solid rgba(255,255,255,0.04);
}
.lore-entry:hover {
  border-color: rgba(212,160,23,0.15);
  background: rgba(212,160,23,0.04);
}

/* Stats */
.stat-number { font-variant-numeric: tabular-nums; }

/* ─── MOD CARDS ──────────────────────────────────────────── */
.mod-card {
  /* Include opacity so reveal animations aren't overwritten by the card's own transition */
  transition: transform 0.3s ease, border-color 0.3s ease, opacity 0.8s ease;
}
.mod-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212,160,23,0.25);
}

.mod-card-glow {
  background: radial-gradient(ellipse 100% 100% at 50% 100%, rgba(212,160,23,0.08) 0%, transparent 60%);
}
.mod-card-glow-ember {
  background: radial-gradient(ellipse 100% 100% at 50% 100%, rgba(232,98,26,0.08) 0%, transparent 60%);
}
.mod-card-glow-rune {
  background: radial-gradient(ellipse 100% 100% at 50% 100%, rgba(91,156,246,0.08) 0%, transparent 60%);
}

.mod-icon {
  display: block;
  filter: drop-shadow(0 0 8px rgba(212,160,23,0.2));
  transition: transform 0.3s, filter 0.3s;
}
.mod-card:hover .mod-icon {
  transform: scale(1.15) rotate(-5deg);
  filter: drop-shadow(0 0 16px rgba(212,160,23,0.4));
}

/* ─── KINGDOM SECTION ────────────────────────────────────── */
.kingdom-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 420px;
}

.kingdom-ring-outer,
.kingdom-ring-inner {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(212,160,23,0.1);
  animation: ringRotate 20s linear infinite;
  pointer-events: none;
}
.kingdom-ring-outer {
  width: 380px; height: 380px;
  border-color: rgba(212,160,23,0.08);
}
.kingdom-ring-inner {
  width: 280px; height: 280px;
  border-color: rgba(232,98,26,0.1);
  animation-direction: reverse;
  animation-duration: 15s;
}

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.kingdom-center {
  width: 100%;
  max-width: 320px;
  z-index: 10;
}

.kingdom-stat-box {
  transition: border-color 0.3s;
}
.kingdom-stat-box:hover { border-color: rgba(212,160,23,0.3); }

.kingdom-feature {
  cursor: default;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.kingdom-feature:hover {
  transform: translateX(4px);
  border-color: rgba(212,160,23,0.2) !important;
  background: rgba(212,160,23,0.04) !important;
}

.feature-icon {
  transition: transform 0.3s;
}
.kingdom-feature:hover .feature-icon { transform: scale(1.3); }

/* ─── YOUTUBE CARDS ──────────────────────────────────────── */
.yt-card {
  /* Include opacity so reveal animations aren't overwritten by the card's own transition */
  transition: transform 0.3s ease, border-color 0.3s ease, opacity 0.8s ease;
}
.yt-card:hover {
  /* Slight lift so it doesn't jump off-screen when hovering near the top */
  transform: translateY(-2px);
  border-color: rgba(232,98,26,0.2);
}

.yt-glow {
  background: radial-gradient(ellipse 100% 60% at 50% 100%, rgba(232,98,26,0.07) 0%, transparent 60%);
}

.yt-icon {
  transition: transform 0.3s ease;
  transform-origin: center center;
}
.yt-card:hover .yt-icon { transform: scale(1.1); }

/* ─── CTA SECTION ────────────────────────────────────────── */
.cta-glow {
  text-shadow:
    0 0 40px rgba(212,160,23,0.15),
    0 0 80px rgba(212,160,23,0.05);
}

/* ─── TOAST ──────────────────────────────────────────────── */
.toast {
  background: rgba(26,26,38,0.95);
  border: 1px solid rgba(212,160,23,0.4);
  color: var(--gold);
  backdrop-filter: blur(16px);
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

/* ─── SECTION LABELS ─────────────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--ember);
  opacity: 0.6;
}

/* ─── REVEAL ANIMATIONS ──────────────────────────────────── */
.reveal-up, .reveal-left, .reveal-right {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-up { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translate(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ─── PARTICLES CANVAS ───────────────────────────────────── */
#particles { opacity: 0.4; }

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  background: linear-gradient(180deg, var(--obsidian) 0%, rgba(8,8,12,1) 100%);
}

/* ─── RESPONSIVE TWEAKS ──────────────────────────────────── */
@media (max-width: 768px) {
  .kingdom-ring-outer { width: 300px; height: 300px; }
  .kingdom-ring-inner { width: 220px; height: 220px; }
  .hero-title { font-size: clamp(2.2rem, 10vw, 4rem); }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .kingdom-ring-outer { width: 240px; height: 240px; }
  .kingdom-ring-inner { width: 180px; height: 180px; }
}
