:root {
    /* Main Backgrounds */
    --bg-color: #f8f9fa;
    /* Off-white for less eye strain than pure white */
    --card-bg: #ffffff;

    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #555555;

    /* Accent Colors: Blue */
    --accent-primary: #2563eb;
    /* Royal Blue */
    --accent-light: #60a5fa;
    --accent-dark: #1e40af;
    --accent-dim: rgba(37, 99, 235, 0.1);

    /* Mapping old Gold variables to new Blue for compatibility */
    --gold-primary: var(--accent-primary);
    --gold-light: var(--accent-light);
    --gold-dark: var(--accent-dark);
    --gold-dim: var(--accent-dim);
    --gold-border: 1px solid var(--accent-primary);

    --font-heading: 'Noto Serif TC', serif;
    --font-body: 'Noto Sans TC', sans-serif;

    --transition-speed: 0.3s;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style-position: inside;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: rgba(255, 255, 255, 0.95);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: var(--font-heading);
    color: var(--gold-primary);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links li a {
    font-size: 1.2rem;
    color: var(--text-primary);
    position: relative;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--gold-primary);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--gold-primary);
    transition: width 0.3s;
}

.nav-links li a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 0 20px;
}

.profile-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    background-color: #fff;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    overflow: hidden;
    position: relative;
    animation: fadeIn 1s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-container:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.5);
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 
       Updated based on user feedback (Step 299):
       Move Left slightly.
       Scale 1.7: Retained.
       TranslateX -2.5%: Small left shift from center.
       TranslateY 8%: Retained.
    */
    object-position: center 20%;
    transform: scale(1.7) translateX(-2.5%) translateY(8%);
    transition: transform 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1 {
    font-size: 5rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 5px;
    background: linear-gradient(to right, var(--accent-light), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content .tagline {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.hero-content .sub-tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-style: italic;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
    font-size: 1.1rem;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.cta-button:hover {
    background-color: var(--gold-primary);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--gold-dark);
}

/* Section Common */
.content-section {
    padding: 100px 0;
}

.alt-bg {
    background-color: #ecf0f3;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--gold-primary);
}

/* About Grid */
.bio-text {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    text-align: justify;
}

.bio-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Education Cards */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.edu-card {
    background: var(--card-bg);
    padding: 30px;
    border: 1px solid #e0e0e0;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.edu-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-primary);
}

.edu-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.edu-card .degree {
    color: var(--text-primary);
    font-weight: bold;
    margin-bottom: 10px;
}

/* Career Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--gold-dark);
}

.timeline-item {
    padding-left: 30px;
    margin-bottom: 50px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--gold-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold-primary);
}

.timeline-item .year {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

/* Public Service */
.service-block {
    margin-bottom: 50px;
    background: var(--card-bg);
    padding: 40px;
    border-left: 4px solid var(--gold-primary);
}

.role-highlight {
    color: var(--gold-light);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: #ffffff;
    padding: 25px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.service-card h4 {
    color: var(--gold-secondary);
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.service-card ul {
    list-style-type: none;
}

.service-card ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.service-card ul li::before {
    content: '•';
    color: var(--gold-primary);
    position: absolute;
    left: 0;
}

/* Professional Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 10px;
    box-shadow: 5px 5px 15px #d1d9e6, -5px -5px 15px #ffffff;
}

.skill-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
    /* filter: grayscale(100%); Removed to make icons always bright */
    /* Optional stylized look */
    transition: transform 0.3s;
}

.skill-card:hover .icon {
    transform: scale(1.1);
}

.skill-card ul {
    list-style: none;
    text-align: left;
    display: inline-block;
}

.skill-card ul li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.skill-card ul li::before {
    content: '✔️';
    position: absolute;
    left: 0;
    font-size: 0.8rem;
    color: var(--gold-primary);
}

/* Philosophy */
.main-quote {
    font-size: 2rem;
    font-family: var(--font-heading);
    color: var(--gold-light);
    text-align: center;
    margin: 50px auto;
    font-style: italic;
    max-width: 900px;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.phi-item {
    text-align: center;
    border: 1px solid var(--gold-dim);
    padding: 30px;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.phi-item:hover {
    background: var(--gold-dim);
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.phi-item h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Contact Section */
.contact-form {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    padding: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row input {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 15px;
    color: var(--text-primary);
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
}

.contact-form textarea {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 15px;
    color: var(--text-primary);
    border-radius: 5px;
    outline: none;
    margin-bottom: 20px;
    resize: none;
    transition: border-color 0.3s;
}

.form-row input:focus,
.contact-form textarea:focus {
    border-color: var(--gold-primary);
}

/* Fix Browser Autofill Background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #080808 inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.contact-form button {
    width: 100px;
    cursor: pointer;
    background: transparent;
}

.contact-form button:hover {
    background: var(--gold-primary);
    color: #000;
}

/* Footer */
footer {
    padding: 40px 0;
    text-align: center;
    background-color: #1a1a1a;
    /* Keep footer dark for contrast */
    color: #999;
    border-top: 1px solid #333;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 3rem;
    }

    /* Mobile Nav Styles */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: rgb(8, 8, 8);
        text-align: center;
        padding: 20px 0;
        border-bottom: 1px solid var(--gold-dark);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .hamburger {
        display: block;
        color: var(--gold-primary);
        font-size: 1.5rem;
    }

    .hamburger span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--gold-primary);
        margin: 5px 0;
        transition: 0.3s;
    }

    .form-row {
        flex-direction: column;
    }
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #ffffff;
    border: 1px solid var(--accent-primary);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-box h3 {
    margin-bottom: 15px;
    color: var(--gold-primary);
}

.modal-box p {
    margin-bottom: 25px;
    color: var(--text-primary);
}

.modal-btn {
    background: var(--gold-primary);
    color: #000;
    border: none;
    padding: 10px 25px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 5px;
    transition: 0.3s;
}

.modal-btn:hover {
    background: #fff;
}