/* ===========================
   GLOBAL RESET
   =========================== */

* {
    box-sizing: border-box;
    max-width: 100%;
}

/* Prevent ANY element from exceeding viewport width */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'DejaVu Sans', sans-serif;
    transition: background 0.3s, color 0.3s;
    position: relative;
}

/* ===========================
   REAL NEW COMPUTER MODERN
   =========================== */

@font-face {
    font-family: 'NewComputerModern';
    src: url('/fonts/new-computer-modern/cmunrm.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'NewComputerModern';
    src: url('/fonts/new-computer-modern/cmunti.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'NewComputerModern';
    src: url('/fonts/new-computer-modern/cmunbx.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'NewComputerModern';
    src: url('/fonts/new-computer-modern/cmunbi.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
}

.scientific {
    font-family: 'NewComputerModern', 'Inter', sans-serif;
}

/* ===========================
   THEME VARIABLES
   =========================== */

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --subtle: #555555;
    --card-bg: #ffffff;
    --card-border: #e0e0e0;
    --accent: #e5e5e5;
    --link: #0055cc;
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --text: #e6e6e6;
    --subtle: #aaaaaa;
    --card-bg: #1a1a1a;
    --card-border: #333333;
    --accent: #333333;
    --link: #66aaff;
}

/* ===========================
   NAVIGATION (Desktop)
   =========================== */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--accent);
    background: var(--bg);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    overflow: hidden; /* prevents nav from expanding width */
}

nav a {
    margin-left: 20px;
    font-weight: 500;
}

#theme-toggle {
    margin-left: 20px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Hamburger button */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    margin-right: 16px;
    color: var(--text);
}

/* ===========================
   MOBILE NAVIGATION (FINAL FIX)
   =========================== */

@media (max-width: 800px) {

    .hamburger {
        display: block;
    }

    .nav-right {
        position: fixed;
        top: 0;
        right: -260px; /* fully hidden */
        width: 260px;
        height: 100vh;
        background: var(--bg);
        border-left: 1px solid var(--accent);
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        transition: right 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
        overflow-x: hidden; /* prevents sideways scroll inside menu */
    }

    .nav-right.open {
        right: 0; /* slide into view */
    }

    nav a {
        margin: 0;
        font-size: 18px;
    }

    #theme-toggle {
        margin-left: 0;
        margin-right: 16px;
    }
}

/* ===========================
   HERO SECTION
   =========================== */

.hero {
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 20px;
    color: var(--subtle);
}

.accent-line {
    width: 80px;
    height: 2px;
    background: var(--accent);
    margin: 20px auto;
}

/* ===========================
   HIGHLIGHT CARDS
   =========================== */

.highlights {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 40px 20px;
    flex-wrap: wrap;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px;
    width: 260px;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===========================
   PAGE WRAPPER
   =========================== */

.page {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 5vw;
}

/* ===========================
   SLIDE-IN NOTIFICATION
   =========================== */

.notification {
    position: fixed;
    top: 70px;
    right: -300px;
    background: var(--accent);
    color: var(--bg);
    padding: 12px 18px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: right 0.5s ease;
    z-index: 999;
}

.notification.show {
    right: 20px;
}

/* ===========================
   CONTACT FORM
   =========================== */

.contact-form {
    margin: 0 auto;
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 16px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.submit-btn {
    padding: 12px 18px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
}

.submit-btn:hover {
    opacity: 0.85;
}
    font-style: normal;
}

@font-face {
    font-family: 'NewComputerModern';
    src: url('/fonts/new-computer-modern/cmunbi.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
}

.scientific {
    font-family: 'NewComputerModern', 'Inter', sans-serif;
}

/* ===========================
   THEME VARIABLES
   =========================== */

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --subtle: #555555;
    --card-bg: #ffffff;
    --card-border: #e0e0e0;
    --accent: #e5e5e5;
    --link: #0055cc;
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --text: #e6e6e6;
    --subtle: #aaaaaa;
    --card-bg: #1a1a1a;
    --card-border: #333333;
    --accent: #333333;
    --link: #66aaff;
}

/* ===========================
   GLOBAL STYLES
   =========================== */

* {
    box-sizing: border-box;
    max-width: 100%;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'DejaVu Sans', sans-serif;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
}

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

/* ===========================
   NAVIGATION (Desktop)
   =========================== */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--accent);
    background: var(--bg);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    overflow: hidden;
}

nav a {
    margin-left: 20px;
    font-weight: 500;
}

#theme-toggle {
    margin-left: 20px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Hamburger button */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    margin-right: 16px;
    color: var(--text);
}

/* ===========================
   MOBILE NAVIGATION (FINAL FIX)
   =========================== */

@media (max-width: 800px) {

    .hamburger {
        display: block;
    }

    .nav-right {
        position: fixed;
        top: 0;
        right: -260px;
        width: 260px;
        height: 100vh;
        background: var(--bg);
        border-left: 1px solid var(--accent);
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        transition: right 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
    }

    .nav-right.open {
        right: 0;
    }

    nav a {
        margin: 0;
        font-size: 18px;
    }

    #theme-toggle {
        margin-left: 0;
        margin-right: 16px;
    }
}

/* ===========================
   HERO SECTION
   =========================== */

.hero {
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 20px;
    color: var(--subtle);
}

.accent-line {
    width: 80px;
    height: 2px;
    background: var(--accent);
    margin: 20px auto;
}

/* ===========================
   HIGHLIGHT CARDS
   =========================== */

.highlights {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 40px 20px;
    flex-wrap: wrap;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px;
    width: 260px;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===========================
   PAGE WRAPPER
   =========================== */

.page {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 5vw;
}

/* ===========================
   SLIDE-IN NOTIFICATION
   =========================== */

.notification {
    position: fixed;
    top: 70px;
    right: -300px;
    background: var(--accent);
    color: var(--bg);
    padding: 12px 18px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: right 0.5s ease;
    z-index: 999;
}

.notification.show {
    right: 20px;
}

/* ===========================
   CONTACT FORM
   =========================== */

.contact-form {
    margin: 0 auto;
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 16px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.submit-btn {
    padding: 12px 18px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
}

.submit-btn:hover {
    opacity: 0.85;
}
