/* =========================================================
   Design Tokens
   ========================================================= */

:root {
    --bg-image: url("/img/background.webp");

    --text-main: #e1e1e1;
    --text-bright: #ffffff;
    --text-soft: #e3e3e3;
    --accent: #a78bfa;
    --accent-soft: #fdd2ed;

    --bg-panel: #101114;
    --bg-panel-strong: #18181f;
    --bg-modal: rgba(50, 50, 50, 0.95);
    --bg-glass: linear-gradient(to bottom, rgba(50,50,50,0.65), rgba(50,50,50,0.45));
    --bg-glass-soft: linear-gradient(to bottom, rgba(50,50,50,0.55), rgba(50,50,50,0.35));

    --border-soft: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.35);

    --shadow-sm: 0 0 12px black;
    --shadow-md: 0 0 16px black;
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.65);
    --shadow-xl: 0 18px 40px rgba(0, 0, 0, 0.28);

    --blur-overlay: 12px;
    --blur-modal: 8px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 16px;
    --radius-2xl: 18px;
    --radius-pill: 999px;

    --logo-width: clamp(220px, 20vw, 500px);

    --ease-standard: 0.25s ease;
    --ease-fast: 0.2s ease;

    color-scheme: dark;
    -webkit-text-fill-color: currentColor;
}

/* =========================================================
   Compositor Hints
   ========================================================= */

body::before,
.social-icon,
.menu-button,
.navbar-burger,
.navbar-burger span,
.navbar-menu,
.product-modal-card,
.product-modal-card .delete,
.product-modal-actions .button,
::view-transition-old(page),
::view-transition-new(page),
.card-tile,
.event-card,
.profile-card {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* =========================================================
   Icons
   ========================================================= */

.icon,
[class^="i-"],
[class*=" i-"] {
    --icon-size: 1.25rem;
    --icon-fit: 100%;

    display: inline-block;
    width: var(--icon-size);
    height: var(--icon-size);
    flex: 0 0 auto;
    vertical-align: middle;
    background-color: currentColor;

    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: var(--icon-fit);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: var(--icon-fit);
}

.i-booth {
    mask-image: url("/img/icons/brands/booth.svg");
    -webkit-mask-image: url("/img/icons/brands/booth.svg");
}

.i-gumroad {
    mask-image: url("/img/icons/brands/gumroad.svg");
    -webkit-mask-image: url("/img/icons/brands/gumroad.svg");
}

.i-discord {
    mask-image: url("/img/icons/brands/discord.svg");
    -webkit-mask-image: url("/img/icons/brands/discord.svg");
}

.i-x {
    --icon-fit: 80%;
    mask-image: url("/img/icons/brands/x.svg");
    -webkit-mask-image: url("/img/icons/brands/x.svg");
}

.i-youtube {
    mask-image: url("/img/icons/brands/youtube.svg");
    -webkit-mask-image: url("/img/icons/brands/youtube.svg");
}

/* =========================================================
   Base
   ========================================================= */

html,
body,
button,
input,
optgroup,
select,
textarea {
    font-family: "M PLUS 1 Code Variable", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: clamp(16px, 0.8vw, 24px);
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: var(--text-main);
}

.navbar,
.footer,
a.navbar-item {
    background: none;
}

.footer {
    padding: 1rem;
}

@media screen and (min-width: 1440px) {
    .container {
        width: min(92vw, 1400px) !important;
        max-width: none !important;
    }
}

@media screen and (min-width: 1920px) {
    .container {
        width: min(90vw, 1700px) !important;
    }
}

@media screen and (min-width: 2560px) {
    .container {
        width: min(88vw, 2200px) !important;
    }
}

/* =========================================================
   Utilities
   ========================================================= */

.hr-white {
    height: 2px;
    border: 0;
    background-color: #ffffff88;
}

.social-icon {
    --icon-size: 3rem;

    color: var(--text-soft);
    margin-inline: 1rem;
    transform: scale(1);
    transition: transform var(--ease-standard);
}

.social-icon:hover {
    transform: scale(1.5);
}

/* =========================================================
   Background
   ========================================================= */

body::before {
    content: "";
    position: fixed;
    inset: -2%;
    z-index: -1;
    pointer-events: none;
    background: var(--bg-image) center / cover no-repeat;
    will-change: transform;
    animation: bg-float 22s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes bg-float {
    0% {
        transform: scale(1.08) translate3d(0%, 0%, 0) rotate(0deg);
    }
    20% {
        transform: scale(1.09) translate3d(-0.6%, -0.3%, 0) rotate(-0.15deg);
    }
    45% {
        transform: scale(1.1) translate3d(0.4%, -0.8%, 0) rotate(0.1deg);
    }
    70% {
        transform: scale(1.085) translate3d(0.7%, 0.2%, 0) rotate(0.12deg);
    }
    100% {
        transform: scale(1.08) translate3d(0%, 0%, 0) rotate(0deg);
    }
}

/* =========================================================
   NoScript
   ========================================================= */

.noscript-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(var(--blur-overlay));
    -webkit-backdrop-filter: blur(var(--blur-overlay));
}

.noscript-box {
    max-width: 480px;
    padding: 2rem;
    border-radius: var(--radius-sm);
    background: var(--bg-panel-strong);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.65);
}

