@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');

:root {
    --primary-color: #4EA685;
    --secondary-color: #57B894;
    --black: #000000;
    --white: #ffffff;
    --gray: #efefef;
    --gray-2: #757575;
    --github-color: #24292f;
    --slide-ease: 1s ease-in-out;
}

* {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100vh;
    height: 100%;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--white);
}

.container {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* ── 녹색 그라데이션: Live=오른쪽·↖ 대각선 / GitHub=왼쪽·↘ 대각선 ── */
.split-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 55%;
    z-index: 1;
    box-shadow: rgba(0, 0, 0, 0.2) 0 4px 20px;
    transition:
        left var(--slide-ease),
        right var(--slide-ease),
        background-image var(--slide-ease),
        border-radius var(--slide-ease);
    pointer-events: none;
}

/* Live: 오른쪽 절반 — 그라데이션 오른쪽 → 왼쪽 대각선 (↖) */
.container.sign-in .split-bg {
    left: 45%;
    right: 0;
    background-image: linear-gradient(
        225deg,
        var(--primary-color) 0%,
        var(--secondary-color) 55%,
        var(--secondary-color) 100%
    );
    border-top-left-radius: max(48vw, 48vh);
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
}

/* GitHub: 왼쪽 절반 — 그라데이션 왼쪽 → 오른쪽 대각선 (↘) */
.container.sign-up .split-bg {
    left: 0;
    right: 45%;
    background-image: linear-gradient(
        45deg,
        var(--primary-color) 0%,
        var(--secondary-color) 55%,
        var(--secondary-color) 100%
    );
    border-bottom-right-radius: max(48vw, 48vh);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
}

/* ── 흰 패널: Live=왼쪽 / GitHub=오른쪽 ── */
.panel-side {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 3;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: left var(--slide-ease), right var(--slide-ease);
}

.container.sign-in .panel-side {
    left: 0;
    right: 50%;
}

.container.sign-up .panel-side {
    left: 50%;
    right: 0;
}

.panel-content {
    width: 100%;
    max-width: 34rem;
    padding: clamp(2.5rem, 8vh, 4rem) clamp(1.5rem, 5vw, 2.75rem) 5.5rem;
    max-height: 100vh;
    overflow-y: auto;
    text-align: left;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.hub-section[hidden] {
    display: none !important;
}

.hub-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.hub-section .subtitle {
    font-size: 0.75rem;
    color: var(--gray-2);
    margin-bottom: 0.85rem;
}

.hub-section .subtitle a {
    color: var(--primary-color);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: min(52vh, 420px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.project-list::-webkit-scrollbar {
    width: 5px;
}

.project-list::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.project-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--gray);
    color: var(--black);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-align: left;
}

.project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 166, 133, 0.35);
    background: #e8f5ef;
}

.project-btn .info {
    flex: 1;
    min-width: 0;
}

.project-btn .name {
    font-weight: 600;
    font-size: 0.88rem;
    display: block;
}

.project-btn .desc {
    font-size: 0.66rem;
    color: var(--gray-2);
    display: block;
    margin-top: 0.12rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-btn .badge {
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: var(--white);
    text-transform: uppercase;
}

.project-btn .badge.github {
    background: var(--github-color);
}

/* ── Deploy / Source (녹색 영역 위) ── */
.hero-side {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.hero-side--deploy {
    left: 50%;
    right: 0;
}

.hero-side--source {
    left: 0;
    right: 50%;
}

.hero-side[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
}

.hero-side[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.hero-text {
    color: var(--white);
    text-align: center;
    max-width: 22rem;
}

.hero-text h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-text p {
    font-weight: 500;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    line-height: 1.55;
}

/* ── 하단 Live / GitHub 토글 ── */
.mode-toggle {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 0.35rem;
    pointer-events: auto;
    padding: 0.35rem;
    border-radius: 2.5rem;
    background: rgba(30, 50, 40, 0.55);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.mode-btn {
    padding: 0.5rem 1.4rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.mode-btn--ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border-color: transparent;
}

.mode-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.mode-btn--solid {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
}

.mode-btn--solid:hover {
    background: #f0faf5;
    color: var(--secondary-color);
    transform: translateY(-1px);
}

@media only screen and (max-width: 1024px) {
    .hero-text h2 {
        font-size: 2rem;
    }

    .project-list {
        max-height: min(45vh, 360px);
    }
}

@media only screen and (max-width: 768px) {
    .split-bg {
        top: 0;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        height: 28vh;
        bottom: auto;
        border-radius: 0 0 1.5rem 1.5rem;
    }

    .hero-side {
        width: 100%;
        height: 28vh;
        left: 0 !important;
        right: 0 !important;
        padding: 1rem;
    }

    .hero-text h2 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .hero-text p {
        display: none;
    }

    .panel-side {
        top: 24vh;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        min-height: calc(100vh - 24vh);
        border-top-left-radius: 1.5rem;
        border-top-right-radius: 1.5rem;
    }

    .panel-content {
        max-height: none;
        padding: 1.25rem 1rem 5rem;
    }

    .project-list {
        max-height: none;
        overflow: visible;
    }

    .mode-toggle {
        bottom: 1rem;
    }
}

@media only screen and (max-width: 425px) {
    .project-btn .desc {
        display: none;
    }

    .hub-section h2 {
        font-size: 1.25rem;
    }
}
