/* Declare cascade layers in order */
@layer reset, base, components, utilities;

/* ------------------------------ */
/* RESET LAYER                    */
/* ------------------------------ */
@layer reset {
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    /* FIXED: html must NOT have height constraints */
    html {
        overflow-x: hidden;
    }

    /* body controls page height */
    body {
        min-height: 100vh;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
    }

    main {
        flex: 1;
    }
}

/* ------------------------------ */
/* BASE LAYER                     */
/* ------------------------------ */
@layer base {

    /* MOVE GRADIENT TO HTML */
    html {
        background: linear-gradient(
    to bottom,
    #d9d9d9 0%,     /* gray start */
    #d9d9d9 20%,    /* gray end */
    #a9d8ff 20%,    /* sky blue start */
    #a9d8ff 73%,    /* sky blue end */
    #7ed957 80%,    /* green start */
    #7ed957 100%    /* green end */
);
        background-attachment: fixed;
    }

    /* BODY BECOMES TRANSPARENT */
    body {
        background: transparent;
        color: #1f1f21;
        font-family: "Inter", "Segoe UI", sans-serif;
        line-height: 1.6;

        display: flex;
        flex-direction: column;

        isolation: isolate;
    }

    .title {
        font-size: 1.8rem;
        font-weight: 600;
        margin-bottom: 15px;
    }

    .nav-grid a,
    .nav-grid a:link,
    .nav-grid a:visited,
    .nav-grid a:hover,
    .nav-grid a:active {
        color: #1f1f21;
        text-decoration: none;
    }
}

.warning-banner {
    background: rgba(255, 255, 0, 0.25);
    border: 1px solid rgba(255, 255, 0, 0.4);
    padding: 12px 16px;
    margin: 20px auto;
    max-width: 900px;
    border-radius: 8px;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 14px;
}

/* ------------------------------ */
/* COMPONENTS LAYER               */
/* ------------------------------ */
@layer components {

    /* XP TEXT STYLES */
    .xp-text,
    .xp-text-title,
    .xp-text-regular {
        font-family: "Trebuchet MS", Tahoma, Verdana, sans-serif;
        color: #ffffff;
        text-shadow:
            1px 1px 2px rgba(0, 0, 0, 0.45),
            0 0 3px rgba(0, 0, 0, 0.25),
            -1px -1px 1px rgba(255, 255, 255, 0.18);
    }

    .xp-text { font-style: italic; font-weight: 600; }
    .xp-text-title { font-weight: 600; }
    .xp-text-regular { font-weight: normal; } /* FIXED */

    /* SKY HEADER */
    .sky-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding: 25px 30px 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    position: relative;
	display: flex;
    flex-direction: column;
    align-items: center;   /* centers horizontally */
    text-align: center;    

    /* FIXES GRADIENT CLIPPING */
    isolation: isolate;
    z-index: 1;
}

