/* =========================
   Design tokens (defaults)
   ========================= */
:root {
    --bg-1: #0b1020;
    --bg-2: #0e1226;
    --ink: #e6edf7;
    --muted: #a6b2c6;
    --brand: #7c5cff;
    --brand-2: #22d3ee;
    --accent: #16f2b3;
    --glass: rgba(255, 255, 255, 0.06);
    --stroke: rgba(255, 255, 255, 0.14);
    --shadow-1: 0 20px 60px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 40px 80px rgba(20, 25, 60, 0.5);
    color-scheme: dark;

    /* Header helpers (can be overridden by theme) */
    --header-bg: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    --header-stroke: rgba(255, 255, 255, 0.14);
    --title-color: #e6edf7;
}

/* Light scheme preference as a baseline for users without manual toggle */
@media (prefers-color-scheme: light) {
    :root {
        --bg-1: #f7f9ff;
        --bg-2: #eef2ff;
        --ink: #0b1220;
        --muted: #4b5563;
        --brand: #6b4eff;
        --brand-2: #06b6d4;
        --accent: #0ea5e9;
        --glass: rgba(255, 255, 255, 0.6);
        --stroke: rgba(2, 6, 23, 0.15);
        --shadow-1: 0 20px 60px rgba(2, 6, 23, 0.12);
        --shadow-2: 0 40px 80px rgba(2, 6, 23, 0.14);
        color-scheme: light;

        --header-bg: #ffffff;
        --header-stroke: rgba(2, 6, 23, 0.12);
        --title-color: #0b1220;
    }
}

/* Manual theme overrides via data-theme */
html[data-theme="light"] {
    --bg-1: #f7f9ff;
    --bg-2: #eef2ff;
    --ink: #0b1220;
    --muted: #4b5563;
    --brand: #6b4eff;
    --brand-2: #06b6d4;
    --accent: #0ea5e9;
    --glass: rgba(255, 255, 255, 0.6);
    --stroke: rgba(2, 6, 23, 0.15);
    --shadow-1: 0 20px 60px rgba(2, 6, 23, 0.12);
    --shadow-2: 0 40px 80px rgba(2, 6, 23, 0.14);
    color-scheme: light;

    --header-bg: #ffffff;
    --header-stroke: rgba(2, 6, 23, 0.12);
    --title-color: #0b1220;
}

html[data-theme="dark"] {
    --bg-1: #0b1020;
    --bg-2: #0e1226;
    --ink: #e6edf7;
    --muted: #a6b2c6;
    --brand: #7c5cff;
    --brand-2: #22d3ee;
    --accent: #16f2b3;
    --glass: rgba(255, 255, 255, 0.06);
    --stroke: rgba(255, 255, 255, 0.14);
    --shadow-1: 0 20px 60px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 40px 80px rgba(20, 25, 60, 0.5);
    color-scheme: dark;

    --header-bg: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    --header-stroke: rgba(255, 255, 255, 0.14);
    --title-color: #e6edf7;
}

/* ================
   Base / Resets
   ================ */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--ink);
    background: linear-gradient(120deg, var(--bg-1), var(--bg-2));
    overflow-x: hidden;
}

/* ==========================
   Background decorative blobs
   ========================== */
.bg {
    position: fixed;
    inset: -20% -20% auto auto;
    width: 140vmax;
    height: 140vmax;
    z-index: -1;
    background:
        radial-gradient(50vmax 50vmax at 15% 20%, rgba(124, 92, 255, .35), transparent 60%),
        radial-gradient(45vmax 45vmax at 80% 10%, rgba(34, 211, 238, .25), transparent 60%),
        radial-gradient(55vmax 55vmax at 50% 70%, rgba(22, 242, 179, .18), transparent 60%);
    filter: blur(10px);
    animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
    0% {
        transform: translate3d(-4%, -2%, 0) scale(1);
    }

    100% {
        transform: translate3d(2%, 3%, 0) scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg {
        animation: none;
    }
}

/* =================
   Layout containers
   ================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* =======
   Header
   ======= */
.header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    margin-top: 18px;
    border-radius: 16px;
    background: var(--header-bg);
    border: 2px solid var(--header-stroke);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-1);
}

