/* ==========================================================================
   main.css — 김주원 포트폴리오, 미니멀 개발자 포트폴리오 디자인 시스템
   토큰 → 베이스 → 레이아웃 → 컴포넌트 순으로 구성된 단일 스타일시트.
   흑/백/회색만 사용하고 색상 액센트는 두지 않는다. 위계는 두께·크기·
   테두리·간격으로 만든다.
   ========================================================================== */

:root {
    --ink: #0a0a0a;
    --paper: #ffffff;
    --surface: #ffffff;
    --surface-subtle: #fafafa;
    --border: #e6e6e6;
    --border-strong: #d0d0d0;
    --muted: #62636a;
    --muted-2: #8f8f95;

    --radius-lg: 14px;
    --radius: 10px;
    --radius-sm: 6px;

    --container-prose: 860px;
    --container-wide: 1140px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;
    --space-10: 140px;

    --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
        "Noto Sans KR", sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI",
        "Noto Sans KR", "Malgun Gothic", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

    --header-h: 64px;
}

/* ---------- 리셋 / 베이스 ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--header-h);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

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

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

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- 레이아웃 유틸 ---------- */
.container {
    width: min(calc(100% - 40px), var(--container-prose));
    margin: 0 auto;
}

.container-wide {
    width: min(calc(100% - 40px), var(--container-wide));
    margin: 0 auto;
}

/* index.html의 최상위 래퍼: 자체 max-width가 없는 자식(아코디언 리스트 등)의
   안전망 역할. hero/project/tech-stack 등은 각자 더 안쪽에서 다시 폭을
   맞추므로 이중으로 중앙정렬돼도 문제 없다. */
.portfolio-shell {
    width: min(calc(100% - 40px), var(--container-wide));
    margin: 0 auto;
    padding: 0 0 var(--space-9);
}

.section {
    padding: var(--space-9) 0;
    border-top: 1px solid var(--border);
}

.section:first-of-type {
    border-top: none;
}

@media (max-width: 720px) {
    .section {
        padding: var(--space-7) 0;
    }
}

/* 공통 섹션 헤더 (project-intro-head / section-header.minimal-header) */
.project-intro-head,
.minimal-header {
    text-align: center;
    margin: 0 auto var(--space-6);
    max-width: 640px;
}

/* project-intro-head는 별도 <section> 래퍼 없이 히어로 바로 다음에 오므로
   여기서 직접 섹션 구분선/여백을 만든다 */
.project-intro-head {
    padding-top: var(--space-9);
    border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
    .project-intro-head {
        padding-top: var(--space-7);
    }
}

.pill-label,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
    box-shadow: none !important;
}

.sparkle-icon {
    display: inline-block;
    color: var(--ink);
    font-size: 0.85em;
    animation: sparkle-twinkle 1.8s ease-in-out infinite;
}

@keyframes sparkle-twinkle {
    0%, 100% {
        transform: scale(0.8) rotate(-10deg);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }
}

.spin-icon {
    display: inline-block;
    color: var(--ink);
    font-size: 0.85em;
    animation: spin-slow 3s linear infinite;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.bulb-icon {
    display: inline-block;
    color: var(--ink);
    font-size: 0.85em;
    animation: bulb-flicker 1.6s ease-in-out infinite;
}

@keyframes bulb-flicker {
    0%, 100% {
        transform: scale(1);
        opacity: 0.65;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sparkle-icon,
    .spin-icon,
    .bulb-icon {
        animation: none;
    }
}

.section-intro {
    text-align: left;
    margin-bottom: var(--space-5);
}

.project-intro-head h1,
.minimal-header h2 {
    margin: 16px 0 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.7rem, 3.4vw, 2.3rem);
    letter-spacing: -0.02em;
    color: var(--ink);
}

.project-intro-head p,
.minimal-header .header-desc {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

/* 태그/키워드 = 모노스페이스 아웃라인 칩 (전 섹션 공통) */
.showcase-keywords span,
.scan-results span,
.insight-tags span,
.mts-tags span,
.keyword-row span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
}

.tag-impact {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: none;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.86rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 160ms ease;
}

.tag-impact:hover,
.tag-impact:focus-visible {
    opacity: 0.78;
}

/* ==========================================================================
   1. 상단 고정 헤더
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 500;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    width: min(calc(100% - 40px), var(--container-wide));
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

.wordmark {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.header-nav::-webkit-scrollbar {
    display: none;
}

.header-nav a {
    font-size: 0.88rem;
    color: var(--muted);
    white-space: nowrap;
    transition: color 160ms ease;
}

.back-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--ink);
}

.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--paper);
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 160ms ease;
}

.header-cta:hover {
    opacity: 0.78;
}

@media (max-width: 720px) {
    .header-inner {
        gap: var(--space-3);
    }

    .header-nav {
        justify-content: flex-start;
        gap: var(--space-4);
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
    }

    .wordmark {
        font-size: 0.95rem;
    }

    /* 이력서 버튼은 히어로/푸터에도 있으니 좁은 화면에서는 내비 공간을 우선한다 */
    .header-cta {
        display: none;
    }
}

