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

:root {
  /* Colors - atmospheric dark fantasy palette */
  --color-bg: #070814; /* near-black with a hint of blue */
  --color-bg-elevated: #0d0f1f;
  --color-surface: #131529;
  --color-surface-soft: #191b33;

  --color-text: #f3f5ff;
  --color-text-muted: #a6afc8;
  --color-text-soft: #c5cee6;

  --color-primary: #7b6dff; /* mystical violet */
  --color-primary-soft: rgba(123, 109, 255, 0.14);
  --color-primary-strong: #a797ff;

  --color-success: #4fbe79;
  --color-warning: #f5b95b;
  --color-danger: #ff4b5c;

  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2933;
  --color-neutral-900: #111827;

  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-border-strong: rgba(255, 255, 255, 0.18);

  --color-overlay: rgba(2, 4, 10, 0.85);
  --color-shadow-soft: rgba(0, 0, 0, 0.55);

  /* Semantic accents for game sections (optional) */
  --color-gameplay: #59b1ff;
  --color-exploration: #6de0c0;
  --color-lore: #f2a9ff;
  --color-community: #ffe37b;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", 
    "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, 
    "Liberation Mono", "Courier New", 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 */
  --font-size-6xl: 3.75rem;  /* 60px */

  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px) */
  --space-0: 0;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-8: 16px;
  --space-10: 20px;
  --space-12: 24px;
  --space-16: 32px;
  --space-20: 40px;
  --space-24: 48px;
  --space-28: 56px;
  --space-32: 64px;
  --space-40: 80px;
  --space-48: 96px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows - cinematic depth */
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --shadow-elevated: 0 28px 80px rgba(0, 0, 0, 0.7);
  --shadow-subtle: 0 0 0 1px rgba(255, 255, 255, 0.03);

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

  /* Layout */
  --container-max-width: 1120px;
  --container-padding-x: 24px;
}

/* Reduced motion adjustments */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }
}

/* ========================================================================== 
   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,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
textarea,
select {
  margin: 0;
  font: inherit;
  color: inherit;
  background: none;
  border-radius: 0;
}

button {
  border: none;
  padding: 0;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

/* Remove default link underlines; handled in base styles */
a {
  color: inherit;
  text-decoration: none;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background: radial-gradient(circle at 20% 0%, #141a35 0, #070814 42%, #020308 90%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  min-height: 100vh;
}

/* Heading scale - French editorial style */

h1,
.h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 2.2rem + 1.3vw, 3.4rem);
  line-height: var(--line-height-tight);
  letter-spacing: 0.02em;
}

h2,
.h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 1.7rem + 0.9vw, 2.6rem);
  line-height: var(--line-height-tight);
  letter-spacing: 0.015em;
}

h3,
.h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.9rem);
  line-height: var(--line-height-snug);
}

h4,
.h4 {
  font-weight: 500;
  font-size: 1.25rem;
  line-height: var(--line-height-snug);
}

h5,
.h5 {
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: var(--line-height-snug);
}

h6,
.h6 {
  font-weight: 500;
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

p {
  margin-bottom: var(--space-6);
  color: var(--color-text-soft);
}

p + p {
  margin-top: -4px;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

small {
  font-size: 0.875em;
}

/* Links - subtle, luminous underline */

a {
  position: relative;
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color var(--transition-normal),
              text-shadow var(--transition-normal);
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.1em;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.1), var(--color-primary), rgba(255,255,255,0.1));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

a:hover::after,
 a:focus-visible::after {
  transform: scaleX(1);
}

a:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(123, 109, 255, 0.7);
}

/* Lists */

ul,
ol {
  padding-left: 1.2rem;
  margin-bottom: var(--space-6);
}

/* Blockquotes */

blockquote {
  margin: var(--space-10) 0;
  padding-left: var(--space-8);
  border-left: 2px solid rgba(255, 255, 255, 0.16);
  color: var(--color-text-soft);
  font-style: italic;
}

