:root {
    --bg: #000;
    --text: #fff;
    --card: #111;
    --accent: #888;
}

html {
    scroll-behavior: smooth;
}

.light {
    --bg: #ffffff;
    --text: #000;
    --card: #f0f0f0;
    --accent: #555;
}

body {
    margin: 0;
    font-family: sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: 0.3s;
    text-align: center;
}

body::after {

    content: "";

    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background:
        radial-gradient(circle at 30% 20%,
            rgba(255, 255, 255, 0.05),
            transparent 40%),
        radial-gradient(circle at 80% 70%,
            rgba(255, 255, 255, 0.05),
            transparent 40%);

    pointer-events: none;

    z-index: -1;

}

.light body::after {

    background:
        radial-gradient(circle at 30% 20%,
            rgba(0, 0, 0, 0.05),
            transparent 40%),
        radial-gradient(circle at 80% 70%,
            rgba(0, 0, 0, 0.05),
            transparent 40%);

}

nav {

    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);

    padding: 8px 20px;

    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);

    border-radius: 20px;

    border: 1px solid rgba(255, 255, 255, 0.15);

}

nav a {

    position: relative;

    color: var(--text);

    margin: 0 15px;

    text-decoration: none;

    font-size: 14px;

    opacity: 0.8;

}

nav a:hover {
    opacity: 1;
}

nav a::after {

    content: "";

    position: absolute;

    left: 0;
    bottom: -4px;

    width: 0%;
    height: 2px;

    background: var(--text);

    transition: 0.3s;

}

nav a:hover::after {

    width: 100%;

}

.light nav {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.hero {
    padding-top: 120px;
    padding-bottom: 80px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.icon {

    width: 130px;
    height: 130px;

    border-radius: 50%;

    margin-bottom: 20px;

    transition: transform 0.6s,
        box-shadow 0.4s;

    border: 3px solid rgba(255, 255, 255, 0.25);

    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.1);
}

.light .icon {

    border: 3px solid rgba(0, 0, 0, 0.25);

    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}


.icon:hover {

    transform:
        rotate(360deg) scale(1.05);

    box-shadow:
        0 0 25px rgba(255, 255, 255, 0.4);

}

.light .icon:hover {

    box-shadow:
        0 0 25px rgba(0, 0, 0, 0.25);

}

h1 {
    margin: 10px 0;
    font-size: 36px;
}

.subtitle {
    color: var(--accent);
}

.section {
    padding: 60px 20px;
    max-width: 900px;
    margin: auto;
}

.section h2 {
    margin-bottom: 20px;
}

.works {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {

    position: relative;

    background: var(--card);

    padding: 20px;

    border-radius: 12px;

    transition: 0.25s;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.2);

    overflow: hidden;

}

.card::before {

    content: "";

    position: absolute;

    inset: 0;

    border-radius: 12px;

    padding: 1px;

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.25),
            rgba(255, 255, 255, 0.05));

    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);

    -webkit-mask-composite: xor;

    mask-composite: exclude;

    pointer-events: none;

}

.card:hover {

    transform: translateY(-6px);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.4);

}

.card::after {

    content: "";

    position: absolute;

    width: 300px;
    height: 300px;

    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.15),
            transparent 60%);

    opacity: 0;

    pointer-events: none;

    transform: translate(-50%, -50%);

    transition: opacity 0.2s;

    top: var(--y);
    left: var(--x);

}

.card:hover::before {

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.6),
            rgba(255, 255, 255, 0.1));

}

.card:hover::after {
    opacity: 1;
}

.links a {
    display: inline-block;
    margin-right: 15px;
    color: var(--text);
}

.theme-btn {
    position: fixed;
    left: 20px;
    bottom: 20px;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    background: var(--card);
    color: var(--text);
}

footer {
    text-align: center;
    padding: 40px;
    opacity: 0.5;
    font-size: 14px;
}

#moon {
    display: none;
}

.light #sun {
    display: none;
}

.light #moon {
    display: block;
}

.theme-btn svg {
    transition: transform 0.4s, opacity 0.2s;
}

.rotate svg {
    transform: rotate(180deg);
}

.theme-btn:hover {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#modal {

    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.6);

    display: flex;

    align-items: center;
    justify-content: center;

    z-index: 2000;

    opacity: 0;
    pointer-events: none;
}

#modal.show {
    opacity: 1;
    pointer-events: auto;
    animation: backdropFadeIn 0.25s ease forwards;
}

#modal.closing-modal {
    animation: backdropFadeOut 0.25s ease forwards;
}


.modal-content {

    position: relative;

    background: var(--card);

    padding: 30px;

    border-radius: 12px;

    max-width: 500px;

    text-align: center;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6);

}

.modal-content a {
    color: var(--text);
    text-decoration: underline;
    opacity: 0.7;
}

.modal-content a:hover {
    opacity: 1;
}

.modal-content.opening {
    animation: modalFade 0.25s;
}

.modal-content.closing {
    animation: modalFadeOut 0.25s;
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes backdropFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes modalFade {

    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }

}

@keyframes modalFadeOut {

    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.9);
        opacity: 0;
    }

}

#modal-image {

    width: 100%;
    max-width: 400px;

    height: 220px;

    object-fit: cover;

    margin-top: 15px;

    border-radius: 8px;

}

.close {

    position: absolute;

    top: 20px;
    right: 30px;

    font-size: 28px;

    cursor: pointer;

}