/* =============================================
   Variables
   ============================================= */
:root {
  /* Color Palette */
  --color-bg: #050816;
  --color-bg-elevated: #0b1020;
  --color-bg-soft: #101629;
  --color-surface: #141b2f;

  --color-text: #f9fafb;
  --color-text-muted: #9ca3af;
  --color-text-soft: #6b7280;

  --color-primary: #6366f1; /* indigo / highlight */
  --color-primary-soft: rgba(99, 102, 241, 0.15);
  --color-primary-strong: #4f46e5;

  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

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

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, 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-md: 1.0625rem; /* 17px - slightly larger for readability */
  --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.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* 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-7: 1.75rem;  /* 28px */
  --space-8: 2rem;     /* 32px */
  --space-9: 2.25rem;  /* 36px */
  --space-10: 2.5rem;  /* 40px */
  --space-11: 2.75rem; /* 44px */
  --space-12: 3rem;    /* 48px */
  --space-14: 3.5rem;  /* 56px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-xs: 0.125rem; /* 2px */
  --radius-sm: 0.25rem;  /* 4px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-full: 9999px;

  /* Shadows (gaming-style, subtle glow) */
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.6);
  --shadow-glow-primary: 0 0 0 1px rgba(99, 102, 241, 0.15),
    0 0 25px rgba(99, 102, 241, 0.35);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 260ms ease-out;
}

/* =============================================
   Reset / Normalize
   ============================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

a {
  text-decoration: none;
  color: inherit;
}

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

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

button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

textarea {
  resize: vertical;
}

/* Remove default focus outline; we will restore via :focus-visible */
:focus {
  outline: none;
}

/* =============================================
   Base Styles
   ============================================= */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: var(--line-height-snug);
  color: var(--gray-50);
}

h1 {
  font-size: var(--font-size-4xl);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-3xl);
  letter-spacing: -0.02em;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: var(--font-size-xl);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

strong,
b {
  font-weight: 600;
}

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

a {
  color: var(--color-primary);
  transition: color var(--transition-fast),
    text-shadow var(--transition-fast),
    opacity var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
  text-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

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

hr {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin: var(--space-6) 0;
}

::selection {
  background-color: rgba(99, 102, 241, 0.35);
  color: #f9fafb;
}

/* =============================================
   Accessibility & Motion
   ============================================= */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

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

/* Screen-reader only 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;
}

/* =============================================
   Layout Utilities
   ============================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

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

.section--alt {
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.16), transparent 55%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.14), transparent 55%),
    var(--color-bg-elevated);
}

/* Flex helpers */
.flex {
  display: flex;
}

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

.gap-2 {
  gap: var(--space-2);
}

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

.gap-6 {
  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: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Spacing utilities (commonly used) */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

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

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

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

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

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: var(--gray-100);
}

.badge--primary {
  border-color: rgba(99, 102, 241, 0.6);
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.4), rgba(56, 189, 248, 0.35));
}

/* =============================================
   Components - Buttons
   ============================================= */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-normal),
    color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    border-color var(--transition-fast);
  white-space: nowrap;
}

.button--primary {
  background: linear-gradient(120deg, #6366f1, #22c55e);
  color: #f9fafb;
  box-shadow: var(--shadow-md);
}

.button--primary:hover {
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-1px);
}

.button--secondary {
  background: rgba(15, 23, 42, 0.95);
  color: var(--gray-100);
  border-color: rgba(148, 163, 184, 0.6);
}

.button--secondary:hover {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
}

.button--ghost {
  background: transparent;
  color: var(--gray-100);
  border-color: transparent;
}

.button--ghost:hover {
  background: rgba(15, 23, 42, 0.9);
}

.button--danger {
  background: #ef4444;
  color: #fef2f2;
}

.button--sm {
  padding: 0.45rem 0.9rem;
  font-size: var(--font-size-xs);
}

.button--lg {
  padding: 0.85rem 1.6rem;
  font-size: var(--font-size-base);
}

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

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

/* =============================================
   Components - Form Elements
   ============================================= */
.label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background-color: rgba(15, 23, 42, 0.85);
  color: var(--gray-50);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

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

.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  outline: none;
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
  background-color: rgba(15, 23, 42, 0.95);
}

.input--error,
.textarea--error,
.select--error {
  border-color: rgba(239, 68, 68, 0.9);
}

.input--error:focus-visible,
.textarea--error:focus-visible,
.select--error:focus-visible {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.7);
}

.form-help {
  margin-top: 0.25rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-soft);
}

.form-error {
  margin-top: 0.25rem;
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* =============================================
   Components - Card & Content Blocks
   ============================================= */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.2), transparent 50%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 1));
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card--soft {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(55, 65, 81, 0.75);
}

.card--hoverable {
  transition: transform var(--transition-normal),
    box-shadow var(--transition-normal),
    border-color var(--transition-normal),
    background-color var(--transition-normal);
}

.card--hoverable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.8);
}

.card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

.card__meta {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}

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

/* Screenshot / media placeholder */
.media-placeholder {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  background: repeating-linear-gradient(
      130deg,
      rgba(15, 23, 42, 0.95),
      rgba(15, 23, 42, 0.95) 10px,
      rgba(30, 64, 175, 0.18) 10px,
      rgba(30, 64, 175, 0.18) 20px
    );
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-soft);
  font-size: var(--font-size-sm);
}

.media-placeholder__label {
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background-color: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

/* =============================================
   Navigation & Header Helpers
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(5, 8, 22, 0.98), rgba(5, 8, 22, 0.82));
  border-bottom: 1px solid rgba(15, 23, 42, 0.95);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: var(--font-size-sm);
}

.navbar__logo {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 10%, #eef2ff, #6366f1);
  box-shadow: 0 0 25px rgba(129, 140, 248, 0.8);
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
}

.navbar__link {
  position: relative;
  padding: 0.25rem 0;
  color: var(--color-text-soft);
  transition: color var(--transition-fast);
}

.navbar__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width var(--transition-normal);
}

.navbar__link:hover,
.navbar__link[aria-current="page"] {
  color: var(--gray-100);
}

.navbar__link:hover::after,
.navbar__link[aria-current="page"]::after {
  width: 100%;
}

/* =============================================
   Hero / Page header helpers
   ============================================= */
.hero {
  padding-top: var(--space-16);
  padding-bottom: var(--space-12);
}

.hero__kicker {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}

.hero__title {
  font-size: clamp(2.25rem, 3.2vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.hero__tagline {
  max-width: 38rem;
  margin-top: var(--space-3);
  color: var(--color-text-muted);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-text-soft);
}

/* =============================================
   Misc helpers (for Polish gaming content)
   ============================================= */
.list-check {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-check li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.4rem;
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #bbf7d0, #22c55e);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.85);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: var(--font-size-xs);
}

.tag-cloud__tag {
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.95);
}

.chip-difficulty {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.chip-difficulty--easy {
  border-color: rgba(34, 197, 94, 0.75);
  color: #bbf7d0;
}

.chip-difficulty--medium {
  border-color: rgba(234, 179, 8, 0.8);
  color: #fef9c3;
}

.chip-difficulty--hard {
  border-color: rgba(239, 68, 68, 0.85);
  color: #fee2e2;
}

/* =============================================
   Footer helpers
   ============================================= */
.site-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.95);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 1), #020617);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  color: var(--color-text-soft);
}

.site-footer a:hover {
  color: var(--gray-200);
}

.site-footer__bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(30, 41, 59, 0.8);
  font-size: var(--font-size-xs);
  color: var(--color-text-soft);
}
