/* ==========================================================================
   LEARNFORFREE — STUDIO VISUALIZATION & DESIGN SYSTEM (STYLE.CSS)
   ========================================================================== */

@font-face {
    font-family: Jakarta;
    src: url("jakarta.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

@font-face {
    font-family: Bricolage;
    src: url("bricolage.ttf") format("truetype");
    font-weight: 800;
    font-display: swap;
}

:root {
    color-scheme: dark;

    /* Deep Obsidian-Indigo Canvas & Layered Surfaces */
    --page: #05050b;
    --page-deep: #030307;
    --surface-1: #0c0d18;
    --surface-2: #121426;
    --surface-3: #191c36;
    --surface-glass: rgba(9, 10, 20, 0.78);
    --input-bg: #080912;

    /* Hairlines & Illuminated Borders */
    --line: rgba(167, 139, 250, 0.14);
    --line-strong: rgba(167, 139, 250, 0.3);
    --line-glow: rgba(139, 92, 246, 0.62);

    /* Typography Hierarchy */
    --text: #f7f7fc;
    --text-secondary: #cdd0e4;
    --text-muted: #9094b8;

    /* Logo-Matched Brand Spectrum */
    --indigo: #6366f1;
    --violet: #8b5cf6;
    --orchid: #a855f7;
    --lavender: #c4b5fd;
    --lavender-bright: #ede9fe;
    --cyan: #38bdf8;
    --amber: #f59e0b;
    --green: #34d399;

    /* Specular Highlights & Depth Shadows */
    --highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --highlight-strong: inset 0 1px 0 rgba(255, 255, 255, 0.24);
    --shadow-sm: 0 6px 22px rgba(2, 2, 8, 0.52);
    --shadow-md: 0 20px 50px rgba(2, 2, 8, 0.72);
    --shadow-lg: 0 30px 76px rgba(2, 2, 8, 0.84);
    --shadow-violet: 0 10px 34px rgba(124, 58, 237, 0.38);
    --shadow-violet-lg: 0 18px 46px rgba(139, 92, 246, 0.56);

    /* Radii & Motion Curves */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   KEYFRAME VISUALIZATIONS & MICRO-MOTION
   ========================================================================== */
@keyframes bookFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(0.8deg);
    }
}

@keyframes auraPulse {
    0%, 100% {
        opacity: 0.82;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.06) rotate(4deg);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* ==========================================================================
   GLOBAL RESET & ATMOSPHERIC CANVAS
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    background-color: var(--page);
    background-image:
        radial-gradient(ellipse 82% 50% at 12% -8%, rgba(99, 102, 241, 0.24), transparent 62%),
        radial-gradient(ellipse 68% 48% at 88% 4%, rgba(168, 85, 247, 0.2), transparent 58%),
        radial-gradient(ellipse 58% 42% at 74% 36%, rgba(56, 189, 248, 0.1), transparent 60%),
        radial-gradient(ellipse 65% 38% at 50% 100%, rgba(99, 102, 241, 0.1), transparent 65%);
    color: var(--text);
    font-family: Jakarta, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-wrap: anywhere;
    -webkit-tap-highlight-color: transparent;
}

/* Architectural Coordinate Grid + Constellation Dots */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        radial-gradient(rgba(196, 181, 253, 0.14) 1px, transparent 1px),
        linear-gradient(to right, rgba(167, 139, 250, 0.032) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(167, 139, 250, 0.032) 1px, transparent 1px);
    background-size: 48px 48px, 48px 48px, 48px 48px;
    mask-image: radial-gradient(ellipse 90% 72% at 50% 12%, #000 25%, transparent 84%);
    -webkit-mask-image: radial-gradient(ellipse 90% 72% at 50% 12%, #000 25%, transparent 84%);
}

::selection {
    background: rgba(139, 92, 246, 0.44);
    color: #ffffff;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--page-deep);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #313561, #232647);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
}

/* ==========================================================================
   TYPOGRAPHY & EDITORIAL HIERARCHY
   ========================================================================== */
h1, h2, h3 {
    font-family: Bricolage, sans-serif;
    line-height: 1.08;
    letter-spacing: -0.028em;
    margin: 0 0 0.85rem;
    color: #ffffff;
    text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 1.45rem + 2.4vw, 2.95rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 1.9rem); }
h3 { font-size: 1.26rem; }

p {
    margin: 0.85rem 0;
    color: var(--text-muted);
    text-wrap: pretty;
}

li::marker {
    color: var(--violet);
    font-weight: 700;
}

/* Links & Disclosures */
a, summary {
    color: var(--lavender);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition:
        color 0.18s var(--ease),
        background-color 0.18s var(--ease),
        border-color 0.18s var(--ease),
        transform 0.18s var(--ease),
        box-shadow 0.18s var(--ease);
}

a:hover {
    color: var(--lavender-bright);
}

a:active {
    opacity: 0.88;
}

summary {
    cursor: pointer;
    font-weight: 700;
    padding: 0.45rem 0;
    user-select: none;
}

summary:hover {
    color: var(--lavender-bright);
}

/* ==========================================================================
   BUTTONS WITH KINETIC SHIMMER & DEPTH
   ========================================================================== */
button, .button {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    background-size: 160% 160%;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    padding: 0.78rem 1.52rem;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), var(--shadow-violet);
    transition:
        transform 0.18s var(--ease),
        background-position 0.35s var(--ease),
        filter 0.18s var(--ease),
        box-shadow 0.18s var(--ease),
        border-color 0.18s var(--ease);
}

