/* ==========================================================================
   YMobiDev — Base CSS
   Design system: variables, reset, typography, layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --color-bg-primary:   #FFFFFF;
  --color-bg-secondary: #F6F7FB;
  --color-bg-tertiary:  #EEF2FF;
  --color-bg-dark:      #18181B;

  /* Brand Indigo */
  --color-brand-primary: #5B6CF9;
  --color-brand-light:   #818CF8;
  --color-brand-dark:    #3740C9;
  --color-gold-primary:  var(--color-brand-primary);
  --color-gold-light:    var(--color-brand-light);
  --color-gold-dark:     var(--color-brand-dark);

  /* Typography */
  --color-text-primary:   #18181B;
  --color-text-secondary: #3F475C;
  --color-text-muted:     #6B7280;
  --color-text-inverted:  #FFFFFF;

  /* Borders */
  --color-border-subtle: #E2E8F4;
  --color-border-accent: var(--color-brand-primary);

  /* Brand image filters */
  --filter-brand:       brightness(0) saturate(100%) invert(44%) sepia(75%) saturate(1300%) hue-rotate(218deg) brightness(103%) contrast(92%);
  --filter-brand-white: brightness(0) invert(1) opacity(0.85);

  /* Status */
  --color-success: #2D7A4F;
  --color-error:   #C0392B;

  /* Font */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Type Scale — Major Third (1.250) */
  --text-xs:   0.64rem;
  --text-sm:   0.8rem;
  --text-base: 1rem;
  --text-lg:   1.25rem;
  --text-xl:   1.563rem;
  --text-2xl:  1.953rem;
  --text-3xl:  2.441rem;
  --text-4xl:  3.052rem;

  /* Font Weights */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Line Heights */
  --leading-tight:  1.2;
  --leading-snug:   1.4;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Spacing — base 8px */
  --space-1:  0.5rem;
  --space-2:  1rem;
  --space-3:  1.5rem;
  --space-4:  2rem;
  --space-5:  2.5rem;
  --space-6:  3rem;
  --space-8:  4rem;
  --space-10: 5rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* Layout */
  --container-max:    1200px;
  --container-narrow: 760px;
  --container-px:     clamp(1rem, 3vw, 2rem);

  /* Sections */
  --section-padding-y: clamp(4rem, 7vw, 5.5rem);

  /* Navigation */
  --nav-height: 72px;

  /* Cards */
  --card-radius:      16px;
  --card-shadow:      0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --card-shadow-hover:0 4px 12px rgba(0,0,0,0.12), 0 8px 32px rgba(0,0,0,0.10);

  /* Buttons */
  --btn-radius:  10px;
  --btn-padding: 0.75rem 1.75rem;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow:   0.4s ease;
}

/* --------------------------------------------------------------------------
   2. CSS Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

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

ul, ol {
  list-style: none;
}

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

input, textarea, select {
  font: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}

/* --------------------------------------------------------------------------
   3. Typography Utilities
   -------------------------------------------------------------------------- */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

.text-muted     { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-gold      { color: var(--color-gold-primary); }
.text-inverted  { color: var(--color-text-inverted); }

.weight-light    { font-weight: var(--weight-light); }
.weight-regular  { font-weight: var(--weight-regular); }
.weight-medium   { font-weight: var(--weight-medium); }
.weight-semibold { font-weight: var(--weight-semibold); }
.weight-bold     { font-weight: var(--weight-bold); }

.leading-tight  { line-height: var(--leading-tight); }
.leading-snug   { line-height: var(--leading-snug); }
.leading-normal { line-height: var(--leading-normal); }
.leading-loose  { line-height: var(--leading-loose); }

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

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

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

.container--680 {
  max-width: 680px;
}

.container--800 {
  max-width: 800px;
}

.container--860 {
  max-width: 860px;
}

.section {
  padding-block: var(--section-padding-y);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverted);
}

.section--alt {
  background-color: var(--color-bg-secondary);
}

/* --------------------------------------------------------------------------
   5. Flex & Grid Helpers
   -------------------------------------------------------------------------- */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-center  { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.gap-1  { gap: var(--space-1); }
.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); }

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

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

/* --------------------------------------------------------------------------
   6. Spacing Utilities
   -------------------------------------------------------------------------- */
.mt-2  { margin-top: var(--space-2); }
.mt-3  { margin-top: var(--space-3); }
.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-3  { margin-bottom: var(--space-3); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

/* --------------------------------------------------------------------------
   7. Visibility
   -------------------------------------------------------------------------- */
.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;
}

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

.divider--gold {
  border-color: var(--color-gold-primary);
  width: 48px;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   9. Page offset for fixed nav
   -------------------------------------------------------------------------- */
main {
  padding-top: var(--nav-height);
}

/* --------------------------------------------------------------------------
   10. Responsive breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --container-px: var(--space-3);
    --section-padding-y: var(--space-8);
    --text-4xl: 2.2rem;
    --text-3xl: 1.8rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --container-px: var(--space-2);
    --text-4xl: 1.9rem;
  }
}
