/* ==========================================================================
   CDSS 94 - Building Thoughtful AI Systems
   Course Website Styles
   ========================================================================== */

/* ==========================================================================
   0. Font Face
   ========================================================================== */
@font-face {
    font-family: 'Neue Haas Grotesk';
    src: url('../assets/fonts/NeueHaasGroteskDisplay-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Neue Haas Grotesk';
    src: url('../assets/fonts/NeueHaasGroteskDisplay-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Neue Haas Grotesk';
    src: url('../assets/fonts/NeueHaasGroteskDisplay-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   1. CSS Variables & Theme
   ========================================================================== */
:root {
    /* Colors */
    --bg: #fafafa;
    --bg-card: #fff;
    --text-primary: #0a0a0a;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --border-color: #e5e5e5;
    --accent: #0a0a0a;

    /* Tag Colors - Modern */
    --tag-due-bg: #fef2f2;
    --tag-due-text: #dc2626;
    --tag-release-bg: #f0fdf4;
    --tag-release-text: #16a34a;
    
    /* Calendar Colors - Modern */
    --calendar-border: #e5e5e5;
    --calendar-header-bg: #f5f5f5;
    --calendar-row-bg: #fff;
    --calendar-row-hover: #fafafa;
    --calendar-cell-border: #e5e5e5;
    --calendar-text: #0a0a0a;
    --calendar-text-muted: #737373;
    
    /* Typography */
    --font: 'Neue Haas Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================================================
   2. Base Styles & Reset
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.02em;
    -webkit-font-smoothing: antialiased;
    animation: fadeIn 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   3. Layout
   ========================================================================== */
.container {
    display: grid;
    grid-template-columns: 420px 1fr;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0;
    padding: 100px 60px 100px 80px;
    gap: 120px;
}

/* ==========================================================================
   4. Sidebar
   ========================================================================== */
.sidebar {
    position: sticky;
    top: 60px;
    height: fit-content;
}

.site-title {
    font-family: var(--font);
    font-size: 76px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.site-description {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.site-description a {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.subscribe-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    color: var(--text-primary);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.social-links a:hover {
    opacity: 1;
}

.social-links svg {
    width: 18px;
    height: 18px;
}

.copyright {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================================================
   5. Teaching Staff
   ========================================================================== */
.teaching-staff {
    margin-top: 40px;
}

.staff-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.staff-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.staff-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

a.staff-member:hover .staff-name {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.staff-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #888;
    overflow: hidden;
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

.staff-role {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: -4px;
}

/* ==========================================================================
   6. Main Content
   ========================================================================== */
.main-content {
    padding-top: 20px;
}

/* ==========================================================================
   7. Navigation Pills
   ========================================================================== */
.nav-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.nav-pill {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-pill:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.nav-pill.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

/* ==========================================================================
   8. Section Headers
   ========================================================================== */
.section-header {
    font-family: var(--font);
    font-size: 36px;
    font-weight: 400;
    margin: 48px 0 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-header:first-of-type {
    margin-top: 0;
}

.section-header.upcoming {
    opacity: 0.4;
}

/* ==========================================================================
   9. Featured Card
   ========================================================================== */
.featured-card {
    position: relative;
    padding: 20px 28px;
    margin-bottom: 24px;
    background: var(--bg-card);
    cursor: pointer;
    transition: background 0.2s;
}

.featured-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px dashed var(--border-color);
    pointer-events: none;
}

.featured-card::after {
    content: '×';
    position: absolute;
    font-size: 14px;
    color: var(--border-color);
}

.featured-card .corner-tl,
.featured-card .corner-tr,
.featured-card .corner-bl,
.featured-card .corner-br {
    position: absolute;
    font-size: 12px;
    color: var(--border-color);
    line-height: 1;
}

.featured-card .corner-tl { top: -6px; left: -4px; }
.featured-card .corner-tr { top: -6px; right: -4px; }
.featured-card .corner-bl { bottom: -6px; left: -4px; }
.featured-card .corner-br { bottom: -6px; right: -4px; }

.featured-card:hover {
    background: #e0e0e0;
}

.featured-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.featured-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.featured-title {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.featured-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.arrow-icon {
    color: var(--text-primary);
    flex-shrink: 0;
}

.arrow-icon svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   10. Post Cards (Syllabus)
   ========================================================================== */
/* ==========================================================================
   Module Cards (Syllabus)
   ========================================================================== */
.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.module-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.module-card.upcoming .module-lectures {
    opacity: 0.6;
}

.module-hero {
    position: relative;
    min-height: 100%;
    background-size: cover;
    background-position: center top;
    overflow: hidden;
}


.module-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 60%);
}

.module-overlay {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: white;
}

.module-number {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
    margin-bottom: 4px;
}

.module-title {
    font-family: var(--font);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.module-lectures {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lecture-item {
    position: relative;
    padding: 12px;
    padding-bottom: 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    margin-bottom: 8px;
}

.lecture-item:last-child {
    margin-bottom: 0;
}

.lecture-item.upcoming {
    opacity: 0.5;
}

.lecture-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.lecture-name {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.lecture-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.lecture-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.lecture-tag {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 4px;
}

.lecture-tag.tag-due {
    background: var(--tag-due-bg);
    color: var(--tag-due-text);
}

.lecture-tag.tag-release {
    background: var(--tag-release-bg);
    color: var(--tag-release-text);
}

.lecture-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lecture-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.lecture-link:hover {
    background: rgba(0, 0, 0, 0.1);
}

.lecture-link.disabled {
    opacity: 0.4;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.03);
}

.lecture-link.slides {
    background: var(--text-primary);
    color: white;
}

.lecture-link.slides:hover {
    background: #333;
}

/* Calendar material links */
.calendar-material-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--calendar-text);
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-right: 12px;
}

.calendar-material-link:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   11. Tags
   ========================================================================== */
.post-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

.tag-due {
    background: var(--tag-due-bg);
    color: var(--tag-due-text);
}

.tag-release {
    background: var(--tag-release-bg);
    color: var(--tag-release-text);
}

/* ==========================================================================
   12. Section Visibility
   ========================================================================== */
.projects-section {
    display: none;
}

.projects-section.active {
    display: block;
}

.schedule-section {
    display: block;
}

.schedule-section.hidden {
    display: none;
}

.calendar-section {
    display: none;
}

.calendar-section.active {
    display: block;
}

.policies-section {
    display: none;
}

.policies-section.active {
    display: block;
}

.policy-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.policy-card .section-header {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.policies-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 720px;
}

.policies-content p {
    margin-bottom: 12px;
}

.policies-heading {
    font-family: var(--font);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 8px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
}

.policies-heading:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.policies-content ul {
    margin: 8px 0 16px 20px;
}

.policies-content li {
    margin-bottom: 6px;
}

.policies-nav-list {
    list-style: none;
    margin-left: 0 !important;
}

.grade-breakdown {
    margin: 16px 0 24px;
}

.grade-item {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

.grade-percent {
    font-family: var(--font);
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 64px;
}

.grade-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.grade-detail {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 14px;
}

/* ==========================================================================
   13. Calendar
   ========================================================================== */
.calendar-grid {
    display: grid;
    gap: 0;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: 80px 1.2fr 1fr 0.8fr 0.8fr;
    background: var(--calendar-header-bg);
}

.calendar-header-cell {
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--calendar-text-muted);
    background: var(--calendar-header-bg);
}

.calendar-row {
    display: grid;
    grid-template-columns: 80px 1.2fr 1fr 0.8fr 0.8fr;
    background: var(--calendar-row-bg);
}


.calendar-row.break {
    opacity: 0.6;
    background: #f5f5f5;
}

.calendar-row.highlight {
    background: linear-gradient(135deg, #f0f0f0 0%, #f5f5f5 100%);
}

.calendar-cell {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-cell:first-child {
    border-left: none;
    justify-content: center;
    align-items: center;
}

.date-display {
    text-align: center;
}

.date-month {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--calendar-text-muted);
}

.date-day {
    font-size: 24px;
    font-weight: 400;
    color: var(--calendar-text);
}

.cell-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--calendar-text-muted);
    margin-bottom: 2px;
}

.cell-content {
    font-size: 14px;
    font-weight: 500;
    color: var(--calendar-text);
}

.cell-subcontent {
    font-size: 13px;
    color: var(--calendar-text-muted);
}

.cell-banner {
    display: block;
    margin-top: 6px;
    padding: 3px 6px;
    background: var(--tag-due-bg);
    color: var(--tag-due-text);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 3px;
    text-align: center;
}

.calendar-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 6px;
    border-radius: 3px;
    margin-top: 6px;
}

.calendar-tag.due {
    background: var(--tag-due-bg);
    color: var(--tag-due-text);
}

.calendar-tag.release {
    background: var(--tag-release-bg);
    color: var(--tag-release-text);
}

/* ==========================================================================
   14. Project Cards
   ========================================================================== */
.project-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.project-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.project-badge.final {
    background: var(--text-primary);
    color: white;
}

.project-badge.p1 {
    background: #f0f0f0;
    color: #525252;
}

.project-badge.p2 {
    background: #e5e5e5;
    color: #404040;
}

.project-card h2 {
    font-family: var(--font);
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 8px;
}

.project-card .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.project-timeline {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.timeline-value {
    font-size: 15px;
    font-weight: 500;
}

.project-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.milestones {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.milestones-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}

.milestone-date {
    font-size: 14px;
    font-weight: 500;
    min-width: 60px;
}

.milestone-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-primary);
    flex-shrink: 0;
}

.milestone-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.project-links {
    display: flex;
    gap: 12px;
}

.project-link {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.project-link.primary {
    background: var(--text-primary);
    color: white;
}

.project-link.primary:hover {
    opacity: 0.85;
}

.project-link.secondary {
    background: #f0f0f0;
    color: var(--text-primary);
}

.project-link.secondary:hover {
    background: #e5e5e5;
}

/* ==========================================================================
   15. Homepage Styles
   ========================================================================== */
body.homepage {
    background: var(--bg);
}

/* Top Navigation */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 60px;
    background: transparent;
}

.nav-logo {
    font-family: var(--font);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-course-badge {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--text-primary);
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-course-badge:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
}

/* Course Page Layout */
body.course-page {
    background: var(--bg);
}

.course-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px 80px;
}

.course-header {
    text-align: center;
    padding: 40px 0 48px;
    margin-bottom: 32px;
}

.course-title {
    font-family: var(--font);
    font-size: 48px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.course-meta {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.course-collab {
    font-style: italic;
}

.course-meta + .course-description {
    margin-top: 16px;
}

.course-description {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 28px;
}

.teaching-staff-inline {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.staff-member-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.staff-member-inline img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.staff-member-inline span {
    font-size: 14px;
    font-weight: 500;
}

.staff-member-inline:hover span {
    text-decoration: underline;
}

/* Page Header (for standalone pages) */
.page-header {
    padding: 40px 0 48px;
    margin-bottom: 40px;
}

.page-title {
    font-family: var(--font);
    font-size: 48px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

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

/* Section Navigation Tabs */
.section-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.section-tab {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all 0.2s;
}

.section-tab:hover {
    color: var(--text-primary);
}

.section-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.course-content {
    /* Reset for course page */
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    padding: 0 60px;
}

.hero-video {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    transform: translateZ(0);
}

.video-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.overlay-title {
    font-family: var(--font);
    font-size: 80px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: white;
    text-align: center;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 32px;
}


.hero-still-link {
    display: block;
    width: 100%;
}

.hero-still {
    display: block;
    width: 100%;
    height: auto;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    pointer-events: none;
}

.video-tap-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 10;
}

.video-tap-overlay.visible {
    display: flex;
}

.tap-to-play {
    color: white;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

/* Video Grid Section */
.video-grid-section {
    padding: 100px 40px 140px;
}

.grid-title {
    font-family: var(--font);
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 60px;
    text-align: center;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px 60px;
}

/* Video Card */
.video-card {
    cursor: pointer;
    width: 85%;
    justify-self: center;
}

.video-thumbnail {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: #1a1a1a;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.video-card:hover .video-thumbnail img {
    opacity: 0.85;
}

.video-info {
    padding: 16px 4px;
}

.video-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}

.video-title {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.video-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.video-module {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}


/* Upcoming lectures */
.video-card.upcoming {
    pointer-events: none;
}

.video-card.upcoming .video-info {
    opacity: 0.4;
}

/* Video Modal */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    visibility: hidden;
}

.video-modal.active {
    pointer-events: auto;
    visibility: visible;
}

.page-content {
    transition: filter 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-content.blurred {
    filter: blur(10px);
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-modal.active .modal-backdrop {
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 1;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-modal.active .modal-content {
    opacity: 1;
    transform: scale(1);
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    cursor: pointer;
    color: white;
    transition: transform 0.2s, background 0.2s;
}

.modal-close:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.modal-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.modal-links {
    display: flex;
    gap: 12px;
}

.modal-links:empty {
    visibility: hidden;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    background: #fff;
    border: none;
    border-radius: 100px;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}

.modal-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ==========================================================================
   16. Responsive Design
   ========================================================================== */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        padding: 60px 32px;
        gap: 60px;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    .site-title {
        font-size: 56px;
    }

    .sidebar-footer {
        position: relative;
        margin-top: 48px;
    }

    .module-card {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 1000px) {
    .calendar-header,
    .calendar-row {
        grid-template-columns: 60px 1fr 1fr 1fr;
    }

    .calendar-cell:nth-child(4) {
        display: none;
    }
}

@media (max-width: 800px) {
    .calendar-header,
    .calendar-row {
        grid-template-columns: 60px 1fr 1fr;
    }

    .calendar-cell:nth-child(4),
    .calendar-cell:last-child {
        display: none;
    }
}

@media (max-width: 600px) {
    .site-title {
        font-size: 44px;
    }

    .module-card {
        grid-template-columns: 1fr;
    }

    .module-hero {
        height: 200px;
    }

    .featured-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .calendar-header,
    .calendar-row {
        grid-template-columns: 1fr;
    }

    .calendar-cell:first-child {
        border-bottom: 1px solid var(--border-color);
        padding: 12px;
    }

    .date-display {
        display: flex;
        align-items: baseline;
        gap: 6px;
    }

    .date-day {
        font-size: 18px;
    }
}

/* Homepage Responsive */
@media (max-width: 1200px) {
    .overlay-title {
        font-size: 64px;
    }

    .video-grid-section {
        padding: 60px 40px 100px;
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 16px 24px;
    }

    .nav-logo {
        font-size: 20px;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-link {
        font-size: 14px;
    }

    .hero {
        padding: 0 24px;
    }

    .hero-video {
        border-radius: 12px;
    }

    .overlay-title {
        font-size: 36px;
        padding: 0 24px;
    }

    .grid-title {
        font-size: 32px;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .video-grid-section {
        padding: 40px 24px 80px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 12px;
    }

    .nav-link {
        font-size: 13px;
    }

    .overlay-title {
        font-size: 28px;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* Course Page Responsive */
@media (max-width: 768px) {
    .course-container {
        padding: 0 24px 60px;
    }

    .course-title {
        font-size: 36px;
    }

    .course-description {
        font-size: 16px;
    }

    .section-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .section-tab {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
    }

    .teaching-staff-inline {
        flex-direction: row;
        gap: 48px;
    }

    .staff-member-inline {
        flex-direction: column;
        gap: 8px;
    }

    .course-header {
        text-align: left;
    }
}

/* ==========================================================================
   17. Mobile Navigation (Hamburger Menu)
   ========================================================================== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: background 0.2s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    left: 0;
    transition: transform 0.3s ease;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

/* Hamburger animation when active */
.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active .hamburger::after {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   18. Mobile Responsive (768px and below)
   ========================================================================== */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 1000;
    }

    .nav-links.active {
        pointer-events: auto;
        opacity: 1;
    }

    .nav-link {
        font-size: 24px;
        padding: 20px 40px;
        width: 100%;
        text-align: center;
    }

    .top-nav {
        padding: 16px 20px;
    }

    /* Calendar Card Layout for Mobile */
    .calendar-section {
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .calendar-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
        background: transparent;
        border: none;
        border-radius: 0;
        min-width: unset;
    }

    .calendar-header {
        display: none;
    }

    .calendar-row {
        display: flex;
        flex-direction: column;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 20px;
        gap: 16px;
    }


    .calendar-cell {
        padding: 0;
        border: none;
    }

    .calendar-cell:first-child {
        align-items: flex-start;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border-color);
    }

    .date-display {
        display: flex;
        align-items: baseline;
        gap: 8px;
    }

    .date-month {
        font-size: 14px;
    }

    .date-day {
        font-size: 28px;
        font-weight: 500;
    }

    .cell-label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .cell-content {
        font-size: 15px;
    }

    /* Show labels on mobile calendar cards */
    .calendar-cell:not(:first-child)::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        margin-bottom: 4px;
    }

    .calendar-cell:nth-child(2)::before { content: 'Lecture'; }
    .calendar-cell:nth-child(3)::before { content: 'Technical Work'; }
    .calendar-cell:nth-child(4)::before { content: 'Materials'; }
    .calendar-cell:nth-child(5)::before { content: 'Due'; }

    /* Hide empty calendar cells on mobile */
    .calendar-cell:empty {
        display: none;
    }

    /* Video Grid Mobile */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .video-card {
        width: 100%;
    }

    .video-grid-section {
        padding: 40px 20px 60px;
    }

    .grid-title {
        font-size: 28px;
        margin-bottom: 32px;
    }

    .video-info {
        padding: 12px 0;
    }

    .video-title {
        font-size: 16px;
    }

    /* Hero */
    .hero {
        padding: 0 20px;
    }

    .overlay-title {
        font-size: 32px;
    }

    /* Course Container */
    .course-container {
        padding: 0 20px 60px;
    }

    .course-title {
        font-size: 32px;
    }

    .page-title {
        font-size: 36px;
    }

    /* Module Cards */
    .module-card {
        grid-template-columns: 1fr;
    }

    .module-hero {
        height: 180px;
    }

    .module-title {
        font-size: 22px;
    }

    /* Video Modal */
    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal-controls {
        flex-direction: column;
        align-items: flex-end;
        gap: 16px;
    }

    .modal-links {
        flex-direction: row;
        width: 100%;
        order: -1;
    }

    .modal-link {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
        border-radius: 4px;
        min-height: auto;
    }

    .modal-close {
        align-self: flex-end;
    }
}

/* ==========================================================================
   19. Small Mobile (480px and below)
   ========================================================================== */
@media (max-width: 480px) {
    .top-nav {
        padding: 12px 16px;
    }

    .nav-logo {
        font-size: 18px;
    }

    /* Hero */
    .hero {
        padding: 0 16px;
    }

    .video-wrapper {
        padding-bottom: 56.25%;
    }

    .video-wrapper iframe,
    .video-wrapper video {
        top: 0;
        height: 100%;
        min-height: auto;
    }

    .overlay-title {
        font-size: 24px;
        padding: 0 16px;
    }

    /* Video Grid */
    .video-grid-section {
        padding: 32px 16px 48px;
    }

    .grid-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .video-title {
        font-size: 15px;
    }

    .video-date {
        font-size: 12px;
    }

    .video-module {
        font-size: 11px;
    }

    /* Course Page */
    .course-container {
        padding: 0 16px 40px;
    }

    .course-title {
        font-size: 26px;
    }

    .course-header {
        padding: 24px 0 32px;
    }

    .course-description {
        font-size: 15px;
    }

    .page-title {
        font-size: 28px;
    }

    .page-header {
        padding: 20px 0 24px;
    }

    .page-subtitle {
        font-size: 14px;
    }

    /* Module Cards */
    .module-hero {
        height: 160px;
    }

    .module-overlay {
        padding: 14px;
    }

    .module-title {
        font-size: 18px;
    }

    .module-lectures {
        padding: 12px 14px;
    }

    .lecture-tab {
        padding: 6px 8px;
    }

    .lecture-name {
        font-size: 13px;
    }

    .lecture-links {
        padding: 0 8px 6px;
    }

    .lecture-link {
        font-size: 11px;
        padding: 5px 8px;
    }

    /* Calendar Cards */
    .calendar-row {
        padding: 16px;
    }

    .date-day {
        font-size: 24px;
    }

    .cell-content {
        font-size: 14px;
    }

    /* Section Headers */
    .section-header {
        font-size: 24px;
        margin: 32px 0 16px;
    }

    /* Policy/About Cards */
    .policy-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .policies-content {
        font-size: 15px;
    }

    .grade-item {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .grade-percent {
        font-size: 22px;
    }

    .grade-label {
        font-size: 14px;
    }

    /* Project Cards */
    .project-card {
        padding: 16px;
    }

    .project-card h2 {
        font-size: 22px;
    }

    .project-timeline {
        flex-direction: column;
        gap: 12px;
    }

    .project-links {
        flex-direction: column;
    }

    .project-link {
        text-align: center;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Featured Card */
    .featured-card {
        padding: 14px 16px;
    }

    .featured-title {
        font-size: 14px;
    }

    .featured-desc {
        font-size: 12px;
    }

    /* Section Nav Tabs */
    .section-nav {
        gap: 4px;
        margin-bottom: 24px;
    }

    .section-tab {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Teaching Staff */
    .teaching-staff-inline {
        gap: 16px;
    }

    .staff-member-inline span {
        font-size: 13px;
    }

    .staff-member-inline img {
        width: 32px;
        height: 32px;
    }
}

