:root {
    color-scheme: dark;
    --background: #070b17;
    --background-soft: #0b1120;
    --surface: rgba(15, 23, 42, 0.78);
    --surface-solid: #111a2e;
    --surface-hover: rgba(25, 36, 60, 0.9);
    --border: rgba(148, 163, 184, 0.16);
    --border-hover: rgba(139, 92, 246, 0.55);
    --text: #e8eef9;
    --muted: #94a3b8;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-soft: rgba(139, 92, 246, 0.14);
    --cyan: #22d3ee;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
    --radius-large: 24px;
    --radius-medium: 16px;
    --content-width: 1120px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 8rem;
}

body {
    min-width: 280px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    line-height: 1.65;
    background:
        radial-gradient(circle at 12% 8%, rgba(139, 92, 246, 0.16), transparent 30rem),
        radial-gradient(circle at 88% 25%, rgba(34, 211, 238, 0.09), transparent 28rem),
        var(--background);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

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

a,
button {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(34, 211, 238, 0.8);
    outline-offset: 4px;
}

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

header {
    position: sticky;
    top: 1rem;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 1rem auto 0;
    padding: 0.8rem 1rem 0.8rem 1.25rem;
    background: rgba(7, 11, 23, 0.78);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
}

header h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

header h1::before {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    margin-right: 0.65rem;
    content: "";
    background: linear-gradient(135deg, var(--accent-light), var(--cyan));
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.8);
}

nav ul {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    display: block;
    padding: 0.55rem 0.8rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 999px;
    transition:
        color 180ms ease,
        background-color 180ms ease;
}

nav a:hover {
    color: #ffffff;
    background: var(--accent-soft);
}

main {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
}

section {
    position: relative;
    margin-block: clamp(4.5rem, 10vw, 8rem);
}

h2,
h3,
p {
    overflow-wrap: anywhere;
}

h2 {
    margin: 0 0 1.75rem;
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.055em;
}

h3 {
    margin-top: 0;
    color: #ffffff;
}

p {
    color: var(--muted);
}

#whoiam {
    max-width: 920px;
    padding: clamp(1.5rem, 5vw, 4rem);
    overflow: hidden;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.86), rgba(10, 16, 31, 0.75));
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow);
}

#whoiam::after {
    position: absolute;
    top: -8rem;
    right: -8rem;
    width: 18rem;
    height: 18rem;
    pointer-events: none;
    content: "";
    background: rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    filter: blur(70px);
}

#whoiam h2 {
    position: relative;
    z-index: 1;
}

#whoiam p {
    position: relative;
    z-index: 1;
    max-width: 76ch;
    margin: 0 0 1rem;
    font-size: clamp(0.98rem, 1.8vw, 1.08rem);
}

#whoiam p:first-of-type {
    color: #cbd5e1;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
}

#whoiam p:last-child {
    margin-bottom: 0;
}

#projet {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

#projet > h2 {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
}

#projet article {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.75rem;
    min-width: 0;
    padding: clamp(1.35rem, 3vw, 2rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    transition:
        transform 220ms ease,
        border-color 220ms ease,
        background-color 220ms ease;
}

#projet article:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-5px);
}

#projet h3 {
    width: 100%;
    margin-bottom: 0;
    font-size: clamp(1.3rem, 2.5vw, 1.65rem);
}

#projet p {
    width: 100%;
    margin: 0 0 0.5rem;
}

#projet button {
    padding: 0;
    overflow: hidden;
    font: inherit;
    background: transparent;
    border: 0;
    border-radius: 999px;
}

#projet button a {
    display: block;
    padding: 0.7rem 1rem;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: inherit;
    transition:
        background-color 180ms ease,
        border-color 180ms ease;
}

#projet button:nth-of-type(even) a {
    color: #d8dfea;
    background: transparent;
    border-color: var(--border);
}

#projet button a:hover {
    background: #7c3aed;
}

#projet button:nth-of-type(even) a:hover {
    color: #ffffff;
    background: var(--accent-soft);
    border-color: var(--border-hover);
}

