/* ============================================
   ✅ Portfolio - 경력기술서 스타일
   ============================================ */
:root {
    --primary: #5ec2f0;
    --primary-dark: #3b82f6;
    --text: #1e293b;
    --text-muted: #64748b;
    --bg: #f6f8fa;
    --bg-alt: #f4faff;
    --border: #cbd0d8;
    --danger: #dc2626;
    --radius: 10px;

    --container-background: #e9f0ff;

    /* 섹션 교차 배경: 홀수(1·3·5번째) / 짝수(2·4·6번째) */
    --section-bg-odd: #ffffff;
    --section-bg-even: #f6f8fa;
}

/* ---------- Dark Mode 팔레트 ----------
   색은 전부 :root 변수를 거치므로 여기서만 갈아끼우면 전체 반전된다 */
[data-theme="dark"] {
    --primary: #5ec2f0;
    --primary-dark: #3b82f6;
    --text: #cbd0d8;
    --text-muted: #94a3b8;
    --bg: #191919;
    --bg-alt: #1e293b;
    --border: #3a3a3a;
    --danger: #f87171;

    --container-background: #232936; /* 라이트 모드(#e9f0ff)와 같은 파란 틴트의 다크 표면 */

    --section-bg-odd: #202020;
    --section-bg-even: #191919;
}

/* 변수를 안 쓰고 색이 박혀 있던 부분들의 다크모드 보정 */
[data-theme="dark"] .site-header {
    background: #191919;
}

[data-theme="dark"] .dark-mode-icon {
    filter: invert(1); /* 검은 아이콘 → 흰색 */
}