button::after, .button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 72%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: skewX(-22deg);
    transition: left 0.55s var(--ease);
    pointer-events: none;
}

button:hover, .button:hover {
    background-position: 100% 50%;
    filter: brightness(1.08);
    border-color: rgba(255, 255, 255, 0.48);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), var(--shadow-violet-lg);
}

button:hover::after, .button:hover::after {
    left: 145%;
}

button:active, .button:active {
    transform: translateY(0) scale(0.985);
}

button.secondary, .button.secondary {
    background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
    color: var(--text);
    border: 1px solid var(--line-strong);
    box-shadow: var(--highlight-top), var(--shadow-sm);
}

button.secondary:hover, .button.secondary:hover {
    background: var(--surface-3);
    color: #ffffff;
    border-color: var(--lavender);
    box-shadow: var(--highlight-top), var(--shadow-md);
}

button:disabled, .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   FORMS, INPUTS & FIELDSETS
   ========================================================================== */
label {
    display: block;
    font-weight: 650;
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin: 1.15rem 0 0.45rem;
}

input, textarea, select {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.82rem 1rem;
    margin: 0 0 1.45rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background-color: var(--input-bg);
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
    transition:
        border-color 0.18s var(--ease),
        box-shadow 0.18s var(--ease),
        background-color 0.18s var(--ease);
}

textarea {
    resize: vertical;
    min-height: 7.5rem;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.5rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) calc(50% + 1px),
        calc(100% - 0.75rem) calc(50% + 1px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
}

input::placeholder, textarea::placeholder {
    color: #666a8f;
    opacity: 1;
}

input:hover, textarea:hover, select:hover {
    border-color: rgba(196, 181, 253, 0.52);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.28), inset 0 1px 2px rgba(0, 0, 0, 0.25);
    background-color: #0e1022;
}

input[type="radio"] {
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    margin: 0 0.75rem 0 0;
    vertical-align: middle;
    accent-color: var(--violet);
    cursor: pointer;
    box-shadow: none;
}

fieldset {
    min-width: 0;
    margin: 1.5rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.3rem 1.55rem;
    background: linear-gradient(180deg, rgba(18, 20, 38, 0.72) 0%, rgba(12, 13, 24, 0.88) 100%);
    box-shadow: var(--highlight-top), var(--shadow-sm);
}

legend {
    padding: 0 0.7rem;
    font-weight: 750;
    color: var(--lavender);
}

/* ==========================================================================
   DATA VISUALIZATION PROGRESS BARS
   ========================================================================== */
progress {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 0.92rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    overflow: hidden;
    background-color: var(--input-bg);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

progress::-webkit-progress-bar {
    background-color: var(--input-bg);
    border-radius: 999px;
}

progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--indigo), var(--violet), var(--orchid), var(--cyan), var(--indigo));
    background-size: 200% 100%;
    animation: progressFlow 3.5s linear infinite;
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 12px rgba(139, 92, 246, 0.5);
    transition: width 0.4s var(--ease);
}

progress::-moz-progress-bar {
    background: linear-gradient(90deg, var(--indigo), var(--violet), var(--orchid), var(--cyan));
    border-radius: 999px;
}

:focus-visible {
    outline: 2px solid var(--lavender);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
