* {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    color: #fff;
    background-color: #6c6c6c;
}

/* Global links */

a:link {
    color: #90CAF9;
}

a:visited {
    color: #FFEB3B;
}

a:hover {
    text-decoration: underline;
}

a:active {
    color: #FFD54F;
}

:root {
    --accent: #4da3ff;
    --accent-hover: #6fb6ff;
    --card-bg: #333;
}

header a:link,
header a:visited,
header a:hover,
header a:active {
    color: white;
    text-decoration: none;
}

/* ================= HEADER ================= */

header {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: url('images/topper-hero.jpg') center/cover no-repeat;
    color: white;
    overflow: hidden;
}

.aurora-overlay {
    position: absolute;
    inset: 0;
    width: 105%;
    background: url('images/aurora-shimmer.png') center/cover no-repeat;
    animation: driftShimmer 15s ease-in-out infinite;
    opacity: 0.3;
    z-index: 0;
}

@keyframes driftShimmer {
    0% { transform: translate(0) scale(1); opacity: .25; }
    50% { transform: translate(-5%, -10%) scale(1.05); opacity: .4; }
    100% { transform: translate(0) scale(1); opacity: .25; }
}

header * {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 5rem;
    margin: .5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,.7);
}

header h2 {
    font-size: 1rem;
    margin: .5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,.7);
}

header a {
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: #FF6F00;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: transform .2s;
}

header a:hover {
    transform: scale(1.1);
}

/* ================= PORTFOLIO ================= */

.portfolio {
    text-align: center;
    padding: 1.2rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 0 0 1rem 0;
}

.portfolio-item {
    background: var(--card-bg);
    color: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;

    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.12),
        0 0 0 rgba(77, 163, 255, 0);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.portfolio-item:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.25),
        0 0 0 2px rgba(77, 163, 255, 0.25),
        0 8px 30px rgba(77, 163, 255, 0.25);
}

.portfolio-item img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;

    filter: brightness(0.72) contrast(1.05);

    transition:
        filter 0.22s ease,
        transform 0.22s ease;
}

.portfolio-item:hover img {
    filter: brightness(1.02) contrast(1.08);
}

.portfolio-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.portfolio-item h3 {
    margin: 0;
    padding: 0.9rem 1rem 0.3rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.portfolio-item p {
    margin: 0;
    padding: 0 1rem 0.9rem;
    font-size: 0.98rem;
    line-height: 1.35;
}

/* Responsive */

@media (max-width: 1100px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portfolio {
        padding: 1rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .portfolio-item img {
        height: 190px;
    }
}

/* ================= MODALS ================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 700px;
    background: linear-gradient(180deg, #1b1b1b 0%, #121212 100%);
    color: #f5f5f5;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 34px 32px 28px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    text-align: left;
    animation: modalFadeUp 0.28s ease;
}

.modal-content-scroll {
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content::before {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    border-radius: 999px;
    margin-bottom: 18px;
    background: var(--accent);
}

.modal-content h1,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content h5 {
    color: #ffffff;
    margin-top: 0;
    line-height: 1.2;
}

.modal-content h1 {
    font-size: 2rem;
    margin-bottom: 14px;
}

.modal-content h3 {
    font-size: 1.7rem;
    margin-bottom: 14px;
}

.modal-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal-content h5 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.modal-content p,
.modal-content li {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.75;
}

.modal-content ul {
    padding-left: 1.2rem;
    margin: 0;
}

/* Intro text box at top of modals */

.modal-intro {
    margin: 0 0 1.25rem 0;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: #202020;
    border: 1px solid #333;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.75;
}

.modal-intro p {
    margin: 0;
}

/* Modal headline links */

.modal-content h5 a,
.modal-content h4 a {
    color: #FFEB3B;
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.18s ease;
}

.modal-content h5 a:hover,
.modal-content h4 a:hover {
    opacity: 0.85;
    text-decoration: underline;
}

/* Buttons */

.modal-close {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;

    margin-top: 22px;
    margin-bottom: 22px;
    padding: 12px 22px;

    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #111111;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;

    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.modal-close:hover {
    transform: translateY(-1px);
    opacity: 0.95;
    background: var(--accent-hover);
}

.modal-close:active {
    transform: translateY(0);
}

@keyframes modalFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ================= MODAL SECTIONS ================= */

.modal-section {
    width: 100%;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 14px;
    background: #202020;
    border: 1px solid #333;
    text-align: left;
}

.modal-section ul {
    padding-left: 1.2rem;
    list-style-position: outside;
}

/* ================= GAME BLOCKS ================= */

.game-section {
    width: 100%;
    background: #232323;
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid #343434;
    margin-bottom: 1.5rem;
}

.game-item {
    display: flex;
    gap: 1rem;
    background: #333;
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
    align-items: center;
    text-align: left;
}

.game-item:last-child {
    margin-bottom: 0;
}

.game-item img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.game-item h5 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.game-item p {
    margin: 0;
    line-height: 1.6;
}

.game-item a {
    text-decoration: none;
}

/* ================= FEATURES ================= */

.features {
    background: #2b3b4f;
    color: white;
    padding: 2rem;
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.feature {
    max-width: 260px;
    text-align: center;
    cursor: pointer;
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.35);
}

.feature img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.feature h3 {
    margin-top: 0;
    margin-bottom: 0.6rem;
}

.feature p {
    margin: 0;
    line-height: 1.6;
}

/* ================= FOOTER ================= */

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
    .modal {
        padding: 16px;
    }

    .modal-content {
        padding: 26px 22px 22px;
        border-radius: 16px;
    }

    .modal-content h1 {
        font-size: 1.6rem;
    }

    .modal-content h3 {
        font-size: 1.35rem;
    }

    .modal-content p,
    .modal-intro,
    .game-item p {
        font-size: 0.96rem;
        line-height: 1.65;
    }

.modal-close {
    width: 100%;
    margin-top: 22px;
    margin-bottom: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #111111;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}
    .game-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-item img {
        width: 100%;
        height: auto;
        max-height: 220px;
    }
}