/* Base variables and resets */
:root {
  /* Brand colors */
  --stl-primary: #202342;
  --stl-primary-2: #2f3357;
  --stl-accent: #fcc425;
  --stl-accent-2: #ffcf01;
  --stl-danger: #ff4747;
  --stl-success: #28a745;
  --stl-info: #17a2b8;
  --stl-muted: #6c757d;
  --stl-text: #111;
  --stl-text-on-dark: #fff;
  --stl-bg: #ffffff;
  --stl-shadow-sm: 0 1px 5px rgba(0, 0, 0, 0.3);
  --stl-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.2);
  --stl-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);

  /* Typography - Font Families */
  --font-sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  --font-text: "Quicksand", var(--font-sans);
  --font-numbers: "Noto Serif", serif;
  --font-display: "Quicksand", var(--font-sans);

  /* Typography - Font Weights */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Typography - Font Sizes */
  --fs-xs: 0.75rem; /* 12px */
  --fs-sm: 0.875rem; /* 14px */
  --fs-base: 1rem; /* 16px */
  --fs-lg: 1.125rem; /* 18px */
  --fs-xl: 1.25rem; /* 20px */
  --fs-2xl: 1.5rem; /* 24px */
  --fs-3xl: 1.875rem; /* 30px */
  --fs-4xl: 2.25rem; /* 36px */
  --fs-5xl: 3rem; /* 48px */

  /* Typography - Line Heights */
  --lh-tight: 1.2;
  --lh-snug: 1.375;
  --lh-normal: 1.5;
  --lh-relaxed: 1.625;
  --lh-loose: 2;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
}

/* Responsive font size adjustments for smaller screens */
@media (max-width: 1100px) or (max-height: 980px) {
  :root {
    --fs-xs: 0.7rem; /* 11.2px */
    --fs-sm: 0.8rem; /* 12.8px */
    --fs-base: 0.9rem; /* 14.4px */
    --fs-lg: 1rem; /* 16px */
    --fs-xl: 1.1rem; /* 17.6px */
    --fs-2xl: 1.3rem; /* 20.8px */
    --fs-3xl: 1.6rem; /* 25.6px */
    --fs-4xl: 1.9rem; /* 30.4px */
    --fs-5xl: 2.4rem; /* 38.4px */
  }
}

@media (max-width: 700px) {
  :root {
    --fs-xs: 0.65rem; /* 10.4px */
    --fs-sm: 0.75rem; /* 12px */
    --fs-base: 0.85rem; /* 13.6px */
    --fs-lg: 0.95rem; /* 15.2px */
    --fs-xl: 1rem; /* 16px */
    --fs-2xl: 1.15rem; /* 18.4px */
    --fs-3xl: 1.4rem; /* 22.4px */
    --fs-4xl: 1.7rem; /* 27.2px */
    --fs-5xl: 2rem; /* 32px */
  }
}

@media (max-width: 480px) {
  :root {
    --fs-xs: 0.6rem; /* 9.6px */
    --fs-sm: 0.7rem; /* 11.2px */
    --fs-base: 0.8rem; /* 12.8px */
    --fs-lg: 0.9rem; /* 14.4px */
    --fs-xl: 0.95rem; /* 15.2px */
    --fs-2xl: 1.05rem; /* 16.8px */
    --fs-3xl: 1.25rem; /* 20px */
    --fs-4xl: 1.5rem; /* 24px */
    --fs-5xl: 1.8rem; /* 28.8px */
  }
}

/* Reset and base */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--stl-text);
  font-family: var(--font-text);
  font-weight: var(--fw-medium);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  background: var(--stl-bg);
}

/* Responsive body font weight adjustment */
@media (max-width: 1100px) or (max-height: 980px) {
  body {
    font-weight: var(--fw-regular);
  }
}

@media (max-width: 700px) {
  body {
    font-weight: var(--fw-regular);
  }
}

/* Typography Styles */

/* Headings using Quicksand with variable weights */
h1,
h2,
h3,
h4,
h5,
h6,
.heading-1,
.heading-2,
.heading-3,
.heading-4,
.heading-5,
.heading-6 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-style: normal;
  line-height: var(--lh-tight);
  margin: 0;
}

