/* swc-base.css — Finology / stockworldcup.org
   Design tokens, reset, typography, utilities */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;600;700&display=swap');

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  /* Brand palette */
  --swc-navy:             #0D1B2E;
  --swc-navy-alt:         #152236;
  --swc-teal:             #00C9A7; /* decorative, data viz */
  --swc-teal-aa-light:    #007B65; /* AA on light bg */
  --swc-teal-aa-dark:     #00C9A7; /* AA on dark bg */

  /* Foreground pairs */
  --swc-fg-light-1:       #0D1B2E;  /* ratio ~16.8:1 vs #F8FAFC */
  --swc-fg-light-2:       #4A5568;  /* ratio ~7.4:1  vs #F8FAFC */
  --swc-fg-light-muted:   #718096;  /* ratio ~4.8:1  — large text only */
  --swc-fg-dark-1:        #F0F4F8;  /* ratio ~14.2:1 vs #0D1B2E */
  --swc-fg-dark-2:        #A0AEC0;  /* ratio ~6.1:1  vs #0D1B2E */

  /* Chart / data color */
  --swc-green:            #2ECC71;
  --swc-red:              #E74C3C;
  --swc-amber:            #F6AD55;

  /* Backgrounds */
  --swc-bg-light:         #F8FAFC;
  --swc-bg-white:         #FFFFFF;
  --swc-bg-light-alt:     #EDF2F7;
  --swc-bg-dark:          #0D1B2E;
  --swc-bg-dark-alt:      #152236;
  --swc-bg-card:          #FFFFFF;
  --swc-border:           #E2E8F0;
  --swc-border-dark:      rgba(255,255,255,0.12);

  /* Spacing */
  --swc-container:        1200px;
  --swc-section-y:        80px;
  --swc-section-y-mob:    64px;
  --swc-card-gap:         24px;

  /* Typography */
  --swc-font:             'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --swc-mono:             'IBM Plex Mono', 'Menlo', 'Consolas', monospace;

  /* Radii */
  --swc-radius:           4px;
  --swc-radius-lg:        6px;

  /* Shadows */
  --swc-shadow-card:      0 1px 3px rgba(0,0,0,0.08);
  --swc-shadow-nav:       0 1px 0 rgba(255,255,255,0.06);
}

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

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

body {
  font-family: var(--swc-font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--swc-fg-light-1);
  background: var(--swc-bg-light);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

/* =========================================================
   TYPOGRAPHY SCALE
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--swc-font);
  line-height: 1.2;
  color: var(--swc-fg-light-1);
}

/* Section-level headings in dark containers inherit correctly via --dark context */

.swc-h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.swc-h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
}

.swc-h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.swc-body {
  font-size: 1rem;
  line-height: 1.7;
}

.swc-body-sm {
  font-size: 0.875rem;
  line-height: 1.6;
}

.swc-data-label {
  font-family: var(--swc-mono);
  font-size: 0.875rem;
  font-weight: 400;
}

.swc-data-large {
  font-family: var(--swc-mono);
  font-size: 1.5rem;
  font-weight: 500;
}

.swc-mono {
  font-family: var(--swc-mono);
}

/* =========================================================
   LAYOUT UTILITIES
   ========================================================= */
.swc-container {
  max-width: var(--swc-container);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

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

.swc-section--tight {
  padding: 48px 0;
}

/* Section bg variants */
.swc-bg-dark {
  background: var(--swc-bg-dark);
}
.swc-bg-dark-alt {
  background: var(--swc-bg-dark-alt);
}
.swc-bg-light {
  background: var(--swc-bg-light);
}
.swc-bg-light-alt {
  background: var(--swc-bg-light-alt);
}
.swc-bg-white {
  background: var(--swc-bg-white);
}

/* Grid helpers */
.swc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--swc-card-gap);
}

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

/* Eyebrow label */
.swc-eyebrow {
  display: inline-block;
  font-family: var(--swc-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Scoped eyebrow colors */
.swc-bg-dark .swc-eyebrow,
.swc-bg-dark-alt .swc-eyebrow {
  color: var(--swc-teal-aa-dark);
}

.swc-bg-light .swc-eyebrow,
.swc-bg-white .swc-eyebrow,
.swc-bg-light-alt .swc-eyebrow {
  color: var(--swc-teal-aa-light);
}

/* Section headline colors per context */
.swc-bg-dark .swc-h2,
.swc-bg-dark-alt .swc-h2,
.swc-bg-dark h2,
.swc-bg-dark-alt h2 {
  color: var(--swc-fg-dark-1);
}

.swc-bg-light .swc-h2,
.swc-bg-white .swc-h2,
.swc-bg-light-alt .swc-h2,
.swc-bg-light h2,
.swc-bg-white h2,
.swc-bg-light-alt h2 {
  color: var(--swc-fg-light-1);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.swc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--swc-font);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 28px;
  border-radius: var(--swc-radius);
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

/* Primary: solid teal, navy text */
.swc-btn--primary {
  background: var(--swc-teal);
  color: var(--swc-navy);
  border-color: var(--swc-teal);
}
.swc-btn--primary:hover {
  background: #00e0bb;
  border-color: #00e0bb;
}

/* Primary outline: teal border + teal text on dark */
.swc-btn--outline {
  background: transparent;
  color: var(--swc-teal);
  border-color: var(--swc-teal);
}
.swc-btn--outline:hover {
  background: var(--swc-teal);
  color: var(--swc-navy);
}

/* Ghost on dark: white text, no bg */
.swc-btn--ghost-dark {
  background: transparent;
  color: var(--swc-fg-dark-1);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.swc-btn--ghost-dark:hover {
  text-decoration: underline;
  color: #ffffff;
}

/* Ghost on light: navy text, no bg */
.swc-btn--ghost-light {
  background: transparent;
  color: var(--swc-fg-light-1);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.swc-btn--ghost-light:hover {
  text-decoration: underline;
}

/* Data CTA: navy fill, white text */
.swc-btn--data-cta {
  background: var(--swc-navy);
  color: var(--swc-fg-dark-1);
  border-color: var(--swc-navy);
}
.swc-btn--data-cta:hover {
  background: var(--swc-navy-alt);
  border-color: var(--swc-navy-alt);
}

/* =========================================================
   FOCUS / ACCESSIBILITY
   ========================================================= */
:focus-visible {
  outline: 2px solid var(--swc-teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =========================================================
   RESPONSIVE HELPERS
   ========================================================= */
@media (max-width: 1024px) {
  .swc-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --swc-section-y: var(--swc-section-y-mob);
  }
  .swc-grid-2,
  .swc-grid-3 {
    grid-template-columns: 1fr;
  }
}
