/* ========================================
   Sub-Page Layout (Experience, Projects)
   ======================================== */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 32px 96px;
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
    margin-bottom: 48px;
    animation: pageFadeUp 0.7s var(--ease-out) 0.1s both;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    line-height: 1.2;
    padding-left: 16px;
    border-left: 3px solid var(--color-accent);
}

.page-header p {
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.6;
    padding-left: 19px;
}

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

/* ========================================
   Timeline (reused from academic)
   ======================================== */
.timeline {
    list-style: none;
    padding: 0;
}

.timeline-item {
    display: flex;
    padding: 18px 12px;
    margin: 0 -12px;
    border-bottom: 1px solid var(--color-border-light);
    border-radius: 6px;
    transition: background-color var(--transition-fast);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item:hover {
    background-color: var(--color-accent-soft);
}

.date {
    min-width: 110px;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-right: 24px;
    flex-shrink: 0;
    padding-top: 3px;
}

.timeline-item em {
    color: var(--color-text-secondary);
    font-style: italic;
    display: block;
    margin-top: 4px;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.5;
}

.timeline-item em strong {
    color: var(--color-text);
    font-weight: 700;
    font-style: normal;
    background: linear-gradient(transparent 60%, rgba(99, 102, 241, 0.12) 60%);
    padding: 0 2px;
}

.timeline-item em .eq-mark {
    color: var(--color-accent);
    font-weight: 1200;
    font-size: 0.85em;
}

.timeline-item > .content {
    flex: 1;
    font-size: 15px;
    line-height: 1.65;
    color: var(--color-text);
    font-weight: 500;
}

.timeline-item a {
    display: inline-block;
    margin-right: 10px;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 3px 10px;
    border-radius: 4px;
    background-color: var(--color-accent-soft);
    color: var(--color-accent);
    transition: all var(--transition-fast);
}

.timeline-item a:hover {
    background-color: var(--color-accent);
    color: #fff;
    text-decoration: none;
}

.timeline-item .coming-soon {
    display: inline-block;
    margin-right: 10px;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 3px 10px;
    border-radius: 4px;
    background-color: var(--color-border-light);
    color: var(--color-text-muted);
    cursor: default;
}

/* ========================================
   Section Styling
   ======================================== */
.page-section {
    margin-bottom: 56px;
    scroll-margin-top: 76px;
}

.page-section h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 24px;
    padding-left: 16px;
    border-left: 3px solid var(--color-accent);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.page-section > p {
    font-size: 15px;
    line-height: 1.78;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    max-width: 620px;
}

/* ========================================
   Project Cards
   ======================================== */
.project-img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--color-border-light);
    cursor: zoom-in;
    transition: opacity var(--transition-fast);
}

.project-img:hover {
    opacity: 0.9;
}

/* Portrait image + horizontal card layout */
.project-card-horizontal {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.project-img-portrait {
    width: 180px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--color-border-light);
    cursor: zoom-in;
    transition: opacity var(--transition-fast);
}

.project-img-portrait:hover {
    opacity: 0.9;
}

.project-card-body {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .project-card-horizontal {
        flex-direction: column;
    }

    .project-img-portrait {
        width: 50%;
        max-width: 200px;
        margin: 0 auto 16px;
        display: block;
    }
}

/* ========================================
   Image Lightbox
   ======================================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lightbox-overlay.active {
    opacity: 1;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    transform: scale(0.92);
    transition: transform 0.3s var(--ease-out);
}

.lightbox-overlay.active img {
    transform: scale(1);
}

.project-card {
    padding: 28px 24px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: box-shadow var(--transition-normal),
                border-color var(--transition-normal);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.project-card p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.project-tag {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: 4px;
    background-color: var(--color-accent-soft);
    color: var(--color-accent);
}

.project-links a {
    display: inline-block;
    margin-right: 10px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 3px 10px;
    border-radius: 4px;
    background-color: var(--color-accent-soft);
    color: var(--color-accent);
    transition: all var(--transition-fast);
}

.project-links a:hover {
    background-color: var(--color-accent);
    color: #fff;
    text-decoration: none;
}

.project-links .coming-soon {
    display: inline-block;
    margin-right: 10px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 3px 10px;
    border-radius: 4px;
    background-color: var(--color-border-light);
    color: var(--color-text-muted);
    cursor: default;
}

/* ========================================
   Page Footer
   ======================================== */
.page-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--color-border-light);
    margin-top: 24px;
}

