/* ================ VARIABLES =============== */

:root {
    --color-primary: #2ee6a6;
    --color-text: #f5f5f5;
    --color-bg: #0f0f0f;
    --color-subtext: #b5b5b5;
    --color-card: #111111;
    --color-border: #1f1f1f;
    --color-border-strong: #2a2a2a;
}

/* ================ GLOBAL =============== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

strong {
    color: var(--color-text);
    font-weight: 600;
}

/* ================ Hero Section =============== */

.hero {
    min-height: 100vh;
    padding: 120px 32px;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-container {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.hero-text {
    max-width: 560px;
}

.hero-intro {
    margin-bottom: 16px;
    font-size: 0.85rem;
    letter-spacing: 0.24em;
    color: var(--color-primary);
}

.hero-title {
    margin-bottom: 20px;
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.1;
}

.hero-subtitle {
    margin-bottom: 20px;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    font-weight: 500;
    line-height: 1.6;
    color: var(--color-text);
}

.hero-description {
    max-width: 520px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-subtext);
}

.hero-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.hero-email {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 0.95rem;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.hero-link {
    font-size: 0.95rem;
    color: var(--color-subtext);
    transition: color 0.2s ease;
}

.hero-link:hover {
    color: var(--color-primary);
}

.hero-divider {
    color: #444;
}

.hero-image img {
    width: 375px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.hero-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(46, 230, 166, 0.2);
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--color-subtext);
    animation: scroll-move 1.6s ease-in-out infinite;
}

@keyframes scroll-move {
    0% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
    100% { transform: translateX(-50%) translateY(0); }
}

/* ================ Common Section Pattern =============== */

.section-base {
    min-height: 100vh;
    padding: 120px 48px;
    display: flex;
    align-items: center;
}

.section-container {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}

.section-label {
    margin-bottom: 16px;
    font-size: 0.85rem;
    letter-spacing: 0.24em;
    color: var(--color-primary);
}

.section-title {
    margin-bottom: 40px;
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
}

/* ================ About Section =============== */

.about {
    min-height: 100vh;
    padding: 120px 48px;
    display: flex;
    align-items: center;
}

.about-container {
    width: 100%;
    margin: 0 auto;
    max-width: 850px;
}

.about-content {
    max-width: 850px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 24px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-subtext);
}

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

/* ================ Story Section =============== */

.story-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.story-card {
    padding: 32px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background-color: var(--color-card);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.story-card:hover {
    border-color: var(--color-border-strong);
    transform: translateY(-2px);
}

.story-card h3 {
    margin-bottom: 18px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.story-card h3::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 18px;
    background-color: var(--color-primary);
    border-radius: 2px;
}

.story-card p {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--color-subtext);
}

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

/* ================ Timeline Section =============== */

.timeline {
    min-height: 100vh;
    position: relative;
}

.timeline-sticky {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.timeline-track {
    display: flex;
    gap: 40px;
    padding: 0 32px;
    will-change: transform;
    transition: transform 0.4s ease;
}

.project-card {
    min-width: calc(100vw - 64px);
    max-width: 900px;
    min-height: 72vh;

    padding: 48px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background-color: var(--color-card);

    display: flex;
    flex-direction: column;
    justify-content: center;

    opacity: 0.35;
    transform: scale(0.96);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.project-card > * {
    margin-bottom: 20px;
}

.project-card > *:last-child {
    margin-bottom: 0;
}

.project-card.is-active {
    opacity: 1;
    transform: scale(1);
    border-color: var(--color-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.project-header {
    margin-bottom: 4px;
}

.project-date {
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--color-primary);
}

.project-title {
    margin-bottom: 6px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
}

.project-summary {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-text);
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stack-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--color-text);
    background-color: #1a1a1a;
    border: 1px solid var(--color-border-strong);
    transition: all 0.2s ease;
}

.stack-badge:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.project-description p {
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-subtext);
}

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

.project-points h4 {
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}

.project-points ul {
    padding-left: 18px;
}

.project-points li {
    margin-bottom: 8px;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-subtext);
}

.project-points li:last-child {
    margin-bottom: 0;
}

.project-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-primary);
}

.project-links a:hover {
    text-decoration: underline;
}

/* ================ Skills Section =============== */

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skill-card {
    padding: 28px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background-color: var(--color-card);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.skill-card h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.skill-card p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-subtext);
}

/* ================ Companies Section =============== */

.companies-intro {
    margin-bottom: 32px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-subtext);
}

