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

:root {
    /* Primary */
    --color-primary: #a9d0ff;
    --color-primary-hover: #8fc2ff;

    /* Accent */
    --color-accent-1: #ffa9d0;
    --color-accent-2: #bac2de;

    /* Backgrounds */
    --color-bg-primary: #1e1e2e;
    --color-bg-secondary: #313244;
    --color-bg-tertiary: #45475a;

    /* Text */
    --color-text-primary: #cdd6f4;
    --color-text-secondary: #bac2de;
    --color-text-muted: #a6adc8;

    /* Borders */
    --color-border-primary: #585b70;
    --color-border-subtle: #45475a;

    /* Semantic */
    --color-success: #a6e3a1;
    --color-error: #f38ba8;
    --color-warning: #f9e2af;
    --color-info: #89dceb;

    /* Utility */
    --color-overlay: rgba(17, 17, 27, 0.5);
    --color-focus: #a9d0ff;
    --color-code: #89b4fa;

    /* Motion */
    --motion-profile-flip-duration: 0.45s;
    --motion-profile-flip-ease: cubic-bezier(0.65, 0, 0.35, 1);

    /* Additional surface colors */
    --color-surface-0: #313244;
    --color-surface-1: #45475a;
    --color-surface-2: #585b70;
    --color-overlay-0: #6c7086;
    --color-overlay-1: #7f849c;
    --color-overlay-2: #9399b2;

    /* Base layers */
    --color-mantle: #181825;
    --color-crust: #11111b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--color-mantle), var(--color-bg-primary));
    color: var(--color-text-primary);
    padding: 20px;
    min-height: 100vh;
}

@media (max-width: 768px) {
    body {
        padding: 8px;
    }
}

a,
a:hover,
a:focus,
a:visited {
    text-decoration: none;
}

