:root {
    --bg: #FAF7F0;
    --card-bg: #FFFFFF;
    --text: #111111;
    --border: #111111;
}

body.dark {
    --bg: #323339;
    --card-bg: #46464D;
    --text: #FAF7F0;
    --border: #FAF7F0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

h1, h2, h3 {
    margin: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-align: center;
    font-family: "DM Sans", Tahoma, monospace, sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

.retro-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--border);
}

header {
    width: 100%;
    background-color: var(--card-bg);
    padding: 1.5rem 1rem;
    border-bottom: 2px solid var(--border);
}

#topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#watermark {
    justify-self: flex-start;
}

#watermark h1 {
    font-family: "jersey 10";
    font-size: 3.5rem;
}

#navigation_holder {
    justify-self: center;
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border: none;
    background-color: transparent;
}

.navigation {
    width: 130px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid var(--border);
    background-color: var(--card-bg);
    cursor: pointer;
    font-family: Tahoma;
    font-weight: bold;
    font-size: clamp(15px, 1.8vw, 15px);
    white-space: nowrap;
    color: var(--text);
}

.navigation {
    position: relative;
    overflow: hidden;
    z-index: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.navigation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
    background-color: var(--border);
    opacity: 0;
    border-radius: inherit;
    pointer-events: none;
    transition: width 0.35s ease, height 0.35s ease, opacity 0.35s ease;
    z-index: -1;
}

.navigation::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--border);
    opacity: 0;
    transform: scale(1.2);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.navigation:hover {
    transform: translateY(-3px);
    box-shadow: 6px 6px 0 var(--border);
}

.navigation:hover::before {
    width: 220%;
    height: 220%;
    opacity: 0.22;
}

.navigation:hover::after {
    opacity: 1;
    transform: scale(1);
}

.navigation:active {
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 var(--border);
}

body.dark .navigation::before {
    background-color: var(--text);
}

#utilities {
    justify-self: flex-end;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.utility {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--border);
    background-color: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 0 var(--border);
}

.utility img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

body.dark .utility img,
body.dark .link img {
    filter: invert(1);
}

main {
    flex: 1;
    width: 70%;
    margin: 1rem auto 0;
    padding: 1.5rem;
    background-color: transparent;
}

#container {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    padding: 2rem;
}

#left {
    width: 40%;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

#holder {
    height: 70%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
    padding: 2.4rem 1.5rem;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

#doodle {
    width: 80%;
    min-height: 264px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.1rem 0 0.1rem;
}

#doodle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#discord_status {
    width: 80%;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    padding: 1.1rem;
    font-size: 1rem;
    background-color: var(--card-bg);
    color: var(--text);
    border-radius: 8px;
}

#discord_avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
    box-shadow: 3px 3px 0 var(--border);
}

#discord-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.2rem;
}

#discord_name {
    font-weight: 700;
    font-size: 1.1rem;
}

#discord_state_row {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

#discord_status_dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    background: #747f8d;
    border: 2px solid #747f8d;
    transition: background 0.25s ease, border-color 0.25s ease;
}

#discord_status.online #discord_status_dot {
    background-color: #43b581;
    border-color: #43b581;
}

#discord_status.idle #discord_status_dot {
    background-color: #faa61a;
    border-color: #faa61a;
}

#discord_status.dnd #discord_status_dot {
    background-color: #f04747;
    border-color: #f04747;
}

#discord_status.offline #discord_status_dot {
    background-color: #747f8d;
    border-color: #747f8d;
}

#discord_activity {
    font-size: 0.9rem;
    opacity: 0.85;
    font-style: italic;
}

#right {
    width: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
    padding: 2.4rem 1.5rem;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

#right h2,
#right h3 {
    margin: 0 0 0.5rem 0;
    text-decoration: underline;
    text-underline-offset: 4px;
}

#about_box {
    width: 80%;
    min-height: 192px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: large;
    padding: 0.75rem;
}

#socials_box {
    width: 80%;
    padding: 1.2rem 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
}

.link_row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.2rem;
}

.link {
    height: 60px;
    width: 60px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    flex-shrink: 0;
    opacity: 0;
    margin-top: 0;
}

.link img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    display: block;
}

.utility,
.link,
#discord_status {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.utility:hover,
.link:hover,
#discord_status:hover {
    box-shadow: 8px 8px 0 var(--border);
    transform: translate(-3px, -3px);
}

.utility:active,
.link:active,
#discord_status:active {
    box-shadow: 3px 3px 0 var(--border);
    transform: translate(-1px, -1px);
}