/* ---------- 스크롤 진행바 ---------- */
#scroll-progress-container {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    z-index: 499;
    pointer-events: none;
}

#scroll-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--ink);
    transition: width 120ms linear;
}

/* ==========================================================================
   2. 히어로 — 마케팅 배너형 2단 그리드 대신, 저자 프로필/바이라인 구조.
   작은 원형 아바타 + eyebrow → 큰 헤드라인 → 바이오 → 구분선 → 인용구/
   경력/링크를 한 줄로 배치하는 단일 컬럼 구성.
   ========================================================================== */
.hero {
    padding: var(--space-9) 0 var(--space-8);
    border-top: none;
}

.hero-inner {
    width: min(calc(100% - 40px), var(--container-wide));
    margin: 0 auto;
}

.hero-byline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-5);
}

.hero-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    flex-shrink: 0;
}

.hero-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.hero-eyebrow strong {
    color: var(--ink);
    font-weight: 600;
}

.hero-title {
    margin: 0 0 var(--space-5);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 3.4vw, 2.7rem);
    line-height: 1.24;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.hero-name {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.hero-bio {
    margin: 0 0 var(--space-5);
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.85;
    max-width: 52ch;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: var(--space-7);
    align-items: stretch;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.hero-tags span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 12px;
    background: var(--surface-subtle);
}

.hero-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-subtle);
}

.hero-card-label {
    margin-bottom: var(--space-4);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.hero-card-quote {
    display: flex;
    gap: 10px;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.hero-card-quote-mark {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    color: var(--border-strong);
}

.hero-card-quote p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--ink);
}

.hero-fact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.hero-fact strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
}

.hero-fact span {
    display: block;
    margin-top: 2px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted-2);
}

.hero-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: auto;
}

.hero-links {
    display: flex;
    gap: var(--space-2);
}

.hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--ink);
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.hero-link:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        margin-top: var(--space-2);
    }
}

@media (max-width: 420px) {
    .hero-bottom-row {
        flex-wrap: wrap;
        row-gap: var(--space-3);
    }
}

/* ==========================================================================
   2-1. 경력 카드
   ========================================================================== */
.career-card {
    padding: var(--space-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-subtle);
}

.career-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.career-card-head h3 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
}

.career-role {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted-2);
}

.career-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.career-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 var(--space-5);
    padding: 0;
    list-style: none;
}

.career-list li {
    padding-left: var(--space-4);
    border-left: 2px solid var(--border);
    line-height: 1.6;
    color: var(--ink);
}

/* ==========================================================================
   2-2. 아키텍처 다이어그램
   ========================================================================== */
.arch-diagram {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin: 0;
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-subtle);
}

.arch-row-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 8px;
}

.arch-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.arch-node {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 8px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    white-space: nowrap;
}

.arch-node--accent {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.arch-arrow {
    flex-shrink: 0;
    color: var(--muted-2);
    font-size: 0.85rem;
}

.proof-media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin: var(--space-4) 0 var(--space-5);
}

.proof-figure {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-subtle);
}

.proof-figure img,
.proof-figure video {
    display: block;
    width: 100%;
    height: auto;
}

.proof-figure figcaption {
    padding: 9px 14px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted-2);
    border-top: 1px solid var(--border);
}

.carousel-placeholder {
    aspect-ratio: 1280 / 578;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--surface-subtle);
    color: var(--muted-2);
}

