/* ==========================================================================
   BASE.CSS — MRC Card Shop
   Reset, custom properties, typography, and global utilities
   ========================================================================== */


/* ==========================================================================
   1. CUSTOM PROPERTIES
   ========================================================================== */

:root {
  /* Brand colors — cyan accent to match the MRC store */
  --color-primary:       #22D3EE;   /* bright cyan, used for buttons, links, headings */
  --color-primary-dark:  #0FB6D4;   /* darker cyan for hover */
  --color-primary-light: #102A33;   /* dark translucent-cyan surface (for tinted backgrounds) */

  /* Accent — purple end of the store gradient */
  --color-accent:        #A855F7;   /* purple */
  --color-accent-light:  #2A1840;   /* dark purple surface */

  /* Brand gradient (cyan -> purple), matches the store hero + buttons */
  --gradient-brand:      linear-gradient(135deg, #22D3EE 0%, #A855F7 100%);

  /* Text */
  --color-text:          #F4F5F7;   /* near-white headings/body on dark */
  --color-text-muted:    #9CA3AF;   /* muted gray */

  /* UI */
  --color-border:        #262631;   /* subtle border on dark */
  --color-bg:            #0A0A0F;   /* near-black page background */
  --color-bg-secondary:  #13131A;   /* slightly lighter dark for cards/sections */

  /* Leaderboard ranks */
  --color-gold:          #E5C158;
  --color-silver:        #C0C8D0;
  --color-bronze:        #CD853F;

  /* Feedback */
  --color-error:         #F87171;   /* lighter red, readable on dark */
  --color-success:       #22D3EE;

  /* Typography */
  --font-family:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-base:      16px;
  --font-size-sm:        0.875rem;   /* 14px */
  --font-size-lg:        1.125rem;   /* 18px */
  --font-size-xl:        1.25rem;    /* 20px */
  --font-size-2xl:       1.5rem;     /* 24px */
  --font-size-3xl:       2rem;       /* 32px */
  --line-height-base:    1.5;
  --line-height-tight:   1.2;

  /* Spacing scale */
  --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 */

  /* Border radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.6);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;

  /* Layout */
  --max-width-content: 640px;
  --max-width-wide:    960px;
  --min-touch-target:  44px;
}


/* ==========================================================================
   2. RESET
   ========================================================================== */

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

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

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

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
}

a:hover {
  color: var(--color-primary-dark);
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: 1rem; }
h6 { font-size: var(--font-size-sm); }

p {
  max-width: 65ch;
}

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

strong {
  font-weight: 700;
}

.text-muted   { color: var(--color-text-muted); }
.text-sm      { font-size: var(--font-size-sm); }
.text-lg      { font-size: var(--font-size-lg); }
.text-xl      { font-size: var(--font-size-xl); }
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.font-bold    { font-weight: 700; }
.text-error   { color: var(--color-error); }
.text-success { color: var(--color-success); }


/* ==========================================================================
   4. LAYOUT
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--wide {
  max-width: var(--max-width-wide);
}

.page-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
  padding-block: var(--space-8);
}

.page-header {
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg);
}

.page-header__logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.page-header__logo:hover {
  color: var(--color-primary-dark);
}

.page-footer {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}


/* ==========================================================================
   5. STACK & CLUSTER (spacing primitives)
   ========================================================================== */

/* Vertical stack — adds consistent gap between direct children */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-8); }

/* Horizontal cluster — wrapping row of items */
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.cluster--end     { justify-content: flex-end; }
.cluster--center  { justify-content: center; }
.cluster--between { justify-content: space-between; }


/* ==========================================================================
   6. UTILITIES
   ========================================================================== */

/* Visibility */
.hidden {
  display: none !important;
}

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

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

/* Width */
.w-full { width: 100%; }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-6);
}
