/* ═══════════════════════════════════════════════════════════════════════
   Portfolio Page — Cyberpunk Resume
   ═══════════════════════════════════════════════════════════════════════ */

.pf-page {
    display: grid;
    gap: 20px;
}

.pf-loading,
.pf-error {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.pf-error {
    color: #f9b6b1;
    border: 1px solid rgba(249, 182, 177, 0.4);
    border-radius: 12px;
    padding: 12px;
    background: rgba(249, 182, 177, 0.08);
}

.pf-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 32px 16px;
    opacity: 0.6;
}

/* ── Toolbar ─────────────────────────────────────────────────────────── */

.pf-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Password Modal ──────────────────────────────────────────────────── */

.pf-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pf-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    width: min(400px, 90vw);
    display: grid;
    gap: 16px;
}

.pf-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-bright);
}

.pf-modal__desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.pf-modal__input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-bright);
    outline: none;
    font-family: inherit;
    font-size: 15px;
    box-sizing: border-box;
}

.pf-modal__input:focus {
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}

.pf-modal__error {
    margin: 8px 0 0;
    font-size: 13px;
    color: #f9b6b1;
}

.pf-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ── Edit Form (공통) ────────────────────────────────────────────────── */

.pf-edit-form {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: grid;
    gap: 14px;
    animation: fadeIn 0.2s ease both;
}

.pf-edit-form label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.pf-edit-form input,
.pf-edit-form textarea,
.pf-edit-form select {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-bright);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.pf-edit-form input:focus,
.pf-edit-form textarea:focus,
.pf-edit-form select:focus {
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}

.pf-edit-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pf-edit-form__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.pf-edit-btn {
    margin-top: 8px;
}

/* ── Profile Card ────────────────────────────────────────────────────── */

.pf-profile-tab {
    display: grid;
    gap: 20px;
}

.pf-profile-card {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: grid;
    gap: 16px;
    box-shadow: var(--shadow-card);
}

.pf-profile-card__header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pf-profile-card__photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(6, 182, 212, 0.3);
}

.pf-profile-card__name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-bright);
}

.pf-profile-card__name-en {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.pf-profile-card__role {
    margin: 4px 0 0;
    font-size: 14px;
    color: #06b6d4;
    font-weight: 600;
}

.pf-profile-card__bio {
    margin: 0;
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-line;
}

.pf-profile-card__links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.pf-profile-card__links a {
    font-size: 13px;
    color: #06b6d4;
    text-decoration: none;
}

.pf-profile-card__links a:hover {
    text-decoration: underline;
}

/* ── Section ─────────────────────────────────────────────────────────── */

.pf-section {
    display: grid;
    gap: 12px;
}

.pf-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pf-section__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Career Group ────────────────────────────────────────────────────── */

.pf-career-group {
    display: grid;
    gap: 8px;
}

.pf-career-group__title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #06b6d4;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pf-career-item {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    display: grid;
    gap: 4px;
}

.pf-career-item__period {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.pf-career-item__role {
    font-size: 14px;
    color: var(--text-bright);
}

.pf-career-item__org {
    font-size: 13px;
    color: var(--text-dim);
}

.pf-career-item__desc {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
}

.pf-career-item__actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

/* ── Skill Group ─────────────────────────────────────────────────────── */

.pf-skill-group {
    display: grid;
    gap: 8px;
}

.pf-skill-group__title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #06b6d4;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pf-skill-group__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pf-skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: #06b6d4;
    font-weight: 500;
}

.pf-skill-tag[data-level="5"] {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.5);
}

.pf-skill-tag[data-level="4"] {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.35);
}

.pf-skill-tag__actions {
    display: inline-flex;
    gap: 2px;
}

.pf-skill-tag__actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1;
}

.pf-skill-tag__actions button:hover {
    color: #06b6d4;
}

/* ── Skill Logo Loop ─────────────────────────────────────────────────── */

.pf-skill-loop {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px 28px;
}

.pf-skill-logo {
    height: 36px;
    width: auto;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.pf-skill-fallback {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-bright);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: 999px;
    white-space: nowrap;
}

/* ── Filter Bar ──────────────────────────────────────────────────────── */

.pf-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pf-filter-btn {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.pf-filter-btn:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
    color: #06b6d4;
}

.pf-filter-btn.is-active {
    background: rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.5);
    color: #06b6d4;
    font-weight: 600;
}

/* ── Project Tab ─────────────────────────────────────────────────────── */

.pf-project-tab {
    display: grid;
    gap: 16px;
}

.pf-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.pf-project-card {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    display: grid;
    gap: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-card);
}

.pf-project-card:hover {
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: var(--shadow-md);
}