.carousel-placeholder i {
    font-size: 1.6rem;
}

.carousel-placeholder span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

@media (max-width: 780px) {
    .proof-media-grid {
        grid-template-columns: 1fr;
    }
}

.demo-carousel {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 836px;
    margin: var(--space-4) auto var(--space-5);
}

.carousel-viewport {
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.carousel-track {
    display: flex;
    align-items: flex-start;
}

.carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
}

.carousel-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--paper);
    color: var(--ink);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 160ms ease, opacity 160ms ease;
}

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

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 560px) {
    .demo-carousel {
        gap: var(--space-2);
    }
    .carousel-btn {
        width: 32px;
        height: 32px;
    }
}

/* ==========================================================================
   3. 프로젝트 카드
   ========================================================================== */
.project-integration {
    max-width: var(--container-wide);
    margin: 0 auto var(--space-9);
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.project-showcase {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.showcase-intro {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.showcase-intro p {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.75;
    color: var(--muted);
}

.showcase-intro-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: var(--space-2);
    padding: 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--paper);
    transition: border-color 160ms ease, opacity 160ms ease;
}

.showcase-intro-link:hover {
    border-color: var(--ink);
    opacity: 0.8;
}

.showcase-meta {
    display: flex;
    flex-direction: column;
}

.showcase-date-row {
    display: flex;
    gap: var(--space-4);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: var(--space-4);
}

.impact-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: var(--space-3);
}

.impact-header-title i {
    color: var(--ink);
}

/* showcase-intro 안에서 소제목 블록(프로젝트 소개 / 백엔드 아키텍처 / 실제 화면 등)을
   나누는 가벼운 구분선. 부모의 flex gap이 이미 위아래 여백을 주므로 margin은 두지 않는다 */
.intro-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

.impact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--space-5);
}

.showcase-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   3-1. 프로젝트 개요 그리드 (여러 프로젝트 카드) / 상세 탭 전환
   ========================================================================== */
.project-grid-section {
    max-width: var(--container-wide);
    margin: 0 auto var(--space-9);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

@media (max-width: 780px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    transition: border-color 180ms ease, transform 180ms ease;
}

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

/* 카드 전체를 감싸는 히트박스 링크(상세 페이지 이동)와, 그 위에 얹히는 실제 콘텐츠 */
.project-card-hitbox {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.project-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex: 1;
    pointer-events: none;
}

.project-card-content .project-card-live-link {
    pointer-events: auto;
}

.project-card-thumb {
    height: 190px;
    overflow: hidden;
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border);
}

.project-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.project-card:hover .project-card-thumb img {
    transform: scale(1.06);
}

.project-card-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-2);
    font-size: 1.4rem;
}

/* 썸네일 위에 타이틀/설명을 오버레이하는 카드 변형 */
.project-card-thumb--overlay {
    position: relative;
    height: 260px;
    display: flex;
    align-items: flex-end;
}

.project-card-thumb--overlay img {
    position: absolute;
    inset: 0;
    object-position: top center;
}

.project-card-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.9) 0%, rgba(10, 10, 10, 0.6) 32%, rgba(10, 10, 10, 0.22) 62%, rgba(10, 10, 10, 0) 100%);
    pointer-events: none;
}

.project-card-meta-chip {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    white-space: nowrap;
}

.project-card-overlay {
    position: relative;
    z-index: 1;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-card-overlay h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    color: #fff;
}

.project-card-overlay p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.84);
}

.project-card-body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    flex: 1;
}

.project-card-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.project-card-body h3 {
    margin: 0;
    font-size: 1.15rem;
    font-family: var(--font-display);
}

.project-card-body p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

.project-card-stats {
    display: flex;
    flex-wrap: wrap;
    row-gap: var(--space-3);
}

.project-card-stats .stat-tile {
    flex: 1 1 30%;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 var(--space-3);
}

.project-card-stats .stat-tile:first-child {
    padding-left: 0;
}

.project-card-stats .stat-tile + .stat-tile {
    border-left: 1px solid var(--border);
}

.project-card-stats .stat-tile strong {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.project-card-stats .stat-tile span {
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--muted);
}

.project-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: var(--space-3);
}

.project-card-tags span {
    font-size: 0.74rem;
    font-family: var(--font-mono);
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
}

