:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --secondary: #2563eb;
    --secondary-light: #3b82f6;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --background: #f1f5f9;
    --surface: #ffffff;
    --text: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.75;
    padding-bottom: 88px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

body.page-exit {
    opacity: 0;
}

/* =====================================================
   HERO SECTION
===================================================== */

/* ── Hero banner (every page) ── */

.hero {
    position: relative;
    min-height: 42vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 24px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.88) 0%,
        rgba(30, 58, 95, 0.75) 50%,
        rgba(37, 99, 235, 0.65) 100%
    );
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 85%, rgba(249, 115, 22, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(59, 130, 246, 0.2) 0%, transparent 45%);
    pointer-events: none;
}

.hero--home {
    background-image: url("hero1.jpg");
}

.hero--history {
    background-image: url("hero2.jpg");
}

.hero--casestudy {
    background-image: url("hero3.jpg");
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero .logo {
    display: block;
    width: clamp(96px, 16vw, 128px);
    height: clamp(96px, 16vw, 128px);
    object-fit: contain;
    margin: 0 auto 28px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35));
}

.hero h1 {
    color: white;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 300;
    line-height: 1.6;
    max-width: 520px;
}

/* =====================================================
   MAIN LAYOUT
===================================================== */

/* ── Main layout ── */

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* =====================================================
   CONTENT CARDS
===================================================== */

/* ── Cards ── */

.card {
    background: var(--surface);
    margin-bottom: 24px;
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card img {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    cursor: pointer;

}

.card h2 {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

.card p {
    color: var(--text);
    font-size: 0.95rem;
}

.card-note {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card h3 {
    color: var(--secondary);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}

/* =====================================================
   HOME PAGE BUTTONS
===================================================== */

/* ── Home page explore buttons ── */

.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

.nav-card {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    text-decoration: none;
    padding: 28px 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
    font-size: 1.05rem;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

.nav-card:active {
    transform: translateY(-1px);
}

/* =====================================================
   INTERACTIVE TIMELINE
===================================================== */

/* ── Interactive timeline ── */

.timeline-hint {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.timeline-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.timeline-filter {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.timeline-filter:hover {
    border-color: var(--secondary-light);
    color: var(--secondary);
}

.timeline-filter.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.timeline {
    border-left: 3px solid var(--secondary);
    padding-left: 28px;
    margin-top: 8px;
}

.timeline-item {
    margin-bottom: 12px;
    position: relative;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition), transform var(--transition);
}

.timeline-item.hidden {
    display: none;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 18px;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--secondary);
    transition: transform var(--transition), background var(--transition);
}

.timeline-item.open::before {
    transform: scale(1.25);
    background: var(--secondary);
}

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

.timeline-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.timeline-trigger:hover {
    border-color: var(--secondary-light);
    box-shadow: var(--shadow-sm);
}

.timeline-item.open .timeline-trigger {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(249, 115, 22, 0.06) 100%);
    border-color: var(--secondary-light);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.timeline-year {
    flex-shrink: 0;
    min-width: 52px;
    padding: 4px 10px;
    background: var(--secondary);
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    text-align: center;
}

.timeline-title {
    flex: 1;
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.timeline-chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform var(--transition);
    margin-right: 4px;
}

.timeline-item.open .timeline-chevron {
    transform: rotate(-135deg);
    margin-top: 6px;
}

.timeline-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    border: 1px solid transparent;
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.timeline-item.open .timeline-panel {
    max-height: 400px;
    opacity: 1;
    padding: 16px 18px 18px;
    border-color: var(--secondary-light);
    background: #fafbfc;
}

.timeline-panel p {
    color: var(--text);
    font-size: 0.92rem;
    margin-bottom: 10px;
}

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

.timeline-detail {
    color: var(--text-muted) !important;
    font-size: 0.88rem !important;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

/* =====================================================
   INFO GRID
===================================================== */

/* ── Info grid ── */

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.info-box {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 22px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), border-color var(--transition);
}

.info-box:hover {
    transform: translateY(-2px);
    border-color: var(--secondary-light);
}

.info-box h3 {
    margin-bottom: 8px;
}

.info-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =====================================================
   PAGE NAVIGATION
===================================================== */

/* ── Page navigation (prev / next only) ── */

.page-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.2);
    z-index: 100;
    overflow: visible;
}

.page-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.page-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    min-width: 130px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    border: none;
    cursor: pointer;
}

.page-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.page-nav-btn:active {
    transform: translateY(0);
}

.page-nav-btn.next {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.page-nav-btn.next:hover {
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}

.page-nav-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.12);
}

.page-nav-btn .arrow {
    font-size: 1.1rem;
    line-height: 1;
}

/* =====================================================
   PAGE MENU
===================================================== */

/* ── Page menu (drop-up from bottom left) ── */

.page-menu {
    position: relative;
    z-index: 110;
}

.page-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.page-menu-toggle:hover,
.page-menu.open .page-menu-toggle {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.page-dots {
    display: flex;
    gap: 7px;
    align-items: center;
}

.page-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: background var(--transition), transform var(--transition);
}

.page-dots span.active {
    background: var(--accent);
    transform: scale(1.2);
}

.page-menu-list {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    min-width: 200px;
    list-style: none;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 110;
}

.page-menu.open .page-menu-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.page-menu-list li {
    margin: 0;
}

.page-menu-list a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background var(--transition), color var(--transition);
}

.page-menu-list a:hover {
    background: #f1f5f9;
    color: var(--secondary);
}

.page-menu-list a.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(249, 115, 22, 0.08) 100%);
    color: var(--secondary);
    font-weight: 600;
}

/* =====================================================
   BACK TO TOP BUTTON
===================================================== */

/* ── Back to top button ── */

