/* General Body Styling */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #fff;
    color: #333;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

html {
    scroll-snap-type: y proximity;
}

/* Dots Background */
#dots-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #ccc;
    border-radius: 50%;
    transition: transform 0.5s ease-out;
}


/* Decorative Shapes */
.shape {
    position: absolute;
    opacity: 0.7;
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.circle {
    border-radius: 50%;
}

.square {
    border-radius: 0;
}

.triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 120px solid; /* color is set inline */
}


@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(15deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}


/* Hero Header */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 300;
}

/* Main Content */
.content {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    scroll-snap-align: start;
}

/* Navigation Menu Styling */
nav {
    margin-bottom: 2rem;
}

.topic-list,
.sub-topic-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.topic-list > li {
    margin-bottom: 1rem;
}

.topic-list > li > a,
.submenu-toggle {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    color: #333;
    background-color: #f8f9fa;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.topic-list > li > a:hover,
.submenu-toggle:hover,
.submenu-toggle:focus-visible {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submenu-toggle::after {
    content: "▾";
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.has-submenu.is-open .submenu-toggle::after {
    transform: rotate(180deg);
}

.sub-topic-list {
    margin-top: 0.6rem;
    padding: 0.75rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: grid;
    gap: 0.5rem;
}

.sub-topic-list[hidden] {
    display: none;
}

.sub-topic-list li a {
    display: block;
    padding: 0.65rem 1rem;
    background-color: #f2f4f6;
    color: #555;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sub-topic-list li a:hover,
.sub-topic-list li a:focus-visible {
    background-color: #e6eaee;
    color: #000;
}

main p {
    text-align: center;
    margin: 0;
    line-height: 1.7;
    color: #4a4a4a;
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        scroll-snap-type: y mandatory;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .content {
        min-height: 100vh;
        padding: 3rem 1.5rem;
        width: 90%;
        border-radius: 18px;
        box-shadow: 0 20px 36px rgba(0, 0, 0, 0.08);
    }

    .shape {
        width: 100px !important;
        height: 100px !important;
        opacity: 0.5;
    }
    .triangle {
        border-left-width: 50px !important;
        border-right-width: 50px !important;
        border-bottom-width: 100px !important;
    }
}

@media (max-width: 480px) {
    body {
        background: radial-gradient(circle at 20% 25%, #fff8f0 0%, #ffffff 42%, #f8fbff 100%);
    }

    .hero h1 {
        font-size: clamp(1.85rem, 7.5vw, 2.3rem);
        line-height: 1.2;
        padding: 0 0.8rem;
    }

    .content {
        min-height: 100vh;
        padding: 2.3rem 1rem;
        width: 95%;
        margin: 0 auto;
        background: rgba(255, 255, 255, 0.93);
        backdrop-filter: blur(8px);
        border-radius: 16px 16px 0 0;
    }

    .topic-list > li > a,
    .submenu-toggle {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }

    .sub-topic-list {
        padding: 0.55rem;
    }

    .sub-topic-list li a {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .shape {
        width: 60px !important;
        height: 60px !important;
        opacity: 0.45;
    }
    .triangle {
        border-left-width: 30px !important;
        border-right-width: 30px !important;
        border-bottom-width: 60px !important;
    }

    .shape.square[style*="left: 80%"] {
        left: 71% !important;
        top: 66% !important;
    }

    .shape.square[style*="left: 90%"] {
        left: 78% !important;
        top: 9% !important;
    }

    .shape.triangle[style*="left: 70%"] {
        left: 58% !important;
        top: 26% !important;
    }

    .shape.circle[style*="top: 90%"] {
        top: 82% !important;
        left: 33% !important;
    }

    .shape.triangle[style*="top: 80%"] {
        top: 74% !important;
    }

    /* Keep all decorative shapes visible after mobile repositioning. */
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-snap-type: none;
    }

    .shape {
        animation: none;
    }
}