.project-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink);
    margin-top: var(--space-2);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.project-card-cta i {
    font-size: 0.78rem;
    transition: transform 160ms ease;
}

.project-card-cta:hover i {
    transform: translateX(3px);
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.project-card-live-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--paper);
    transition: border-color 160ms ease, opacity 160ms ease;
}

.project-card-live-link i {
    font-size: 0.7rem;
}

.project-card-live-link:hover {
    border-color: var(--ink);
    opacity: 0.8;
}

.placeholder-note {
    font-size: 0.78rem;
    color: var(--muted-2);
    font-family: var(--font-mono);
    padding: var(--space-6);
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

/* ==========================================================================
   4. My Contributions — 아코디언 / STAR 카드
   ========================================================================== */
.featured-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.accordion-item.active {
    border-color: var(--ink);
}

.accordion-header {
    width: 100%;
    display: grid;
    grid-template-columns: 1.5fr 1fr 20px;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-5);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
}

.accordion-header:hover {
    background: var(--surface-subtle);
}

.header-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header-main h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ink);
}

.header-main p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.card-index {
    display: none;
}

.scan-results {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.arrow-icon {
    font-size: 1rem;
    color: var(--muted-2);
    transition: transform 220ms ease;
    justify-self: end;
}

.accordion-item.active .arrow-icon {
    transform: rotate(180deg);
    color: var(--ink);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 480ms cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface-subtle);
}

.accordion-item.active .accordion-content {
    max-height: 4000px;
}

.inner-padding {
    padding: var(--space-5) var(--space-4);
    border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
    .accordion-header {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .arrow-icon {
        justify-self: start;
    }
}

/* ---- STAR (Situation/Task/Action/Result) 카드: 색 대신 라벨/두께로 구분 ---- */
.star-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: none;
}

.star-card--situation,
.star-card--task,
.star-card--action,
.star-card--result {
    border: 1px solid var(--border);
    background-color: var(--surface);
}

.star-card__header {
    padding: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.star-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.star-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
}

.star-icon--situation,
.star-icon--task,
.star-icon--action,
.star-icon--result {
    background-color: var(--ink);
    color: var(--paper);
}

.star-label-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.star-type-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.star-type-label--situation,
.star-type-label--task,
.star-type-label--action,
.star-type-label--result {
    color: var(--muted-2);
}

.star-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ink);
}

.inner-arrow-icon {
    font-size: 0.92rem;
    color: var(--muted-2);
    transition: transform 220ms ease;
}

.inner-accordion-content {
    display: none;
    border-top: 1px solid var(--border);
}

/* STAR 카드 내부에 촘촘히 박힌 인라인 스타일(색/굵기)은 대부분 이미
   중립 회색조라 그대로 둬도 새 시스템과 잘 어울린다. */

/* ==========================================================================
   5. 기술 스택
   ========================================================================== */
.tech-stack-section {
    max-width: var(--container-wide);
    margin: 0 auto;
}

.tech-stack-section::before {
    display: none;
}

.tech-category-grid {
    display: grid;
    /* 박스 안 배지가 2열로 앉을 때 "Spring Security" 같은 긴 이름 +
       숙련도 점이 잘리지 않을 만큼 최소 폭을 확보한다 */
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: var(--space-4);
}

.tech-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-5);
    background: var(--surface);
    box-shadow: none;
    transition: border-color 160ms ease;
}

.tech-box:hover {
    transform: none;
    border-color: var(--border-strong);
    box-shadow: none;
}

.box-backend,
.box-data,
.box-infra,
.box-tools,
.box-ai {
    background-color: var(--surface);
    border: 1px solid var(--border);
}

.tech-stack-section .tech-category-grid .tech-box .box-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

/* 2열 그리드는 유지하되, 배지 내부(아이콘+이름)는 폭이 좁아도 절대
   두 줄로 넘어가지 않도록 한다 — 이름이 길면 말줄임(...)로 잘라내고
   숙련도 점은 항상 오른쪽에 고정 노출 */
.badge-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
}

.tech-badge {
    display: flex;
    align-items: center;
    min-width: 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    box-shadow: none;
    gap: 6px;
}

.tech-badge:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-strong);
}

