/* ==========================================================
   강범준 포트폴리오 — 전역 스타일
   라이트 톤 설계 문서형: 종이색 배경 · 잉크 텍스트 · 포인트 컬러 하나
   ========================================================== */

:root {
    --paper: #f7f6f2;
    --paper-2: #efede6;
    --surface: #ffffff;
    --ink: #16181d;
    --ink-2: #3d424c;
    --muted: #6b707a;
    --line: #dcd9d0;
    --accent: #1f47c7;
    --accent-soft: rgba(31, 71, 199, 0.08);

    --font-sans: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR",
                 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

    --max: 1120px;
    --gutter: 32px;
    --label-col: 180px;
    --col-gap: 48px;
    --header-height: 64px;
    --radius: 8px;
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
    background-color: var(--paper);
    color: var(--ink-2);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.7;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    /* 한국어 어절 단위 줄바꿈 */
    word-break: keep-all;
    overflow-wrap: break-word;
}

::selection {
    background-color: var(--accent-soft);
    color: var(--ink);
}

h1, h2, h3, h4 {
    color: var(--ink);
    line-height: 1.3;
    letter-spacing: -0.03em;
}

a {
    color: inherit;
    transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

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

ul, ol {
    list-style: none;
}

strong, b {
    color: var(--ink);
    font-weight: 700;
}

/* 숫자·연도는 고정폭 숫자로 (한글에는 모노 폰트를 쓰지 않음) */
.num {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.muted {
    color: var(--muted);
}

/* ---------- 줄바꿈 원칙 ----------
   1) 본문은 keep-all(어절 단위)로 끊는다 (body).
   2) 제목·짧은 문구는 balance로 줄 길이를 고르게, 문단은 pretty로 마지막 줄 고아 단어를 막는다.
   3) 끊기면 의미가 깨지는 묶음(과목명, 학과명, 기간, 고유명사)은 .nowrap으로 감싼다.
   4) <br>로 강제 개행하지 않는다. 줄 구분이 필요하면 블록 요소(.sub 등)를 쓴다. */
h1, h2, h3, h4,
.hero-tagline {
    text-wrap: balance;
}

p, li, dd {
    text-wrap: pretty;
}

.nowrap {
    white-space: nowrap;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* 접근성: 본문 건너뛰기 */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 16px;
}

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- 버튼 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

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

.btn-primary {
    background-color: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.btn-primary:hover {
    background-color: #000;
    border-color: #000;
}

/* ---------- 아이콘 버튼 (LinkedIn · GitHub · 메일) ---------- */
.icon-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background-color: var(--surface);
    color: var(--ink);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    border-color: var(--ink);
    color: var(--accent);
}

.icon-btn-sm {
    width: 36px;
    height: 36px;
}

.icon-btn-sm svg {
    width: 18px;
    height: 18px;
}

/* ---------- 헤더 / 내비게이션 (블로그 페이지와 공용) ---------- */
#site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: rgba(247, 246, 242, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    max-width: var(--max);
    min-height: var(--header-height);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.logo {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
    white-space: nowrap;
}

.logo span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 28px;
}


.nav-link {
    color: var(--ink-2);
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-cta {
    padding: 8px 14px;
    font-size: 14px;
}

.nav-cta[aria-current="page"] {
    border-color: var(--ink);
}

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

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 56px;
    align-items: end;
}


.hero-name {
    font-size: clamp(48px, 7vw, 76px);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.hero-tagline {
    margin-top: 16px;
    color: var(--ink);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.35;
}

.hero-lead {
    max-width: 36em;
    margin-top: 24px;
    font-size: 18px;
}

.hero .icon-links {
    margin-top: 28px;
}

.portrait img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 50% 20%;
    border-radius: 12px;
    /* 흰 배경 사진이 종이색 배경에 자연스럽게 녹아들도록 */
    mix-blend-mode: multiply;
}


/* ---------- 본문 레이아웃: 좌측 고정 목차 / 우측 섹션 ---------- */
.layout {
    display: grid;
    grid-template-columns: var(--label-col) minmax(0, 1fr);
    gap: var(--col-gap);
    align-items: start;
    margin-top: 72px;
}

.toc {
    position: sticky;
    top: calc(var(--header-height) + 32px);
    padding-top: 8px;
}

.toc a {
    display: block;
    padding: 6px 0 6px 14px;
    border-left: 2px solid var(--line);
    color: var(--muted);
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
}

.toc a:hover {
    color: var(--ink);
}

.toc a[aria-current="true"] {
    border-left-color: var(--accent);
    color: var(--ink);
    font-weight: 700;
}

.block {
    padding: 0 0 72px;
}

.block + .block {
    padding-top: 72px;
    border-top: 1px solid var(--line);
}

.block-title {
    margin-bottom: 24px;
    font-size: 26px;
    font-weight: 800;
}

.prose p + p {
    margin-top: 16px;
}

/* ---------- 케이스 (현장 → 해결 → 결과) ---------- */
.cases {
    display: flex;
    flex-direction: column;
}

.case + .case {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.case-meta {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.case-title {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 750;
}

.case-body > div {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
}

.case-body > div + div {
    margin-top: 12px;
}

.case-body dt {
    padding-top: 2px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.case-change dt {
    color: var(--accent);
}

.case-change dd {
    padding: 12px 16px;
    background-color: var(--accent-soft);
    border-radius: var(--radius);
    color: var(--ink);
    font-weight: 600;
}

/* 결과: 1줄 Before(취소선) / 2줄 → After */
.case-change .before,
.case-change .after {
    display: block;
}

.case-change .before {
    color: var(--muted);
    font-weight: 500;
    text-decoration: line-through;
    text-decoration-color: rgba(107, 112, 122, 0.5);
}

.case-change .after {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.case-change .arrow {
    color: var(--accent);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}

.tags li {
    padding: 3px 10px;
    background-color: var(--paper-2);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 13px;
}

/* ---------- 경력 ---------- */
.job + .job {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.job-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
}

.job-head h3 {
    font-size: 22px;
}

.job-period {
    color: var(--muted);
    font-size: 15px;
}

.job-role {
    margin-top: 2px;
    color: var(--muted);
    font-size: 15px;
}

.job-items {
    margin-top: 16px;
}

.job-items li {
    position: relative;
    padding-left: 16px;
    font-size: 16px;
}

.job-items li + li {
    margin-top: 12px;
}

.job-items li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--ink-2);
}

.job-items strong {
    margin-right: 6px;
}

.job-items a {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.job-items a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- 기술 ---------- */
.skills-lead {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 16px;
}

.skills > div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.skills > div:last-child {
    border-bottom: 1px solid var(--line);
}

.skills dt {
    color: var(--ink);
    font-weight: 700;
}

.skills {
    font-size: 16px;
}

/* ---------- 개인 프로젝트 ---------- */
.side-projects > li + li {
    margin-top: 32px;
}

.side-projects > li > h3 {
    font-size: 20px;
}

.side-projects h3 a {
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.side-projects h3 a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.side-projects .ext {
    color: var(--muted);
    font-size: 0.8em;
}

.side-projects > li > p {
    margin-top: 6px;
    font-size: 16px;
}

.side-link {
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
}

.side-link a {
    color: var(--accent);
    text-decoration: none;
}

.side-link a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- 강의 · 학력 · 자격 ---------- */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 32px;
}

.meta-grid h3 {
    margin-bottom: 10px;
    font-size: 15px;
}

.meta-grid li {
    font-size: 15px;
    line-height: 1.6;
}

.meta-grid li + li {
    margin-top: 10px;
}

.meta-grid .num.muted {
    margin-left: 4px;
    font-size: 14px;
}

.meta-grid .sub {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

/* ---------- 연락처 ---------- */
.contact-email {
    margin: 12px 0 20px;
    font-size: 22px;
    font-weight: 700;
}

.contact-email a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 2px solid var(--accent);
}

.contact-email a:hover {
    color: var(--accent);
}

/* ---------- 푸터 (블로그 페이지와 공용) ---------- */
footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    max-width: var(--max);
    margin: 0 auto;
    padding: 32px var(--gutter) 48px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.footer-social {
    display: flex;
    gap: 20px;
}

.footer-social a {
    color: var(--ink-2);
    text-decoration: none;
}

.footer-social a:hover {
    color: var(--accent);
}

/* ==========================================================
   반응형
   ========================================================== */
@media (max-width: 860px) {
    :root {
        --gutter: 24px;
    }

    /* 모바일: 헤더를 두 줄(로고 / 메뉴)로 두고 고정 해제 */
    #site-header {
        position: static;
    }

    html {
        scroll-padding-top: 16px;
    }

    .nav-container {
        flex-wrap: wrap;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .nav-actions {
        flex-wrap: wrap;
        gap: 12px 20px;
    }


    .hero {
        padding-top: 48px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* 사진은 작은 아바타로 이름 위에 */
    .portrait {
        order: -1;
        width: 96px;
    }

    .portrait img {
        aspect-ratio: 1 / 1;
        border-radius: 50%;
        object-position: 50% 15%;
    }


    /* 모바일: 목차를 숨기고 섹션을 위에서 아래로 */
    .layout {
        grid-template-columns: 1fr;
        margin-top: 48px;
    }

    .toc {
        display: none;
    }

    .block {
        padding-bottom: 56px;
    }

    .block + .block {
        padding-top: 56px;
    }

    .block-title {
        margin-bottom: 20px;
        font-size: 23px;
    }
}

@media (max-width: 480px) {
    :root {
        --gutter: 20px;
    }

    body {
        font-size: 16px;
    }

    .logo span {
        display: none;
    }

    .hero-lead {
        font-size: 16px;
    }



    .case-title {
        font-size: 20px;
    }

    .case-body > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .skills > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .case-change dd {
        padding: 10px 12px;
    }

    .contact-email {
        font-size: 19px;
    }
}

/* 모션 최소화 선호 시 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

/* 인쇄: 이력서로 출력할 때 */
@media print {
    #site-header,
    .skip-link,
    .icon-links,
    footer .footer-social {
        display: none;
    }

    body {
        background: #fff;
        font-size: 10.5pt;
    }

    .hero {
        padding-top: 0;
    }

    .toc {
        display: none;
    }

    .layout {
        display: block;
    }

    .block,
    .block + .block {
        padding: 20pt 0;
    }

    .case,
    .job {
        break-inside: avoid;
    }

    .portrait img {
        mix-blend-mode: normal;
    }
}

/* ==========================================================
   기술 블로그
   ========================================================== */

.blog-section,
.post {
    max-width: 760px;
    margin: 0 auto;
    padding: 72px var(--gutter) 96px;
}

/* ---------- 목록 페이지 ---------- */
.blog-heading {
    margin-bottom: 12px;
    font-size: clamp(32px, 6vw, 44px);
    font-weight: 800;
}

.blog-intro {
    max-width: 560px;
    margin-bottom: 40px;
    color: var(--muted);
}

.blog-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--ink);
}

.blog-item {
    border-bottom: 1px solid var(--line);
}

.blog-item a {
    display: block;
    padding: 24px 0;
    color: inherit;
    text-decoration: none;
}

.blog-item a:hover .blog-item-title,
.blog-item a:focus-visible .blog-item-title {
    color: var(--accent);
}

.blog-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 14px;
}

.blog-item-label {
    color: var(--accent);
    font-weight: 600;
}

.blog-item-date {
    font-variant-numeric: tabular-nums;
}

.blog-item-title {
    margin-bottom: 6px;
    font-size: 21px;
    transition: color var(--transition);
}

.blog-item-description {
    font-size: 16px;
}

.blog-empty {
    padding: 40px 0;
    color: var(--muted);
    font-size: 15px;
    text-align: center;
}

/* ---------- 글 본문(포스트) ---------- */
.post-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.post-label {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
}

.post-title {
    margin-top: 10px;
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 800;
    line-height: 1.25;
}

.post-meta {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.post-content {
    font-size: 17px;
    line-height: 1.8;
}

.post-content p {
    margin-top: 20px;
}

.post-content h2,
.post-content h3 {
    margin-top: 48px;
    margin-bottom: 12px;
}

.post-content h2 {
    font-size: 24px;
}

.post-content h3 {
    font-size: 19px;
}

.post-content ul,
.post-content ol {
    margin-top: 20px;
    padding-left: 22px;
    list-style: initial;
}

.post-content ol {
    list-style: decimal;
}

.post-content li + li {
    margin-top: 8px;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content pre {
    margin-top: 24px;
    padding: 18px 22px;
    background-color: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    word-break: normal;
}

.post-content code {
    padding: 2px 6px;
    background-color: var(--paper-2);
    border-radius: 4px;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.88em;
}

.post-content pre code {
    padding: 0;
    background: transparent;
}

.post-content blockquote {
    margin-top: 24px;
    padding: 4px 20px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
}

.post-content table {
    display: block;
    width: 100%;
    margin-top: 24px;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 15px;
}

.post-content th,
.post-content td {
    padding: 8px 14px;
    border: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.post-content th {
    background-color: var(--paper-2);
    color: var(--ink);
}

.post-back {
    margin-top: 48px;
    font-size: 15px;
}

.post-back a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.post-back a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 860px) {
    .blog-section,
    .post {
        padding-top: 48px;
        padding-bottom: 72px;
    }

    .post-content {
        font-size: 16px;
    }
}
