/* ==========================================================================
   christophe-ribot.fr — feuille de style unique
   Design sombre minimaliste. L'accent se change via --accent.
   ========================================================================== */

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #2dd4bf;
    --border: #21262d;
    color-scheme: dark;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/InterVariable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: min(100% - 3rem, 68rem);
    margin-inline: auto;
}

/* --- Liens & accessibilité ------------------------------------------------ */

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

a:hover,
a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

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

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--surface);
    padding: 0.5rem 1rem;
    z-index: 10;
}

.skip-link:focus {
    left: 0;
}

/* --- Header ---------------------------------------------------------------- */

.site-header {
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 1.1rem;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    font-weight: 650;
    letter-spacing: -0.01em;
}

.wordmark:hover,
.wordmark:focus-visible {
    text-decoration: none;
    color: var(--accent);
}

.lang-switch {
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    gap: 0.5rem;
}

.lang-switch .current {
    color: var(--accent);
    font-weight: 600;
}

/* --- Hero ------------------------------------------------------------------ */

.hero {
    display: grid;
    gap: 2.5rem;
    align-items: center;
    padding-block: clamp(4rem, 12vh, 8rem);
}

@media (min-width: 45rem) {
    .hero {
        grid-template-columns: 1fr auto;
        gap: 4rem;
    }
}

.hero-greeting {
    color: var(--muted);
    margin: 0 0 0.5rem;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 0.95rem;
}

.hero h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.3rem, 6vw, 3.6rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-title {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    color: var(--accent);
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    max-width: 34em;
    margin: 0 0 2rem;
}

.portrait {
    border-radius: 50%;
    border: 1px solid var(--border);
    width: clamp(160px, 24vw, 280px);
    height: auto;
    justify-self: center;
}

/* --- Bouton ------------------------------------------------------------------ */

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-weight: 550;
    background: none;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
}

/* --- Sections ---------------------------------------------------------------- */

.section {
    padding-block: clamp(2.5rem, 6vh, 4.5rem);
    border-top: 1px solid var(--border);
}

.section h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    letter-spacing: -0.02em;
    margin: 0 0 1.2rem;
}

.section h2 span {
    color: var(--accent);
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
}

.section p {
    max-width: 62ch;
    color: var(--text);
}

/* --- Contact ------------------------------------------------------------------ */

.contact-grid {
    display: grid;
    gap: 3rem;
    margin-top: 2rem;
}

@media (min-width: 45rem) {
    .contact-grid {
        grid-template-columns: minmax(0, 30rem) 1fr;
        gap: 4rem;
    }
}

.contact-form p {
    margin: 0 0 1.1rem;
}

.contact-form label {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form textarea {
    resize: vertical;
}

/* Pot de miel : hors écran, jamais display:none (les bots le détectent). */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-status {
    font-size: 0.95rem;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
}

.form-status[data-state='ok'] {
    color: var(--accent);
    border-color: var(--accent);
}

.form-status[data-state='err'] {
    color: #f85149;
    border-color: #f85149;
}

.email-line {
    color: var(--muted);
}

.email-line .email {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 1.05rem;
}

.social {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0;
    margin: 1.5rem 0 0;
}

.social a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social a:hover,
.social a:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
}

/* --- Page 404 (styles ici : la CSP interdit les <style> inline) ------------- */

.error-page {
    min-height: 80vh;
    display: grid;
    place-content: center;
    text-align: center;
}

.error-page h1 {
    font-size: clamp(3rem, 10vw, 5rem);
    margin: 0 0 0.5rem;
    color: var(--accent);
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
}

/* --- Footer ---------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer p {
    margin: 0;
}

/* --- Animations d'entrée ------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
    @keyframes fade-up {
        from {
            opacity: 0;
            transform: translateY(14px);
        }
        to {
            opacity: 1;
            transform: none;
        }
    }

    .hero-text,
    .portrait {
        animation: fade-up 0.6s ease-out both;
    }

    .portrait {
        animation-delay: 0.15s;
    }
}
