/* ===== Theme Variables ===== */
:root {
    --bg: #1a1a1a;
    --bg-panel: #1a1a1a;
    --text: #bfbfbf;
    --text-heading: #e5e5e5;
    --text-bio: #b0b0b0;
    --text-highlight: #c9c9c9;
    --text-social: #b0b0b0;
    --text-social-hover: #e5e5e5;
    --text-separator: #777;
    --text-btn: #bfbfbf;
    --text-btn-hover: #e5e5e5;
    --text-back: #b0b0b0;
    --text-back-hover: #e5e5e5;
    --text-section: #666;
    --text-desc: #909090;
    --accent: #e5e5e5;
    --accent-hover: #ffffff;
    --border: #333;
    --border-hover: #555;
    --border-panel: #2a2a2a;
    --btn-bg-hover: rgba(255, 255, 255, 0.03);
    --social-underline: #444;
    --social-underline-hover: #888;
    --scrollbar: #333;
    --scrollbar-hover: #444;
}

[data-theme="light"] {
    --bg: #f5f5f0;
    --bg-panel: #f5f5f0;
    --text: #4a4a4a;
    --text-heading: #1a1a1a;
    --text-bio: #555555;
    --text-highlight: #1a1a1a;
    --text-social: #555555;
    --text-social-hover: #1a1a1a;
    --text-separator: #aaa;
    --text-btn: #4a4a4a;
    --text-btn-hover: #1a1a1a;
    --text-back: #555555;
    --text-back-hover: #1a1a1a;
    --text-section: #888;
    --text-desc: #777;
    --accent: #1a1a1a;
    --accent-hover: #000000;
    --border: #d5d5d0;
    --border-hover: #bbb;
    --border-panel: #e0e0db;
    --btn-bg-hover: rgba(0, 0, 0, 0.04);
    --social-underline: #ccc;
    --social-underline-hover: #888;
    --scrollbar: #ccc;
    --scrollbar-hover: #bbb;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    transition: background-color 0.4s ease, color 0.4s ease;
    cursor: none;
}

/* ===== Custom Cursor ===== */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: rgba(80, 80, 80, 0.7);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
}

.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(80, 80, 80, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
}

/* Cursor hover state */
.cursor-dot.hovering {
    width: 12px;
    height: 12px;
}

.cursor-ring.hovering {
    width: 48px;
    height: 48px;
    border-color: rgba(80, 80, 80, 0.6);
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }

    body,
    a,
    button {
        cursor: auto !important;
    }
}

/* cursor: none on all interactive elements (desktop) */
a, button, .social-link, .view-work-btn, .back-btn, .theme-toggle, .work-item-name {
    cursor: none;
}

/* ===== Layout ===== */
.layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 100;
    background: var(--border);
    border: 1px solid var(--border-panel);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
}

.theme-toggle:hover {
    background: var(--border-hover);
    transform: rotate(30deg);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: none;
}

/* ===== Hero Panel (Left) ===== */
.hero-panel {
    width: 100%;
    min-width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: min-width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 60px 20px;
}

.hero-panel.shrink {
    width: 50%;
    min-width: 50%;
    filter: blur(4px);
    opacity: 0.4;
    pointer-events: none;
}

.hero-content {
    max-width: 520px;
    width: 100%;
    padding-top: 40px;
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* ===== Profile Image ===== */
.profile-image-wrapper {
    width: 220px;
    height: 190px;
    margin-bottom: 28px;
    overflow: hidden;
    border-radius: 4px;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 85%;
    filter: grayscale(0%);
    transition: filter 0.4s ease, transform 0.4s ease;
}

.profile-image:hover {
    filter: grayscale(0%);
    transform: scale(1.02);
}

/* ===== Name ===== */
.name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    line-height: 1.2;
    transition: color 0.4s ease;
}

/* ===== Bio ===== */
.bio {
    margin-bottom: 28px;
}

.bio p {
    margin-bottom: 18px;
    color: var(--text-bio);
    font-size: 14.5px;
    line-height: 1.75;
    transition: color 0.4s ease;
}

.bio p:last-child {
    margin-bottom: 0;
}

.highlight {
    color: var(--text-highlight);
    font-weight: 500;
    transition: color 0.4s ease;
}

/* ===== Social Links ===== */
.social-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.social-link {
    color: var(--text-social);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--social-underline);
}

.social-link:hover {
    color: var(--text-social-hover);
    text-decoration-color: var(--social-underline-hover);
}

.social-separator {
    color: var(--text-separator);
    font-size: 14px;
    user-select: none;
}

/* ===== View Work Button ===== */
.view-work-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-btn);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}

.view-work-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-btn-hover);
    background: var(--btn-bg-hover);
}

.view-work-btn .arrow-icon {
    transition: transform 0.25s ease;
}

.view-work-btn:hover .arrow-icon {
    transform: translateX(3px);
}

/* ===== Work Panel (Right) ===== */
.work-panel {
    width: 0;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-panel);
    transition: min-width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.4s ease;
    opacity: 0;
}

.work-panel.show {
    width: 50%;
    min-width: 50%;
    opacity: 1;
}

.work-content {
    padding: 60px 50px 60px 60px;
    max-width: 600px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}

.work-panel.show .work-content {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Back Button ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-back);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 40px;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: var(--text-back-hover);
}

.back-btn svg {
    transition: transform 0.2s ease;
}

