/* ===================================================
   Tsung-Hao Tseng — Resume Website
   Clean & Modern CSS with anime.js animation hooks
   =================================================== */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* ===================================================
   SCROLL PROGRESS BAR
   =================================================== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}

#scroll-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #555, #333, #111);
    border-radius: 0 2px 2px 0;
    transition: width 0.05s linear;
}

/* ===================================================
   SECTION HEADING UNDERLINE ANIMATION
   =================================================== */
.word-card h2,
section#experience>h2 {
    overflow: hidden;
}

/* Animated underline bar — grows on scroll-reveal */
.h2-underline-bar {
    display: block;
    width: 0;
    height: 3px;
    background: #333;
    border-radius: 2px;
    margin-top: 8px;
    transition: width 0.8s cubic-bezier(.25, .8, .25, 1);
}

.h2-underline-bar.revealed {
    width: 60px;
}

/* Paragraph text reveal — words fade in */
.word-reveal-container .word-span {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
}

body {
    font-family: "Google Sans", "Inter", system-ui, sans-serif;
    line-height: 1.65;
    color: #2d2d2d;
    background-color: #f7f7f8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Utility: content wrapper ---------- */
.content {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 5%;
}

/* ---------- Links ---------- */
a {
    text-decoration: none;
    color: #3a3a3a;
    transition: color 0.35s ease, text-shadow 0.35s ease;
}

a:hover {
    color: #111;
    text-shadow: none;
}

a:active {
    color: #666;
}

/* ---------- Lists (generic) ---------- */
li {
    margin: 6px 0;
    font-weight: 500;
    transition: transform 0.4s cubic-bezier(.25, .8, .25, 1), color 0.3s ease;
}

li:hover {
    transform: translateX(8px);
    color: #111;
}

/* ===================================================
   HEADER / HERO
   =================================================== */
header#top {
    padding-top: 60px;
    padding-bottom: 40px;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

section#hero_title h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 900;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 12px;
}

section#hero_title h2 {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #444;
    font-weight: 600;
    margin-bottom: 18px;
    overflow-wrap: break-word;
    white-space: normal;
}

section#hero_title p {
    font-weight: 500;
    font-size: 1rem;
    color: #555;
    max-width: 540px;
    line-height: 1.7;
    font-style: italic;
    border-left: 3px solid #c0c0c0;
    padding-left: 16px;
}

/* Hero Image */
section#hero_image {
    display: flex;
    align-items: center;
    justify-content: center;
    /* JS will set opacity:0 before animating */
}

section#hero_image img {
    display: block;
    width: clamp(160px, 22vw, 320px);
    border-radius: 50%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    transition: transform 0.6s cubic-bezier(.25, .8, .25, 1), box-shadow 0.6s ease;
}

section#hero_image img:hover {
    transform: scale(1.06);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.18);
}

/* ===================================================
   NAVIGATION BAR
   =================================================== */
.nav_bar {
    width: 100%;
    padding: 0;
    margin: 0;
    font-family: "Google Sans", sans-serif;
    z-index: 1000;
    background: rgba(247, 247, 248, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    transition: box-shadow 0.3s ease;
}

.nav_bar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.nav_bar ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 5%;
    max-width: 1140px;
    margin: 0 auto;
    justify-content: center;
}

.nav_bar li {
    margin: 0;
}

.nav_bar li:hover {
    transform: none;
}

.btn {
    display: inline-block;
    color: #f5f5f5;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    background-color: #2d2d2d;
    border-radius: 8px;
    transition: all 0.35s cubic-bezier(.25, .8, .25, 1);
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-3px);
    background-color: #444;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-weight: 600;
    text-shadow: none;
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ===================================================
   SECTIONS — WORD CARDS
   =================================================== */
.word-card {
    margin: 0 auto;
    padding: 48px 0;
    max-width: 1140px;
    border-bottom: 1px solid #e8e8e8;
    /* JS will set initial animation state */
}

.word-card h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}

/* h2 underline is now handled by .h2-underline-bar in JS */

.word-card p {
    font-weight: 500;
    line-height: 1.75;
    color: #444;
}

.word-card ul {
    list-style: none;
    padding: 0;
}

.word-card li {
    padding: 2px 0;
    margin: 4px 0;
}

/* ===================================================
   SOCIAL LINKS
   =================================================== */
section#links {
    margin: 0 auto;
    padding: 32px 0 48px;
    max-width: 1140px;
    display: flex;
    gap: 40px;
    justify-content: center;
    /* JS will set initial animation state */
}

section#links figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.4s cubic-bezier(.25, .8, .25, 1);
    cursor: pointer;
}

section#links figure:hover {
    transform: translateY(-6px);
}

section#links figure img {
    width: 44px;
    height: 44px;
    opacity: 0.75;
    transition: opacity 0.3s ease;
}

section#links figure:hover img {
    opacity: 1;
}

section#links figcaption h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
}

/* ===================================================
   CONTACTS
   =================================================== */
section#contacts {
    padding-bottom: 48px;
}

section#contacts ul {
    padding-left: 0;
}

section#contacts li {
    padding: 4px 0;
}

section#contacts li#email:hover {
    transform: translateY(-3px) translateX(0);
}

/* ===================================================
   EDUCATION & TECH SKILLS
   =================================================== */
.multi-line-li {
    margin-bottom: 28px !important;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.multi-line-li:last-child {
    border-bottom: none;
}

.multi-line-li h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
}

.multi-line-li h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    margin-top: 4px;
}

.multi-line-li p {
    font-size: 0.92rem;
    color: #777;
    margin-top: 4px;
}

