@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ===========================
   DESIGN SYSTEM — PERSONAL SITE
   =========================== */

:root {
    --ambient-glow: linear-gradient(180deg, #18181c 0%, #101013 55%, #09090b 100%);

    /* Brand */
    --brand-primary: #a1a1aa;
    --brand-primary-light: rgba(161, 161, 170, 0.15);
    --brand-primary-hover-bg: rgba(161, 161, 170, 0.2);
    --brand-primary-hover: #d4d4d8;

    /* Surfaces */
    --bg-color: #101013;
    --bg-subtle: #141418;

    /* Cards */
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-bg-hover: rgba(255, 255, 255, 0.07);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(161, 161, 170, 0.4);

    /* Text */
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 24px rgba(161, 161, 170, 0.15);

    /* Typography */
    --font-heading: 'Outfit', 'DM Sans', 'Avenir Next', sans-serif;
    --font-body: 'DM Sans', 'Outfit', 'Avenir Next', sans-serif;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

[data-theme="light"] {
    --brand-primary: #52525b;
    --brand-primary-light: rgba(82, 82, 91, 0.1);
    --brand-primary-hover-bg: rgba(82, 82, 91, 0.15);
    --brand-primary-hover: #3f3f46;

    --bg-color: #ffffff;
    --bg-subtle: #f8f9fb;

    --card-bg: #ffffff;
    --card-bg-hover: #ffffff;
    --card-border: rgba(0, 0, 0, 0.08);
    --card-border-hover: rgba(82, 82, 91, 0.4);

    --text-color: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: rgba(0, 0, 0, 0.08);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 24px rgba(82, 82, 91, 0.1);
    --ambient-glow: var(--bg-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--ambient-glow);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    margin: 0;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 20px;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: calc(60px + 2rem);
}

/* --- Profile --- */
.profile {
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
}

.profile-image-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
    cursor: pointer;
    display: none;
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    padding: 0;
    background: var(--bg-color);
    box-shadow: var(--shadow-md);
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
}

.profile-image-wrapper:hover .profile-image {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
    border-color: var(--card-border-hover);
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    color: var(--text-color);
}

/* --- Tabs --- */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    width: fit-content;
    margin: 0 auto 2rem;
    padding: 0.35rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .tabs-container {
    background: #f4f5f7;
    border-color: #e5e7eb;
}

.tab-button {
    padding: 0.6rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    flex: 0 0 auto;
}

.tab-button:hover {
    color: var(--text-color);
    background: var(--card-bg-hover);
}

[data-theme="light"] .tab-button:hover {
    background: #ebedf0;
}

.tab-button.active {
    color: var(--text-color);
    background: var(--brand-primary-light);
    font-weight: 600;
}

[data-theme="light"] .tab-button.active {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--brand-primary);
    border-radius: 2px;
}

/* --- Links --- */
.links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.tab-panel[hidden] {
    display: none;
}

.about-panel {
    margin-bottom: 3rem;
}

.empty-state {
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    color: var(--text-secondary);
    text-align: center;
}

.link-item {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: transform var(--transition-slow), border-color var(--transition-fast), box-shadow var(--transition-slow);
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="light"] .link-item {
    box-shadow: var(--shadow-sm);
}

.link-item:nth-child(1) { animation-delay: 0.1s; }
.link-item:nth-child(2) { animation-delay: 0.18s; }
.link-item:nth-child(3) { animation-delay: 0.26s; }
.link-item:nth-child(4) { animation-delay: 0.34s; }
.link-item:nth-child(5) { animation-delay: 0.42s; }

.link-item:hover {
    transform: translateY(-3px);
    border-color: var(--card-border-hover);
    box-shadow: var(--shadow-glow);
}

.link-item:hover .link-icon {
    background: var(--brand-primary-hover-bg);
    transform: scale(1.05);
}

.link-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    background: var(--brand-primary-light);
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    transition: all var(--transition-fast);
}

.link-text {
    flex: 1;
}

.link-title {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.link-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.link-released {
    font-size: 0.8rem;
    color: var(--brand-primary);
    font-weight: 500;
    margin-top: 0.2rem;
}

/* --- Thumbnails --- */
.link-thumbnail {
    width: 110px;
    min-width: 110px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-slow);
}

.link-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.link-item:hover .link-thumbnail {
    border-color: var(--card-border-hover);
    transform: scale(1.02);
}

/* Film items with background thumbnails */
.link-item[data-category="film"] {
    position: relative;
    padding: 0;
    overflow: hidden;
    background: transparent;
    border-radius: var(--radius-xl);
}

