/* ===== CSS Variables / Theme ===== */
:root {
    --bg: #171717;
    --text: #fbfbfb;
    --text-secondary: #888;
    --border: #333;
    --nav-bg: #171717;
    --hover: #222;
    --link: #ccc;
    --link-hover: #fff;
    --card-bg: #1e1e1e;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --accent: #6ee7b7;
    --accent-dim: rgba(110, 231, 183, 0.1);
    --accent-border: rgba(110, 231, 183, 0.3);
}

[data-theme="light"] {
    --bg: #f8f8f8;
    --text: #111;
    --text-secondary: #666;
    --border: #ddd;
    --nav-bg: #f8f8f8;
    --hover: #eee;
    --link: #444;
    --link-hover: #000;
    --card-bg: #fff;
    --card-shadow: rgba(0, 0, 0, 0.15);
    --accent: #059669;
    --accent-dim: rgba(5, 150, 105, 0.08);
    --accent-border: rgba(5, 150, 105, 0.25);
}

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

body {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* ===== Navigation ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    position: sticky;
    top: 0;
    background-color: var(--nav-bg);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    padding: 4px 0;
}

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

.nav-link.active {
    border-bottom: 1.5px solid var(--text);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background-color 0.2s;
    line-height: 1;
}

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

/* ===== Hero Section ===== */
.hero {
    width: 100%;
}

.image-container {
    position: relative;
}

.image-container > img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center;
    transform: scaleX(-1);
}

.text-container {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    background: rgba(23, 23, 23, 0.92);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--card-shadow);
    border: 1px solid var(--border);
    z-index: 3;
    transition: background-color 0.3s, border-color 0.3s;
}

[data-theme="light"] .text-container {
    background: rgba(255, 255, 255, 0.92);
}

.text-container h1 {
    margin-bottom: 10px;
    font-size: 28px;
    color: var(--text);
}

.text-container p {
    line-height: 1.8;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== Record Player ===== */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.record-player {
    position: absolute;
    top: 15%;
    left: 8%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: rotate 5s linear infinite;
}

.record-player img {
    width: 110%;
    height: 110%;
    transform: translate(-50%, -50%);
    position: absolute;
    top: 50%;
    left: 50%;
    object-fit: cover;
}

/* ===== Playlists Section ===== */
.playlists-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 0;
}

.playlists-title {
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.playlists-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.playlist-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s;
}

.playlist-card:hover {
    border-color: var(--accent-border);
}

.playlist-card h3 {
    font-size: 14px;
    margin-bottom: 14px;
    color: var(--text);
}

@media screen and (max-width: 768px) {
    .playlists-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Posts Section ===== */
.posts-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.posts-title {
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ===== View Toggle ===== */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.view-toggle button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-toggle button:hover {
    color: var(--text);
}

.view-toggle button.active {
    background: var(--accent-dim);
    color: var(--accent);
}

/* ===== Shared Post Elements ===== */
.tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent);
}

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

.post-title {
    font-size: 15px;
    margin: 6px 0;
    line-height: 1.4;
    color: var(--text);
}

.post-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Grid View ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.grid-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-2px);
}

.grid-cover {
    width: 100%;
    aspect-ratio: 1;
    background: #2a2a2a;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
}

.grid-body {
    padding: 16px;
}

.grid-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.grid-body .post-title {
    font-size: 14px;
}

.grid-body .post-excerpt {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== List View ===== */
.posts-list {
    display: flex;
    flex-direction: column;
}

.list-post {
    display: flex;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
}

.list-post:first-child {
    padding-top: 0;
}

.list-post:last-child {
    border-bottom: none;
}

.list-cover {
    width: 130px;
    height: 130px;
    min-width: 130px;
    background: #2a2a2a;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
}

.list-body {
    flex: 1;
}

.list-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 4px;
}

.list-body .post-title {
    font-size: 16px;
}

/* ===== Responsive ===== */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 16px 20px;
    }

    .nav-links {
        gap: 16px;
    }

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

    .record-player {
        width: 100px;
        height: 100px;
        top: 20%;
        left: 10%;
    }

    .text-container {
        position: relative;
        margin: 20px auto;
        width: 90%;
        padding: 20px;
        left: auto;
        transform: none;
        bottom: auto;
    }

    .text-container h1 {
        font-size: 22px;
    }

    .text-container p {
        font-size: 13px;
    }

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

    .list-post {
        flex-direction: column;
        gap: 12px;
    }

    .list-cover {
        width: 100%;
        height: 200px;
    }
}

@media screen and (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

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

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

    .record-player {
        width: 80px;
        height: 80px;
    }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    .record-player {
        width: 120px;
        height: 120px;
        top: 20%;
        left: 5%;
    }

    .text-container {
        bottom: 20px;
        padding: 15px;
    }
}