.pf-project-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pf-project-card__cat {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pf-project-card__cat--company {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.pf-project-card__cat--personal {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.pf-project-card__cat--academy {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.pf-project-card__period {
    font-size: 11px;
    color: var(--text-muted);
}

.pf-project-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
}

.pf-project-card__role {
    margin: 0;
    font-size: 12px;
    color: #06b6d4;
    font-weight: 500;
}

.pf-project-card__desc {
    margin: 0;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pf-project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pf-tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: #06b6d4;
}

.pf-tech-tag button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    line-height: 1;
}

.pf-tech-tag button:hover {
    color: #f9b6b1;
}

.pf-project-card__link {
    font-size: 12px;
    color: #06b6d4;
    text-decoration: none;
}

.pf-project-card__link:hover {
    text-decoration: underline;
}

.pf-project-card__actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

/* ── Tech Input ──────────────────────────────────────────────────────── */

.pf-tech-input {
    display: grid;
    gap: 8px;
}

.pf-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Intro Tab ───────────────────────────────────────────────────────── */

.pf-intro-tab {
    display: grid;
    gap: 16px;
}

.pf-intro-tab__toolbar {
    display: flex;
    gap: 10px;
}

.pf-intro-list {
    display: grid;
    gap: 12px;
}

.pf-intro-card {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    display: grid;
    gap: 10px;
    transition: border-color 0.2s ease;
}

.pf-intro-card.is-main {
    border-color: rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 0.03);
}

.pf-intro-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pf-intro-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pf-intro-card__badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: #06b6d4;
    letter-spacing: 0.08em;
}

.pf-intro-card__date {
    font-size: 11px;
    color: var(--text-muted);
}

.pf-intro-card__preview {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

.pf-intro-card__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Resume View ─────────────────────────────────────────────────────── */

.pf-resume-overlay {
    display: grid;
    gap: 16px;
}

.pf-resume-actions {
    display: flex;
    gap: 10px;
}

.pf-resume {
    background: #fff;
    color: #1a1a2e;
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Pretendard', -apple-system, system-ui, sans-serif;
    line-height: 1.6;
}

.pf-resume__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #1a1a2e;
    margin-bottom: 24px;
}

.pf-resume__name {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
}

.pf-resume__role {
    margin: 4px 0 0;
    font-size: 14px;
    color: #555;
}

.pf-resume__contact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 12px;
    color: #555;
}

.pf-resume__section {
    margin-bottom: 24px;
}

.pf-resume__section h2 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1a1a2e;
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
}

.pf-resume__section p {
    margin: 0;
    font-size: 13px;
    color: #333;
    line-height: 1.7;
}

.pf-resume__item {
    margin-bottom: 14px;
}

.pf-resume__item-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.pf-resume__item-header strong {
    font-size: 14px;
    color: #1a1a2e;
}

.pf-resume__item-header span {
    font-size: 12px;
    color: #555;
}

.pf-resume__period {
    font-size: 11px !important;
    color: #888 !important;
}

.pf-resume__item p {
    margin-top: 4px;
}

.pf-resume__tech {
    font-size: 11px !important;
    color: #06b6d4 !important;
    margin-top: 4px !important;
}

.pf-resume__skills {
    font-size: 13px !important;
    color: #333 !important;
}

/* ── Print ────────────────────────────────────────────────────────────── */

@media print {
    body * {
        visibility: hidden;
    }

    .pf-resume-overlay,
    .pf-resume-overlay * {
        visibility: visible;
    }

    .pf-resume-overlay {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .no-print {
        display: none !important;
    }

    .pf-resume {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        max-width: none;
    }

    .pf-resume__header {
        border-bottom: 2px solid #000;
    }

    .pf-resume__section h2 {
        border-bottom: 1px solid #000;
    }
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .pf-toolbar {
        position: fixed;
        bottom: 16px;
        right: 16px;
        z-index: 90;
        gap: 8px;
        flex-direction: column;
    }

    .pf-toolbar .button {
        font-size: 13px;
        padding: 8px 14px;
        border-radius: 20px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    }

    .pf-profile-card {
        padding: 16px;
    }

    .pf-profile-card__photo {
        width: 56px;
        height: 56px;
    }

    .pf-profile-card__name {
        font-size: 18px;
    }

    .pf-project-grid {
        grid-template-columns: 1fr;
    }

    .pf-edit-form__row {
        grid-template-columns: 1fr;
    }

    .pf-edit-form input,
    .pf-edit-form textarea,
    .pf-edit-form select {
        font-size: 16px;
        padding: 12px 14px;
    }

    .pf-edit-form label {
        font-size: 14px;
    }

    .pf-modal__input {
        font-size: 16px;
    }

    .pf-resume {
        padding: 20px;
    }

    .pf-resume__header {
        flex-direction: column;
    }

    .pf-resume__contact {
        align-items: flex-start;
    }

    .pf-filter-btn {
        font-size: 13px;
        padding: 8px 16px;
        min-height: 36px;
    }

    .pf-intro-card__actions .button {
        min-height: 44px;
    }
}
