/* index.html 전용 스타일: 히어로 / 약력 요약 / 포트폴리오 요약 */

body {
    display: flex;
    flex-direction: column;
}

.page-grid {
    display: grid;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background:
        radial-gradient(circle at 12% 14%, rgba(0, 255, 65, 0.1), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(85, 105, 255, 0.12), transparent 32%),
        linear-gradient(135deg, var(--bg-1) 0%, var(--surface-violet) 48%, var(--surface-blue) 100%);
    /* minmax(0, ...)가 없으면 fr 트랙이 자식(포트폴리오 카드 등)의
       콘텐츠 최대 폭까지 늘어나며 좁은 화면에서 레이아웃이 깨진다 */
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
        "hero career"
        "portfolio portfolio";
    min-height: 100vh;
}

/* ===== 좌상단: 히어로 영역 ===== */
/* 얼굴 로고, 소개 문구, 기술 링크에 적용 */
.hero-panel {
    grid-area: hero;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 2rem 1rem;
}

.hero-panel::before {
    content: '';
    position: absolute;
    width: 72%;
    aspect-ratio: 1;
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 50%;
    box-shadow: 0 0 55px rgba(0, 255, 65, 0.12), inset 0 0 35px rgba(0, 255, 65, 0.06);
    pointer-events: none;
}

.hero-panel::after {
    content: '';
    position: absolute;
    inset: 12%;
    background: repeating-linear-gradient(90deg, transparent 0 28px, rgba(0, 255, 65, 0.035) 29px 30px);
    opacity: 0.6;
    pointer-events: none;
}

.face-container {
    position: relative;
    z-index: 1;
    font-size: clamp(3rem, 9vw, 7rem);
    font-weight: 700;
    text-shadow:
        0 0 10px #00ff41,
        0 0 20px #00ff41,
        0 0 40px #00ff41;
    user-select: none;
    letter-spacing: 0.1em;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.face-container:focus-visible {
    outline: 1px solid var(--accent-green);
    outline-offset: 0.35rem;
    border-radius: 0.25rem;
}

.face {
    position: relative;
}

.eye {
    position: relative;
    display: inline-block;
}

.eyeball {
    position: absolute;
    width: 40%;
    height: 40%;
    background: #ff4444;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-60%, -50%);
    transition: all 0.1s ease;
    box-shadow:
        0 0 10px #ff4444,
        inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.highlight {
    position: absolute;
    width: 30%;
    height: 30%;
    background: #ffffff;
    border-radius: 50%;
    top: 40%;
    left: 30%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    transform: translate(0, 0);
    transition: all 0.1s ease;
}

.matrix-hair {
    position: absolute;
    top: -100%;
    left: 20%;
    width: 54%;
    height: 120%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.hair-stream {
    position: absolute;
    color: #00ff41;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    line-height: 0.6;
    opacity: 0.8;
    animation: streamFall linear infinite;
    text-shadow: 0 0 8px #00ff41;
    white-space: pre-line;
    width: 0.8rem;
    text-align: center;
}

.hair-stream.bright {
    color: #ffffff;
    text-shadow: 0 0 15px #00ff41;
    opacity: 1;
}

.hair-stream.special {
    color: #00ffff;
    text-shadow: 0 0 12px #00ffff;
}

@keyframes streamFall {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.subtitle {
    position: relative;
    z-index: 1;
    margin-top: 0.8rem;
    font-size: clamp(0.95rem, 1.5vw, 1.0rem);
    line-height: 1.45;
    color: var(--text-dim);
    text-align: center;
    opacity: 0;
    animation: fadeInUp 2s ease 1s forwards;
}

.code-line {
    opacity: 0;
    animation: typewriter 1s ease forwards;
}

.code-line:nth-child(1) {
    animation-delay: 2s;
}

.code-line:nth-child(2) {
    animation-delay: 2.5s;
}

.code-line:nth-child(3) {
    animation-delay: 3s;
}

.code-line:nth-child(4) {
    animation-delay: 3.5s;
}

.code-line:nth-child(5) {
    animation-delay: 4s;
}

.code-line:nth-child(6) {
    animation-delay: 4.5s;
}

/* 히어로 문구의 각 줄은 PyPI/GitHub 페이지로 연결된다 (새 탭) */
.code-line a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.code-line a:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes typewriter {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

/* ===== 우상단: 경력 패널 ===== */
/* career.json의 lead, timeline, skills가 표시되는 약력 요약 본문 */
.career-panel {
    grid-area: career;
    padding: 3.8rem 1.8rem 0.6rem;
    border-left: 1px solid rgba(122, 138, 205, 0.26);
    background: linear-gradient(180deg, rgba(22, 26, 54, 0.18), rgba(12, 14, 28, 0.06));
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    justify-content: flex-start;
}

.career-panel h2 {
    font-size: 1.0rem;
    color: var(--accent-green);
    letter-spacing: 0.05em;
}

.career-panel .lead {
    font-size: 1.0rem;
    color: var(--text-dim);
    line-height: 1.45;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.timeline-item {
    position: relative;
    border-left: 2px solid var(--accent-green);
    padding-left: 0.9rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.34rem;
    top: 0.22rem;
    width: 0.42rem;
    height: 0.42rem;
    border: 2px solid var(--accent-green);
    border-radius: 50%;
    background: var(--surface-blue);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.45);
}

.timeline-period {
    font-size: 0.95rem;
    color: var(--accent-blue-text);
}

.timeline-role {
    font-size: 1.18rem;
    color: #ddd;
    margin-top: 0.1rem;
}

.timeline-desc {
    font-size: 1.02rem;
    color: var(--text-dimmer);
    margin-top: 0.1rem;
    line-height: 1.4;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-tag {
    font-size: 0.7rem;
    color: var(--accent-cyan);
    border: 1px solid var(--border-dim);
    border-radius: 3px;
    padding: 0.15rem 0.45rem;
    background: rgba(0, 255, 255, 0.04);
}

.career-more {
    font-size: 1.02rem;
    color: var(--accent-blue-text);
    text-decoration: none;
    align-self: flex-start;
    border-bottom: 1px dashed var(--accent-blue);
}

/* ===== 하단: 포트폴리오 스크롤 스트립 ===== */
/* manifest.json 카드가 #portfolioStrip에 가로로 표시되는 영역 */
.portfolio-section {
    grid-area: portfolio;
    border-top: 1px solid rgba(122, 138, 205, 0.26);
    background: linear-gradient(180deg, rgba(7, 9, 20, 0.24), transparent);
    padding: 0.5rem 1.5rem 0.8rem;
}

.portfolio-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.35rem;
}

.portfolio-section-head h2 {
    font-size: 0.95rem;
    color: var(--accent-green);
    letter-spacing: 0.05em;
}

.portfolio-section-head a {
    font-size: 0.95rem;
    color: var(--accent-blue-text);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-blue);
}

.portfolio-section {
    /* grid 트랙이 카드 전체 폭만큼 늘어나지 않도록 명시적으로 차단 */
    min-width: 0;
}

#portfolioStrip {
    display: flex;
    gap: 1.2rem;
    min-width: 0;
    overflow-x: auto;
    /* JS에서 requestAnimationFrame으로 직접 easing을 주므로 브라우저 기본 smooth는 끔 */
    scroll-behavior: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}

#portfolioStrip::-webkit-scrollbar {
    height: 6px;
}

#portfolioStrip::-webkit-scrollbar-thumb {
    background: var(--border-dim);
    border-radius: 3px;
}

/* 포트폴리오 카드 크기 (첫 화면 1줄 안정적 표시) */
#portfolioStrip .proj-card {
    width: 440px;
}