/* Brand block */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 900;
    letter-spacing: 0.2px;
}

/* Brand logo box (place your <img> inside) */
.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Glassy frame */
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Icon inside the brand box */
.brand-logo img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    display: block;
}

/* Brand title */
.brand-title {
    font-size: clamp(18px, 2.4vw, 24px);
    font-weight: 800;
    color: var(--title-color);
    /* adjusts with theme */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* Hover highlight on brand logo */
.brand:hover .brand-logo {
    box-shadow: 0 14px 32px rgba(34, 211, 238, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    transition: box-shadow .2s ease, transform .15s ease;
}

/* ===================
   Buttons & Toggle UI
   =================== */
.magnet {
    position: relative;
    display: inline-block;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(124, 92, 255, .35);
    transform: translate3d(0, 0, 0);
    transition: transform .15s ease, box-shadow .2s ease;
}

.btn:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 18px 36px rgba(124, 92, 255, .42);
}

.btn-outline {
    background: transparent;
    color: var(--ink);
    border: 2px solid var(--stroke);
    box-shadow: none;
}

.toggle {
    width: 64px;
    height: 36px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 2px solid var(--stroke);
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    backdrop-filter: blur(8px);
}

.knob {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
    transform: translateX(0);
    transition: transform .25s ease;
}

html[data-theme="dark"] .knob {
    transform: translateX(28px);
    background: #dbe8ff;
}

/* =========
   Hero area
   ========= */
.hero {
    text-align: center;
    padding: 46px 0 18px;
}

.title {
    font-size: clamp(30px, 5vw, 56px);
    line-height: 1.05;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    text-shadow: 0 6px 22px rgba(0, 0, 0, .35);
}

.subtitle {
    color: var(--muted);
    margin: 0 auto;
    max-width: 760px;
}

/* =======
   Toolbar
   ======= */
.toolbar {
    margin: 22px 0;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 2px dashed var(--stroke);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
    backdrop-filter: blur(10px);
}

/* ====
   Grid
   ==== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

/* =====
   Cards
   ===== */
.card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03));
    border: 2px solid var(--stroke);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(14px);
    transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(124, 92, 255, .5);
    box-shadow: 0 50px 100px rgba(34, 211, 238, .18);
}

.card-head {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 52px;
}

/* Card icon box (per-card image) */
.icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--brand-2));
    box-shadow: 0 10px 22px rgba(22, 242, 179, .35);
}

.icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fallback-pill {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #0b1020;
}

.name {
    font-weight: 800;
    letter-spacing: .2px;
    display: inline-block;
}

.meta {
    color: var(--muted);
    font-size: 13px;
}

.size {
    color: var(--muted);
    font-size: 12px;
    padding-left: 8px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.ghost {
    background: transparent;
    color: var(--brand-2);
    border: 2px solid rgba(34, 211, 238, .5);
    font-weight: 700;
}

.ghost:hover {
    background: rgba(34, 211, 238, .12);
}

/* ============
   Micro-motion
   ============ */
.magnet:hover .btn {
    transform: translate3d(var(--mx, 0), var(--my, 0), 0) scale(1.02);
}

@media (prefers-reduced-motion: reduce) {
    .magnet:hover .btn {
        transform: none;
    }
}

/* ======
   Footer
   ====== */
footer {
    margin: 40px 0 30px;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    border-top: 2px solid var(--stroke);
    padding: 18px 2px;
    color: var(--muted);
}

.footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--stroke);
}

/* Default: inline next to brand */
.skyline {
    margin-left: 8px;
    font-size: 0.7em;
    color: var(--muted, #9aa9be);
    vertical-align: super;/* keep the superscript look on wide screens */
    white-space: nowrap;/ avoid awkward wraps in the middle */
}

/* Mobile: move to new line and normalize baseline */
@media (max-width: 520px) {
    .skyline {
        display: block;
        /*forces a new line*/
        margin: 6px 0 0 0;
        /*space above */
        font-size: 0.85em;
        /*slightly larger for readability on mobile*/
        vertical-align: baseline;
        /*no superscript offset when block-level*/
        white-space: normal;
        opacity: 0.9;
    }
}