/* ==========================================================================
   Govix Design System — Base
   Variables, reset, typography, and foundational styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Brand colours */
    --color-primary: #004d5a;
    --color-primary-dark: #003a44;
    --color-primary-light: #006877;

    /* Warm accent — complementary amber */
    --color-accent: #C2882B;
    --color-accent-hover: #D49A2B;
    --color-accent-dark: #A87420;

    /* Surface colours */
    --color-surface-dark: #1B3A44;

    /* Neutral palette */
    --color-white: #ffffff;
    --color-off-white: #f4f7f8;
    --color-light-grey: #e2e8ea;
    --color-mid-grey: #9EBBC3;
    --color-dark-grey: #2c3e42;
    --color-black: #0a1214;

    /* Semantic text — on dark backgrounds */
    --color-text-primary: var(--color-white);
    --color-text-secondary: #B8D4DB;
    --color-text-tertiary: #9AB9C2;

    /* Semantic text — on light backgrounds */
    --color-text-dark: var(--color-dark-grey);
    --color-text-dark-secondary: #536B71;

    /* Backward compatibility */
    --color-text-muted: var(--color-mid-grey);

    /* Background */
    --color-bg-primary: var(--color-primary);
    --color-bg-light: var(--color-off-white);
    --color-bg-white: var(--color-white);

    /* Typography */
    --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-light: 300;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    --font-weight-extra-bold: 800;

    /* Font sizes (rem based on 16px root) */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 2rem;       /* 32px */
    --text-4xl: 2.5rem;     /* 40px */
    --text-5xl: 3.5rem;     /* 56px */
    --text-6xl: 4.5rem;     /* 72px */

    /* Spacing scale */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */
    --space-4xl: 6rem;      /* 96px */
    --space-5xl: 8rem;      /* 128px */

    /* Layout */
    --max-width: 1200px;
    --max-width-narrow: 800px;
    --max-width-wide: 1440px;
    --header-height: 80px;
    --border-radius: 4px;
    --border-radius-lg: 8px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

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

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

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

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

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

ul,
ol {
    list-style: none;
}

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

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--text-6xl);
    font-weight: var(--font-weight-light);
}

h2 {
    font-size: var(--text-5xl);
    font-weight: var(--font-weight-light);
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

h5 {
    font-size: var(--text-xl);
}

h6 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
}

p {
    font-size: var(--text-lg);
    line-height: 1.7;
    max-width: 65ch;
}

.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-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-dark-secondary { color: var(--color-text-dark-secondary); }
.text-accent { color: var(--color-accent); }
.text-center { text-align: center; }

strong, .font-bold {
    font-weight: var(--font-weight-bold);
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

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

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

.section {
    padding: var(--space-5xl) 0;
}

.section--sm {
    padding: var(--space-3xl) 0;
}

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

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

.section--dark {
    background-color: var(--color-primary-dark);
}

.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;
}

/* --------------------------------------------------------------------------
   Responsive Typography
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
    h1 { font-size: var(--text-5xl); }
    h2 { font-size: var(--text-4xl); }
    h3 { font-size: var(--text-2xl); }
}

@media screen and (max-width: 768px) {
    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    h3 { font-size: var(--text-2xl); }

    .section {
        padding: var(--space-3xl) 0;
    }

    .container {
        padding: 0 var(--space-md);
    }
}

@media screen and (max-width: 480px) {
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
}
