/* Variables */
:root {
    --bg-color: #0a0a0a;
    --text-color: #f0f0f0;
    --text-muted: #888;
    --accent-color: #fff;
    --card-bg: #1a1a1a;
    --card-hover: #252525;
    --transition-duration: 0.4s;
    --cursor-size: 20px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: default;
}

/* Cursor Follower */
.cursor-follower {
    position: fixed;
    width: var(--cursor-size);
    height: var(--cursor-size);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    mix-blend-mode: difference;
}

.cursor-follower.hover {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Container */
.main-container {
    min-height: 100vh;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Header */
.header {
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.logo {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* Elements Section */
.elements-section {
    margin-bottom: 4rem;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Element Card */
.element-card {
    position: relative;
    aspect-ratio: 4/3;
    background-color: var(--card-bg);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-duration) ease;
}

.element-card:hover {
    transform: translateY(-8px);
}

.element-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    transition: filter var(--transition-duration) ease;
}

.element-card:hover .element-card-image {
    filter: grayscale(0%);
}

.element-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--transition-duration) ease;
}

.element-card:hover .element-card-overlay {
    transform: translateY(0);
    opacity: 1;
}

.element-card-number {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.element-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.element-card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Footer */
.footer {
    padding: 2rem 0;
    border-top: 1px solid #222;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Detail Overlay */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow-y: auto;
}

.detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

.close-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.detail-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.5s ease 0.2s;
}

.detail-overlay.active .detail-content {
    transform: translateY(0);
    opacity: 1;
}

.detail-header {
    margin-bottom: 3rem;
}

.detail-number {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.detail-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.detail-image {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    margin-bottom: 3rem;
}

.detail-body {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
}

.detail-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.detail-info p {
    margin-bottom: 0.5rem;
}

.detail-description {
    font-size: 1.1rem;
    line-height: 1.8;
}

.detail-description h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.detail-description p {
    margin-bottom: 1rem;
}

.detail-description ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.detail-description li {
    margin-bottom: 0.5rem;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 2px solid var(--card-bg);
    border-top-color: var(--text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .header {
        margin-bottom: 2rem;
        padding-top: 1rem;
    }

    .elements-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .element-card-overlay {
        opacity: 1;
        transform: translateY(0);
    }

    .detail-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .close-btn {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .detail-content {
        padding: 5rem 1rem 2rem;
    }

    .cursor-follower {
        display: none;
    }

    body {
        cursor: auto;
    }
}

/* Page transition */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