.link:nth-child(1) { transition-delay: 0s; }
.link:nth-child(2) { transition-delay: 0.02s; }
.link:nth-child(3) { transition-delay: 0.04s; }
.link:nth-child(4) { transition-delay: 0.06s; }
.link:nth-child(5) { transition-delay: 0.08s; }
.link:nth-child(6) { transition-delay: 0.10s; }

footer {
    width: 100%;
    background-color: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    border-top: 2px solid var(--border);
}

#copyright_holder {
    width: 80%;
    margin: 0 auto;
    padding: 0.5rem 0;
}

#copyright {
    font-size: large;
    color: var(--text);
}

@keyframes slideDown {
    0% { opacity: 0; transform: translateY(-40px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes riseFade {
    0% { opacity: 0; transform: translateY(40px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes statusRise {
    0% { opacity: 0; margin-top: 30px; }
    100% { opacity: 1; margin-top: 0; }
}

@keyframes linkDrop {
    0% { opacity: 0; margin-top: -20px; }
    100% { opacity: 1; margin-top: 0; }
}

@keyframes footerSlideUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate {
    animation-duration: 1s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

#topbar > * {
    animation-name: slideDown;
    animation-duration: 1s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
}

#watermark { animation-delay: 0.1s; }
#navigation_holder { animation-delay: 0.35s; }
#utilities { animation-delay: 0.6s; }

#doodle {
    animation-name: riseFade;
    animation-duration: 1s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
    animation-delay: 0.8s;
}

#discord_status {
    animation-name: statusRise;
    animation-duration: 1s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
    animation-delay: 1.0s;
    text-decoration: none;
}

#about_box {
    animation-name: riseFade;
    animation-duration: 1s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
    animation-delay: 1.2s;
}

#socials_box {
    animation-name: riseFade;
    animation-duration: 1s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
    animation-delay: 1.4s;
}

.link_row:nth-of-type(1) .link:nth-child(1) { animation: linkDrop 0.9s ease-out 1.6s forwards; }
.link_row:nth-of-type(1) .link:nth-child(2) { animation: linkDrop 0.9s ease-out 1.75s forwards; }
.link_row:nth-of-type(1) .link:nth-child(3) { animation: linkDrop 0.9s ease-out 1.9s forwards; }
.link_row:nth-of-type(1) .link:nth-child(4) { animation: linkDrop 0.9s ease-out 2.05s forwards; }

.link_row:nth-of-type(2) .link:nth-child(1) { animation: linkDrop 0.9s ease-out 2.2s forwards; }
.link_row:nth-of-type(2) .link:nth-child(2) { animation: linkDrop 0.9s ease-out 2.35s forwards; }

footer {
    animation-name: footerSlideUp;
    animation-duration: 1s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
    animation-delay: 2.5s;
}
/* ========== RESPONSIVE LAYOUT (TABLET & PHONE) ========== */

@media (max-width: 900px) {

    /* make content use full width */
    main {
        width: 100%;
        margin: 0.5rem auto 0;
        padding: 1rem;
    }

    /* outer card a bit tighter */
    #container {
        flex-direction: column;      /* stack left + right */
        align-items: center;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }

    #left,
    #right {
        width: 100%;
        padding: 1.2rem 0;
    }

    /* doodle + status take more width and scale nicely */
    #doodle {
        width: 65%;
        min-height: auto;
    }

    #discord_status {
        width: 90%;
    }

    /* about + socials use full width inside the card */
    #about_box,
    #socials_box {
        width: 100%;
    }

    /* header tweaks */
    #watermark h1 {
        font-size: 2.4rem;
        text-align: left;
    }

    /* if you re-enable navigation later, let buttons wrap nicely */
    #navigation_holder {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .navigation {
        width: auto;
        padding: 0 1.2rem;
        font-size: 0.9rem;
    }
}

/* ========== SMALL PHONES (VERY NARROW) ========== */

@media (max-width: 600px) {

    header {
        padding: 1rem 0.75rem;
    }

    #topbar {
        grid-template-columns: 1fr auto;  /* logo + utilities on one row */
        grid-auto-rows: auto;
        row-gap: 0.5rem;
    }

    #watermark h1 {
        font-size: 2rem;
    }

    /* move nav below logo if you add it back later */
    #navigation_holder {
        grid-column: 1 / -1;
        justify-content: center;
    }

    /* doodle + status */
    #doodle {
        width: 75%;
    }

    #discord_status {
        width: 100%;
    }

    /* socials icons a bit smaller so they fit comfortably */
    .link {
        width: 50px;
        height: 50px;
    }

    #socials_box {
        padding: 1rem 0.5rem 1.2rem;
    }

    /* footer text */
    #copyright {
        font-size: 0.85rem;
    }
}