.noscript-box h1 {
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
}

.noscript-box p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* =========================================================
   View Transitions
   ========================================================= */

#content {
    view-transition-name: page;
}

::view-transition-old(page) {
    animation: page-out 180ms ease both;
}

::view-transition-new(page) {
    animation: page-in 220ms ease both;
}

@keyframes page-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
        filter: blur(4px);
    }
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* =========================================================
   Navigation
   ========================================================= */

.menu-button {
    margin-top: 0.65rem;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-main);
    transform: scale(1);
    transition:
            color var(--ease-standard),
            text-shadow var(--ease-standard),
            transform var(--ease-standard);
}

.menu-button:is(:hover, :focus, :focus-visible, :active, .is-current) {
    color: var(--text-bright);
    transform: scale(1.05);
    text-shadow: 0 0 10px #a6a6a6, 0 0 20px #a6a6a6, 0 0 30px #a6a6a6;
}

.navbar-burger {
    color: var(--text-bright);
    border-radius: 0.9rem;
    transition:
            background-color var(--ease-fast),
            transform 0.15s ease,
            box-shadow var(--ease-fast),
            opacity var(--ease-fast);
}

.navbar-burger span {
    background-color: var(--text-bright);
    transition:
            background-color var(--ease-fast),
            transform var(--ease-fast),
            opacity var(--ease-fast);
}

.navbar-burger:hover {
    background-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.navbar-burger:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(0.96);
}

.navbar-burger:focus-visible {
    outline: none;
    background-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.navbar-burger.is-active {
    background-color: rgba(255, 255, 255, 0.14);
}

@media screen and (max-width: 1023px) {
    .navbar {
        position: relative;
        z-index: 1000;
    }

    .navbar-menu {
        position: fixed;
        top: 4.25rem;
        left: 0.75rem;
        right: 0.75rem;
        z-index: 999;
        display: block;
        padding: 0.5rem;
        overflow: hidden;

        background: rgba(15, 15, 20, 0.55);
        backdrop-filter: blur(8px) saturate(140%);
        -webkit-backdrop-filter: blur(8px) saturate(140%);
        border: 1px solid var(--border-soft);
        border-radius: 1rem;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);

        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px) scale(0.95);

        transition:
                opacity var(--ease-fast),
                transform var(--ease-fast),
                visibility var(--ease-fast);
    }

    .navbar-menu.is-active {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .navbar-menu .navbar-item {
        border-radius: 0.8rem;
    }

    .navbar-end {
        padding-left: 0 !important;
    }

    .menu-button:is(:hover, :focus, :focus-visible, :active, .is-current) {
        transform: scale(1.05) translateX(2rem);
    }
}

/* =========================================================
   Branding
   ========================================================= */

.home-logo {
    display: block;
    width: var(--logo-width);
    max-width: 100%;
    height: auto;
    margin: 0 auto 1.5rem;
}

/* =========================================================
   Shared Glass Cards
   ========================================================= */

.title-card,
.event-card,
.profile-card {
    border: 1px solid var(--border-soft);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-lg);
}

.title-card {
    padding: 2rem;
    background: var(--bg-glass-soft);
}

.event-card,
.profile-card {
    background: var(--bg-glass);
    transition:
            transform var(--ease-standard),
            box-shadow var(--ease-standard),
            border-color var(--ease-standard);
}

.event-card:hover,
.profile-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xl);
}

/* =========================================================
   Store
   ========================================================= */

.shop-grid {
    --grid-gap: 2rem;
    --card-min: 170px;
    --card-max: 200px;

    display: grid;
    gap: var(--grid-gap);
    grid-template-columns: repeat(auto-fit, minmax(var(--card-min), var(--card-max)));
    justify-content: center;
}

@media screen and (min-width: 2560px) {
    .shop-grid {
        --card-min: 200px;
        --card-max: 300px;
    }
}

@media screen and (max-width: 479px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
}

.card-tile {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    transition:
            transform var(--ease-standard),
            outline-color var(--ease-standard),
            outline-offset var(--ease-standard),
            box-shadow var(--ease-standard);
}

