*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

@font-face {
    font-family: 'Lato';
    src: url('/fonts/Lato-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@keyframes silverShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

:root {
    --color-bg: #0e0e12;
    --color-surface: #16161a;
    --color-surface-alt: #1c1c20;
    --color-text: #e8e8ec;
    --color-text-muted: #8a8a96;
    --color-primary: #00c9a7;
    --color-primary-hover: #00e6c0;
    --color-accent: #7c6aef;
    --color-gold: #c8a84e;
    --color-border: #2a2a30;
    --color-border-hover: #3a3a42;
    --shimmer-dark: #707880;
    --shimmer-mid: #c0c4cc;
    --shimmer-light: #f0f2f5;
    --radius: 8px;
    --max-width: 960px;
}

html {
    font-family: 'Lato', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    transition: background-color 640ms ease, color 640ms ease;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s;
}

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

/* Header / Nav */

.header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    transition: background-color 640ms ease, border-color 640ms ease;
}

.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.nav__brand {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(
        90deg,
        var(--shimmer-dark) 0%,
        var(--shimmer-mid) 25%,
        var(--shimmer-light) 50%,
        var(--shimmer-mid) 75%,
        var(--shimmer-dark) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: silverShimmer 6s linear infinite;
    text-decoration: none;
}

.nav__brand:hover {
    text-decoration: none;
}

.nav__links {
    list-style: none;
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.nav__links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.nav__links a.active {
    color: var(--color-text);
    font-weight: 600;
}

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

.nav__lang {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.8rem !important;
    font-family: inherit;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238a8a96' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}

.nav__lang:hover {
    border-color: #0ea5e9;
}

.nav__lang option {
    background: var(--color-surface);
    color: var(--color-text);
}

/* Main */

.main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* Hero (index) */

.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero__logo {
    width: min(200px, 40vw);
    height: auto;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    box-shadow:
        0 0 40px rgba(0, 201, 167, 0.15),
        0 0 80px rgba(124, 106, 239, 0.08);
}

.hero__title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(
        90deg,
        var(--shimmer-dark) 0%,
        var(--shimmer-mid) 25%,
        var(--shimmer-light) 50%,
        var(--shimmer-mid) 75%,
        var(--shimmer-dark) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: silverShimmer 6s linear infinite;
}

.hero__subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.hero__desc {
    max-width: 540px;
    margin: 1rem auto 2rem;
    color: var(--color-text-muted);
}

/* Button */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn--primary {
    background: #1a8f4a;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(26, 143, 74, 0.4);
}

.btn--primary:hover {
    background: #157a3e;
    box-shadow: 0 0 30px rgba(26, 143, 74, 0.5);
    text-decoration: none;
    color: #ffffff;
}

.btn--disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* Features (index) */

.features {
    padding: 2rem 0;
}

.features__title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.features__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.feature {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: background-color 640ms ease, border-color 640ms ease, box-shadow 0.2s;
}

.feature:hover {
    border-color: var(--color-border-hover);
}

.feature__title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--shimmer-dark) 0%, var(--shimmer-mid) 25%, var(--shimmer-light) 50%, var(--shimmer-mid) 75%, var(--shimmer-dark) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: silverShimmer 6s linear infinite;
}

.feature__desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Pages (themes, terms) */

.page__logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: block;
    box-shadow:
        0 0 40px rgba(0, 201, 167, 0.15),
        0 0 80px rgba(124, 106, 239, 0.08);
}

.page__title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(
        90deg,
        var(--shimmer-dark) 0%,
        var(--shimmer-mid) 25%,
        var(--shimmer-light) 50%,
        var(--shimmer-mid) 75%,
        var(--shimmer-dark) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: silverShimmer 6s linear infinite;
}

.page__intro {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* Themes grid */

.themes__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.theme-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: background-color 640ms ease, border-color 640ms ease, box-shadow 0.2s;
}

.theme-card:hover {
    border-color: #505560;
}

.theme-card__name {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    background: linear-gradient(90deg, var(--shimmer-dark) 0%, var(--shimmer-mid) 25%, var(--shimmer-light) 50%, var(--shimmer-mid) 75%, var(--shimmer-dark) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: silverShimmer 6s linear infinite;
}

.theme-card__desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Terms */

.terms__section {
    margin-bottom: 1.5rem;
}

.terms__heading {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--color-gold);
}

.terms__text {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Footer */

.footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    margin-top: 2rem;
    transition: background-color 640ms ease, border-color 640ms ease;
}

.footer__content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
}

.footer__logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: block;
    box-shadow:
        0 0 20px rgba(0, 201, 167, 0.1),
        0 0 40px rgba(124, 106, 239, 0.05);
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.footer__links a {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.footer__links a:hover {
    color: #0ea5e9;
}

.footer__copy {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* 404 page */

.notfound {
    text-align: center;
    padding: 4rem 0;
}

.notfound__logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    box-shadow:
        0 0 40px rgba(0, 201, 167, 0.15),
        0 0 80px rgba(124, 106, 239, 0.08);
}

.notfound__code {
    font-size: 6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(
        90deg,
        var(--shimmer-dark) 0%,
        var(--shimmer-mid) 25%,
        var(--shimmer-light) 50%,
        var(--shimmer-mid) 75%,
        var(--shimmer-dark) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: silverShimmer 6s linear infinite;
}

.notfound__desc {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* Responsive - tablettes+ */

@media (min-width: 640px) {
    .features__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .themes__grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

/* Theme toggle button */

.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.theme-toggle:hover {
    border-color: #0ea5e9;
}

.theme-toggle__icon {
    display: none;
    filter: brightness(0) invert(0.85);
}

[data-theme="light"] .theme-toggle__icon {
    filter: brightness(0) invert(0.25);
}

[data-theme="dark"] .theme-toggle__icon--light,
:not([data-theme]) .theme-toggle__icon--light {
    display: block;
}

[data-theme="dark"] .theme-toggle__icon--dark,
:not([data-theme]) .theme-toggle__icon--dark {
    display: none;
}

[data-theme="light"] .theme-toggle__icon--light {
    display: none;
}

[data-theme="light"] .theme-toggle__icon--dark {
    display: block;
}

/* Light mode */

[data-theme="light"] {
    --color-bg: #f5f5f7;
    --color-surface: #ffffff;
    --color-surface-alt: #eaeaef;
    --color-text: #1a1a1a;
    --color-text-muted: #6a6a76;
    --color-border: #d5d5dc;
    --color-border-hover: #b5b5bc;
}

[data-theme="light"] .header {
    background: var(--color-surface);
    border-bottom-color: var(--color-border);
}

[data-theme="light"] .footer {
    background: var(--color-surface);
    border-top-color: var(--color-border);
}

[data-theme="light"] .feature,
[data-theme="light"] .theme-card {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="light"] .theme-toggle {
    border-color: var(--color-border);
}

[data-theme="light"] .theme-toggle:hover {
    border-color: #0ea5e9;
}

[data-theme="light"] {
    --shimmer-dark: #505560;
    --shimmer-mid: #808890;
    --shimmer-light: #b0b4bc;
}
