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

:root {
    --bg: #0a0e27;
    --surface: #151b3d;
    --primary: #00ff41;
    --secondary: oklch(74% 0.238 322.16); 
    --third: oklch(75% 0.183 55.934);
    --text: #c5c8d4;
    --border: #1e2749;
}

body {
    font-family: 'Courier New', monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tab-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.terminal-nav {
    background: var(--surface);
    border-bottom: 2px solid var(--primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.terminal-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prompt {
    color: var(--secondary);
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

.prompt:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translateY(7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-7px);
}

/* Hero */

.hero h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--primary);
    text-align: center;
}

.hero h1 .highlight {
    color: var(--third);
}

.hero h1 .mobile-break {
    display: none;
}

/* Latest Posts */
.home-courses {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.home-courses h2 {
    color: var(--secondary);
    margin-bottom: 1rem;
    flex-shrink: 0;
}

#home-courses-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    overflow-y: auto;
    min-height: 0;
}

.home-course-card {
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.3s;
    display: flex;
    flex-direction: column;
}

.home-course-card:hover {
    border-color: var(--primary);
}

.card-thumb {
    position: relative;
    border-bottom: 1px solid var(--border);
}

.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    bottom: 0.4rem;
    right: 0.4rem;
    font-size: 0.65rem;
    font-family: 'Courier New', monospace;
    padding: 0.15rem 0.4rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.card-footer .status-badge {
    position: static;
}

.status-online  { background: var(--primary); color: var(--bg); }
.status-upcoming { background: var(--secondary); color: var(--bg); }

.home-course-card .card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.home-course-card h3 {
    color: var(--primary);
    font-size: 0.85rem;
    margin: 0;
}

.home-course-card .card-desc {
    font-size: 0.78rem;
    color: var(--text);
    flex: 1;
}

.home-course-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.home-course-card .price {
    color: var(--third);
    font-size: 0.9rem;
    font-weight: bold;
}

.home-course-card .buy-btn {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.3s;
}

.home-course-card .buy-btn:hover {
    background: var(--secondary);
    color: var(--bg);
}

#see-more-courses {
    margin-top: 0.75rem;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-end;
    flex-shrink: 0;
}

#see-more-courses:hover {
    background: var(--primary);
    color: var(--bg);
}

/* Newsletter */
.newsletter {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border: 1px solid var(--border);
}

.newsletter h3 {
    color: var(--secondary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

#newsletter-form {
    display: flex;
    gap: 1rem;
}

#newsletter-form input {
    flex: 1;
    padding: 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

#newsletter-form button {
    padding: 0.6rem 1.5rem;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    font-size: 0.9rem;
}

#newsletter-form button:hover {
    background: var(--primary);
    color: var(--bg);
}

#form-message {
    margin-top: 0.5rem;
    color: var(--primary);
    font-size: 0.85rem;
}

/* Posts Page */
#all-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-bottom: 1rem;
}

#posts h2, #courses h2 {
    padding-top: 2rem;
}

/* Post Card */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.post-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.post-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.post-card .date {
    color: var(--secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.post-preview {
    font-size: 0.9rem;
}

/* Courses */
#courses-list {
    padding-bottom: 1rem;
}

.course-item {
    display: grid;
    grid-template-columns: 220px 1fr 160px;
    gap: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.course-item:hover {
    border-color: var(--primary);
}

.course-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--border);
}

.course-item .card-thumb {
    width: 220px;
    flex-shrink: 0;
}

.course-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.75rem;
    border-left: 1px solid var(--border);
    padding-left: 1.5rem;
}

.course-price {
    color: var(--third);
    font-size: 1.1rem;
    font-weight: bold;
}

.course-tag {
    font-size: 0.72rem;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.15rem 0.5rem;
    text-align: center;
    letter-spacing: 0.05em;
}

.course-stats {
    font-size: 0.78rem;
    color: var(--third);
    margin-top: 0.4rem;
}

.course-buy-btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    text-decoration: none;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.course-buy-btn:hover {
    background: var(--secondary);
    color: var(--bg);
}

.course-info h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.course-meta {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* About */
.about-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.contact-info h2 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin-bottom: 0.75rem;
}

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

.contact-info a:hover {
    text-decoration: underline;
}

/* Detail Pages */
#back-btn,
#back-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
    background: var(--surface);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: inherit;
}