.link-item[data-category="film"] .link-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-xl);
    border: none;
    z-index: 0;
}

.link-item[data-category="film"] .link-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(16, 16, 19, 0.55) 0%,
        rgba(16, 16, 19, 0.45) 50%,
        rgba(16, 16, 19, 0.7) 100%
    );
    z-index: 1;
}

[data-theme="light"] .link-item[data-category="film"] .link-thumbnail::after {
    background: linear-gradient(
        to bottom,
        rgba(16, 16, 19, 0.5) 0%,
        rgba(16, 16, 19, 0.4) 50%,
        rgba(16, 16, 19, 0.65) 100%
    );
}

.link-item[data-category="film"] .link-icon,
.link-item[data-category="film"] .link-text {
    position: relative;
    z-index: 2;
}

.link-item[data-category="film"] .link-text {
    flex: 1;
    padding: 1.25rem;
}

.link-item[data-category="film"] .link-icon {
    margin-left: 1.25rem;
}

.link-item[data-category="film"]:hover .link-thumbnail {
    transform: scale(1.03);
}

.link-item[data-category="film"]:hover .link-thumbnail::after {
    background: linear-gradient(
        to bottom,
        rgba(16, 16, 19, 0.45) 0%,
        rgba(16, 16, 19, 0.35) 50%,
        rgba(16, 16, 19, 0.6) 100%
    );
}

[data-theme="light"] .link-item[data-category="film"]:hover .link-thumbnail::after {
    background: linear-gradient(
        to bottom,
        rgba(16, 16, 19, 0.4) 0%,
        rgba(16, 16, 19, 0.3) 50%,
        rgba(16, 16, 19, 0.55) 100%
    );
}

/* Film cards always use light text regardless of theme */
.link-item[data-category="film"] .link-title,
.link-item[data-category="film"] .link-description,
.link-item[data-category="film"] .link-released {
    color: rgba(255, 255, 255, 0.95);
}

.link-item[data-category="film"] .link-description {
    color: rgba(255, 255, 255, 0.75);
}

.link-item[data-category="film"] .link-released {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.link-item[data-category="film"] .link-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.link-item[data-category="film"]:hover .link-icon {
    background: rgba(255, 255, 255, 0.25);
}

/* --- Social Links --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 0.75rem;
}

.social-link {
    color: var(--text-muted);
    font-size: 1.35rem;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.social-link:hover {
    color: var(--brand-primary);
    transform: translateY(-2px);
}

/* --- Nav --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: all var(--transition-base);
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Theme Toggle --- */
.theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    padding: 0;
    flex-shrink: 0;
}

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

[data-theme="light"] .theme-toggle:hover {
    background: #f0f1f3;
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    fill: var(--text-color);
}

.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .moon { display: inline-block; }

/* --- Animation --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .profile,
    .link-item {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* --- Media Queries --- */
@media (max-width: 768px) {
    .container {
        padding: 1rem 16px;
        padding-top: calc(60px + 1rem);
    }

    .profile-name {
        font-size: 1.85rem;
        padding: 0 1rem;
    }

    .profile-image-wrapper {
        width: 100px;
        height: 100px;
        margin-top: 1rem;
    }

    .links {
        gap: 0.6rem;
    }

    .link-item {
        padding: 1rem;
    }

    .link-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.05rem;
    }

    .link-title {
        font-size: 0.9rem;
    }

    .link-description {
        font-size: 0.82rem;
    }

    .link-item[data-category="film"] .link-text {
        padding: 1rem;
    }

    .link-item[data-category="film"] .link-icon {
        margin-left: 1rem;
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.05rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-link {
        font-size: 1.2rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .tabs-container {
        padding: 0.3rem;
        gap: 0.25rem;
    }

    .tab-button {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
        max-width: 120px;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 0.75rem 12px;
        padding-top: calc(60px + 0.75rem);
    }

    .profile-name {
        font-size: 1.65rem;
    }

    .profile-image-wrapper {
        width: 80px;
        height: 80px;
        margin-top: 0.75rem;
    }

    .link-item[data-category="film"] .link-text {
        padding: 0.875rem;
    }

    .link-item[data-category="film"] .link-icon {
        margin-left: 0.875rem;
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 1rem;
    }

    .social-links {
        gap: 0.85rem;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .container {
        padding-top: calc(60px + 1rem);
    }

    .profile-image-wrapper {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
        margin-top: 0.5rem;
    }

    .profile-name {
        font-size: 1.65rem;
        margin-bottom: 0.5rem;
    }

}
