/* ========================================================================
   Variables
   ======================================================================== */

:root {
  /* Color palette - dark, atmospheric, cinematic */
  --color-bg: #050608;              /* Deep charcoal black */
  --color-bg-elevated: #0d0f13;     /* For cards / panels */
  --color-bg-muted: #14171d;        /* Subtle sections */

  --color-text: #e5e7eb;            /* Main text (soft off-white) */
  --color-text-muted: #9ca3af;      /* Muted copy */
  --color-text-soft: #d1d5db;       /* Subheadings */

  --color-primary: #c27b3b;         /* Muted bronze highlight */
  --color-primary-soft: rgba(194, 123, 59, 0.2);

  --color-success: #4ade80;         /* Soft green */
  --color-warning: #facc15;         /* Amber */
  --color-danger: #f97373;          /* Desaturated red */

  --color-border-subtle: #1f2933;   /* Subtle borders */
  --color-border-strong: #374151;   /* Stronger borders */

  --color-gray-50: #111827;
  --color-gray-100: #1f2933;
  --color-gray-200: #4b5563;
  --color-gray-300: #6b7280;
  --color-gray-400: #9ca3af;
  --color-gray-500: #d1d5db;

  /* Cinematic overlays */
  --color-overlay-soft: rgba(0, 0, 0, 0.45);
  --color-overlay-strong: rgba(0, 0, 0, 0.7);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Cinzel", "Cormorant Garamond", "Times New Roman", serif;
  --font-mono: "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 999px;

  /* Shadows – subtle, cinematic */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-medium: 0 18px 45px rgba(0, 0, 0, 0.6);
  --shadow-strong: 0 28px 80px rgba(0, 0, 0, 0.85);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 320ms ease-out;
}

/* Respect user color scheme preference if needed */
@media (prefers-color-scheme: light) {
  :root {
    /* Slight lift in brightness while keeping the mood */
    --color-bg: #0c1016;
    --color-bg-elevated: #151923;
    --color-text: #e5e7eb;
  }
}

/* ========================================================================
   Reset / Normalize
   ======================================================================== */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/* Remove default button styles */
button {
  border: none;
  background: none;
  padding: 0;
}

/* ========================================================================
   Base Styles
   ======================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Cinematic subtle vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top, transparent 0, rgba(0, 0, 0, 0.6) 60%),
              radial-gradient(circle at bottom, transparent 0, rgba(0, 0, 0, 0.8) 65%);
  z-index: -1;
}

main {
  min-height: 100vh;
}

/* Headings: display uses serif to emphasize lore / mystery */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h4,
h5,
h6 {
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-4);
}

small {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

strong {
  font-weight: 600;
}

/* Links - subtle, cinematic accent */

a {
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  cursor: pointer;
  transition: color var(--transition-base),
              text-shadow var(--transition-base);
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.1em;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-primary), transparent);
  opacity: 0.4;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

a:hover {
  color: #f9fafb;
  text-shadow: 0 0 18px rgba(194, 123, 59, 0.6);
}

a:hover::after {
  opacity: 0.9;
  transform: scaleX(1);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-6) 0;
}

/* ========================================================================
   Accessibility & Motion
   ======================================================================== */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

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

/* ========================================================================
   Layout Utilities
   ======================================================================== */

/* Container */

.container {
  width: 100%;
  max-width: 1120px; /* Slightly constrained for cinematic framing */
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-6);
  }
}

/* Flex helpers */

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.items-stretch {
  align-items: stretch;
}

.gap-sm {
  gap: var(--space-3);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

/* Grid helpers */

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Alignment utilities */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-3); }
.mt-md { margin-top: var(--space-6); }
.mt-lg { margin-top: var(--space-10); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-3); }
.mb-md { margin-bottom: var(--space-6); }
.mb-lg { margin-bottom: var(--space-10); }

.py-section {
  padding-block: var(--space-12);
}

@media (min-width: 1024px) {
  .py-section {
    padding-block: var(--space-16);
  }
}

