/* base.css – Reset, CSS variables, typography, layout helpers */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; border: none; background: none; }
button { cursor: pointer; }

/* ══════════════════════════════════════════════
   CSS Variables
   ══════════════════════════════════════════════ */

:root {
  /* ── Typography ── */
  --font-body:  'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Manrope', var(--font-body);

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  --leading-tight:  1.25;
  --leading-normal: 1.6;

  /* ── Spacing ── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* ── Layout ── */
  --max-width:     1200px;
  --max-width-sm:  640px;
  --max-width-md:  768px;
  --max-width-lg:  1024px;

  --radius-sm:  0.375rem;
  --radius-md:  0.5rem;
  --radius-lg:  0.75rem;
  --radius-xl:  1rem;
  --radius-full: 9999px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* ── Z-index scale ── */
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;

  /* ── Header height ── */
  --header-h: 80px;

  /* ── Dark theme colors (default) ── */
  --color-bg:          #0a0a0a;
  --color-bg-elevated: #141414;
  --color-bg-card:     #1c1c1c;
  --color-bg-input:    #242424;
  --color-surface:     #2c2c2c;
  --color-border:      #333333;

  --color-text:        #f0f0f0;
  --color-text-muted:  #a0a0a0;
  --color-text-dim:    #666666;

  --color-accent:      #f0f0f0;
  --color-accent-hover:#ffffff;
  --color-accent-dim:  rgba(255,255,255,.08);

  --color-success:     #34d399;
  --color-error:       #f87171;

  --logo-filter:       invert(1) brightness(2);

  --shadow-sm:  0 1px 2px rgba(0,0,0,.5);
  --shadow-md:  0 4px 12px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.6);
  --shadow-xl:  0 12px 40px rgba(0,0,0,.7);

  --header-bg:  rgba(10,10,10,.92);
}

/* ── Light theme ── */
[data-theme="light"] {
  --color-bg:          #fafafa;
  --color-bg-elevated: #ffffff;
  --color-bg-card:     #ffffff;
  --color-bg-input:    #f5f5f5;
  --color-surface:     #eeeeee;
  --color-border:      #dcdcdc;

  --color-text:        #111111;
  --color-text-muted:  #555555;
  --color-text-dim:    #999999;

  --color-accent:      #111111;
  --color-accent-hover:#000000;
  --color-accent-dim:  rgba(0,0,0,.05);

  --color-success:     #059669;
  --color-error:       #dc2626;

  --logo-filter:       none;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.1);
  --shadow-xl:  0 12px 40px rgba(0,0,0,.12);

  --header-bg:  rgba(250,250,250,.92);
}

/* ══════════════════════════════════════════════
   Typography
   ══════════════════════════════════════════════ */

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg);  }

@media (min-width: 480px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  h4 { font-size: var(--text-xl);  }
}
@media (min-width: 768px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }
}

p { margin-bottom: var(--space-4); }
strong { font-weight: 600; }
em { font-style: italic; }

/* ══════════════════════════════════════════════
   Layout Helpers
   ══════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--space-8); }
}

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

.grid {
  display: grid;
  gap: var(--space-6);
}
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 480px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center  { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.text-lg     { font-size: var(--text-lg); }

.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

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

.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   Skeleton Loader
   ══════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, var(--color-bg-card) 25%, var(--color-surface) 50%, var(--color-bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text   { height: 1em; margin-bottom: var(--space-2); }
.skeleton-title  { height: 1.5em; width: 70%; margin-bottom: var(--space-3); }
.skeleton-img    { aspect-ratio: 16/9; width: 100%; }
.skeleton-card   { height: 320px; }

/* ══════════════════════════════════════════════
   Animations
   ══════════════════════════════════════════════ */

.fade-in {
  animation: fadeIn var(--transition-slow) both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════
   Main content push footer down
   ══════════════════════════════════════════════ */

main {
  flex: 1;
  padding-top: var(--header-h);
}
