/* ============================================
   BULWARK GAMES — Dark Fantasy Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700;900&family=EB+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Noto+Sans+JP:wght@400;700;900&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  --blood: #8b0000;
  --blood-bright: #c41e1e;
  --ember: #d4631d;
  --ember-glow: #ff8c42;
  --gold: #c9a84c;
  --gold-dim: #8a6d2b;
  --bone: #d4c5a9;
  --parchment: #e8dcc8;
  --dark: #0a0a0a;
  --dark-2: #111111;
  --dark-3: #1a1a1a;
  --dark-4: #222222;
  --dark-5: #2a2a2a;
  --smoke: #333333;
  --ash: #555555;
  --mist: #888888;
  --font-display: 'Cinzel Decorative', 'Cinzel', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: 'EB Garamond', serif;
  --font-jp: 'Noto Sans JP', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--blood) var(--dark);
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--dark);
}
::-webkit-scrollbar-thumb {
  background: var(--blood);
  border-radius: 4px;
}

body {
  background: var(--dark);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: var(--blood);
  color: var(--parchment);
}

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

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--ember-glow);
}

/* ---- Noise overlay (grain texture) ---- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ---- Vignette ---- */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.4s ease, padding 0.4s ease;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.95);
  padding: 0.5rem 2rem;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(139, 0, 0, 0.3);
}

.nav-logo {
  height: 50px;
  transition: height 0.4s ease;
}

.nav.scrolled .nav-logo {
  height: 36px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone);
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--blood-bright);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--blood-bright);
}

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

.nav-links a.active {
  color: var(--gold);
}

.nav-links a.active::after {
  width: 100%;
  background: var(--gold);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.35) saturate(0.8);
  transform: scale(1.1);
  transition: transform 8s ease;
}

.hero:hover .hero-bg {
  transform: scale(1.0);
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(10,10,10,0.3) 0%,
    rgba(10,10,10,0.1) 40%,
    rgba(10,10,10,0.5) 80%,
    rgba(10,10,10,1) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
}

.hero-logo {
  width: 280px;
  margin: 0 auto 2rem;
  animation: logoReveal 2s ease-out;
  filter: drop-shadow(0 0 40px rgba(139, 0, 0, 0.5));
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: var(--bone);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  animation: fadeUp 1.5s ease-out 0.5s both;
  text-shadow: 0 0 40px rgba(139, 0, 0, 0.4);
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--mist);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: fadeUp 1.5s ease-out 0.8s both;
}

.hero-cta {
  display: flex;
  gap: 1.5rem;
  margin-top: 3rem;
  animation: fadeUp 1.5s ease-out 1.1s both;
}

.btn {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.9rem 2.5rem;
  border: 1px solid var(--blood);
  color: var(--bone);
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139,0,0,0.3), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  border-color: var(--blood-bright);
  color: white;
  box-shadow: 0 0 30px rgba(139, 0, 0, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blood), #5a0000);
  border-color: var(--blood-bright);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--blood-bright), var(--blood));
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  animation: bounce 2s infinite;
}

.scroll-indicator span {
  display: block;
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--gold-dim);
  border-bottom: 2px solid var(--gold-dim);
  transform: rotate(45deg);
  opacity: 0.5;
}

/* ============================================
   EMBER PARTICLES
   ============================================ */
.particles-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9997;
  overflow: hidden;
}

.ember {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--ember-glow);
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(255, 140, 66, 0.4);
  animation: emberFloat linear infinite;
  opacity: 0;
}

@keyframes emberFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) translateX(0) scale(1);
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-20vh) translateX(var(--drift)) scale(0.3);
  }
}

/* ============================================
   SECTIONS (General)
   ============================================ */
section {
  position: relative;
  z-index: 1;
}

.section-divider {
  width: 100%;
  height: 80px;
  background: linear-gradient(to bottom, var(--dark), transparent);
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blood), transparent);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.5s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.6s; }

/* ============================================
   TYPOGRAPHY HELPERS
   ============================================ */
.section-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--parchment);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.section-text {
  font-size: 1.1rem;
  color: var(--mist);
  max-width: 700px;
  line-height: 1.8;
}

.jp-text {
  font-family: var(--font-jp);
  color: var(--blood-bright);
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
  background: linear-gradient(145deg, var(--dark-3), var(--dark-2));
  border: 1px solid var(--dark-5);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blood), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card:hover {
  border-color: rgba(139, 0, 0, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.card:hover::before {
  opacity: 1;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

/* ============================================
   IMAGE FRAMES
   ============================================ */
.frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--dark-5);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.frame:hover img {
  transform: scale(1.05);
}

.frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201, 168, 76, 0.1);
  pointer-events: none;
}

.frame-glow {
  box-shadow: 0 0 0 1px rgba(139, 0, 0, 0.2),
              inset 0 0 60px rgba(0, 0, 0, 0.5);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--dark-4);
  background: var(--dark);
}

.footer-logo {
  height: 60px;
  margin: 0 auto 1rem;
  opacity: 0.6;
}

.footer-text {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes logoReveal {
  0% {
    opacity: 0;
    transform: scale(0.8);
    filter: drop-shadow(0 0 0 rgba(139, 0, 0, 0));
  }
  50% {
    filter: drop-shadow(0 0 80px rgba(139, 0, 0, 0.8));
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 40px rgba(139, 0, 0, 0.5));
  }
}

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

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(139, 0, 0, 0.4);
  }
}

@keyframes bloodDrip {
  0% { height: 0; opacity: 0; }
  20% { opacity: 1; }
  100% { height: 80px; opacity: 0; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero-logo { width: 200px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.75rem; }
  .container { padding: 0 1rem; }
}