#back-post-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
    background: var(--surface);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: inherit;
}

#back-btn:hover,
#back-post-btn:hover {
    background: var(--primary);
    color: var(--bg);
}

#course-content,
#post-content {
    background: var(--surface);
    padding: 2rem;
    border: 1px solid var(--border);
}

.course-detail-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    margin-bottom: 0;
    border: 1px solid var(--border);
}

.course-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--third);
}

.stats-buy-row {
    display: flex;
    justify-content: center;
}

.detail-stats-buy {
    margin-left: auto;
}

.detail-stats-buy-link {
    color: var(--secondary);
    text-decoration: none;
    border: 1px solid var(--secondary);
    padding: 0.3rem 0.9rem;
    transition: all 0.3s;
}

.detail-stats-buy-link:hover {
    background: var(--secondary);
    color: var(--bg);
}

#course-content h1,
#course-content h2,
#post-content h1,
#post-content h2 {
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

#course-content a,
#post-content a {
    color: var(--secondary);
}

#course-content a[href*="enroll"] {
    display: block;
    width: fit-content;
    margin: 1rem auto;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
    text-decoration: none;
    padding: 1rem 2rem;
    border: 2px solid var(--secondary);
    transition: all 0.3s;
    text-align: center;
}

#course-content a[href*="enroll"]:hover {
    background: var(--secondary);
    color: var(--bg);
}

.detail-buy-wrap {
    text-align: center;
    margin: 2rem 0 1rem;
}

.detail-buy-btn {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
    text-decoration: none;
    padding: 1rem 2rem;
    border: 2px solid var(--secondary);
    transition: all 0.3s;
}

.detail-buy-btn:hover {
    background: var(--secondary);
    color: var(--bg);
}

.detail-buy-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Tab System */
.tab-content {
    display: none !important;
    padding: 2rem 0;
}

.tab-content.active {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Non-home tabs: normal browser scroll */
#posts.active,
#courses.active,
#about.active,
#course-detail.active,
#post-detail.active {
    overflow-y: visible;
    flex: unset;
}

.tab-content h2 {
    color: var(--secondary);
}

/* Home Layout */
#home.active {
    display: grid !important;
    height: calc(100vh - 60px);
    grid-template-rows: minmax(100px, 20vh) 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
    overflow: hidden;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 768px) {
    /* Hamburger menu */
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-links.active {
        max-height: 300px;
        border-bottom: 2px solid var(--primary);
    }
    
    .nav-links a {
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .terminal-nav .container {
        position: relative;
    }
    
    /* Home page mobile */
    #home.active {
        grid-template-rows: auto auto !important;
        overflow-y: auto !important;
    }
    
    .hero h1 {
        font-size: 1.2rem;
        padding: 1rem 0;
    }
    
    .hero h1 .mobile-break {
        display: block;
    }
    
    .hero h1 .comma {
        display: none;
    }
    
    #home-courses-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .newsletter {
        padding: 1rem;
    }
    
    #newsletter-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    #newsletter-form input {
        width: 100%;
    }
    
    #newsletter-form button {
        width: 100%;
    }
    
    /* Posts page mobile */
    .post-card {
        padding: 1rem;
    }
    
    .post-card h3 {
        font-size: 0.95rem;
    }
    
    /* Courses mobile */
    .course-item,
    .about-content {
        grid-template-columns: 1fr;
    }

    .course-item .card-thumb {
        width: 100%;
    }

    .course-side {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 1rem;
    }

    .course-img {
        width: 100%;
        height: auto;
    }
    
    .profile-img {
        margin: 0 auto;
    }
    
    /* Course detail mobile */
    #course-content,
    #post-content {
        padding: 1rem;
    }
    
    #course-content h1,
    #post-content h1 {
        font-size: 1.3rem;
    }
    
    #course-content h2,
    #post-content h2 {
        font-size: 1.1rem;
    }
    
    #course-content a[href*="enroll"] {
        font-size: 1.2rem;
        padding: 0.75rem 1.5rem;
    }

    #back-btn {
        bottom: 4rem;
        right: 1rem;
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    #back-post-btn {
        bottom: 4rem;
        right: 1rem;
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .course-detail-stats {
        font-size: 0.8rem;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--border);
    color: var(--secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
}