/* ==========================================================================
   sparkyxf — global styles
   ========================================================================== */

html { scroll-behavior: smooth; }
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* page itself must not scroll — only .sparkyxf-main does */
    background: #0B0F17;
    color: #E5E7EB;
    font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Fixed viewport layout — appbar + footer pinned, only content scrolls.
   100dvh tracks iOS dynamic viewport (browser chrome show/hide). */
.mud-layout {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    height: 100vh; /* fallback */
    overflow: hidden;
}
/* MudBlazor renders MudMainContent as .mud-main-content */
.mud-main-content.sparkyxf-main {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
    background: #0B0F17;
}
.sparkyxf-footer {
    flex-shrink: 0;
    padding: 20px 0;
    text-align: center;
}

/* ----- Gotcha #1: prevent reload focus ring on h1 (and other headings) ----- */
h1, h2, h3, h4, h5, h6 { outline: none !important; }
h1:focus, h1:focus-visible,
h2:focus, h2:focus-visible,
h3:focus, h3:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* ----- Initial loader ----- */
.initial-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
}
.initial-loader__spinner {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 3px solid #1F2937;
    border-top-color: #22D3EE;
    animation: spin 0.9s linear infinite;
}
.initial-loader__text { color: #9CA3AF; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Blazor error UI ----- */
#blazor-error-ui {
    background: #EF4444;
    color: white;
    bottom: 0; left: 0; right: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ==========================================================================
   App shell
   ========================================================================== */

.sparkyxf-appbar {
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #1F2937;
    background: #0B0F17CC !important; /* 8-digit hex per gotcha #2 */
}

.sparkyxf-brand {
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #22D3EE 0%, #A78BFA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Login
   ========================================================================== */

.login-bg {
    position: relative;
    min-height: calc(100vh - 64px);
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, #22D3EE22 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, #A78BFA22 0%, transparent 40%),
        #0B0F17;
}
.login-card {
    backdrop-filter: blur(8px);
    background: #111827CC !important;
    border: 1px solid #1F2937;
}

/* ==========================================================================
   Landing page (filled fully in step 4)
   ========================================================================== */

.hero {
    position: relative;
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at top right, #22D3EE22 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, #A78BFA22 0%, transparent 50%),
        #0B0F17;
}
.hero__grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(#1F293744 1px, transparent 1px),
        linear-gradient(90deg, #1F293744 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    pointer-events: none;
}
.hero__title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    background: linear-gradient(120deg, #FFFFFF 0%, #22D3EE 50%, #A78BFA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rise 0.8s cubic-bezier(.2,.8,.2,1) both;
}
.hero__subtitle {
    color: #9CA3AF;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    max-width: 640px;
    margin-top: 1rem;
    animation: rise 0.9s 0.1s cubic-bezier(.2,.8,.2,1) both;
}
.hero__cta { animation: rise 1s 0.2s cubic-bezier(.2,.8,.2,1) both; }

@keyframes rise {
    from { opacity: 0; transform: translate3d(0, 24px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.section { padding: 96px 0; position: relative; }
.section--alt { background: #0E141E; }
.section__title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.section__subtitle { color: #9CA3AF; max-width: 720px; }

.feature-card {
    height: 100%;
    background: #111827 !important;
    border: 1px solid #1F2937;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: #22D3EE66;
    box-shadow: 0 20px 50px -20px #22D3EE33;
}

.project-card-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.project-card {
    height: 100%;
    background: #111827 !important;
    border: 1px solid #1F2937;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.project-card:hover {
    transform: translateY(-4px);
    border-color: #A78BFA66;
    box-shadow: 0 20px 50px -20px #A78BFA33;
}

/* tech-styled SVG accent */
.tech-orb {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
    margin-inline: auto;
    animation: float 8s ease-in-out infinite;
    filter: drop-shadow(0 30px 60px #22D3EE22);
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* responsive nudges */
@media (max-width: 600px) {
    .section { padding: 64px 0; }
}
