/* --- 源泉圓體 TC (GenSenRounded) Font Face --- */
@font-face {
    font-family: 'GenSenRounded2TC';
    font-style: normal;
    font-weight: 400;
    src: url('https://raw.githubusercontent.com/ButTaiwan/gensen-font/master/otf/TC/GenSenRounded2TC-R.otf') format('opentype');
}
@font-face {
    font-family: 'GenSenRounded2TC';
    font-style: normal;
    font-weight: 700;
    src: url('https://raw.githubusercontent.com/ButTaiwan/gensen-font/master/otf/TC/GenSenRounded2TC-B.otf') format('opentype');
}

/* --- Colourblind-Friendly Greyscale Palette & Variables --- */
:root {
    --black:        #000000;
    --dark-gray:    #404040;
    --mid-gray:     #808080;
    --light-gray:   #BFBFBF;
    --white:        #FFFFFF;

    --bg-outer:       var(--dark-gray);
    --bg-card:        var(--white);
    --text-primary:   var(--black);
    --text-secondary: var(--mid-gray);
    --accent-light:   var(--light-gray);

    --font-family: 'OpenDyslexic', 'GenSenRounded2TC', sans-serif;
}

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

body {
    background-color: var(--bg-outer);
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    gap: 40px;
    line-height: 1.5;
    text-align: left;
    letter-spacing: 0.05em;
}

b, strong {
    font-weight: 700;
}

/* --- Main Card Container --- */
.app-container {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 1100px;
    min-height: 650px;
    border-radius: 40px;
    padding: 40px 60px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

/* --- Slim navbar-only bar (all pages except homepage) --- */
.app-container--nav-only {
    min-height: unset !important;
    padding: 14px 40px !important;
    border-radius: 30px;
}

.app-container--nav-only .navbar {
    margin-bottom: 0 !important;
}

/* --- Navigation Bar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
}

.menu-icon {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-icon .bar {
    width: 30px;
    height: 4px;
    background-color: var(--mid-gray);
    border-radius: 2px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--mid-gray);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--black);
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 2px;
}

/* --- Hero Section --- */
.hero-section {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    flex: 1;
    max-width: 500px;
}

.hero-content h1 {
    font-size: 4rem;
    color: var(--black);
    margin-bottom: 20px;
}

.hero-content .underline {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.hero-content p {
    font-size: 2rem;
    color: var(--mid-gray);
    margin-bottom: 40px;
}

.cta-button {
    display: inline-block;
    background-color: var(--dark-gray);
    color: var(--white);
    text-decoration: none;
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 1.5rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: var(--black);
    transform: translateY(-2px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    width: 100%;
    height: 400px;
    background-color: var(--light-gray);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark-gray);
    border: 2px dashed var(--mid-gray);
}

/* --- Timeline Section --- */
.timeline-section {
    width: 100%;
    max-width: 1100px;
    background-color: var(--white);
    border-radius: 40px;
    padding: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    background-image:
        linear-gradient(rgba(191,191,191,0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(191,191,191,0.18) 1px, transparent 1px);
    background-size: 36px 36px;
}

.timeline-title {
    color: var(--black);
    font-size: 2.2rem;
    margin-bottom: 40px;
    text-align: center;
}

/* Carousel Container */
.timeline-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.timeline-carousel::-webkit-scrollbar { display: none; }
.timeline-carousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Individual Cards --- */
.timeline-card {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 320px;
    border-radius: 20px;
    padding: 30px 25px;
    scroll-snap-align: start;
    transition: transform 0.3s ease,
                background-color 0.35s ease,
                box-shadow 0.3s ease;

    /* Inactive: all cards are the same light gray */
    background-color: var(--light-gray);
}

/* Active card: dark gray, lifted */
.timeline-card.active {
    background-color: var(--dark-gray);
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
}

/* Text — inactive cards */
.timeline-card h3 {
    color: var(--black);
    font-size: 1.2rem;
    margin-bottom: 12px;
    line-height: 1.4;
    transition: color 0.35s ease;
}

.timeline-card p {
    color: var(--dark-gray);
    font-size: 0.93rem;
    line-height: 1.7;
    margin-bottom: 10px;
    transition: color 0.35s ease;
}

.timeline-card p:last-child { margin-bottom: 0; }

/* Text — active card */
.timeline-card.active h3,
.timeline-card.active p {
    color: var(--white);
}

/* Icon Circle */
.icon-circle {
    width: 64px;
    height: 64px;
    background-color: rgba(0, 0, 0, 0.12);
    color: var(--black);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    flex-shrink: 0;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.timeline-card.active .icon-circle {
    background-color: rgba(255, 255, 255, 0.18);
    color: var(--white);
}

/* --- Navigation Arrows and Dots --- */
.carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.arrow-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--light-gray);
    background-color: var(--white);
    color: var(--black);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.arrow-btn:hover {
    background-color: var(--dark-gray);
    color: var(--white);
    border-color: var(--dark-gray);
    transform: scale(1.1);
}

.dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--light-gray);
    transition: background-color 0.3s, transform 0.3s;
}

.dot.active {
    background-color: var(--dark-gray);
    transform: scale(1.35);
}