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

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    --font-main: 'Outfit', sans-serif;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(129, 140, 248, 0.1) 0%, transparent 20%);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Header */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--card-border);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header-content .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

.header-row {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

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

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

section {
    margin-bottom: 6rem;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

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

/* Work Item Card */
.work-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.work-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(56, 189, 248, 0.3);
}

.work-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.work-item:hover img {
    transform: scale(1.1);
}

.work-item iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: none;
}

/* All iframes should be responsive */
iframe {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
}

.work-item p {
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2));
}

.work-item small {
    display: block;
    margin-top: 0.5rem;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Utility */
hr {
    border: 0;
    height: 1px;
    background: var(--card-border);
    margin: 4rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
}

/* Responsive */
@media (max-width: 768px) {
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    main {
        padding: 2rem 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    body > main {
        max-width: 100% !important;
        width: 100% !important;
    }

    section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Force responsive video and iframe on mobile */
    video,
    video#responsiveVideo,
    main video,
    section video,
    .work-detail video {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    iframe,
    iframe[title*="YouTube"],
    .work-item iframe,
    main iframe,
    section iframe,
    .work-detail iframe {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    .work-detail {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
    }

    .work-detail video,
    .work-detail iframe {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
    }
}

/* Video Responsive Styles */
video {
    max-width: 100%;
    height: auto;
    width: 100% !important;
    display: block;
}

.work-detail video {
    max-width: 100%;
    width: 100% !important;
    height: auto;
    display: block;
}

/* YouTube iframe Responsive */
iframe[title*="YouTube"] {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.work-item {
    animation: fadeIn 0.6s ease-out backwards;
}

.work-item:nth-child(1) {
    animation-delay: 0.1s;
}

.work-item:nth-child(2) {
    animation-delay: 0.2s;
}

.work-item:nth-child(3) {
    animation-delay: 0.3s;
}

.work-item:nth-child(4) {
    animation-delay: 0.4s;
}

.work-item:nth-child(5) {
    animation-delay: 0.5s;
}

.work-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Global Navigation */
.global-nav a {
    color: var(--text-secondary);
    padding-bottom: 0.2rem;
    border-bottom: 2px solid transparent;
}

.global-nav a:hover {
    color: var(--text-primary);
    border-bottom-color: rgba(148, 163, 184, 0.6);
}

.global-nav a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Social Links */
.social-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-links a {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.social-links a:hover {
    background: var(--accent-gradient);
    color: #0f172a;
    border-color: rgba(56, 189, 248, 0.6);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .header-row {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* About Page */
.about-section {
    max-width: 900px;
    margin: 0 auto 4rem auto;
}

.about-hero {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}

.about-avatar img {
    width: 100%;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    object-fit: cover;
}

.about-name {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-hero-text h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.about-lead {
    color: var(--text-secondary);
    font-size: 1rem;
}

.about-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    margin-bottom: 0.8rem;
}

.about-label::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--accent-gradient);
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
}

.about-block h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.about-block p {
    color: var(--text-secondary);
}

.about-block p .profile-name,
.profile-name {
    font-size: 1.5rem !important;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.about-list {
    list-style: none;
    margin-top: 0.5rem;
}

.about-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
}

.about-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.about-note {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.about-timeline {
    list-style: none;
    margin-top: 1.5rem;
    border-left: 1px solid var(--card-border);
    padding-left: 1.5rem;
}

.about-timeline li {
    margin-bottom: 1.5rem;
    position: relative;
}

.about-timeline li::before {
    content: '';
    position: absolute;
    left: -0.55rem;
    top: 0.2rem;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent-gradient);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

.about-year {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.4rem;
}

.about-timeline-body p {
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .about-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-block p .profile-name,
    .profile-name {
        font-size: 1.5rem !important;
    }
}