@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #121212;
    --primary-color: #FFFFFF;
    --accent-color: #FFFFFF; /* A clean white accent */
    --text-color-secondary: rgba(255, 255, 255, 0.7);
    --font-family: 'Poppins', sans-serif;
}

/* --- Base & Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden; /* Prevent scrolling */
}

body.is-loading {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

body.is-loaded {
    opacity: 1;
}

#background-sky, #stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; /* Fallback for browsers that do not support dvh */
    height: 100dvh;
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

#background-sky {
    z-index: -2;
    background-color: var(--bg-color);
}

#page-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh; /* Fallback for browsers that do not support dvh */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-content {
    opacity: 0; /* Hidden for entrance animation */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-image-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
    position: relative; /* Establish a stacking context */
    z-index: 1; /* Ensure it's above the background */
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 10;
}

h1.ml-name {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle drop shadow for readability */
}

.ml-name .letter {
    display: inline-block;
    line-height: 1em;
    opacity: 0; /* Prepare for staggered animation */
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-color-secondary);
    margin-bottom: 1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle drop shadow for readability */
}

.welcome-text {
    font-size: 1.1rem;
    color: var(--text-color-secondary);
    margin-bottom: 2rem; /* Add space before connect section */
    text-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle drop shadow for readability */
}

/* --- Connect Section --- */
.connect-section p {
    font-size: 1rem;
    color: var(--text-color-secondary);
    margin-bottom: 1.5rem;
    max-width: 500px; /* Constrain width for readability */
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle drop shadow for readability */
}

.icon-group {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.icon-link {
    font-size: 1.8rem;
    color: var(--text-color-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1)); /* Subtle drop shadow for icons */
}

.icon-link:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

/* --- Day Mode --- */
body.day-mode {
    --primary-color: #2c3e50; /* A dark slate blue for text */
    --text-color-secondary: rgba(44, 62, 80, 0.75);
    --accent-color: #2c3e50;
}

body.day-mode .profile-image {
    box-shadow: 0 0 25px rgba(44, 62, 80, 0.5);
}

body.day-mode .icon-link {
    color: var(--text-color-secondary);
}

body.day-mode .icon-link:hover {
    color: var(--accent-color);
}

/* --- Horizontal Time Slider --- */
.time-slider-container {
    position: relative;
    width: 100%;
    max-width: 280px; /* Match the approximate width of the icon group */
    margin: 2rem auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.time-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #2c3e50 0%, #f1c40f 50%, #2c3e50 100%);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

.time-slider:hover {
    opacity: 1;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.slider-tooltip {
    position: absolute;
    bottom: 35px; /* Position above the slider */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    white-space: nowrap;
}

.time-slider-container:hover .slider-tooltip {
    opacity: 1;
    visibility: visible;
}


/* --- Media Queries --- */
/* --- Starfield --- */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    perspective: 100px;
    perspective-origin: 50% 50%;
    z-index: -1;
}
#stars-container .layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateZ(0px);
}
#stars-container .star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

/* --- Media Queries --- */
@media (max-width: 768px) {
    #page-container {
        padding: 0 1.5rem;
    }

    h1.ml-name {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .icon-group {
        flex-wrap: wrap;
        justify-content: center;
        /* Set a max-width to encourage a 4-3 split for 7 icons.
           Calculated based on icon size (1.8rem) and gap (1.5rem).
           4 icons + 3 gaps = 4*1.8 + 3*1.5 = 7.2 + 4.5 = 11.7rem
           5 icons + 4 gaps = 5*1.8 + 4*1.5 = 9.0 + 6.0 = 15.0rem
           A value between these two will force a wrap after 4 icons.
        */
        max-width: 14rem;
        margin-left: auto;
        margin-right: auto;
    }

    #stars-container .star {
        opacity: 0.7; /* Reduce star intensity on mobile */
    }
}