
/* =========================================
   COURSE MATERIAL WEBSITE
   Dark circuit-board design
========================================= */


/* ---------- Theme variables ---------- */

:root {
    --bg: #061120;
    --bg-secondary: #0a192d;
    --surface: rgba(9, 25, 45, 0.88);
    --surface-hover: rgba(14, 36, 62, 0.96);
    --header-bg: rgba(5, 16, 31, 0.88);

    --text: #f1f6ff;
    --text-secondary: #a8bbd4;
    --text-muted: #7188a6;

    --accent: #8dc8ff;
    --accent-strong: #55aaff;
    --accent-soft: rgba(141, 200, 255, 0.12);
    --accent-line: rgba(141, 200, 255, 0.28);

    --border: rgba(141, 200, 255, 0.20);
    --border-hover: rgba(141, 200, 255, 0.48);

    --button-text: #061120;
    --disabled-bg: rgba(128, 149, 177, 0.16);
    --disabled-text: #7188a6;

    --shadow: rgba(0, 0, 0, 0.25);
    --pulse-glow: rgba(141, 200, 255, 0.8);
    --circuit-color: #8dc8ff;
}

html[data-theme="light"] {
    --bg: #f4f8fc;
    --bg-secondary: #eaf1f8;
    --surface: rgba(255, 255, 255, 0.90);
    --surface-hover: rgba(255, 255, 255, 0.98);
    --header-bg: rgba(244, 248, 252, 0.90);

    --text: #102a4c;
    --text-secondary: #45617e;
    --text-muted: #7189a5;

    --accent: #123f70;
    --accent-strong: #175b9e;
    --accent-soft: rgba(18, 63, 112, 0.09);
    --accent-line: rgba(18, 63, 112, 0.24);

    --border: rgba(18, 63, 112, 0.18);
    --border-hover: rgba(18, 63, 112, 0.42);

    --button-text: #ffffff;
    --disabled-bg: rgba(100, 124, 151, 0.13);
    --disabled-text: #8a9caf;

    --shadow: rgba(24, 57, 91, 0.08);
    --pulse-glow: rgba(18, 63, 112, 0.65);
    --circuit-color: #123f70;
}


/* ---------- Reset ---------- */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    transition:
        background 0.35s ease,
        color 0.35s ease;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

.container {
    width: min(1080px, calc(100% - 48px));
    margin: 0 auto;
}



/* =========================================
   HEADER / NAVIGATION
========================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.nav-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.site-logo {
    flex-shrink: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
    transition: color 0.25s ease;
}

.site-logo:hover {
    color: var(--accent-strong);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-left: auto;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--accent-soft);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
}

.main-nav a {
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 25px 0;
    transition: color 0.25s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--accent-strong);
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-strong);
}

.contact-button {
    padding: 7px 12px !important;
    border: 1px solid var(--accent-strong);
    border-radius: 6px;
    color: var(--accent-strong) !important;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.contact-button:hover {
    background: var(--accent-strong);
    color: var(--button-text) !important;
}


/* ---------- Theme toggle ---------- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--accent-soft);
    color: var(--text-secondary);
    padding: 5px 8px;
    cursor: pointer;
    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
}

.theme-icon {
    font-size: 14px;
    line-height: 1;
}

.moon-icon {
    color: var(--text);
}

.toggle-track {
    display: flex;
    align-items: center;
    width: 36px;
    height: 20px;
    padding: 2px;
    border-radius: 20px;
    background: var(--accent-strong);
}

.toggle-thumb {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transform: translateX(16px);
    transition: transform 0.25s ease;
}

html[data-theme="light"] .toggle-thumb {
    transform: translateX(0);
}


/* =========================================
   MAIN CONTENT
========================================= */

.main-content {
    padding-top: 80px;
    padding-bottom: 110px;
}

.page-intro {
    margin-bottom: 44px;
}

.section-label {
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    margin-bottom: 14px;
}

.page-intro h1 {
    color: var(--text);
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.05em;
    margin-bottom: 18px;
}

.intro-text {
    color: var(--text-secondary);
    font-size: 17px;
}


/* =========================================
   WEEK CARDS
========================================= */

.weeks-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.week-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 26px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 24px;

    box-shadow: 0 8px 28px var(--shadow);

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.week-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.week-card.upcoming {
    opacity: 0.72;
}

.week-card.upcoming:hover {
    transform: none;
    border-color: var(--border);
}

.about-card {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.8fr);
    align-items: center;
    gap: 30px;
}

.about-photo {
    grid-column: 2;
    grid-row: 1;


    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--accent-soft);
}

.about-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-card .week-description {
    max-width: 760px;
}

.week-number {
    color: var(--accent);
    font-size: 29px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    opacity: 0.9;
}

.week-info {
    min-width: 0;
}

.week-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 5px;
}

.week-heading h2 {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.week-date {
    color: var(--text-muted);
    font-size: 12px;
}

.week-description {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    max-width: 650px;
}

.week-action {
    display: flex;
    justify-content: flex-end;
    min-width: 142px;
}


/* ---------- Download button ---------- */

.download-button,
.coming-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 140px;
    min-height: 42px;
    border-radius: 6px;
    padding: 10px 17px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.download-button {
    background: var(--accent-strong);
    color: var(--button-text);
    border: 1px solid var(--accent-strong);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.download-button:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.download-icon {
    font-size: 20px;
    font-weight: 400;
    line-height: 0.8;
}

.coming-button {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    border: 1px solid transparent;
    cursor: not-allowed;
}


/* =========================================
   FOOTER
========================================= */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.footer-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--text-muted);
    font-size: 12px;
}


/* =========================================
   RESPONSIVE DESIGN
========================================= */

@media (max-width: 760px) {

    .container {
        width: min(100% - 32px, 1080px);
    }

    .nav-inner {
        min-height: 68px;
        gap: 14px;
    }

    .site-logo {
        font-size: 17px;
    }

    .menu-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-left: 0;
        padding: 8px 16px 14px;
        background: var(--header-bg);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav a {
        font-size: 12px;
        padding: 12px 0;
    }

    .main-nav a.active::after {
        display: none;
    }

    .theme-toggle {
        padding: 4px 6px;
    }

    .main-content {
        padding-top: 56px;
        padding-bottom: 76px;
    }

    .page-intro {
        margin-bottom: 32px;
    }

    .week-card {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 16px;
        padding: 20px;
    }

    .about-card {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .about-card .week-info {
        order: 1;
    }

    .about-photo {
        order: 2;
        max-width: 360px;
    }

    .week-number {
        font-size: 24px;
    }

    .week-action {
        grid-column: 2;
        justify-content: flex-start;
        min-width: 0;
        margin-top: 6px;
    }

    .download-button,
    .coming-button {
        min-width: 130px;
    }
}

@media (max-width: 500px) {

    .main-nav {
        gap: 11px;
    }

    .main-nav a {
        font-size: 11px;
    }

    .theme-icon:first-child {
        display: none;
    }

    .theme-toggle {
        gap: 4px;
    }

    .page-intro h1 {
        font-size: 42px;
    }

    .week-card {
        padding: 18px;
    }

    .week-heading {
        gap: 6px 10px;
    }

    .week-heading h2 {
        font-size: 17px;
    }

    .week-description {
        font-size: 13px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 20px 0;
        gap: 6px;
    }
}


/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}