#topBtn {
    position: fixed;
    right: 24px;
    bottom: 100px;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    background: var(--surface);
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: background var(--transition), transform var(--transition), color var(--transition);
    z-index: 99;
}

#topBtn:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-3px);
}

#topBtn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   SCROLL ANIMATIONS
===================================================== */

/* ── Scroll animations ── */

.fade {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* =====================================================
   RESPONSIVE DESIGN
===================================================== */

/* ── Responsive ── */

@media (max-width: 768px) {
    .hero {
        min-height: 36vh;
        padding: 44px 20px;
    }

    main {
        padding: 20px 16px;
    }

    .card {
        padding: 24px 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .button-grid {
        grid-template-columns: 1fr;
    }

    .page-nav {
        padding: 14px 16px;
    }

    .page-nav-btn {
        min-width: auto;
        padding: 11px 16px;
        font-size: 0.82rem;
    }

    .page-nav-btn .label {
        display: none;
    }

    #topBtn {
        right: 16px;
        bottom: 92px;
        width: 44px;
        height: 44px;
    }

    .timeline-trigger {
        flex-wrap: wrap;
        gap: 8px;
    }

    .timeline-title {
        flex: 1 1 100%;
        order: 3;
        padding-left: 64px;
    }
}

@media (max-width: 480px) {
    .page-menu-list {
        min-width: 180px;
    }

    .timeline-filters {
        gap: 6px;
    }

    .timeline-filter {
        padding: 7px 12px;
        font-size: 0.78rem;
    }
}

/* =====================================================
   404 PAGE
===================================================== */

/* 404 Page */

.error-card {
    text-align: center;
}

.home-button {
    display: inline-block;
    padding: 14px 28px;
    background: var(--secondary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    transition: 0.3s;
}

.home-button:hover {
    transform: translateY(-3px);
    background: var(--secondary-light);
}

/* Page Load Animation */

.hero-content {
    animation: heroFade 1s ease forwards;
}

@keyframes heroFade {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Animations */

.fade {
    opacity: 0;
    transform: translateY(50px);
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

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

/* Navigation Cards */

.nav-card {
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.nav-card:hover {
    transform: translateY(-8px) scale(1.03);
}

/* Card Hover */

.card {
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
}

/* =====================================================
   IMAGE VIEWER / MODAL
===================================================== */

/* Image Viewer */

.image-modal {
    position: fixed;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);

    opacity: 0;
    visibility: hidden;

    transition: all 0.35s ease;

    z-index: 9999;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-modal-content {

    width: min(90%, 900px);

    background: rgba(255,255,255,0.15);

    backdrop-filter: blur(20px);

    border: 1px solid rgba(255,255,255,0.2);

    border-radius: 30px;

    padding: 2rem;

    text-align: center;

    transform: scale(0.85);

    transition: transform 0.35s ease;
}

.image-modal.active .image-modal-content {
    transform: scale(1);
}

.image-modal img {
    width: 100%;
    max-height: 70vh;

    object-fit: contain;

    border-radius: 20px;
}

.image-modal p {
    margin-top: 1.5rem;
    line-height: 1.7;
}

#closeModal {

    position: absolute;

    top: 25px;
    right: 25px;

    width: 50px;
    height: 50px;

    border: none;

    border-radius: 50%;

    background: rgba(255,255,255,0.15);

    color: white;

    font-size: 1.8rem;

    cursor: pointer;
}

.gallery-image {
    cursor: pointer;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.03);
}

/* IMAGE VIEWER */

body.modal-open {
    overflow: hidden;
}

body.modal-open > *:not(.image-modal) {
    filter: blur(12px);
    transition: filter 0.4s ease;
}

.image-modal {
    position: fixed;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(15,23,42,0.45);

    backdrop-filter: blur(14px);

    opacity: 0;
    visibility: hidden;

    transition: 0.4s ease;

    z-index: 9999;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-modal-content {

    position: relative;

    width: min(90%, 950px);

    padding: 24px;

    border-radius: 24px;

    background: rgba(255,255,255,0.12);

    border: 1px solid rgba(255,255,255,0.2);

    backdrop-filter: blur(25px);

    transform: scale(0.85);
    opacity: 0;

    transition:
        transform 0.4s ease,
        opacity 0.4s ease;
}

.image-modal.active .image-modal-content {
    transform: scale(1);
    opacity: 1;
}

.image-modal-content {
    position: relative;

    width: min(95vw, 1400px);
    max-height: 95vh;

    padding: 1rem;

    background: transparent;
    border: none;
    backdrop-filter: none;

    transform: scale(0.7);
    opacity: 0;

    transition:
        transform 0.45s cubic-bezier(.2,.8,.2,1),
        opacity 0.45s ease;
}

.image-modal img {
    width: 100%;
    max-height: 80vh;

    object-fit: contain;

    border-radius: 20px;

    box-shadow:
        0 25px 80px rgba(0,0,0,0.45),
        0 10px 30px rgba(0,0,0,0.25);
}

#modalDescription {

    margin-top: 18px;

    color: white;

    text-align: center;

    font-size: 0.95rem;
}

#closeModal {

    position: absolute;

    right: 15px;
    top: 15px;

    width: 44px;
    height: 44px;

    border: none;

    border-radius: 50%;

    cursor: pointer;

    font-size: 1.6rem;

    background: rgba(255,255,255,0.15);

    color: white;
}

.card img {

    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease;
}

.card img:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

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

#modalDescription {
    margin-top: 20px;

    padding: 18px 24px;

    border-radius: 16px;

    background: rgba(255,255,255,0.95);

    color: #334155;

    font-size: 1rem;
    line-height: 1.7;

    max-width: 1000px;

    margin-left: auto;
    margin-right: auto;
}