.card-tile:hover {
    transform: translateY(-4px) scale(1.03);
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 6px;
}

.card-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================================
   Store Modal
   ========================================================= */

.js-product-modal {
    display: flex;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 0.28s;
}

.js-product-modal.is-active {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.js-product-modal .modal-background {
    background: none;
    opacity: 0;
    backdrop-filter: blur(var(--blur-modal));
    -webkit-backdrop-filter: blur(var(--blur-modal));
    transition: opacity 0.35s ease;
}

.js-product-modal.is-active .modal-background {
    opacity: 1;
}

.product-modal-card {
    width: min(920px, 95vw);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-2xl);
    background: var(--bg-modal);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    transform-origin: center center;
    transition:
            transform var(--ease-fast),
            opacity var(--ease-fast);
}

.js-product-modal.is-active .product-modal-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.product-modal-card .modal-card-head {
    box-shadow: 0 0 16px #191919;
}

.product-modal-card .modal-card-head,
.product-modal-card .modal-card-body {
    background: none;
}

.product-modal-card .modal-card-title {
    font-weight: 700;
}

.product-modal-card .delete {
    min-width: 2rem;
    min-height: 2rem;
    background-color: rgba(255, 255, 255, 0.08);
    transition:
            transform var(--ease-standard),
            background-color var(--ease-standard);
}

.product-modal-card .delete:hover {
    transform: rotate(90deg);
    background-color: rgba(255, 255, 255, 0.16);
}

.product-modal-image-wrap {
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: 0 0 16px #191919;
}

.product-modal-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.product-type-tag {
    color: black;
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
}

.product-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto !important;
}

.product-modal-actions .button {
    flex: 1 1 0;
    justify-content: center;
    min-height: 45px;
    border-radius: var(--radius-md);
    transform: scale(1);
    transition: transform var(--ease-fast);
}

.product-modal-actions .button:hover {
    transform: scale(1.05);
}

@media screen and (max-width: 768px) {
    .product-modal-card {
        width: 60vw;
    }

    .product-modal-actions {
        flex-direction: column;
    }

    .product-modal-actions .button {
        width: 100%;
    }
}

@media screen and (max-width: 450px) {
    .product-modal-card {
        width: 95vw;
    }
}

/* =========================================================
   Events
   ========================================================= */

.events-hero .title {
    margin: 0 auto;
    opacity: 0.8;
}

.events-timeline {
    position: relative;
    margin-top: 3rem;
}

.events-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 5px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.35));
}

.timeline-year {
    position: relative;
    width: calc(50% - 2rem);
    margin-bottom: 3rem;
    color: #fafafa;
}

.timeline-year.is-left {
    margin-right: auto;
}

.timeline-year.is-right {
    margin-left: auto;
}

.timeline-year.is-left .timeline-year-label {
    padding-right: 0.5rem;
    text-align: right;
}

.timeline-year.is-right .timeline-year-label {
    padding-left: 0.5rem;
    text-align: left;
}

.timeline-year-marker {
    position: absolute;
    top: 0.75rem;
    z-index: 2;

}

.timeline-year.is-left .timeline-year-marker {
    right: -2.45rem;
}

.timeline-year.is-right .timeline-year-marker {
    left: -2.45rem;
}

.timeline-dot {
    display: block;
    width: 1rem;
    height: 1rem;
    border-radius: var(--radius-pill);
    background: #fcfcfc;
    box-shadow: 0 0 12px white;
}

.timeline-year-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-year-label {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

.event-logo img {
    width: 96px;
    height: 96px;
    padding: 0.75rem;
    object-fit: contain;
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.event-date {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

@media screen and (max-width: 768px) {
    .events-timeline::before {
        left: 1rem;
        transform: none;
    }

    .timeline-year {
        width: 100%;
        padding-left: 2.5rem;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .timeline-year-marker {
        left: 0.75rem !important;
        right: auto !important;
    }

    .timeline-year .timeline-year-label {
        text-align: left !important;
    }

    .event-logo.image {
        margin: 0 auto 1rem;
    }

    .event-card .columns {
        text-align: center;
    }
}

/* =========================================================
   About
   ========================================================= */

.profile-sections {
    position: relative;
    z-index: 10;
    padding-inline: 1rem;
}

.profile-row {
    padding: 2.5rem 0;
}

.profile-card {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2.5rem;
}

.profile-avatar {
    width: min(350px, 100%);
}

.profile-avatar img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 9999px;
}

@media screen and (max-width: 768px) {
    .reverse-mobile {
        display: flex;
        flex-direction: column-reverse;
    }
}

/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}