.sky-header::after {
    content: "";
    position: absolute;
    bottom: -40px;
    left: 50%;
    width: 120%;
    height: 120px;
    background: radial-gradient(circle at center,
        rgba(255,255,255,0.7),
        rgba(255,255,255,0)
    );
    transform: translateX(-50%);
    filter: blur(40px);
    pointer-events: none;

    /* FIXES GRADIENT CLIPPING */
    z-index: -1;
}

    /* TAB BAR */
    .tab-bar {
        display: flex;
        gap: 12px;
		padding-bottom: 12px;
    }
	
	.tab-bar-row-2 {
		display: flex;
        gap: 12px;
	}

    /* GLOSS BUTTONS */
    .gloss-btn {
        padding: 10px 18px;
        border-radius: 8px;
        text-decoration: none;
        color: #ffffff;
        background: linear-gradient(to bottom, #6bb7ff, #4a90e2);
        border: 1px solid #3a78c2;
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.6),
            0 2px 4px rgba(0,0,0,0.15);
        position: relative;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .gloss-btn::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 40%;
        background: rgba(255,255,255,0.35);
        filter: blur(4px);
        border-radius: 8px 8px 0 0;
    }

    .gloss-btn:hover {
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.6),
            0 4px 8px rgba(0,0,0,0.2);
    }

    /* NAV GRID */
    .nav-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        padding: 30px;
    }

    /* GLOSS CARDS */
    .gloss-card {
        padding: 20px;
        border-radius: 10px;
        position: relative;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.45);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.6),
            0 3px 6px rgba(0,0,0,0.10);
    }

    .gloss-card::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 35%;
        background: rgba(255,255,255,0.35);
        filter: blur(6px);
        border-radius: 10px 10px 0 0;
        pointer-events: none;
    }

    .gloss-card:hover {
        transform: translateY(-3px);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.7),
            0 6px 12px rgba(0,0,0,0.12);
    }

    /* UPDATES */
    .updates {
        max-width: 1200px;
        margin: 0 auto;
    }

    .updates h3 {
        text-shadow: 0 1px 0 rgba(255,255,255,0.6);
        font-family: Tahoma, Verdana, sans-serif;
        font-weight: bold;
        font-size: 14px;
        color: #1a1a1a;
        margin-bottom: 6px;
    }

    .updates ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .updates li {
        font-family: Tahoma, Verdana, sans-serif;
        font-weight: normal;
        font-size: 12px;
        color: #2a2a2a;
        margin-bottom: 6px;
    }

    .updates-card {
        padding: 20px;
        border-radius: 10px;
        position: relative;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
        background: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.45);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.6),
            0 3px 6px rgba(0,0,0,0.10);
    }

    .updates-card::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 35%;
        background: rgba(255,255,255,0.1);
        filter: blur(6px);
        border-radius: 10px 10px 0 0;
        pointer-events: none;
    }

    .updates-card:hover {
        transform: translateY(-3px);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.7),
            0 6px 12px rgba(0,0,0,0.12);
    }

    /* PINNED */
    .pinned { padding: 0 30px; }
    .pinned h3 { margin-bottom: 10px; }

    .pinned-row {
        display: flex;
        gap: 20px;
    }

    .pin { width: 50%; }

    /* PHILOSOPHY */
    .philosophy {
        margin: 40px 0;
        text-align: center;
        font-style: italic;
        color: #3a3a3d;
    }

    /* FOOTER */
    footer {
        margin-top: 40px;
        padding: 20px;
        text-align: center;
        font-size: 0.9rem;
        background: rgba(255, 255, 255, 0.55);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.45);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.5),
            0 -3px 6px rgba(0,0,0,0.08);
    }

    footer a {
        color: #4a90e2;
        text-decoration: none;
    }

    footer a:hover {
        text-decoration: underline;
    }

    /* GREEN BUTTON */
    .green-btn {
        padding: 10px 18px;
        border-radius: 8px;
        text-decoration: none;
        color: #ffffff;
        background: linear-gradient(to bottom, #7ED957, #4CAF50);
        border: 1px solid #3E8E41;
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.6),
            0 2px 4px rgba(0,0,0,0.18);
        position: relative;
    }

    .green-btn::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 40%;
        background: rgba(255,255,255,0.35);
        filter: blur(4px);
        border-radius: 8px 8px 0 0;
    }
}

.md-btn {
    padding: 6px 10px;
    margin-right: 6px;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 6px;
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: transform 0.05s ease, background 0.1s ease;
}

.md-btn:hover {
    background: rgba(255,255,255,0.6);
}

.md-btn:active {
    transform: translateY(1px);
    background: rgba(255,255,255,0.8);
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.topic-row {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.35);
}

.topic-row.sticky {
    background: rgba(255,255,150,0.35);
    border-color: rgba(255,255,200,0.6);
}

.topic-avatar {
    width: 64px;
    height: 64px;
    margin-right: 14px;
    flex-shrink: 0;
}

.topic-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.topic-main {
    display: flex;
    flex-direction: column;
}

.topic-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1f1f21;
    text-decoration: none;
}

.topic-title:hover {
    text-decoration: underline;
}

.topic-meta {
    font-size: 0.85rem;
    color: #333;
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

/* ------------------------------ */
/* UTILITIES LAYER                */
/* ------------------------------ */
@layer utilities {
    /* Add future utility classes here */
}
