/* ==========================================================
   lilia.tn — Style commun
   Thème sombre/clair, dégradés néon, cartes "bento"
   ========================================================== */

:root {
    --violet: #8b5cf6;
    --cyan: #22d3ee;
    --pink: #f472b6;
    --lime: #a3e635;
    --amber: #fbbf24;
    --grad: linear-gradient(120deg, var(--violet) 0%, var(--cyan) 100%);
    --grad-hot: linear-gradient(120deg, var(--pink) 0%, var(--violet) 55%, var(--cyan) 100%);

    --bg: #f6f6fb;
    --bg-soft: #eeeef7;
    --surface: #ffffff;
    --surface-2: #f3f2fb;
    --text: #15142b;
    --muted: #5d5b78;
    --border: rgba(21, 20, 43, 0.1);
    --glow: rgba(139, 92, 246, 0.18);
    --shadow: 0 10px 30px -12px rgba(40, 30, 90, 0.18);
    --accent-text: #6d28d9;

    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

    --radius: 22px;
    --radius-sm: 12px;
    --nav-h: 68px;
    --max: 1180px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0a14;
        --bg-soft: #10101e;
        --surface: #14142a;
        --surface-2: #1b1b36;
        --text: #ecebf7;
        --muted: #a09fbf;
        --border: rgba(255, 255, 255, 0.09);
        --glow: rgba(139, 92, 246, 0.35);
        --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
        --accent-text: #c4b5fd;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0a0a14;
    --bg-soft: #10101e;
    --surface: #14142a;
    --surface-2: #1b1b36;
    --text: #ecebf7;
    --muted: #a09fbf;
    --border: rgba(255, 255, 255, 0.09);
    --glow: rgba(139, 92, 246, 0.35);
    --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
    --accent-text: #c4b5fd;
    color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--violet); color: #fff; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
    position: absolute; top: -100px; left: 16px; z-index: 2000;
    background: var(--violet); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* Fond décoratif : grille + halos */
.bg-deco {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.bg-deco::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
    opacity: 0.6;
}
.bg-deco .blob {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45;
}
.bg-deco .b1 { width: 480px; height: 480px; background: var(--violet); top: -160px; left: -120px; }
.bg-deco .b2 { width: 420px; height: 420px; background: var(--cyan); top: 10%; right: -160px; opacity: 0.3; }
.bg-deco .b3 { width: 360px; height: 360px; background: var(--pink); bottom: -160px; left: 30%; opacity: 0.2; }

/* ---------- Texte utilitaire ---------- */
.grad-text {
    background: var(--grad-hot);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
    color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.08em;
}
.eyebrow::before { content: '//'; opacity: 0.6; }

.section { padding: 96px 0; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 10px 0 14px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* ---------- Navigation ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--nav-h);
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
    max-width: var(--max); margin: 0 auto; height: 100%;
    padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo {
    font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem;
    text-decoration: none; display: flex; align-items: center; gap: 2px;
}
.logo .tld { color: var(--accent-text); }
.logo .cursor {
    display: inline-block; width: 9px; height: 1.1em; margin-left: 3px;
    background: var(--cyan); animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
    display: block; padding: 8px 14px; border-radius: 999px;
    text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--muted);
    transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }

.nav-links a.nav-cta {
    margin-left: 6px; color: #fff; background: var(--grad);
    box-shadow: 0 6px 18px -8px var(--violet); font-weight: 600;
}
.nav-links a.nav-cta:hover { color: #fff; background: var(--grad); transform: translateY(-1px); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; transition: transform .2s, border-color .2s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--violet); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

.menu-btn { display: none; }

@media (max-width: 820px) {
    .menu-btn { display: grid; }
    .nav-links {
        position: fixed; top: var(--nav-h); left: 12px; right: 12px;
        flex-direction: column; align-items: stretch; gap: 4px;
        padding: 12px; border-radius: var(--radius);
        background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
        opacity: 0; transform: translateY(-10px); pointer-events: none;
        transition: opacity .25s, transform .25s;
    }
    .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
    .nav-links a { padding: 12px 16px; font-size: 1rem; }
    .nav-links a.nav-cta { margin: 6px 0 0; text-align: center; }
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 22px; border-radius: 14px; border: 1px solid transparent;
    font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
    text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
    background: var(--grad); color: #fff;
    box-shadow: 0 10px 30px -10px var(--violet);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px var(--violet); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--violet); }

/* ---------- Badges / chips ---------- */
.pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 14px 7px 10px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 0.88rem; font-weight: 500;
}
.pill .dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--lime);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 25%, transparent);
    animation: pulse 2s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--lime) 0%, transparent); } }

.chip {
    display: inline-block; padding: 6px 12px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 0.85rem; font-weight: 500;
}

/* ---------- Cartes ---------- */
.card {
    position: relative;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
    box-shadow: var(--shadow);
}
.card-hover { transition: transform .3s, border-color .3s, box-shadow .3s; }
.card-hover:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--violet) 60%, transparent); box-shadow: 0 20px 50px -20px var(--glow); }

.icon-bubble {
    width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
    font-size: 1.6rem; background: var(--surface-2); border: 1px solid var(--border);
    margin-bottom: 18px;
}

/* ---------- En-tête de page (sous-pages) ---------- */
.page-hero { padding: calc(var(--nav-h) + 72px) 0 48px; }
.page-hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); margin: 12px 0 16px; }
.page-hero p { color: var(--muted); font-size: 1.12rem; max-width: 640px; }
.page-hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Bandeau "Me contacter" ---------- */
.cta-band {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
    padding: 32px 36px;
    background: radial-gradient(ellipse at top left, color-mix(in srgb, var(--violet) 22%, var(--surface)), var(--surface) 70%);
}
.cta-band h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: 4px; }
.cta-band p { color: var(--muted); }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) {
    .cta-band { padding: 24px 20px; }
    .cta-band .actions, .cta-band .btn { width: 100%; }
}

/* ---------- Pied de page ---------- */
.footer {
    border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px;
    color: var(--muted); font-size: 0.92rem;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.footer a { color: var(--accent-text); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Apparition au scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Easter egg (code Konami) ---------- */
.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 3000;
    transform: translate(-50%, 140%);
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px; border-radius: 16px; max-width: calc(100% - 32px);
    background: var(--surface); border: 1px solid var(--amber); box-shadow: var(--shadow);
    font-family: var(--font-mono); font-size: 0.9rem;
    transition: transform .5s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.show { transform: translate(-50%, 0); }
.triforce { width: 36px; height: 32px; flex: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
    .section { padding: 72px 0; }
    .card { padding: 22px; }
    .container { padding: 0 16px; }
}