.page-footer p {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.page-footer a {
    font-weight: 600;
}

/* ========================================
   Scroll Reveal - Timeline Items
   ======================================== */
.reveal .timeline-item {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.reveal.revealed .timeline-item {
    opacity: 1;
    transform: translateY(0);
}

.reveal.revealed .timeline-item:nth-child(1) { transition-delay: 0.06s; }
.reveal.revealed .timeline-item:nth-child(2) { transition-delay: 0.12s; }
.reveal.revealed .timeline-item:nth-child(3) { transition-delay: 0.18s; }
.reveal.revealed .timeline-item:nth-child(4) { transition-delay: 0.24s; }
.reveal.revealed .timeline-item:nth-child(5) { transition-delay: 0.30s; }
.reveal.revealed .timeline-item:nth-child(6) { transition-delay: 0.36s; }

/* Scroll Reveal - Project Cards */
.reveal .project-card {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out),
                box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.reveal.revealed .project-card {
    opacity: 1;
    transform: translateY(0);
}

.reveal.revealed .project-card:nth-child(1) { transition-delay: 0.06s; }
.reveal.revealed .project-card:nth-child(2) { transition-delay: 0.14s; }
.reveal.revealed .project-card:nth-child(3) { transition-delay: 0.22s; }

.reveal.revealed .project-card:hover {
    transform: none;
}

/* ========================================
   Responsive - Mobile (< 768px)
   ======================================== */
@media (max-width: 768px) {
    .page-container {
        padding: 24px 16px 60px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-section h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .timeline-item {
        flex-direction: column;
        padding: 14px 8px;
        margin: 0 -8px;
    }

    .date {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 4px;
    }

    .project-card {
        padding: 20px 16px;
    }
}

/* ========================================
   CV Page — Header
   ======================================== */
.cv-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--color-text);
}

.cv-header h1 {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.cv-header .cv-contact {
    font-size: 13.5px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.cv-header .cv-contact a {
    font-weight: 500;
}

.cv-header .cv-contact .sep {
    margin: 0 6px;
    color: var(--color-text-muted);
}

/* ========================================
   CV Page — Sections
   ======================================== */
.cv-section {
    margin-bottom: 36px;
}

.cv-section h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.cv-section .cv-item {
    margin-bottom: 14px;
}

.cv-section .cv-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.cv-section .cv-item-header strong {
    font-size: 15px;
    color: var(--color-text);
}

.cv-section .cv-item-header .cv-date {
    font-size: 13px;
    color: var(--color-accent);
    font-weight: 600;
    white-space: nowrap;
}

.cv-section .cv-item-detail {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-top: 2px;
}

.cv-section .cv-item-detail em {
    color: var(--color-text-muted);
}

/* CV — Publication list */
.cv-section .cv-pub {
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    padding-left: 18px;
    text-indent: -18px;
}

.cv-section .cv-pub strong {
    color: var(--color-text);
}

.cv-section .cv-pub a {
    font-size: 12.5px;
    font-weight: 600;
}

/* CV — Skills */
.cv-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cv-skills span {
    font-size: 12.5px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
    background-color: var(--color-accent-soft);
    color: var(--color-text-secondary);
}

/* CV — Awards list */
.cv-section ul.cv-awards {
    list-style: none;
    padding: 0;
}

.cv-section ul.cv-awards li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 6px 0;
    font-size: 14px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-light);
}

.cv-section ul.cv-awards li:last-child {
    border-bottom: none;
}

.cv-section ul.cv-awards .cv-date {
    font-size: 12px;
    color: var(--color-accent);
    font-weight: 600;
    white-space: nowrap;
}

/* CV — Project list */
.cv-section ul.cv-projects {
    list-style: none;
    padding: 0;
}

.cv-section ul.cv-projects li {
    margin-bottom: 10px;
}

.cv-section ul.cv-projects li strong {
    font-size: 14px;
    color: var(--color-text);
}

.cv-section ul.cv-projects li p {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin-top: 2px;
}

/* ========================================
   CV Print Styles
   ======================================== */
@media print {
    .cv-header {
        margin-bottom: 24px;
        padding-bottom: 16px;
    }

    .cv-section {
        margin-bottom: 20px;
        break-inside: avoid;
    }

    .cv-section h2 {
        margin-bottom: 8px;
    }

    .cv-skills span {
        border: 1px solid var(--color-border);
        background: none;
    }

    .page-container {
        padding: 0;
        max-width: 100%;
    }

    .page-footer {
        display: none;
    }

    /* Force all reveal elements visible for print */
    .reveal,
    .reveal .timeline-item,
    .reveal .project-card {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .page-header,
    .reveal .timeline-item,
    .reveal .project-card {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========================================
   Professional editorial refresh
   ======================================== */
.page-container {
    max-width: 960px;
    padding: 78px 32px 100px;
}

.page-header {
    margin-bottom: 86px;
    padding-bottom: 42px;
    border-bottom: 1px solid var(--color-border);
}

.page-header .page-number {
    margin-bottom: 12px;
    padding: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.page-header h1 {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    font-size: clamp(48px, 7vw, 68px);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.page-header p:not(.page-number) {
    max-width: 580px;
    padding: 0;
    font-size: 15px;
    color: var(--color-text-secondary);
}

.page-section {
    margin-bottom: 76px;
    scroll-margin-top: 90px;
}

.page-section h2 {
    margin-bottom: 24px;
    padding: 18px 0 0;
    border-top: 1px solid var(--color-border);
    border-left: 0;
    font-size: 31px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.page-section > p {
    max-width: 700px;
    margin-bottom: 18px;
    font-size: 14px;
}

.timeline-item {
    margin: 0;
    padding: 20px 2px;
    border-radius: 0;
    transition: padding var(--transition-fast), background-color var(--transition-fast);
}

.timeline-item:hover {
    padding-right: 12px;
    padding-left: 12px;
}

.date {
    min-width: 124px;
    margin-right: 28px;
    padding-top: 4px;
    font-size: 10.5px;
    letter-spacing: 0.08em;
}

.timeline-item > .content {
    font-size: 14px;
    line-height: 1.65;
}

.timeline-item em {
    margin-top: 5px;
    font-family: var(--font-display);
    font-size: 14px;
    line-height: 1.55;
}

.timeline-item em strong {
    background: linear-gradient(transparent 66%, rgba(143, 29, 44, 0.1) 66%);
}

.timeline-item a,
.project-links a {
    margin-top: 9px;
    padding: 3px 8px;
    border: 1px solid rgba(143, 29, 44, 0.14);
    border-radius: 0;
    background: transparent;
    font-size: 10.5px;
    letter-spacing: 0.04em;
}

.project-card {
    margin-bottom: 28px;
    padding: 28px;
    border-radius: 0;
    background: rgba(255, 254, 250, 0.76);
}

.project-card:hover {
    border-color: #c9c1b6;
    box-shadow: var(--shadow-md);
}

.project-card h3 {
    margin-bottom: 10px;
    font-size: 24px;
    line-height: 1.16;
    letter-spacing: -0.02em;
}

.project-card p {
    max-width: 760px;
    font-size: 13.5px;
    line-height: 1.75;
}

.project-img,
.project-img-portrait {
    border-radius: 0;
    border-color: var(--color-border);
    background: #f2f1ed;
}

.project-img { margin-bottom: 22px; }
.project-card-horizontal { gap: 28px; }

.project-cover {
    display: block;
    margin-bottom: 22px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    background: #f2f1ed;
}

.project-cover img {
    display: block;
    width: 100%;
    transition: transform var(--transition-normal), opacity var(--transition-fast);
}

.project-cover:hover img {
    opacity: 0.94;
    transform: scale(1.012);
}

.project-title-link {
    color: var(--color-text);
}

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

.project-cover-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin-bottom: 22px;
    border: 1px solid var(--color-border);
    background: var(--color-border);
}

.project-cover-grid .project-cover {
    margin: 0;
    border: 0;
}

.project-tag {
    padding: 4px 8px;
    border-radius: 0;
    font-size: 9.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-tags { margin: 16px 0 13px; }

.page-footer {
    padding: 34px 0 0;
    text-align: left;
}

.page-footer p { font-size: 11px; }

@media (max-width: 768px) {
    .page-container { padding: 54px 16px 70px; }
    .page-header { margin-bottom: 62px; padding-bottom: 32px; }
    .page-header h1 { font-size: 48px; }
    .page-section { margin-bottom: 60px; }
    .page-section h2 { font-size: 27px; }
    .timeline-item { padding: 17px 2px; }
    .timeline-item:hover { padding-right: 2px; padding-left: 2px; }
    .date { margin: 0 0 5px; }
    .project-card { padding: 18px; }
    .project-card h3 { font-size: 21px; }
}
