/* Modern CSS Design System for Etta Huang CV */
:root {
    /* Color Palette - Dark Mode Default */
    --bg-dark: #0b0f19;
    --bg-card: rgba(22, 30, 49, 0.7);
    --bg-card-hover: rgba(30, 41, 67, 0.85);
    --bg-navbar: rgba(11, 15, 25, 0.8);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-blue: #38bdf8;
    --accent-indigo: #6366f1;
    --accent-emerald: #10b981;
    --accent-purple: #a855f7;
    --accent-amber: #f59e0b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.3);
    
    --font-heading: 'Plus Jakarta Sans', 'Noto Sans TC', sans-serif;
    --font-body: 'Inter', 'Noto Sans TC', sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    --shadow-glass: 0 12px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode Overrides */
html.light {
    --bg-dark: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: rgba(255, 255, 255, 0.98);
    --bg-navbar: rgba(248, 250, 252, 0.9);
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --accent-blue: #0284c7;
    --accent-indigo: #4f46e5;
    --accent-emerald: #059669;
    --accent-purple: #7c3aed;
    --accent-amber: #d97706;
    
    --border-color: rgba(0, 0, 0, 0.12);
    --border-highlight: rgba(2, 132, 199, 0.5);
    
    --shadow-glass: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Glowing Background Circles */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}
.bg-glow-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-indigo), transparent);
    top: -100px;
    left: -100px;
}
.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-blue), transparent);
    top: 40%;
    right: -150px;
}
.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-emerald), transparent);
    bottom: -100px;
    left: 20%;
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
    border-color: var(--border-highlight);
}

/* Buttons & Icons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: #fff;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.05);
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--accent-blue);
    border-color: var(--border-highlight);
    transform: rotate(15deg);
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 1000;
    background: var(--bg-navbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-accent {
    color: var(--accent-blue);
}

.logo-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.nav-menu {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

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

/* Layout Main Container */
.main-wrapper {
    max-width: 1200px;
    margin: 100px auto 40px;
    padding: 0 24px;
}

/* Hero Section */
.hero-card {
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.hero-profile-area {
    display: flex;
    gap: 32px;
    align-items: center;
    margin-bottom: 32px;
}

.avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.avatar-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-blue);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
}

.hero-info {
    flex-grow: 1;
}

.badge-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.tag-primary { background: rgba(56, 189, 248, 0.15); color: var(--accent-blue); border: 1px solid rgba(56, 189, 248, 0.3); }
.tag-secondary { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); border: 1px solid rgba(99, 102, 241, 0.3); }
.tag-accent { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); border: 1px solid rgba(168, 85, 247, 0.3); }

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
}

.hero-tagline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.contact-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.chip-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.chip-item:hover {
    color: var(--accent-blue);
    border-color: var(--border-highlight);
    background: rgba(56, 189, 248, 0.08);
}

/* Language Bar */
.language-bar {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.lang-title {
    color: var(--accent-blue);
    font-weight: 700;
}

.lang-divider {
    color: var(--text-muted);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.metric-icon {
    font-size: 1.6rem;
    color: var(--accent-blue);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-value {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-value small {
    font-size: 0.9rem;
    font-weight: 500;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Section Common Container */
.section-container {
    margin-top: 50px;
}

.section-header {
    margin-bottom: 28px;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.accent-icon {
    color: var(--accent-blue);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-top: 4px;
}

/* Highlights Grid */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.highlight-card {
    padding: 28px;
    position: relative;
}

.card-icon-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card-icon-title i {
    color: var(--accent-blue);
}

.period-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-code);
    display: block;
    margin-bottom: 16px;
}

.card-body-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.highlight-card-featured {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.15);
}

/* Skills Matrix */
.skills-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.skill-group-card {
    padding: 24px;
}

.skill-group-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-chip {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
}

.skill-chip.active { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.35); color: var(--accent-blue); font-weight: 500; }
.skill-chip.tech { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.35); color: #a5b4fc; font-weight: 500; }
.skill-chip.tool { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); color: #fcd34d; font-weight: 500; }
.skill-chip.ai { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.35); color: #e9d5ff; font-weight: 500; }

/* Light Mode Contrast Rules for Skill Chips and Tags */
html.light .chip-item,
html.light .language-bar {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

html.light .skill-chip {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    font-weight: 600;
}

html.light .skill-chip.active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
}

html.light .skill-chip.tech {
    background: #eef2ff;
    border-color: #6366f1;
    color: #3730a3;
}

html.light .skill-chip.tool {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

html.light .skill-chip.ai {
    background: #faf5ff;
    border-color: #a855f7;
    color: #581c87;
}

html.light .t-tag {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
    font-weight: 600;
}

html.light .t-tag.highlight-tag {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #78350f;
    font-weight: 700;
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

#timeline-search {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

#timeline-search:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.filter-btn {
    padding: 6px 14px;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active {
    background: var(--accent-blue);
    color: #fff;
}

/* Timeline List */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
}

.timeline-item {
    padding: 28px;
    position: relative;
    border-left: 4px solid var(--accent-blue);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 14px;
}

.company-badge {
    display: flex;
    flex-direction: column;
}

.comp-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent-blue);
}

.comp-period {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-code);
}

.role-title-group {
    text-align: right;
}

.role-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.role-tag {
    font-size: 0.85rem;
    color: var(--accent-emerald);
    font-weight: 600;
}

.timeline-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.proj-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.proj-title i {
    color: var(--accent-indigo);
}

.proj-duties {
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.94rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.t-tag {
    font-size: 0.78rem;
    font-family: var(--font-code);
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.highlight-tag {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.4);
    font-weight: 700;
}

/* Autobio Section */
.profile-card {
    padding: 36px;
}

.autobio-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.paragraph strong {
    color: var(--text-primary);
}

.highlight-para {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 20px;
    border-radius: var(--radius-md);
}

/* Education Section */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.edu-card {
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.edu-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.edu-details h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.edu-degree {
    font-size: 0.9rem;
    color: var(--accent-emerald);
    font-weight: 600;
}

/* Footer */
.footer {
    margin-top: 80px;
    background: var(--bg-navbar);
    border-top: 1px solid var(--border-color);
    padding: 40px 24px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.footer-brand p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-contacts a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

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

.footer-copy {
    width: 100%;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Print Styles */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .navbar, .bg-glow, .timeline-controls, #print-btn, #theme-toggle, .toast {
        display: none !important;
    }
    .main-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .glass-card {
        background: #fff !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        break-inside: avoid;
    }
    .hero-title, .comp-name, .role-title, .proj-title {
        color: #000 !important;
    }
    .t-tag, .skill-chip {
        border: 1px solid #999 !important;
        color: #333 !important;
        background: #f0f0f0 !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .hero-profile-area { flex-direction: column; text-align: center; }
    .badge-group, .contact-chips, .language-bar { justify-content: center; }
    .role-title-group { text-align: left; }
    .flex-header { flex-direction: column; align-items: flex-start; }
    .search-box { width: 100%; }
    .footer-container { flex-direction: column; text-align: center; }
}

/* Side Projects Showcase */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 24px;
}

.project-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-shot {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
    cursor: zoom-in;
}

.project-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: var(--transition);
}

.project-shot:hover img {
    transform: scale(1.03);
}

.project-body {
    padding: 24px 26px 26px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.project-body .card-icon-title {
    margin-bottom: 0;
}

.project-body .period-text {
    margin-bottom: 0;
}

.project-features {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

.project-features li + li {
    margin-top: 4px;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 6px;
}

.project-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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