/* ============================================================
   main.css — Design system: tokens, typography, base resets
   Matches the Material Design 3 palette from the HTML mockups
   ============================================================ */

/* ─── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ─── CSS Custom Properties (Design Tokens) ─────────────────── */
:root {
    /* Brand colours */
    --color-primary:                #003ec7;
    --color-primary-container:      #0052ff;
    --color-on-primary:             #ffffff;
    --color-on-primary-container:   #dfe3ff;
    --color-primary-fixed:          #dde1ff;
    --color-primary-fixed-dim:      #b7c4ff;
    --color-inverse-primary:        #b7c4ff;
    --color-on-primary-fixed:       #001452;
    --color-on-primary-fixed-variant: #0038b6;

    /* Secondary */
    --color-secondary:              #505f76;
    --color-secondary-container:    #d0e1fb;
    --color-on-secondary:           #ffffff;
    --color-on-secondary-container: #54647a;
    --color-secondary-fixed:        #d3e4fe;
    --color-secondary-fixed-dim:    #b7c8e1;
    --color-on-secondary-fixed:     #0b1c30;
    --color-on-secondary-fixed-variant: #38485d;

    /* Tertiary */
    --color-tertiary:               #005479;
    --color-tertiary-container:     #006d9c;
    --color-on-tertiary:            #ffffff;
    --color-on-tertiary-container:  #cee9ff;
    --color-tertiary-fixed:         #c9e6ff;
    --color-tertiary-fixed-dim:     #89ceff;
    --color-on-tertiary-fixed:      #001e2f;
    --color-on-tertiary-fixed-variant: #004c6e;

    /* Surface */
    --color-surface:                #faf8ff;
    --color-surface-dim:            #d4d9ed;
    --color-surface-bright:         #faf8ff;
    --color-surface-container-lowest:  #ffffff;
    --color-surface-container-low:  #f1f3ff;
    --color-surface-container:      #e9edff;
    --color-surface-container-high: #e2e8fc;
    --color-surface-container-highest: #dde2f6;
    --color-surface-variant:        #dde2f6;
    --color-surface-tint:           #004ced;
    --color-inverse-surface:        #2a303f;
    --color-inverse-on-surface:     #edf0ff;

    /* Text */
    --color-on-surface:             #151b29;
    --color-on-surface-variant:     #434656;
    --color-on-background:          #151b29;
    --color-background:             #faf8ff;

    /* Utility */
    --color-outline:                #737688;
    --color-outline-variant:        #c3c5d9;
    --color-error:                  #ba1a1a;
    --color-on-error:               #ffffff;
    --color-error-container:        #ffdad6;
    --color-on-error-container:     #93000a;

    /* ─── Spacing ───────────────────────────────────────────── */
    --space-xs:     4px;
    --space-sm:     8px;
    --space-md:     16px;
    --space-lg:     24px;
    --space-xl:     32px;
    --space-xxl:    48px;
    --space-gutter: 24px;
    --space-margin-desktop: 40px;
    --space-margin-mobile:  16px;

    /* ─── Border Radius ─────────────────────────────────────── */
    --radius-sm:   0.25rem;  /* 4px  */
    --radius-md:   0.5rem;   /* 8px  */
    --radius-lg:   0.75rem;  /* 12px */
    --radius-full: 9999px;

    /* ─── Shadows ───────────────────────────────────────────── */
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
    --shadow-primary: 0 4px 14px rgba(0,62,199,0.2);
    --shadow-ai-glow: 0 0 20px rgba(0,82,255,0.15);

    /* ─── Sidebar ───────────────────────────────────────────── */
    --sidebar-width: 280px;
    --topnav-height: 64px;
    --bottom-nav-height: 64px;
}

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

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

body {
    background-color: var(--color-background);
    color: var(--color-on-surface);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

input, textarea, select {
    font-family: inherit;
}

/* ─── Typography Scale ────────────────────────────────────────── */
.display-lg {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 48px;
    line-height: 56px;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.display-sm {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 36px;
    line-height: 44px;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.headline-lg {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 30px;
    line-height: 38px;
    letter-spacing: -0.01em;
    font-weight: 600;
}

.headline-md {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
}

.headline-sm {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
}

.body-lg {
    font-size: 18px;
    line-height: 28px;
    font-weight: 400;
}

.body-md {
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
}

.body-sm {
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
}

.label-md {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.label-sm {
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
}

/* ─── Material Symbols ────────────────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    user-select: none;
    line-height: 1;
}

/* ─── Utility Classes ─────────────────────────────────────────── */
.text-primary         { color: var(--color-primary); }
.text-on-surface      { color: var(--color-on-surface); }
.text-on-surface-variant { color: var(--color-on-surface-variant); }
.text-error           { color: var(--color-error); }
.text-tertiary-container { color: var(--color-tertiary-container); }

.bg-primary           { background-color: var(--color-primary); }
.bg-surface           { background-color: var(--color-surface); }
.bg-surface-container { background-color: var(--color-surface-container); }
.bg-surface-container-low { background-color: var(--color-surface-container-low); }
.bg-surface-container-lowest { background-color: var(--color-surface-container-lowest); }

.glass-card {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226,232,252,0.5);
}

.ai-glow {
    box-shadow: var(--shadow-ai-glow);
}

/* Active press scale effect */
.press-effect:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Animate in */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeSlideUp 0.4s ease both;
}

/* Pulse for AI indicators */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;
}
