/* ICRS Design System: Structural Precision */
:root {
    /* Color Palette */
    --primary: #001332;
    --primary-container: #002759;
    --on-primary: #ffffff;
    --secondary: #a63b00;
    --on-secondary: #ffffff;
    --secondary-container: #fc6c29;
    --tertiary: #0b1800;
    --tertiary-fixed: #b5f65f;
    --on-tertiary-fixed: #102000;
    
    /* Surface Palette */
    --surface: #f8f9ff;
    --on-surface: #0b1c30;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #eff4ff;
    --surface-container: #e5eeff;
    --surface-container-high: #dce9ff;
    --surface-container-highest: #d3e4fe;
    --surface-dim: #cbdbf5;
    --surface-variant: #d3e4fe;
    --on-surface-variant: #44474f;
    
    /* Outline & Misc */
    --outline: #747780;
    --outline-variant: rgba(196, 198, 209, 0.2);
    
    /* Layout */
    --max-width: 1280px;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--surface);
    color: var(--on-surface);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
    padding-top: var(--header-height);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.label {
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    font-weight: 700;
}

p {
    font-size: 1rem;
    color: var(--on-surface-variant);
}

.display-lg { font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 900; }
.display-md { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 900; }
.display-sm { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.05em; line-height: 1; }
.title-lg { font-size: 2rem; }

/* Structural Rules */
section {
    padding: 100px 2rem;
    position: relative;
}

section.section-compact {
    padding-top: 50px;
    padding-bottom: 50px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Background Shifts (The No-Line Rule) */
.bg-surface-low { background-color: var(--surface-container-low); }
.bg-surface-lowest { background-color: var(--surface-container-lowest); }
.bg-primary-container { background-color: var(--primary-container); color: var(--on-primary); }

/* Glass Headers */
header.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 3000; /* Ensure header and its buttons stay above the menu drawer */
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--outline-variant);
}

header.sticky-nav .container {
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

@media (min-width: 769px) {
    header.sticky-nav .container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
    }

    .logo-link {
        justify-self: start;
    }

    nav {
        justify-self: center;
    }

    header.sticky-nav .container::after {
        content: "";
    }
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 48px;
    width: auto;
    display: block;
    transition: opacity 0.2s ease;
}

.logo-link:hover .logo-img {
    opacity: 0.85;
}

@media (max-width: 768px) {
    header.sticky-nav .container {
        padding: 0 1.5rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    color: var(--on-primary);
    box-shadow: 0 10px 30px rgba(0, 19, 50, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 19, 50, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--outline-variant);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--surface-container-low);
    border-color: var(--primary);
}

.btn-accent {
    background: var(--secondary);
    color: var(--on-secondary);
}

/* Utilities */
.blueprint-pattern {
    background-image: radial-gradient(var(--outline-variant) 1px, transparent 1px);
    background-size: 24px 24px;
}

.accent-bar {
    width: 4px;
    height: 48px;
    background-color: var(--secondary);
    display: inline-block;
}

/* Logo & Broken Ring Motif */
.broken-ring-svg {
    width: 64px;
    height: 64px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 2500; /* Ensure button stays above the menu drawer */
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
    background-color: var(--surface-container-low);
}

/* Responsive Navigation */
.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--on-surface-variant);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Desktop-only nav (hidden on mobile) */
@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }
}

/* Mobile-only drawer (hidden on desktop) */
@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .mobile-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: var(--surface-container-lowest);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%); /* Slide out to the right */
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 2000;
        display: flex;
        visibility: hidden;
        list-style: none;
    }

    .mobile-nav.active {
        transform: translateX(0); /* Slide in from the right */
        visibility: visible;
    }

    .mobile-nav a {
        font-size: 1.5rem;
        text-decoration: none;
        color: var(--on-surface-variant);
        font-family: 'Space Grotesk', sans-serif;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        transition: color 0.3s;
    }

    .mobile-nav a:hover, .mobile-nav a.active {
        color: var(--primary);
    }

    section {
        padding: 60px 1.5rem;
    }

    section.section-compact {
        padding-top: 30px;
        padding-bottom: 30px;
    }
}

footer {
    margin-top: 0 !important;
}

/* Self-hosted Typography */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/Inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/Inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/SpaceGrotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/SpaceGrotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Local Material Symbols Outlined Font Definition */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('../fonts/MaterialSymbolsOutlined.woff2') format('woff2');
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