h1,
.heading-1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold); /* 700 */
}

h2,
.heading-2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-semibold); /* 600 */
}

h3,
.heading-3 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold); /* 600 */
}

h4,
.heading-4 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-medium); /* 500 */
}

h5,
.heading-5 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium); /* 500 */
}

h6,
.heading-6 {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium); /* 500 */
}

/* Responsive heading adjustments */
@media (max-width: 700px) {
  h1,
  .heading-1 {
    font-weight: var(--fw-semibold);
  }

  h2,
  .heading-2,
  h3,
  .heading-3 {
    font-weight: var(--fw-semibold);
  }
}

/* Paragraph and text styles using Quicksand */
p,
.text-body {
  font-family: var(--font-text);
  font-optical-sizing: auto;
  font-weight: var(--fw-regular); /* 400 */
  font-style: normal;
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  margin: 0;
}

.text-lg {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
}

.text-sm {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}

.text-xs {
  font-size: var(--fs-xs);
  line-height: var(--lh-normal);
}

/* Text weight utilities */
.text-light {
  font-weight: var(--fw-light); /* 300 */
}

.text-regular {
  font-weight: var(--fw-regular); /* 400 */
}

.text-medium {
  font-weight: var(--fw-medium); /* 500 */
}

.text-semibold {
  font-weight: var(--fw-semibold); /* 600 */
}

.text-bold {
  font-weight: var(--fw-bold); /* 700 */
}

/* Numbers and data display using Noto Serif */
.number,
.data-value,
.metric,
[data-type="number"] {
  font-family: var(--font-numbers);
  font-optical-sizing: auto;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  font-feature-settings: "tnum" 1; /* Tabular numbers for alignment */
}

.number-lg {
  font-family: var(--font-numbers);
  font-size: var(--fs-3xl);
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  line-height: var(--lh-tight);
}

.number-xl {
  font-family: var(--font-numbers);
  font-size: var(--fs-4xl);
  font-weight: 700;
  font-variation-settings: "wdth" 100;
  line-height: var(--lh-tight);
}

/* Noto Serif weight variants */
.number-light {
  font-weight: 300;
  font-variation-settings: "wdth" 100;
}

.number-regular {
  font-weight: 400;
  font-variation-settings: "wdth" 100;
}

.number-semibold {
  font-weight: 600;
  font-variation-settings: "wdth" 100;
}

.number-bold {
  font-weight: 700;
  font-variation-settings: "wdth" 100;
}

/* Noto Serif width variants (condensed/expanded) */
.number-condensed {
  font-variation-settings: "wdth" 62.5;
}

.number-normal {
  font-variation-settings: "wdth" 100;
}

/* Special text styles */
.subtitle {
  font-family: var(--font-text);
  font-size: var(--fs-lg);
  font-weight: var(--fw-light); /* 300 */
  line-height: var(--lh-relaxed);
  opacity: 0.9;
}

.caption {
  font-family: var(--font-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  opacity: 0.75;
}

.label {
  font-family: var(--font-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium); /* 500 */
  line-height: var(--lh-normal);
  text-transform: uppercase;
}

/* Links */
a {
  font-family: inherit;
  color: var(--stl-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--stl-accent);
}

/* Buttons inherit Quicksand */
button,
input,
textarea,
select {
  font-family: var(--font-text);
}

/* Tables - mix of text and numbers */
table {
  font-family: var(--font-text);
}

table th {
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  text-transform: uppercase;
}

table td {
  font-size: var(--fs-lg);
}

/* Numbers in tables use Noto Serif */
table td.number,
table td[data-type="number"] {
  font-family: var(--font-numbers);
  font-weight: 500;
  font-variation-settings: "wdth" 100;
}

/* Responsive table text sizing */
@media (max-width: 1100px) or (max-height: 980px) {
  table td {
    font-size: var(--fs-base);
  }
}

@media (max-width: 700px) {
  table td {
    font-size: var(--fs-sm);
  }
  table th {
    font-size: var(--fs-xs);
  }
}

img {
  max-width: 100%;
  height: auto;
}
button {
  font-family: inherit;
}

/* Utilities */
.hidden {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.center {
  display: grid;
  place-items: center;
}

/* Common animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}