/* Code */

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

pre {
  margin: var(--space-6) 0;
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: rgba(7, 8, 20, 0.9);
  overflow: auto;
}

/* ========================================================================== 
   Accessibility & Focus
   ========================================================================== */

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

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

/* Screen-reader-only content */

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

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Respect reduced motion preferences */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

/* Layout container for editorial sections */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding-x);
  padding-right: var(--container-padding-x);
}

.section {
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
}

.section--tight {
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

.section--bleed {
  padding-left: 0;
  padding-right: 0;
}

/* Flex helpers */

.flex {
  display: flex;
}

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

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

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

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

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

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

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

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

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

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

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

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

/* Grid helpers */

.grid {
  display: grid;
}

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

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

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

/* Alignment & spacing utilities */

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

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

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

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: var(--space-6); }
.mb-sm { margin-bottom: var(--space-6); }
.mt-md { margin-top: var(--space-12); }
.mb-md { margin-bottom: var(--space-12); }
.mt-lg { margin-top: var(--space-20); }
.mb-lg { margin-bottom: var(--space-20); }

.pt-lg { padding-top: var(--space-20); }
.pb-lg { padding-bottom: var(--space-20); }

/* Atmospheric overlays & gradients */

.bg-elevated {
  background: radial-gradient(circle at 0% 0%, rgba(88, 108, 255, 0.25) 0, transparent 50%),
              radial-gradient(circle at 100% 100%, rgba(144, 226, 255, 0.16) 0, transparent 48%),
              var(--color-bg-elevated);
}

.bg-surface {
  background: linear-gradient(145deg, #111427, #171a33);
}

.backdrop-blur {
  backdrop-filter: blur(16px);
}

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

/* Buttons - primary CTA for sections like "Analyse du gameplay" */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.12) 0, transparent 40%),
              linear-gradient(135deg, #4946ff, #8c6dff);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-slow),
              border-color var(--transition-fast),
              color var(--transition-fast);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
  border-color: rgba(255, 255, 255, 0.22);
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.4);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.button--ghost {
  background: rgba(11, 13, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-subtle);
}

.button--ghost:hover {
  background: rgba(29, 34, 71, 0.95);
}

.button--outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--color-text);
  box-shadow: none;
}

.button--outline:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Inputs - for search, newsletter, commentaires */

.input,
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(5, 7, 18, 0.9);
  color: var(--color-text);
  font-size: 0.95rem;
  transition: border-color var(--transition-normal),
              box-shadow var(--transition-normal),
              background-color var(--transition-normal);
}

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

.input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 1px rgba(123, 109, 255, 0.7);
  background-color: rgba(7, 9, 22, 1);
}

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

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

/* Cards - for sections (gameplay, personnages, monde, communauté) */

.card {
  position: relative;
  padding: var(--space-16);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(6, 8, 22, 0.96), rgba(14, 17, 37, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(123, 109, 255, 0.16) 0, transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

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

.card--soft {
  padding: var(--space-12);
  border-radius: var(--radius-md);
  background: rgba(14, 17, 37, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-subtle);
}

.card--highlight {
  border-color: rgba(248, 250, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), var(--shadow-elevated);
}

/* Tag / pill - for category labels ("Gameplay", "Personnages") */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.62rem;
  border-radius: var(--radius-pill);
  background: rgba(12, 18, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--color-text-soft);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Hero overlay for cinematic headers */

.hero-overlay {
  position: relative;
}

.hero-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(144, 226, 255, 0.14) 0, transparent 45%),
              linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(2, 3, 10, 0.92) 68%, rgba(2, 3, 10, 1) 100%);
  pointer-events: none;
}

/* Subtle divider */

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  margin: var(--space-20) 0;
}

/* Badges for score / note */

.badge-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.2) 0, transparent 55%),
              linear-gradient(135deg, #6de0c0, #59b1ff);
  color: #020308;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ========================================================================== 
   End base.css
   ========================================================================== */
