/* iSTEMLabsAfrica — Base
   Reset, tokens import, typography, shared layout primitives.
   Design tokens live in tokens/variant-*.css and are imported here. */

/* ------------------------------------------------------------------ */
/* Design tokens (variant default = A)                                 */
/* NOTE: @import must precede all other rules.                         */
/* ------------------------------------------------------------------ */
@import url('./tokens/variant-a.css');

/* ------------------------------------------------------------------ */
/* Font faces (variable fonts, one file per family)                     */
/* ------------------------------------------------------------------ */
@font-face {
    font-family: 'Baloo 2';
    src: url('../assets/fonts/baloo2.woff2') format('woff2');
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../assets/fonts/opensans.woff2') format('woff2');
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Rubik';
    src: url('../assets/fonts/rubik.woff2') format('woff2');
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

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

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

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-normal);
    line-height: 1.5;
    color: var(--on-surface);
    background-color: var(--surface);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

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

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

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

ul,
ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.2;
    color: var(--on-surface);
}

/* ------------------------------------------------------------------ */
/* Typography helpers                                                  */
/* ------------------------------------------------------------------ */
.display-lg   { font-family: var(--font-display); font-size: var(--fs-display-lg);   font-weight: var(--fw-bold);   letter-spacing: -0.02em; }
.display-md   { font-family: var(--font-display); font-size: var(--fs-display-md);   font-weight: var(--fw-bold);   letter-spacing: -0.01em; }
.headline-lg  { font-family: var(--font-display); font-size: var(--fs-headline-lg);  font-weight: var(--fw-semi); }
.headline-md  { font-family: var(--font-display); font-size: var(--fs-headline-md);  font-weight: var(--fw-semi); }
.headline-sm  { font-family: var(--font-display); font-size: var(--fs-headline-sm);  font-weight: var(--fw-semi); }
.title-lg     { font-family: var(--font-display); font-size: var(--fs-title-lg);     font-weight: var(--fw-semi); }
.title-md     { font-family: var(--font-display); font-size: var(--fs-title-md);     font-weight: var(--fw-medium); }
.title-sm     { font-family: var(--font-display); font-size: var(--fs-title-sm);     font-weight: var(--fw-medium); }
.body-lg      { font-family: var(--font-body);    font-size: var(--fs-body-lg);      font-weight: var(--fw-normal); }
.body-md      { font-family: var(--font-body);    font-size: var(--fs-body-md);      font-weight: var(--fw-normal); }
.body-sm      { font-family: var(--font-body);    font-size: var(--fs-body-sm);      font-weight: var(--fw-normal); }
.label-lg     { font-family: var(--font-body);    font-size: var(--fs-label-lg);     font-weight: var(--fw-medium); }
.label-md     { font-family: var(--font-body);    font-size: var(--fs-label-md);     font-weight: var(--fw-medium); }
.label-sm     { font-family: var(--font-body);    font-size: var(--fs-label-sm);     font-weight: var(--fw-normal); }

/* ------------------------------------------------------------------ */
/* Layout primitives                                                   */
/* ------------------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

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

/* Safe-area helpers (PWA / mobile) */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.pt-safe {
    padding-top: env(safe-area-inset-top, 0);
}

/* Scrollbar (thin, themed) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--outline-variant, var(--border)); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