#tools > h2 {
    margin-bottom: 2.5rem;
}

.tools-category {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
    padding: clamp(1.1rem, 3vw, 1.6rem);
    background: rgba(11, 17, 32, 0.62);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
}

.tools-category > h3 {
    grid-column: 1 / -1;
    margin-bottom: 0.35rem;
    color: #cbd5e1;
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    min-width: 0;
    min-height: 125px;
    padding: 1rem 0.7rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid transparent;
    border-radius: var(--radius-medium);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background-color 180ms ease;
}

.tool-card:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(167, 139, 250, 0.35);
    transform: translateY(-4px);
}

.tool-card img {
    width: clamp(38px, 7vw, 48px);
    height: clamp(38px, 7vw, 48px);
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28));
    transition: transform 180ms ease;
}

.tool-card:hover img {
    transform: scale(1.08);
}

.tool-card span {
    color: #dbe4f0;
    font-size: 0.92rem;
    font-weight: 650;
    text-align: center;
}

.social-heading {
    max-width: 670px;
    margin-bottom: 2rem;
}

.social-heading > span {
    color: var(--accent-light);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.social-heading h2 {
    margin: 0.55rem 0 1rem;
}

.social-heading p {
    margin: 0;
    font-size: 1.02rem;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.social-card {
    --social-color: var(--accent);
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    padding: 1.25rem;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    transition:
        transform 200ms ease,
        border-color 200ms ease,
        background-color 200ms ease;
}

.social-card::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0;
    background: radial-gradient(circle at top left, var(--social-color), transparent 58%);
    transition: opacity 200ms ease;
}

.social-card:hover {
    background: var(--surface-hover);
    border-color: color-mix(in srgb, var(--social-color) 55%, transparent);
    transform: translateY(-4px);
}

.social-card:hover::before {
    opacity: 0.13;
}

.social-card img,
.social-card-content,
.social-arrow {
    position: relative;
    z-index: 1;
}

.social-card img {
    flex: 0 0 auto;
    width: clamp(36px, 7vw, 42px);
    height: clamp(36px, 7vw, 42px);
    object-fit: contain;
}

.social-card-content {
    flex: 1;
    min-width: 0;
}

.social-card-content h3 {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
}

.social-card-content p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.social-arrow {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 1.35rem;
    transition:
        color 180ms ease,
        transform 180ms ease;
}

.social-card:hover .social-arrow {
    color: #ffffff;
    transform: translate(3px, -3px);
}

.github,
.twitter {
    --social-color: #ffffff;
}

.tiktok {
    --social-color: #ff0050;
}

.youtube {
    --social-color: #ff0000;
}

.instagram {
    --social-color: #e4405f;
}

.discord {
    --social-color: #5865f2;
}

.email {
    --social-color: #ea4335;
}

footer {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
    padding: 2rem 0 2.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

footer p {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
}

@media (max-width: 820px) {
    html {
        scroll-padding-top: 11rem;
    }

    header {
        position: relative;
        top: auto;
        flex-direction: column;
        gap: 0.65rem;
        padding: 1rem;
        border-radius: var(--radius-large);
    }

    nav,
    nav ul {
        width: 100%;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    #projet {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    main,
    header,
    footer {
        width: min(calc(100% - 1.25rem), var(--content-width));
    }

    section {
        margin-block: 4rem;
    }

    h2 {
        letter-spacing: -0.04em;
    }

    #whoiam {
        padding: 1.35rem;
        border-radius: 20px;
    }

    .tools-category {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0.85rem;
        border-radius: 20px;
    }

    .social-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 390px) {
    header {
        align-items: stretch;
    }

    header h1 {
        text-align: center;
    }

    nav a {
        padding: 0.45rem 0.6rem;
        font-size: 0.8rem;
    }

    #projet button {
        width: 100%;
    }

    #projet button a {
        text-align: center;
    }

    .tool-card {
        min-height: 110px;
    }

    .social-card {
        gap: 0.8rem;
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