.tech-emoji {
    flex-shrink: 0;
    line-height: 1;
}

.tech-stack-section .tech-category-grid .tech-box .tech-badge .tech-name {
    color: var(--ink);
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tech-dots {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 3px;
    margin-left: auto;
    padding-left: 2px;
}

.dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    border-radius: 50%;
    background-color: var(--border);
}

.dot.filled {
    background-color: var(--ink);
}

/* ==========================================================================
   6. Technical Case Studies (트러블슈팅)
   ========================================================================== */
.minimal-ts-list {
    max-width: var(--container-wide);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.mts-item.mts-card {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: 0;
    transition: border-color 160ms ease;
}

.mts-item:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-strong);
}

.mts-item-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-5);
}

.mts-item-header h3 {
    font-size: 1.12rem;
    color: var(--ink);
    font-weight: 700;
}

.mts-item-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-5);
    align-items: start;
}

.mts-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.mts-prefix {
    margin-bottom: 2px;
}

.ts-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.76rem;
}

.mts-cause h4,
.mts-solution h4 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mts-cause h4 {
    color: var(--muted-2);
}

.mts-cause p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--muted);
}

.mts-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-top: 44px;
    color: var(--border-strong);
}

.mts-blue,
.mts-green {
    color: var(--ink) !important;
}

.ts-status.resolved {
    color: var(--muted);
    font-weight: 600;
}

.ts-result-ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ts-result-ul li {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: var(--space-4);
    border-left: 2px solid var(--border);
}

.ts-result-ul li strong {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.5;
}

.ts-result-ul li span {
    display: block;
    font-size: 0.86rem;
    line-height: 1.65;
    color: var(--muted);
}

@media (max-width: 850px) {
    .mts-item.mts-card {
        padding: var(--space-5) !important;
    }

    .mts-item-body {
        grid-template-columns: 1fr;
    }

    .mts-connector {
        padding-top: 0;
        transform: rotate(90deg);
        margin: 2px 0;
    }
}

/* ==========================================================================
   7. 인사이트
   ========================================================================== */
.insights-grid {
    max-width: var(--container-wide);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    padding: 0;
}

.insight-card {
    display: flex;
    flex-direction: column;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: none;
    transition: border-color 200ms ease;
}

.insight-card:hover {
    transform: none;
    background: var(--surface) !important;
    border-color: var(--ink) !important;
    box-shadow: none;
}

/* 썸네일: 다이어그램/스크린샷 원본 크기와 무관하게 고정 높이로 자르고,
   overflow:hidden으로 아래 텍스트 영역과 절대 겹치지 않게 한다 */
.insight-thumb {
    position: relative;
    width: 100%;
    height: 168px;
    overflow: hidden;
    background-color: var(--surface-subtle);
    border-bottom: 1px solid var(--border);
}

.insight-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}

.insight-card:hover .insight-thumb img {
    transform: none;
    opacity: 0.92;
}

.insight-category {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
}

/* 이미지 위가 아니라 이미지 "아래" 흰 영역에 텍스트를 배치 — 이미지와
   충분한 여백을 두어 절대 겹치지 않도록 함 */
.insight-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: var(--space-5);
}

.insight-date {
    color: var(--muted-2);
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.insight-body h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    line-height: 1.4;
    color: var(--ink) !important;
}

.insight-body p {
    margin: 0 0 var(--space-4);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.insight-tags {
    margin-top: auto;
}

/* ==========================================================================
   8. 반응형 컨테이너 보정
   ========================================================================== */
@media (max-width: 720px) {
    .container,
    .container-wide,
    .header-inner {
        width: min(calc(100% - 24px), var(--container-wide));
    }
}

/* ==========================================================================
   9. 커피챗 CTA (최하단)
   ========================================================================== */
.coffee-chat-inner {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.coffee-chat-inner h2 {
    margin: 16px 0 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.7rem, 3.4vw, 2.3rem);
    letter-spacing: -0.02em;
    color: var(--ink);
}

.coffee-chat-inner .header-desc {
    margin: 0 0 var(--space-6);
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.coffee-chat-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--paper);
    font-size: 0.92rem;
    font-weight: 600;
    transition: opacity 160ms ease;
}

.coffee-chat-cta:hover {
    opacity: 0.78;
}