.back-btn:hover svg {
    transform: translateX(-3px);
}

/* ===== Work Section ===== */
.work-section {
    margin-bottom: 36px;
}

.section-title {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-section);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
    transition: color 0.4s ease;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-panel);
    margin: 32px 0;
}

/* ===== Work Items ===== */
.work-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.work-item {
    font-size: 14.5px;
    line-height: 1.6;
    transition: transform 0.2s ease;
}

.work-item:hover {
    transform: translateX(2px);
}

.work-item-name {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    display: inline;
}

.work-item-name::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 0;
    height: 1.5px;
    background: var(--accent-hover);
    transition: width 0.3s ease;
}

.work-item-name:hover {
    color: var(--accent-hover);
}

.work-item-name:hover::after {
    width: 100%;
}

.pr-merged-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    flex-shrink: 0;
}

.work-item-desc {
    color: var(--text-desc);
    font-size: 14px;
    transition: color 0.4s ease;
}

.cooking-text {
    color: var(--text-desc);
    font-size: 14px;
    font-style: italic;
    transition: color 0.4s ease;
}

/* ===== Scrollbar ===== */
.work-panel::-webkit-scrollbar,
.hero-panel::-webkit-scrollbar {
    width: 6px;
}

.work-panel::-webkit-scrollbar-track,
.hero-panel::-webkit-scrollbar-track {
    background: transparent;
}

.work-panel::-webkit-scrollbar-thumb,
.hero-panel::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: 3px;
}

.work-panel::-webkit-scrollbar-thumb:hover,
.hero-panel::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

/* ===== Page Load Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 0.7s ease forwards;
}

.profile-image-wrapper {
    animation: fadeInUp 0.7s ease 0.1s forwards;
    opacity: 0;
}

.name {
    animation: fadeInUp 0.7s ease 0.2s forwards;
    opacity: 0;
}

.bio {
    animation: fadeInUp 0.7s ease 0.3s forwards;
    opacity: 0;
}

.social-links {
    animation: fadeInUp 0.7s ease 0.4s forwards;
    opacity: 0;
}

.view-work-btn {
    animation: fadeInUp 0.7s ease 0.5s forwards;
    opacity: 0;
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 900px) {
    body {
        overflow: hidden;
        height: 100vh;
    }

    .layout {
        position: relative;
        flex-direction: column;
        overflow: hidden;
    }

    /* Hero panel: full screen, scrollable */
    .hero-panel {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        min-width: 100% !important;
        height: 100vh;
        padding: 50px 28px 40px;
        align-items: flex-start;
        overflow-y: auto;
        z-index: 2;
        transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
    }

    .hero-panel.shrink {
        width: 100% !important;
        min-width: 100% !important;
        opacity: 0;
        filter: none;
        pointer-events: none;
        transform: translateX(-30px);
    }

    .hero-content {
        max-width: 100%;
        padding-top: 20px;
    }

    /* Profile image: mobile */
    .profile-image-wrapper {
        width: 65%;
        max-width: 260px;
        height: 170px;
        margin-top: 20px;
    }

    /* Work panel: full screen overlay */
    .work-panel {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        min-width: 100% !important;
        height: 100vh;
        border-left: none;
        z-index: 3;
        background: var(--bg);
        overflow-y: auto;
        transition: opacity 0.4s ease, transform 0.4s ease;
        transform: translateX(30px);
        pointer-events: none;
    }

    .work-panel.show {
        width: 100% !important;
        min-width: 100% !important;
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .work-content {
        padding: 50px 24px 60px;
        max-width: 100%;
    }

    /* Back button */
    .back-btn {
        margin-bottom: 32px;
    }

    /* Theme toggle */
    .theme-toggle {
        top: 14px;
        right: 16px;
        width: 36px;
        height: 36px;
        z-index: 10;
    }

    /* Section title */
    .section-title {
        font-size: 11px;
        margin-bottom: 14px;
    }

    /* Work items spacing */
    .work-items {
        gap: 14px;
    }

    .work-item {
        font-size: 15px;
        line-height: 1.65;
    }

    .work-item-desc {
        font-size: 14px;
    }

    .work-section {
        margin-bottom: 32px;
    }
}

/* ===== Responsive: Small Mobile ===== */
@media (max-width: 480px) {
    .hero-panel {
        padding: 44px 20px 36px;
    }

    .hero-content {
        padding-top: 16px;
    }

    .name {
        font-size: 21px;
        margin-bottom: 20px;
    }

    .bio p {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 16px;
    }

    .profile-image-wrapper {
        width: 60%;
        max-width: 220px;
        height: 150px;
        margin-bottom: 20px;
    }

    .social-links {
        margin-bottom: 24px;
    }

    .social-link {
        font-size: 13.5px;
    }

    .view-work-btn {
        font-size: 13.5px;
        padding: 9px 18px;
    }

    .work-content {
        padding: 44px 20px 50px;
    }

    .back-btn {
        font-size: 13.5px;
        margin-bottom: 28px;
    }

    .work-item {
        font-size: 14.5px;
    }

    .work-item-desc {
        font-size: 13.5px;
    }

    .cooking-text {
        font-size: 13.5px;
    }

    .theme-toggle {
        top: 12px;
        right: 14px;
        width: 34px;
        height: 34px;
    }

    .theme-toggle svg {
        width: 16px;
        height: 16px;
    }
}