.page-container {
    width: min(1800px, calc(100% - 80px));
    max-width: none;
    margin: 0 auto;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

@media (max-width: 768px) {
    .page-container {
        width: 100%;
        gap: 20px;
        min-height: calc(100vh - 16px);
    }
}

/* Top Section */
.top-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.nav-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.nav-children {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 18px;
    margin-left: 8px;
    border-left: 1px solid rgba(88, 91, 112, 0.6);
    opacity: 0;
    pointer-events: none;
    transform: translateX(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-children.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.nav-tab,
.nav-subtab {
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    letter-spacing: 0.06em;
}

@media (max-width: 768px) {
    .nav-tab,
    .nav-subtab {
        padding: 12px 8px;
        font-size: 15px;
    }
}

.nav-subtab {
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-overlay-1);
}

.nav-tab::after,
.nav-subtab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.nav-tab:hover,
.nav-subtab:hover {
    color: var(--color-text-primary);
}

.nav-tab.is-active,
.nav-subtab.is-active {
    color: var(--color-text-primary);
}

.nav-tab.is-active::after,
.nav-subtab.is-active::after {
    transform: scaleX(1);
}

.nav-tab:focus-visible,
.nav-subtab:focus-visible {
    outline: none;
    color: var(--color-text-primary);
}

.nav-tab:focus-visible::after,
.nav-subtab:focus-visible::after {
    transform: scaleX(1);
}

.nav-tab:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.nav-tab:disabled::after {
    display: none;
}

.nav-divider {
    width: 100%;
    height: 1px;
    background: var(--color-border-primary);
    opacity: 0.4;
}

/* Main Content Section */
.main-content {
    display: flex;
    flex: 1;
    width: 100%;
    justify-content: center;
    align-items: stretch;
}

.content-viewport {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    min-height: 420px;
    overflow: hidden;
}

.content-section {
    position: relative;
    inset: auto;
    width: 100%;
    flex: 1 0 auto;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
}

.content-section.is-active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.content-section.is-entering,
.content-section.is-exiting {
    position: absolute;
    inset: 0;
    display: flex;
    animation-duration: 0.55s;
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
    animation-fill-mode: both;
    pointer-events: none;
}

.slide-in-from-right {
    animation-name: slideInFromRight;
}

.slide-in-from-left {
    animation-name: slideInFromLeft;
}

.slide-out-to-left {
    animation-name: slideOutToLeft;
}

.slide-out-to-right {
    animation-name: slideOutToRight;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(12%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-12%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-8%);
        opacity: 0;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(8%);
        opacity: 0;
    }
}

/* Card Group Container */
.card-group {
    display: flex;
    gap: 20px;
    padding: 0 32px;
    width: fit-content;
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    align-self: center;
}

@media (max-width: 768px) {
    .card-group {
        padding: 0 8px;
        gap: 16px;
    }
}

.content-section[data-section="home"] .card-group {
    max-width: 1100px;
}

.content-section[data-section="home"] .bottom-section {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Individual Cards */
.card {
    flex: 1 1 280px;
    min-width: 280px;
    max-width: 340px;
    border: 1px solid var(--color-border-subtle);
    border-radius: 18px;
    padding: 0;
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card--wide {
    flex: 1 1 580px;
    min-width: 280px;
    max-width: 500px;
}

@media (max-width: 768px) {
    .card {
        flex: 1 1 100%;
        min-width: 0;
        max-width: 100%;
        border-radius: 14px;
    }

    .card--wide {
        max-width: 100%;
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.card-divider {
    width: 100%;
    height: 1px;
    background: var(--color-border-primary);
}

@media (max-width: 768px) {
    .card-header {
        padding: 14px;
    }
}

.card-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.handle-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    background-color: var(--color-crust);
    border: 1px solid var(--color-border-primary);
    border-radius: 6px;
    color: var(--color-code);
    font-family: 'Fira Code', 'Source Code Pro', Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.03em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    width: fit-content;
}

.profile-icon {
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-accent-1);
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative;
    background-color: var(--color-bg-secondary);
    box-shadow: 0 6px 18px var(--color-overlay);
    perspective: 480px;
    isolation: isolate;
    transform-style: preserve-3d;
}

.profile-icon img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--color-border-subtle);
}

.profile-icon .platform-logo {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
    backface-visibility: hidden;
    transform: rotateY(0deg);
    opacity: 1;
    transition: transform var(--motion-profile-flip-duration) var(--motion-profile-flip-ease),
        opacity var(--motion-profile-flip-duration) var(--motion-profile-flip-ease);
}

.profile-icon .platform-logo svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.profile-icon[data-platform] {
    border-color: var(--color-border-primary);
}

.profile-icon[data-platform] .profile-photo {
    grid-area: 1 / 1;
    border-radius: 8px;
    opacity: 0;
    transform: rotateY(-180deg);
    transform-origin: center;
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    will-change: transform, opacity;
    backface-visibility: hidden;
    transition: transform var(--motion-profile-flip-duration) var(--motion-profile-flip-ease),
        opacity var(--motion-profile-flip-duration) var(--motion-profile-flip-ease);
}

.profile-icon[data-platform]:hover .platform-logo,
.profile-icon[data-platform]:focus-within .platform-logo {
    transform: rotateY(180deg);
    opacity: 0;
}

.profile-icon[data-platform]:hover .profile-photo,
.profile-icon[data-platform]:focus-within .profile-photo {
    transform: rotateY(0deg);
    opacity: 1;
}

.profile-icon[data-platform="tiktok"] .platform-logo {
    background: #ffffff;
    color: #ffffff;
}

.profile-icon[data-platform="github"] .platform-logo {
    background: #0d1117;
    color: #f0f6fc;
}

.profile-icon[data-platform="discord"] .platform-logo {
    background: #5865f2;
    color: #ffffff;
}

/* Keyframes removed in favor of transform transitions for smoother reversal */

@media (prefers-reduced-motion: reduce) {
    .profile-icon[data-platform] .platform-logo,
    .profile-icon[data-platform] .profile-photo {
        transition: none;
    }

    .profile-icon[data-platform]:hover .platform-logo,
    .profile-icon[data-platform]:focus-within .platform-logo {
        opacity: 0;
        transform: none;
    }

    .profile-icon[data-platform]:hover .profile-photo,
    .profile-icon[data-platform]:focus-within .profile-photo {
        opacity: 1;
        transform: none;
    }
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    padding: 20px;
}

@media (max-width: 768px) {
    .card-body {
        padding: 14px;
    }
}

.card-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.card-footer {
    border-top: 1px solid var(--color-border-primary);
    padding: 0;
}

.card-cta {
    width: 100%;
    background-color: var(--color-bg-secondary);
    border: none;
    padding: 16px;
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .card-cta {
        padding: 18px 14px;
        font-size: 12px;
    }
}

.card-cta:hover,
.card-cta:focus-visible {
    background-color: var(--color-surface-0);
}

.card-cta:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

/* Bottom Section */
.bottom-section {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: auto;
}

.about-button {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 15px;
    cursor: pointer;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

@media (max-width: 768px) {
    .nav-primary {
        gap: 16px;
    }

    .nav-children {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        padding-left: 0;
        padding-top: 8px;
        border-left: none;
        border-top: 1px solid rgba(88, 91, 112, 0.5);
        gap: 12px;
    }
}

/* osu! Page Specific Styles */

.osu-card-group {
    justify-content: center;
}

.osu-box {
    flex: 1 1 320px;
    min-width: 320px;
    max-width: 360px;
    border: 1px solid var(--color-border-subtle);
    border-radius: 18px;
    padding: 0;
    background-color: var(--color-bg-tertiary);
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

@media (max-width: 768px) {
    .osu-box {
        flex: 1 1 100%;
        min-width: 0;
        max-width: 100%;
        border-radius: 14px;
    }
}

.osu-box-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border-primary);
    width: 100%;
}

@media (max-width: 768px) {
    .osu-box-header {
        padding: 14px;
    }
}

.osu-box-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

@media (max-width: 768px) {
    .osu-box-title {
        font-size: 16px;
    }
}

.osu-box-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

@media (max-width: 768px) {
    .osu-box-content {
        padding: 14px;
    }
}

.osu-preview {
    width: 100%;
    border: 1px solid var(--color-border-primary);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--color-bg-secondary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    aspect-ratio: 16 / 9;
    position: relative;
}

.osu-preview-trigger {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    display: block;
}

.osu-preview-trigger:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.osu-preview img,
.osu-preview-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.osu-preview--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-0);
    border-style: dashed;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    cursor: default;
}

