/* style.css */

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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #f4f4f5;
    font-family: 'Noto Sans KR', sans-serif;
    color: #111;
    cursor: default;
    -webkit-font-smoothing: antialiased;
}

/* Scrollable pages (Resume/Info/Project) */
body.page {
    height: auto;
    min-height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* =====================================================
   Loader
   ===================================================== */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #f4f4f5;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #333;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* 로딩 중일 때 메인 콘텐츠 숨기기 */
body.loading canvas,
body.loading .ui-layer {
    opacity: 0;
}

/* =====================================================
   Navigation Bar
   ===================================================== */
header {
    width: 100%;
    padding: 40px 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeInDown 1s ease 0.2s forwards;
    z-index: 100;
    position: relative;
}

.top-nav {
  width: 100%;
  max-width: 1200px;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  margin-bottom: 0; /* 필요시 값 조절 */
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;

  padding-bottom: 10px;
}

.nav-left { justify-self: start; }
.nav-right { justify-self: end; }

/* nav 안의 타이틀(h1) 기본 여백/라인 영향 제거 */
.top-nav .site-title {
  margin: 0;
  line-height: 0;
  font-size: 0; /* 이미지 베이스라인/텍스트 라인 영향 제거 */
  justify-self: center;
}

/* 로고 링크는 nav 링크 효과(opacity/underline) 제외 */
.top-nav a.brand {
  opacity: 1;
}
.top-nav a.brand::after {
  content: none;
}

/* nav에서 로고 크기만 별도로 제어 (원하시는 크기로) */
.top-nav .site-title img {
  display: block;
  height: 40px;  /* 예: 32~48px 권장, 필요시 조절 */
  width: auto;
}


.nav-left, .nav-right {
    display: flex;
    gap: 24px;
}

.nav-left {
  grid-column: 1;
  justify-self: start;
}

.nav-right {
  grid-column: 3;
  justify-self: end;
}


.top-nav a {
    position: relative;
    opacity: 0.5;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
    opacity: 1;
}

.top-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.top-nav a:hover::after,
.top-nav a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
}

.site-header-content {
    text-align: center;
    margin-bottom: 60px;
}

h1.site-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 8px;
}

p.subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: #666;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* =====================================================
   Page Structure (New Design)
   ===================================================== */
.page-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 50px 40px 120px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.4s forwards;
}

/* Typography */
h2.page-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 4rem;
    letter-spacing: -0.03em;
    margin-bottom: 60px;
    opacity: 0.1; /* Subtle background-like title */
    display: none; /* Hidden by default, optional */
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 24px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    display: block;
}

/* =====================================================
   Resume Grid
   ===================================================== */
.resume-section {
    margin-bottom: 60px;
}

.resume-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.resume-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    font-size: 1rem;
    line-height: 1.6;
}

.resume-year {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: #666;
}

.resume-detail strong {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.resume-detail span {
    color: #555;
    font-size: 0.95rem;
}

/* =====================================================
   Project List (Catalog Style)
   ===================================================== */
.project-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #111;
}

.project-item {
    display: grid;
    grid-template-columns: 0.5fr 3fr 1fr 1fr;
    align-items: baseline;
    padding: 24px 0;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-item:hover {
    padding-left: 10px;
    border-bottom-color: #111;
}

.p-id {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: #888;
}

.p-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.p-year, .p-cat {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: #666;
    text-align: right;
}

/* =====================================================
   Info Page
   ===================================================== */
.info-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.info-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 24px;
    word-break: keep-all;
}

.info-contact ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-contact li {
    font-size: 1rem;
    display: flex;
    gap: 12px;
}

.info-contact .label {
    width: 100px;
    color: #888;
    font-family: 'Montserrat', sans-serif;
}

.info-contact a {
    border-bottom: 1px solid transparent;
}
.info-contact a:hover {
    border-bottom-color: currentColor;
}

/* =====================================================
   Footer
   ===================================================== */
.page-footer {
    margin-top: auto;
    padding: 40px;
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

/* =====================================================
   Matter.js & Index specific
   ===================================================== */
canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: opacity 0.5s ease;
}

.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: opacity 0.5s ease;
}

.ui-layer header,
.ui-layer footer,
.ui-layer a {
    pointer-events: auto;
}

.ui-layer footer {
    width: 100%;
    text-align: center;
    padding: 40px;
    font-size: 0.75rem;
    color: #999;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.05em;
    line-height: 1.6;
    animation: fadeInUp 1s ease 0.5s forwards;
    opacity: 0;
}

/* Detail Panel for Index */
.detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 35vw;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0,0,0,0.05);
    padding: 40px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transform: translateX(0);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.detail-panel.hidden {
    transform: translateX(100%);
}