/* Screen reader only */

.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;
}

/* ========================================================================
   Components
   ======================================================================== */

/* Button - cinematic bronze primary */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.18), transparent 55%),
              linear-gradient(135deg, #8b5a2c, #c27b3b 45%, #f0c27b 100%);
  color: #0b0b0c;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              filter var(--transition-fast),
              background-position var(--transition-fast),
              border-color var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-soft);
  filter: brightness(0.98);
}

.btn:focus-visible {
  outline: 2px solid #f5f3ff;
  outline-offset: 3px;
  border-color: #f5f3ff;
}

.btn--ghost {
  background: rgba(10, 11, 15, 0.7);
  border-color: var(--color-border-strong);
  color: var(--color-text-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.btn--ghost:hover {
  background: rgba(20, 22, 28, 0.95);
  border-color: var(--color-primary);
}

.btn--muted {
  background: linear-gradient(135deg, #14171d, #1f2933);
  color: var(--color-text);
  border-color: #374151;
}

.btn[disabled],
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

/* Inputs */

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.06), transparent 50%),
              #05070b;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  outline: none;
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base),
              background-color var(--transition-base);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-muted);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(194, 123, 59, 0.4), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.input[disabled],
.textarea[disabled],
.select[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

/* Card - dark, textured, atmospheric */

.card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 55%),
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(135deg, rgba(55, 65, 81, 0.45), rgba(17, 24, 39, 0.95));
  background-blend-mode: soft-light, overlay, normal;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 140px 140px;
  mix-blend-mode: soft-light;
  opacity: 0.4;
  pointer-events: none;
}

.card__header {
  margin-bottom: var(--space-4);
}

.card__title {
  margin: 0 0 var(--space-1);
}

.card__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card__body {
  position: relative;
  z-index: 1;
}

/* Media framing (for galleries, walkthrough images) */

.media-frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #020308;
  box-shadow: var(--shadow-medium);
}

.media-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.12), transparent 55%),
              radial-gradient(circle at 80% 100%, rgba(0, 0, 0, 0.85), transparent 55%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Subtle section background helper for different content blocks */

.section-panel {
  position: relative;
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at top left, rgba(120, 85, 46, 0.3), transparent 55%),
              linear-gradient(145deg, #050608, #14171d 50%, #050608 100%);
  border: 1px solid rgba(55, 65, 81, 0.7);
  box-shadow: var(--shadow-soft);
}

.section-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(0deg, rgba(15, 23, 42, 0.8), transparent 50%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.6), transparent 45%);
  mix-blend-mode: multiply;
  opacity: 0.7;
  pointer-events: none;
}

/* Tag / pill (for platform labels, difficulty, etc.) */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text-soft);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill--accent {
  border-color: rgba(194, 123, 59, 0.7);
  background: rgba(30, 64, 175, 0.2);
}

/* ========================================================================
   Helper Classes for Atmospheric Theme
   ======================================================================== */

.bg-elevated {
  background-color: var(--color-bg-elevated);
}

.bg-muted {
  background-color: var(--color-bg-muted);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-soft {
  color: var(--color-text-soft);
}

.text-bronze {
  color: var(--color-primary);
}

.border-subtle {
  border: 1px solid var(--color-border-subtle);
}

.border-strong {
  border: 1px solid var(--color-border-strong);
}

.shadow-soft {
  box-shadow: var(--shadow-soft);
}

.shadow-medium {
  box-shadow: var(--shadow-medium);
}

.shadow-strong {
  box-shadow: var(--shadow-strong);
}

.radius-md {
  border-radius: var(--radius-md);
}

.radius-xl {
  border-radius: var(--radius-xl);
}

/* Dark gradient overlay utility for hero / lore sections */

.overlay-gradient {
  position: relative;
}

.overlay-gradient::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 30%, rgba(0, 0, 0, 0.95) 100%);
  pointer-events: none;
  z-index: 1;
}

.overlay-gradient > * {
  position: relative;
  z-index: 2;
}

/* End of base.css */