.osu-preview--placeholder .osu-preview-text {
    font-size: 12px;
    text-align: center;
}

.osu-preview-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 27, 0.75);
    padding: 32px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

@media (max-width: 768px) {
    .osu-preview-modal {
        padding: 12px;
    }
}

.osu-preview-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.osu-preview-modal__backdrop {
    position: absolute;
    inset: 0;
}

.osu-preview-modal__content {
    position: relative;
    max-width: min(1200px, 90vw);
    width: 100%;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 30px 70px var(--color-overlay);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.osu-preview-modal__content img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--color-border-subtle);
}

.osu-preview-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: rgba(17, 17, 27, 0.65);
    color: var(--color-text-primary);
    width: 36px;
    height: 36px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 768px) {
    .osu-preview-modal__close {
        width: 44px;
        height: 44px;
        border-radius: 22px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }
}

.osu-preview-modal__close:focus-visible {
    outline: 2px solid var(--color-focus);
}

[data-preview-caption] {
    font-size: 14px;
    color: var(--color-text-secondary);
}

body.is-modal-open {
    overflow: hidden;
}


.osu-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.osu-skin-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    background-color: var(--color-crust);
    border: 1px solid var(--color-border-primary);
    border-radius: 6px;
    color: var(--color-code);
    font-family: 'Fira Code', 'Source Code Pro', Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.03em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.osu-box-footer {
    border-top: 1px solid var(--color-border-primary);
    padding: 0;
}

.osu-button-container {
    padding: 0;
}

.osu-button {
    width: 100%;
    background-color: var(--color-bg-secondary);
    border: none;
    padding: 16px;
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    transition: background-color 0.2s ease;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .osu-button {
        padding: 18px 14px;
        font-size: 12px;
    }
}

.osu-button:hover,
.osu-button:focus-visible {
    background-color: var(--color-surface-0);
}

.osu-button:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.osu-button-label {
    font-size: 13px;
    letter-spacing: 0.1em;
}

.osu-button-icon {
    font-size: 18px;
}

@media (max-width: 480px) {
    .osu-preview-modal__content {
        max-width: 100%;
        border-radius: 12px;
        padding: 12px;
    }

    [data-preview-caption] {
        font-size: 13px;
    }
}
