/* ============================================
   WHITEMARSH GAMES — Global Stylesheet
   Digital Wilderness Aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Outfit:wght@300;400;500;600&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-abyss: #050508;
  --bg-primary: #0a0a0f;
  --bg-secondary: #10101a;
  --bg-elevated: #161622;
  --bg-card: #1a1a2a;
  --sunset-gold: #f0a030;
  --sunset-orange: #e06020;
  --sunset-deep: #c03a1a;
  --electric-blue: #1a7fef;
  --water-blue: #3aa5ff;
  --water-glow: #1a7fef33;
  --text-primary: #eaeaf0;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --border-subtle: #ffffff08;
  --border-accent: #1a7fef22;
  --gradient-sunset: linear-gradient(135deg, var(--sunset-gold), var(--sunset-orange), var(--sunset-deep));
  --gradient-blue: linear-gradient(135deg, var(--electric-blue), var(--water-blue));
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --nav-height: 72px;
}

/* --- Reset & Base --- */
*, *::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-weight: 400;
  color: var(--text-primary);
  background: var(--bg-abyss);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

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

/* --- Noise / Grain Overlay --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  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-size: 128px 128px;
}

/* --- Navigation --- */
.nav {
  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 clamp(1.5rem, 5vw, 4rem);
  background: linear-gradient(180deg, rgba(5,5,8,0.95) 0%, rgba(5,5,8,0.7) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-logo img {
  height: 48px;
  width: auto;
}

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

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

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

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

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

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

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

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

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

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(5,5,8,0.98);
    backdrop-filter: blur(20px);
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-120%);
    transition: transform 0.4s ease;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-links.open {
    transform: translateY(0);
  }
}

/* --- Page Container --- */
.page {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* --- Section Utility --- */
.section {
  padding: clamp(4rem, 10vw, 8rem) clamp(1.5rem, 5vw, 4rem);
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--electric-blue);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--electric-blue);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem clamp(1.5rem, 5vw, 4rem);
  background: var(--bg-abyss);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 300px;
}

.footer-links {
  display: flex;
  gap: 3rem;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
  }
  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }
}

/* --- Legal / Content Pages --- */
.legal-page {
  padding-top: calc(var(--nav-height) + 3rem);
  min-height: 100vh;
}

.legal-header {
  text-align: center;
  padding: 3rem clamp(1.5rem, 5vw, 4rem) 2rem;
  position: relative;
}

.legal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-sunset);
  border-radius: 2px;
}

.legal-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}

.legal-header .updated {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 3rem) 5rem;
}

.legal-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--electric-blue);
}

.legal-content h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.legal-content ul, .legal-content ol {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-content li {
  margin-bottom: 0.4rem;
}

.legal-content a {
  color: var(--water-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content strong {
  color: var(--text-primary);
  font-weight: 500;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Scroll Reveal Script Helper --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Selection color */
::selection {
  background: var(--sunset-orange);
  color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-abyss);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