.detail-close {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.detail-close:hover { opacity: 1; }

.detail-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.detail-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* =====================================================
   Animations & Responsive
   ===================================================== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    header { padding: 20px; }
    .top-nav { margin-bottom: 20px; }
    
    .nav-left, .nav-right { gap: 16px; }
    
    .resume-item {
        grid-template-columns: 1fr;
        gap: 4px;
        margin-bottom: 16px;
    }
    
    .project-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .p-id, .p-year, .p-cat { display: none; }
    
    .info-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .detail-panel {
        width: 100%;
        height: 60%;
        top: auto;
        bottom: 0;
    }
}

/* =====================================================
   PDF-style Resume Layout (matches provided PDF)
   ===================================================== */

.resume-pdf {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e6e6e6;
    padding: 56px 56px 64px;
}

.resume-pdf-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.resume-pdf-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 2.2rem;
    letter-spacing: 0.22em;
    line-height: 1.15;
    margin: 0;
}

.resume-pdf-role {
    margin-top: 10px;
    font-size: 1rem;
    color: #333;
    letter-spacing: 0.03em;
}

.resume-pdf-photo {
    flex: 0 0 auto;
}

.resume-pdf-photo img {
    width: 78px;
    height: 78px;
    border-radius: 999px;
    object-fit: cover;
    background: #f0f0f0;
    display: block;
}

.resume-pdf-rule {
    width: 100%;
    height: 2px;
    background: #111;
    margin-top: 16px;
}

.resume-pdf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 34px;
}

.resume-pdf-col.left {
    padding-right: 36px;
}

.resume-pdf-col.right {
    padding-left: 36px;
    border-left: 1px solid #ddd;
}

.resume-pdf-block {
    margin-bottom: 28px;
}

.resume-pdf-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 2px solid #111;
    margin-bottom: 14px;
}

.resume-pdf-dl {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.resume-pdf-dl .row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
}

.resume-pdf-dl dt {
    color: #444;
    font-weight: 600;
}

.resume-pdf-dl dd {
    color: #111;
}

.resume-pdf-timeline {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tl-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px;
    font-size: 0.95rem;
    line-height: 1.55;
}

.tl-date {
    color: #444;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
}

.tl-sub {
    margin-top: 4px;
    color: #777;
    font-size: 0.82rem;
    font-family: 'Noto Sans KR', sans-serif;
}

.tl-title {
    font-weight: 700;
    color: #111;
}

.tl-desc {
    color: #444;
    margin-top: 3px;
}

.resume-pdf-skills {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

.skill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    font-size: 0.95rem;
}

.skill-name {
    color: #111;
    font-weight: 600;
}

.dots {
    display: inline-flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid #111;
    display: inline-block;
}

.dot.full { background: #111; }
.dot.empty { background: transparent; }
.dot.half { background: linear-gradient(90deg, #111 50%, transparent 50%); }

/* Experience */
.resume-pdf-exp {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.exp-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px;
    font-size: 0.95rem;
    line-height: 1.55;
}

.exp-date {
    color: #444;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
}

.exp-sub {
    margin-top: 4px;
    color: #777;
    font-size: 0.82rem;
    font-family: 'Noto Sans KR', sans-serif;
}

.exp-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.exp-company {
    font-weight: 800;
    color: #111;
}

.exp-team {
    font-weight: 700;
    color: #666;
    white-space: nowrap;
}

.exp-desc {
    color: #444;
    margin-top: 4px;
}

/* Awards */
.resume-pdf-awards {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.award-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px;
    font-size: 0.95rem;
    line-height: 1.55;
}

.award-date {
    color: #444;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
}

.award-title {
    font-weight: 800;
    color: #111;
}

.award-meta {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #444;
}

.meta-label {
    display: inline-block;
    width: 70px;
    color: #777;
    font-weight: 600;
}

/* Activities */
.resume-pdf-activities {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.act-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px;
    font-size: 0.95rem;
    line-height: 1.55;
}

.act-date {
    color: #444;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
}

.act-title {
    font-weight: 800;
    color: #111;
}

.act-desc {
    color: #444;
    margin-top: 4px;
}

.act-org {
    margin-top: 4px;
    color: #666;
}

/* Responsive */
@media (max-width: 900px) {
    .resume-pdf {
        padding: 28px 22px 32px;
    }

    .resume-pdf-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .resume-pdf-col.left {
        padding-right: 0;
    }

    .resume-pdf-col.right {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid #ddd;
        padding-top: 28px;
    }

    .tl-item, .exp-item, .award-item, .act-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
