/* ================================================================
   PROJECTKART — BASE
   Global layout, surfaces, containers and interaction foundation
================================================================ */


/* ================================================================
   BODY
================================================================ */

html,
body {
    width: 100%;
    min-height: 100%;
}

.hidden {
    display: none !important;
}

body {
    position: relative;

    background:
        radial-gradient(
            circle at 78% 8%,
            rgba(40, 120, 255, 0.055),
            transparent 28%
        ),
        var(--color-bg-primary);

    color: var(--color-text-primary);

    font-family: Inter, var(--font-sans);
    font-size: 16px;
    font-weight: var(--font-weight-regular);
    line-height: 1.6;

    letter-spacing: -0.01em;

    overflow-x: hidden;
}


/* ================================================================
   PAGE BACKGROUND
================================================================ */

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.012),
            transparent 18%
        );

    z-index: -1;
}


/* ================================================================
   MAIN
================================================================ */

main {
    display: block;
    width: 100%;
}


/* ================================================================
   GLOBAL CONTAINER
================================================================ */

.container {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        var(--container-width)
    );

    margin-inline: auto;
}


/* ================================================================
   WIDE CONTAINER
================================================================ */

.container--wide {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        1560px
    );

    margin-inline: auto;
}


/* ================================================================
   NARROW CONTAINER
================================================================ */

.container--narrow {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        var(--content-narrow)
    );

    margin-inline: auto;
}


/* ================================================================
   SECTION
================================================================ */

.section {
    position: relative;

    width: 100%;

    padding-block: var(--space-16);
}


.section--large {
    padding-block: 140px;
}


.section--medium {
    padding-block: 96px;
}


.section--small {
    padding-block: 64px;
}


.section--flush {
    padding-block: 0;
}


/* ================================================================
   SECTION BACKGROUNDS
================================================================ */

.section--surface {
    background: var(--color-bg-secondary);
}


.section--dark {
    background: #05070a;
}


.section--border-top {
    border-top: 1px solid var(--border-color);
}


.section--border-bottom {
    border-bottom: 1px solid var(--border-color);
}


/* ================================================================
   SURFACE
================================================================ */

.surface {
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.008)
        );

    border: 1px solid var(--border-color);

    border-radius: var(--radius-xl);

    box-shadow: var(--shadow-sm);
}


/* ================================================================
   GLASS SURFACE
================================================================ */

.glass {
    background:
        rgba(13, 17, 23, 0.72);

    border: 1px solid var(--border-color);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}


/* ================================================================
   HORIZONTAL DIVIDER
================================================================ */

.divider {
    width: 100%;
    height: 1px;

    background: var(--border-color);
}


/* ================================================================
   LINKS
================================================================ */

a {
    transition:
        color var(--transition-base),
        opacity var(--transition-base);
}


a:hover {
    color: var(--color-text-primary);
}


/* ================================================================
   BUTTON / INTERACTIVE DEFAULT
================================================================ */

button,
a,
input,
textarea,
select {
    -webkit-user-select: none;
    user-select: none;
}


input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}


/* ================================================================
   SVG
================================================================ */

svg {
    width: 1em;
    height: 1em;

    fill: currentColor;

    flex-shrink: 0;
}


/* ================================================================
   IMAGES
================================================================ */

img {
    display: block;

    max-width: 100%;
    height: auto;
}


/* ================================================================
   IMAGE WRAPPER
================================================================ */

.image-wrap {
    position: relative;

    overflow: hidden;

    border-radius: var(--radius-xl);
}


.image-wrap img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform var(--transition-smooth),
        filter var(--transition-smooth);
}


.image-wrap:hover img {
    transform: scale(1.045);
}


/* ================================================================
   BLUE GLOW
================================================================ */

.blue-glow {
    position: relative;
}


.blue-glow::after {
    content: "";

    position: absolute;

    width: 260px;
    height: 260px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(40, 120, 255, 0.13),
            transparent 70%
        );

    filter: blur(20px);

    pointer-events: none;

    z-index: -1;
}


/* ================================================================
   STATUS DOT
================================================================ */

.status-dot {
    display: inline-block;

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--color-success);

    box-shadow:
        0 0 0 4px rgba(24, 211, 154, 0.08);
}


/* ================================================================
   BADGE
================================================================ */

.badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 28px;

    padding: 0 11px;

    border: 1px solid var(--border-color);

    border-radius: var(--radius-pill);

    background:
        rgba(255, 255, 255, 0.025);

    color: var(--color-text-secondary);

    font-size: 11px;
    font-weight: var(--font-weight-semibold);

    letter-spacing: 0.08em;
    text-transform: uppercase;

    white-space: nowrap;
}


/* ================================================================
   BLUE BADGE
================================================================ */