#portfolioStrip .proj-thumb {
    height: 110px;
}

#portfolioStrip .proj-emoji {
    font-size: 2.8rem;
}

@media (min-width: 901px) {
    .page-grid {
        grid-template-columns: 380px minmax(0, 1fr);
    }

    .face-container {
        font-size: 3.8rem;
    }

    .career-panel {
        padding-top: 3.8rem;
    }
}

/* 화면 폭 900px 이하: 히어로와 약력 영역을 세로 배치 */
@media (max-width: 900px) {
    .page-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "hero"
            "career"
            "portfolio";
    }

    .career-panel {
        border-left: none;
        border-top: 1px solid var(--border-dim);
        padding: 1.5rem 1.2rem;
        gap: 1.2rem;
    }

    .hero-panel {
        min-height: 38vh;
        padding: 2rem 1rem 1.5rem;
    }
}

/* 소개글 한 줄이 너무 길어지지 않도록 읽기 좋은 폭(약 70자)으로 제한 */
.career-panel .lead {
    max-width: 110ch;
}

.timeline {
    max-width: 62rem;
}

.timeline-desc {
    font-size: 0.72rem;
}

.portfolio-section {
    padding-bottom: 1.4rem;
}

@media (min-width: 1600px) {
    .page-grid {
        grid-template-columns: 380px minmax(0, 1fr);
    }

    .face-container {
        font-size: 5.2rem;
    }

    .career-panel {
        padding: 3.8rem 2.5rem 0.8rem;
        gap: 0.55rem;
    }

    .timeline {
        gap: 0.55rem;
    }

    #portfolioStrip .proj-card {
        width: 440px;
    }

    #portfolioStrip .proj-thumb {
        height: 110px;
    }
}