.companies-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.company-card {
    padding: 32px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background-color: var(--color-card);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.company-card:hover {
    border-color: var(--color-border-strong);
    transform: translateY(-2px);
}

.company-tag {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    background-color: rgba(46, 230, 166, 0.08);
    border: 1px solid rgba(46, 230, 166, 0.2);
}

.company-card h3 {
    margin-bottom: 16px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
}

.company-card p {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--color-subtext);
}

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

/* ================ Future Section =============== */

.future-list {
    display: flex;
    flex-direction: column;
    position: relative;
}

.future-phase {
    position: relative;
    padding: 0 0 40px 32px;
    border-left: 2px solid var(--color-border);
}

.future-phase:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.future-phase::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    background-color: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--color-bg);
}

.phase-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    color: var(--color-primary);
}

.future-phase h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
}

.future-phase p {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--color-subtext);
}

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

/* ================ Contact Section =============== */

.contact-message {
    margin-bottom: 32px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-subtext);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background-color: var(--color-card);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46, 230, 166, 0.08);
}

.contact-label {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    color: var(--color-primary);
}

.contact-value {
    font-size: 0.98rem;
    color: var(--color-text);
}

/* ================ PLAYER BAR =============== */

#player-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 1000;

    width: min(620px, calc(100% - 48px));

    border-radius: 18px;
    border: 1px solid var(--color-border);
    overflow: hidden;

    background-color: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#player-bar.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.player-top {
    text-align: center;
    padding: 16px 18px 10px;
}

.player-title {
    margin-bottom: 4px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

.player-subtitle {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--color-subtext);
}

.player-bottom-wrap {
    background-color: rgba(255, 255, 255, 0.02);
    padding: 0 5px 6px;
}

.player-progress {
    position: relative;
    padding-top: 2px;
    padding-bottom: 18px;
}

.player-bar-track {
    position: relative;
    width: 100%;
    height: 2px;
    background-color: #242424;
    border-radius: 999px;
}

.player-bar-progress {
    position: relative;
    width: 0%;
    height: 100%;
    background-color: #6a6a6a;
    border-radius: 999px;
    transition: width 0.45s ease;
}

.player-bar-thumb {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(50%, -50%) scale(0.8);

    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #dcdcdc;
    box-shadow: 0 0 10px rgba(46, 230, 166, 0.18);

    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-progress:hover .player-bar-thumb {
    opacity: 1;
    transform: translate(50%, -50%) scale(1);
}

.player-time {
    position: absolute;
    bottom: 0;
    transform: translateY(3px);
    font-size: 0.75rem;
    color: var(--color-subtext);
    white-space: nowrap;
    opacity: 0.75;
    letter-spacing: 0.02em;
}

.player-time.player-start { left: 0; }
.player-time.player-end { right: 0; }

.player-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 22px;
    margin-top: -10px;
}

.player-nav {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;

    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-nav:hover {
    opacity: 1;
    transform: scale(1.05);
}

.player-nav:disabled {
    opacity: 0.2;
    cursor: default;
    transform: none;
}

.player-nav span {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.player-prev span {
    border-right: 9px solid var(--color-text);
}

.player-next span {
    border-left: 9px solid var(--color-text);
}

/* ================ PRETEXT (Hero reflow) =============== */

.pretext-wrap {
    position: relative;
    max-width: 520px;
}

.pretext-source {
    color: transparent;
    user-select: none;
}

.pretext-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.pretext-fallback .pretext-source {
    color: var(--color-subtext);
    user-select: auto;
}

.pretext-fallback .pretext-canvas {
    display: none;
}

/* ================ RESPONSIVE =============== */

@media (max-width: 768px) {
    /* Hero */
    .hero {
        padding: 80px 24px;
    }
    .hero-container {
        flex-direction: column-reverse;
        gap: 32px;
    }
    .hero-text {
        max-width: 100%;
    }
    .hero-image img {
        width: 220px;
    }

    /* About + Common sections */
    .about,
    .section-base {
        padding: 80px 24px;
        min-height: auto;
    }
    .about-container,
    .section-container {
        max-width: 100%;
    }

    /* Cards */
    .story-card,
    .company-card {
        padding: 24px;
    }
    .skill-card {
        padding: 22px;
    }

    /* Timeline */
    .project-card {
        min-width: calc(100vw - 32px);
        padding: 32px 24px;
        min-height: auto;
    }

    /* Future */
    .future-phase {
        padding-left: 24px;
    }

    /* Contact */
    .contact-item {
        padding: 18px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* Player bar */
    #player-bar {
        width: calc(100% - 24px);
        bottom: 12px;
    }

    /* Pretext: 모바일은 일반 텍스트로 폴백 */
    .pretext-source {
        color: var(--color-subtext);
    }
    .pretext-canvas {
        display: none;
    }
}
