/* ============================================
   LEEF 2.0 — Base Styles
   ============================================ */

/* ---- CSS Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--fw-regular);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--color-base);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---- Selection ---- */
::selection {
    background-color: var(--color-primary);
    color: var(--color-dark);
}

/* ---- Links ---- */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--color-primary);
}

/* ---- Images ---- */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---- Lists ---- */
ul,
ol {
    list-style: none;
}

/* ---- Buttons ---- */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    outline: none;
}

/* ---- Inputs ---- */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
}

h1 {
    font-size: var(--fs-4xl);
}

h2 {
    font-size: var(--fs-3xl);
}

h3 {
    font-size: var(--fs-2xl);
}

h4 {
    font-size: var(--fs-xl);
}

h5 {
    font-size: var(--fs-lg);
}

h6 {
    font-size: var(--fs-md);
}

p {
    line-height: var(--lh-normal);
    color: var(--color-gray-500);
}

/* ---- Utility: Mono Text (CPFM style) ---- */
.mono {
    font-family: var(--font-mono);
    letter-spacing: var(--ls-wide);
}

.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

/* ---- Utility: Flexbox ---- */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---- Utility: Grid ---- */
.grid {
    display: grid;
}

/* ---- Utility: Container ---- */
.container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-full {
    width: 100%;
    padding: 0 var(--space-6);
}

/* ---- Utility: Visibility ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ---- Scrollbar Custom ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-scale {
    animation: fadeInScale var(--duration-slower) var(--ease-spring) forwards;
}

/* ---- Stagger Delays ---- */
.delay-1 {
    animation-delay: 100ms;
}

.delay-2 {
    animation-delay: 200ms;
}

.delay-3 {
    animation-delay: 300ms;
}

.delay-4 {
    animation-delay: 400ms;
}

.delay-5 {
    animation-delay: 500ms;
}

/* ---- Dark Mode Body Variant ---- */
body.dark {
    background-color: var(--color-dark);
    color: var(--color-white);
}

body.dark ::selection {
    background-color: var(--color-primary);
    color: var(--color-dark);
}

body.dark ::-webkit-scrollbar-track {
    background: var(--color-dark);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    h1 {
        font-size: var(--fs-3xl);
    }

    h2 {
        font-size: var(--fs-2xl);
    }

    h3 {
        font-size: var(--fs-xl);
    }

    .container {
        padding: 0 var(--space-4);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: var(--fs-2xl);
    }
}