.badge--blue {
    border-color: var(--color-primary-border);

    background:
        rgba(40, 120, 255, 0.09);

    color: #71a8ff;
}


/* ================================================================
   GREEN BADGE
================================================================ */

.badge--success {
    border-color:
        rgba(24, 211, 154, 0.28);

    background:
        rgba(24, 211, 154, 0.08);

    color: #4be3b4;
}


/* ================================================================
   OVERLAY
================================================================ */

.overlay {
    position: fixed;
    inset: 0;

    background:
        rgba(0, 0, 0, 0.64);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity var(--transition-base),
        visibility var(--transition-base);

    z-index: var(--z-overlay);
}


.overlay.is-visible {
    opacity: 1;
    visibility: visible;
}


/* ================================================================
   SCROLLBAR
================================================================ */

* {
    scrollbar-width: thin;
    scrollbar-color:
        #283241
        #080a0e;
}


/* WebKit */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}


::-webkit-scrollbar-track {
    background: #080a0e;
}


::-webkit-scrollbar-thumb {
    background: #283241;

    border-radius: 999px;

    border: 2px solid #080a0e;
}


::-webkit-scrollbar-thumb:hover {
    background: #3a4657;
}


/* ================================================================
   TEXT SELECTION
================================================================ */

::selection {
    background:
        rgba(40, 120, 255, 0.35);

    color: #ffffff;
}


/* ================================================================
   PAGE LOADING
================================================================ */

body.is-loading {
    overflow: hidden;
}


.page-loader {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--color-bg-primary);

    z-index: 9999;

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition:
        opacity 500ms ease,
        visibility 500ms ease;
}


.page-loader.is-hidden,
.page-loader.is-complete {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


/* ================================================================
   LOADER
================================================================ */

.loader {
    width: 34px;
    height: 34px;

    border: 2px solid
        rgba(255, 255, 255, 0.08);

    border-top-color:
        var(--color-primary);

    border-radius: 50%;

    animation:
        projectkart-spin 700ms linear infinite;
}


/* ================================================================
   EMPTY STATE
================================================================ */

.empty-state {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 280px;

    padding: 48px 24px;

    text-align: center;

    border: 1px dashed
        rgba(255, 255, 255, 0.12);

    border-radius: var(--radius-xl);

    background:
        rgba(255, 255, 255, 0.012);
}


.empty-state__icon {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 56px;
    height: 56px;

    margin-bottom: 18px;

    border-radius: 16px;

    background:
        rgba(40, 120, 255, 0.09);

    color: var(--color-primary);

    font-size: 24px;
}


.empty-state h3 {
    margin-bottom: 6px;

    color: var(--color-text-primary);

    font-size: 18px;
    font-weight: var(--font-weight-semibold);
}


.empty-state p {
    max-width: 460px;

    color: var(--color-text-muted);

    font-size: 14px;
}


/* ================================================================
   TOAST
================================================================ */

.toast-container {
    position: fixed;

    right: 24px;
    bottom: 24px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    width: min(
        calc(100% - 40px),
        380px
    );

    z-index: var(--z-toast);

    pointer-events: none;
}


.toast {
    display: flex;

    align-items: center;

    gap: 12px;

    min-height: 54px;

    padding: 12px 16px;

    border:
        1px solid var(--border-color-light);

    border-radius: var(--radius-md);

    background:
        rgba(17, 22, 29, 0.94);

    box-shadow: var(--shadow-lg);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    color: var(--color-text-primary);

    font-size: 14px;

    pointer-events: auto;

    animation:
        toast-in 320ms var(--ease-out);
}


.toast.is-leaving {
    animation:
        toast-out 260ms ease forwards;
}


/* ================================================================
   VISUALLY HIDDEN
================================================================ */

.visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


/* ================================================================
   RESPONSIVE
================================================================ */

@media (max-width: 1024px) {

    :root {
        --container-padding: 28px;
    }

    .section {
        padding-block: 88px;
    }

    .section--large {
        padding-block: 108px;
    }
}


@media (max-width: 768px) {

    :root {
        --container-padding: var(--container-padding-mobile);
    }

    .container,
    .container--wide,
    .container--narrow {
        width: calc(
            100% - (var(--container-padding-mobile) * 2)
        );
    }

    .section,
    .section--medium,
    .section--large {
        padding-block: 72px;
    }

    .surface {
        border-radius: var(--radius-lg);
    }

    .toast-container {
        right: 20px;
        bottom: 20px;

        width: calc(100% - 40px);
    }
}


@media (max-width: 480px) {

    .section,
    .section--medium,
    .section--large {
        padding-block: 56px;
    }

    .empty-state {
        min-height: 240px;
        padding: 36px 18px;
    }
}