[data-theme="dark"] .modal-box {
    background: var(--bg-alt);
    border: 1px solid var(--border); /* 어두운 배경에선 그림자만으론 분리가 약해 테두리 병행 */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .badge-member {
    background: rgba(96, 165, 250, 0.12);
    border-color: #1e40af;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px; /* 2줄 헤더 높이만큼 앵커 이동 보정 */
}

body {
    font-family: 'Chiron GoRound TC', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    font-optical-sizing: auto;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-weight: 400;
      font-style: normal;
}

.container {
    background: var(--container-background);
    max-width: 960px;
    margin: 0 auto;
    padding: 50px;
    border: 3px dashed var(--border); /* solid: 실선 */
    border-radius: 30px;
}

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

.external-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.external-link::after {
    /* content: "↗"; */
    font-size: 0.8em;
    margin-left: 2px;
}

.external-link:hover {
    opacity: 0.75;
}

ul {
    list-style: none;
}

.muted {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85em;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(246, 248, 250, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1.5px solid var(--border);
}

.header-inner {
    display: flex;
    flex-wrap: wrap; /* gnb가 flex-basis: 100% 로 두 번째 줄로 내려간다 */
    align-items: center;
    gap: 0 24px;

    max-width: 960px;
    margin: 0 auto;
    padding: 8px 20px 0;
}

.logo {
    display: flex;
    align-items: center;
}

.hj-cloud-icon .letter {
    transform-box: fill-box;
    transform-origin: center;
}

.hj-cloud-icon .letter-h {
    animation: hjFloatH 5s ease-in-out infinite;
}

.hj-cloud-icon .letter-j {
    animation: hjFloatJ 6.4s ease-in-out infinite;
}

.hj-cloud-icon .cloud-body {
    animation: hjBob 4.5s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes hjFloatH {
    0%   { transform: translate(0px, 0px) rotate(0deg); }
    25%  { transform: translate(2px, -2px) rotate(-3deg); }
    50%  { transform: translate(-1px, -3px) rotate(2deg); }
    75%  { transform: translate(-2px, 0px) rotate(-2deg); }
    100% { transform: translate(0px, 0px) rotate(0deg); }
}

@keyframes hjFloatJ {
    0%   { transform: translate(0px, 0px) rotate(0deg); }
    30%  { transform: translate(-2px, 1px) rotate(3deg); }
    55%  { transform: translate(1px, 0px) rotate(-2deg); }
    80%  { transform: translate(2px, -2px) rotate(2deg); }
    100% { transform: translate(0px, 0px) rotate(0deg); }
}

@keyframes hjBob {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-2px); }
}

.hj-cloud-icon {
    overflow: visible;
}

.hj-cloud-icon .star {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0.8;
}

.hj-cloud-icon .star-1 { animation: hjStarA 4.2s ease-in-out infinite; }
.hj-cloud-icon .star-2 { animation: hjStarB 5.4s ease-in-out infinite 0.6s; }
.hj-cloud-icon .star-3 { animation: hjStarC 3.6s ease-in-out infinite 1.2s; }
.hj-cloud-icon .star-4 { animation: hjStarA 4.8s ease-in-out infinite 0.3s; }
.hj-cloud-icon .star-5 { animation: hjStarB 5.8s ease-in-out infinite 0.9s; }

.hj-cloud-icon .celestial-sun,
.hj-cloud-icon .celestial-moon {
    transform-box: fill-box;
    transform-origin: center;
}

.hj-cloud-icon .celestial-sun {
    animation: hjSunDrift 9s ease-in-out infinite;
}

.hj-cloud-icon .celestial-moon {
    display: none;
    animation: hjMoonSway 8s ease-in-out infinite;
}

@keyframes hjSunDrift {
    0%, 100% { transform: translate(0px, 0px) rotate(0deg); }
    33%      { transform: translate(-2px, 1.5px) rotate(3deg); }
    66%      { transform: translate(1.5px, -1.5px) rotate(-3deg); }
}

@keyframes hjMoonSway {
    0%, 100% { transform: translate(0px, 0px) rotate(0deg); }
    50%      { transform: translate(1.5px, -2px) rotate(6deg); }
}

[data-theme="dark"] .hj-cloud-icon .celestial-moon {
    display: block;
}

[data-theme="dark"] .hj-cloud-icon .celestial-sun {
    display: none;
}

@keyframes hjStarA {
    0%, 100% { transform: translate(0px, 0px) rotate(0deg); opacity: 0.8; }
    50%      { transform: translate(1.5px, -1.5px) rotate(20deg); opacity: 0.35; }
}

@keyframes hjStarB {
    0%, 100% { transform: translate(0px, 0px) rotate(0deg); opacity: 0.7; }
    50%      { transform: translate(-1.5px, 1px) rotate(-20deg); opacity: 0.3; }
}

@keyframes hjStarC {
    0%, 100% { transform: translate(0px, 0px) scale(1); opacity: 0.75; }
    50%      { transform: translate(1px, 1.5px) scale(0.7); opacity: 0.35; }
}

.gnb {
    order: 10; /* 첫 줄(로고·auth·다크모드) 뒤로 밀어 두 번째 줄에 배치 */
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 35px;
    min-height: 36px; /* 첫 줄보다 살짝 낮은 줄 높이 */
    font-size: 14px;
    color: var(--text-muted);
}

.gnb a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 아이콘: SVG 파일을 mask로 씌우고 배경색을 currentColor로 칠한다
   → 글자색(hover·active·다크모드)을 아이콘이 그대로 따라감 */
.gnb a::before {
    content: '';
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: var(--icon) no-repeat center / contain;
    mask: var(--icon) no-repeat center / contain;
}

.gnb a[href="#about"]        { --icon: url('/images/icons/about.svg'); }
.gnb a[href="#skills"]       { --icon: url('/images/icons/skills.svg'); }
.gnb a[href="#career"]       { --icon: url('/images/icons/career.svg'); }
.gnb a[href="#education"]    { --icon: url('/images/icons/education.svg'); }
.gnb a[href="#architecture"] { --icon: url('/images/icons/site.svg'); }
.gnb a[href="#guestbook"]    { --icon: url('/images/icons/guestbook.svg'); }

.gnb a:hover {
    color: var(--primary);
}

.gnb a.active {
    color: var(--primary);
    font-weight: 700;
}

/* 끝이 둥근 밑줄 (text-decoration은 각져서 가상 요소로 대체) */
.gnb a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.dark-mode-icon {
    width: 50px;
    height: 50px;
    cursor: pointer;
}

/* margin-left: auto 가 남는 공간을 전부 왼쪽에 몰아넣어
   auth-area 부터 그 뒤 요소(다크모드 아이콘)까지 우측 끝으로 정렬된다 */
.auth-area {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.auth-nickname {
    font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}

/* 버튼 앞 브랜드 아이콘 (hero 연락처 버튼) */
.hero-contact .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 메일 버튼 우상단에 얹히는 복사 버튼 */
.mail-btn-wrap {
    position: relative;
    display: inline-flex;
}

.copy-mail-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: 0.15s;
}

.copy-mail-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.copy-mail-btn .btn-icon {
    width: 12px;
    height: 12px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* 히어로 GitHub 버튼 · 소스코드 버튼: 프라이머리 색 없이 프로필 이미지만 반투명하게 깔기 */
.section .arch-grid .hero-contact .btn-primary,
.hero .hero-contact .btn-primary {
    position: relative;
    overflow: hidden; /* 이미지가 버튼 둥근 모서리 밖으로 안 나가게 */
    z-index: 0;
    background: transparent;
    border-color: var(--border);
    color: var(--text); /* 배경색이 없어져 흰 글자가 안 보이므로 기본 글자색으로 */
}

.section .arch-grid .hero-contact .btn-primary:hover,
.hero .hero-contact .btn-primary:hover {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.section .arch-grid .hero-contact .btn-primary::before,
.hero .hero-contact .btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/github-profile.png') center / 115px 50px no-repeat;
    opacity: 0.25;
    z-index: -1; /* 버튼 배경색 위 · 글자 아래 */
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12.5px;
    cursor: pointer;
    padding: 0;
}

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

.link-btn.danger:hover {
    color: var(--danger);
}

/* ---------- Hero ---------- */
.hero {
    padding: 50px 0 50px 0;
}

/* Hero 배경 프로필 이미지 — 컨테이너 왼쪽 상단 사분면에 텍스트 뒤로 깔림 */
.hero .container {
    position: relative;
    z-index: 0; /* 스태킹 컨텍스트 생성: 이미지가 배경색 위 · 콘텐츠 아래에 놓이게 함 */
    overflow: hidden;
}

.hero-label {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 14px;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 44px);
    line-height: 1.3;
    margin: 12px 0 20px;
}

.accent {
    color: var(--primary);
}

.hero-desc {
    color: var(--text-muted);
    font-size: 16px;
}

.hero-contact {
    margin-top: 28px;
    display: flex;
    gap: 10px;
}

/* ---------- Sections ---------- */
.section {
    padding: 50px 0;

}

/* 섹션 배경은 클래스가 아니라 순서로 자동 교차된다 (.section-alt 수동 지정 불필요) */
main > section:nth-of-type(odd) {
    background: var(--section-bg-odd);
}

main > section:nth-of-type(even) {
    background: var(--section-bg-even);
}

.section-title {
    font-size: 26px;
    margin-bottom: 28px;
}

.section-title .count {
    color: var(--primary);
    font-size: 20px;
}

.section-desc {
    color: var(--text-muted);
    margin: -16px 0 24px;
    font-size: 14.5px;
}

/* ---------- Skills ---------- */
.skill-grid {
   display: grid;
   /* grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); */
   gap: 16px;
   padding-top: 16px;
}

.arch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.skill-card,
.arch-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 카드 공백을 채우는 배경 워터마크 아이콘 (카드당 큰 것 + 작은 것 2개 겹침) */
.skill-bg-icon {
    position: absolute;
    top: 50%;
    opacity: 0.08;
    pointer-events: none;
    user-select: none;
}

.skill-bg-icon.icon-a {
    right: 92px;
    width: 116px;
    height: 116px;
    transform: translateY(-58%) rotate(-8deg);
}

.skill-bg-icon.icon-b {
    right: 28px;
    width: 64px;
    height: 64px;
    transform: translateY(-18%) rotate(10deg);
}

@media (max-width: 640px) {
    .skill-bg-icon.icon-a {
        right: 56px;
        width: 72px;
        height: 72px;
    }

    .skill-bg-icon.icon-b {
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

.skill-card h3,
.arch-card h3 {
    color: var(--primary);
    font-size: 15px;
    margin-bottom: 10px;
}

.skill-card li {
    font-size: 14px;
    color: var(--text-muted);
    padding: 3px 0;
}
.skill-card li::before {
    content: "- ";
}

.arch-card p {
    font-size: 14px;
}

/* ---------- Career ---------- */
.career-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.company {
    font-size: 20px;
}

.role {
    color: var(--text-muted);
    font-size: 14px;
}

.period {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
}

.career-summary {
    margin: 14px 0 34px;
    color: var(--text-muted);
    font-size: 15px;
}

.timeline {
    border-left: 2px solid var(--border);
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 34px;
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

.timeline-body h4 {
    font-size: 17px;
    margin-bottom: 8px;
}

.timeline-body li {
    font-size: 14.5px;
    color: var(--text-muted);
    padding: 2px 0 2px 14px;
    position: relative;
}

.timeline-body li::before {
    content: '·';
    position: absolute;
    left: 2px;
    color: var(--primary);
    font-weight: 900;
}

.tags {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--primary);
    font-weight: 600;
}

/* ---------- Comment ---------- */
.comment-form textarea,
.reply-form textarea,
.edit-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    font: inherit;
    font-size: 14px;
    resize: vertical;
}

.comment-form textarea:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

.guest-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.guest-fields input {
    flex: 1;
    max-width: 220px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
}

.form-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.comment-list {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
}

.comment {
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.comment-empty {
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-nick {
    font-weight: 700;
    font-size: 14px;
}

.badge {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.badge-member {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--primary);
}

.comment-date {
    font-size: 12px;
    color: var(--text-muted);
}

.comment-content {
    font-size: 14.5px;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-content.deleted {
    color: var(--text-muted);
    font-style: italic;
}

.comment-actions {
    margin-top: 6px;
    display: flex;
    gap: 12px;
}

.replies {
    margin-top: 12px;
    padding-left: 22px;
    border-left: 2px solid var(--border);
}

.replies .comment {
    border-top: none;
    padding: 10px 0;
}

.reply-form-slot {
    margin-top: 10px;
}

.reply-form,
.edit-form {
    margin-top: 8px;
}

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.pagination button {
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal.open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    width: min(380px, calc(100vw - 40px));
    position: relative;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35), 0 4px 12px rgba(15, 23, 42, 0.2);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

#authForm label,
#commentModalForm label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}

#authForm input,
#commentModalForm input {
    width: 100%;
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
}

.modal-title {
    font-size: 17px;
    margin-bottom: 6px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 6px;
}

/* ---------- Footer ---------- */
.site-footer {
    padding: 32px 0;
    border-top: 1.5px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--section-bg-odd);
}

.footer-link {
    color: var(--primary);
    font-weight: 600;
}

.footer-link:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .gnb {
        display: none;
    }

    .hero {
        padding: 60px 0 50px;
    }

    .guest-fields {
        flex-direction: column;
    }

    .guest-fields input {
        max-width: none;
    }
}
