:root {
    --primary: rgb(255, 121, 121);
    --primary-light: rgb(225,43,43);
    --primary-lighter: yellow;

    --dark: black;
    --darker: black;

    --text: rgb(216,216,220);
    --heading: rgb(245,245,245);

    --font: 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono: 'Segoe UI', Helvetica, Arial, sans-serif;

    --transition-theme: all 0.9s ease-in-out;
    --transition-fade: opacity 1.1s ease-out, transform 1.1s ease-out;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body::-webkit-scrollbar {
    display: none;
}

.home-icon {
    font-size: 30px;
}

html, body {
    margin: 0;
    min-height: 100%;
    scrollbar-width: none;
}

/* ──────────────────────────────────────────────── */
/* Background with hue rotation for theme switching  */
/* ──────────────────────────────────────────────── */

body {
    background: black;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        var(--bg-url, url("./assets/backgrounds/regular.svg"))
        center / cover no-repeat;
    transition: filter 0.9s ease-in-out;
    will-change: filter;
}

body.orange-theme::before {
    filter: blur(10) saturate(10) hue-rotate(0deg);
}

body.green-theme::before {
    filter: hue-rotate(90deg);
}

/* ──────────────────────────────────────────────── */
/* Hero text – liquid glass style                   */
/* ──────────────────────────────────────────────── */

.hero-container {
    position: relative;
    height: 38vh;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0 3rem;
}

.top-text, .bottom-text {
    position: relative;
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--heading);
    text-shadow: 0 4px 30px rgba(0,0,0,0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.1rem;
    padding: 0.9rem 1.8rem;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,255,255,0.07);
    transition: var(--transition-theme);
    opacity: 0;
    transform: translateY(40px);
}

#modalContent {
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
}

#modalTitle {
    color: var(--heading);
    font-family: var(--font);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: -1.4rem;
    margin-top: -0.2rem;
}

.top-text {
    font-size: clamp(2.1rem, 6.8vw, 3.8rem);
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.bottom-text {
    font-size: clamp(1.1rem, 4.2vw, 1.9rem);
    font-weight: 400;
    color: var(--text);
    padding: 0.7rem 1.6rem;
}

/* entrance animation */
body.loaded .top-text,
body.loaded .bottom-text {
    opacity: 1;
    transform: translateY(0);
    transition: var(--transition-fade);
}

body.loaded .top-text { transition-delay: 0.18s; }
body.loaded .bottom-text { transition-delay: 0.38s; }

/* ──────────────────────────────────────────────── */

.text {
    color: var(--text);
    font-family: var(--font);
}

.Titlebar {
    position: sticky;
    top: 12px;

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

    width: min(400px, 90%);
    height: 70px;

    margin: auto;
    padding: 0 30px;

    font-family: var(--font);
    font-size: small;
    color: var(--heading);

    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 11px;

    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);

    box-shadow:
        0 6px 18px rgba(0,0,0,0.55),
        inset 0 1px 0 rgba(255,255,255,0.03);

    z-index: 50;
    opacity: 0;
    transform: translateY(-30px);
    transition: var(--transition-fade);
}

body.loaded .Titlebar {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.05s;
}

.Titlebar::after {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 45%;   
    border-radius: 11px 11px 0 0;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.heading-lower {
    color: var(--primary);
    font-family: var(--font);
    font-weight: 650;
    font-size: clamp(2.1rem, 5.5vw, 3.2rem);
    text-align: center;
    margin: 14vh 0 3.5rem;
    opacity: 0;
    transform: translateY(50px);
    transition: var(--transition-fade);
}

body.loaded .heading-lower {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 1.2rem;
    width: min(1000px,96%);
    margin: auto;
    padding: 0 1rem 4rem;
    opacity: 0;
    transform: translateY(60px);
    transition: var(--transition-fade);
}

body.loaded .card-grid {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

h4 {
    color: var(--heading);
    font-family: var(--font);
    font-size: 1.32rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

h5 {
    color: var(--text);
    font-family: var(--font);
    font-size: 0.96rem;
    line-height: 1.38;
    margin: 0;
    opacity: 0.92;
}

.card {
    --g-angle: 135deg;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.2rem;
    border-radius: 14px;
    background: linear-gradient(var(--g-angle), rgba(255,255,255,0.11), rgba(255,255,255,0.015));
    border: 1px solid rgba(255,255,255,0.055);
    backdrop-filter: blur(7px) saturate(125%);
    box-shadow: 0 10px 24px rgba(0,0,0,0.48);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.15s ease;
    cursor: pointer;
    opacity: 0;
}

.card:nth-child(1) { transition-delay: 0.75s; }
.card:nth-child(2) { transition-delay: 0.82s; }
.card:nth-child(3) { transition-delay: 0.89s; }
.card:nth-child(4) { transition-delay: 0.96s; }
.card:nth-child(5) { transition-delay: 1.03s; }
.card:nth-child(6) { transition-delay: 1.10s; }
.card:nth-child(7) { transition-delay: 1.17s; }

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

.card:hover {
    transform: translateY(-7px);
    box-shadow: 0 22px 44px rgba(0,0,0,0.62);
    border-color: rgba(255,255,255,0.13);
}

.card:focus {
    outline: 3px solid rgba(255,255,255,0.08);
    outline-offset: 3px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.modal {
    background: var(--dark);
    color: var(--heading);
    width: min(720px,96%);
    max-height: calc(100vh - 4rem);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 22px 54px rgba(0,0,0,0.65);
    border: 1px solid rgba(255,255,255,0.04);
}

.modal-header {
    padding: 0.9rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.035);
}

.modal-content {
    padding: 1.2rem;
    overflow-y: auto;
    max-height: calc(100vh - 8.5rem);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--heading);
    font-size: 1.6rem;
    cursor: pointer;
}

.hidden { display: none !important; }
body.modal-open { overflow: hidden; }

/* rounded logo */
.rounded {
    border-radius: 999px;
    transition: var(--transition-theme);
}

.rounded:hover {
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

/* responsive */
@media (max-width: 900px) {
    .card-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 560px) {
    .card-grid { grid-template-columns: 1fr; }
    .top-text   { font-size: clamp(1.9rem, 7vw, 2.6rem); padding: 0.7rem 1.4rem; }
    .bottom-text { font-size: clamp(1rem, 4.5vw, 1.45rem); padding: 0.6rem 1.3rem; }
}