.multi-line-li ul {
    margin-top: 8px;
    list-style: disc;
    padding-left: 20px;
}

.multi-line-li ul li {
    font-size: 0.93rem;
    color: #555;
    margin: 3px 0;
}

/* ===================================================
   EXPERIENCE SECTION
   =================================================== */
section#experience {
    max-width: 1140px;
    margin: 0 auto;
    padding: 48px 0 24px;
}

section#experience>h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 32px;
    padding-bottom: 10px;
    position: relative;
    /* JS will set initial animation state */
}

/* experience h2 underline is now handled by .h2-underline-bar in JS */

/* Experience Image Cards */
.image-card {
    margin-bottom: 56px;
    padding: 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    /* JS will set initial animation state */
}

.image-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px) !important;
}

.image-card ul {
    list-style: none;
    padding-left: 0;
}

.image-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.image-card h4 {
    font-size: 0.92rem;
    font-weight: 500;
    color: #777;
    margin-bottom: 4px;
}

.image-card h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    margin-top: 16px;
    margin-bottom: 6px;
}

.image-card li {
    font-size: 0.93rem;
    color: #555;
    margin: 3px 0;
}

.image-card-description {
    flex: 1;
    padding-right: 24px;
}

.image-card-img {
    flex-shrink: 0;
}

.image-card-img figure {
    margin: 0;
    font-weight: 500;
    text-align: center;
}

.image-card img {
    width: 100%;
    max-width: 380px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.5s cubic-bezier(.25, .8, .25, 1), box-shadow 0.5s ease;
}

.image-card img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}

.image-card figcaption {
    font-size: 0.88rem;
    color: #888;
    font-style: italic;
    line-height: 1.5;
}

/* ===================================================
   STRENGTHS
   =================================================== */
section#strengths li {
    position: relative;
    padding-left: 20px;
}

section#strengths li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #888;
    font-weight: 700;
}

/* ===================================================
   CAREER OBJECTIVE
   =================================================== */
section#career-objective h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.6;
    margin-bottom: 12px;
}

section#career-objective ul {
    padding-left: 0;
}

section#career-objective li {
    position: relative;
    padding-left: 20px;
    margin: 6px 0;
}

section#career-objective li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #999;
    font-size: 0.75rem;
}

/* ===================================================
   CTA (Floating Email Button)
   =================================================== */
section#cta {
    text-align: center;
    padding: 40px 0;
}

.cta-btn img {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 52px;
    height: 52px;
    padding: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 1500;
    transition: transform 0.35s cubic-bezier(.25, .8, .25, 1), box-shadow 0.35s ease;
    cursor: pointer;
}

.cta-btn img:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

/* ===================================================
   FOOTER
   =================================================== */
footer {
    padding: 28px 5%;
    background: #eee;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

footer p {
    font-weight: 700;
    color: #444;
    margin-bottom: 8px;
}

footer a.btn {
    display: inline-block;
    font-size: 0.85rem;
    padding: 8px 20px;
}

/* ===================================================
   RESPONSIVE — DESKTOP (>= 900px)
   =================================================== */
@media (min-width: 900px) {
    header#top {
        display: flex;
        flex-direction: row;
        gap: 40px;
        padding-top: 80px;
        padding-bottom: 60px;
    }

    section#hero_title {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 3;
        order: 2;
    }

    section#hero_image {
        flex: 2;
        order: 1;
    }

    .nav_bar ul {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 12px 5%;
    }

    .word-card {
        display: flex;
        flex-direction: row;
        gap: 40px;
        padding: 56px 5%;
    }

    .word-card h2 {
        flex: 0 0 200px;
    }

    .word-card p,
    .word-card ul,
    .word-card div {
        flex: 1;
    }

    section#links {
        justify-content: flex-start;
        gap: 56px;
        padding-left: 5%;
    }

    .image-card {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }

    .image-card-description {
        flex: 1;
        padding-right: 0;
    }

    .image-card-img {
        flex: 0 0 40%;
        max-width: 400px;
    }

    .image-card-img figure {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    section#career-objective div {
        flex: 1;
    }
}

/* ===================================================
   RESPONSIVE — MOBILE (<= 600px)
   =================================================== */
@media (max-width: 600px) {
    .content {
        padding: 0 6%;
    }

    header#top {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 40px;
    }

    section#hero_title p {
        border-left: none;
        padding-left: 0;
        text-align: center;
    }

    section#hero_title h1 {
        font-size: 2rem;
    }

    .nav_bar ul {
        gap: 4px;
        padding: 10px 4%;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.82rem;
    }

    .image-card {
        padding: 20px;
    }

    section#links {
        gap: 24px;
    }
}

/* ===================================================
   ANIMATION HELPERS (used by anime.js)
   =================================================== */
/* Animation states are managed by JS for progressive enhancement */
.js-loaded .anim-target {
    opacity: 0;
    transform: translateY(40px);
}

/* Skill tag pill style for tech skills section */
section#technical-skills .multi-line-li ul li {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 14px;
    border-radius: 20px;
    margin: 4px 4px;
    font-size: 0.88rem;
    color: #444;
    transition: background 0.3s ease, transform 0.3s ease;
}

section#technical-skills .multi-line-li ul li:hover {
    background: #e0e0e0;
    transform: translateY(-2px) translateX(0);
}

/* Core Strengths list items in tech section */
section#technical-skills>ul>li:last-child ul li {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 14px;
    border-radius: 20px;
    margin: 4px 4px;
    font-size: 0.88rem;
    transition: background 0.3s ease, transform 0.3s ease;
}

/* h2 underline animations are managed by JS */

/* Subtle page-level divider gradient */
main.content::before {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin-bottom: 0;
}