/* =============================================
   VARIABLES
============================================= */

:root {
    --teal:        #16e694;
    --teal-dim:    #57e8c3;
    --teal-glow:   rgba(22, 230, 148, 0.18);
    --purple:      #8e35c0;
    --magenta:     #c41aa1;
    --purple-glow: rgba(142, 53, 192, 0.22);
    --bg:          #070708;
    --text:        #f8fafc;
    --muted:       rgba(248, 250, 252, 0.38);
}

/* =============================================
   ACCESSIBILITÉ
============================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: fixed;
    top: -100%;
    left: 8px;
    z-index: 10001;
    padding: 8px 16px;
    background: var(--teal);
    color: #020d08;
    font-size: 14px;
    font-weight: 700;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #020d08;
    outline-offset: 2px;
}

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

/* =============================================
   RESET & BASE
============================================= */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: radial-gradient(ellipse at 50% 38%, #0d0f0e 0%, var(--bg) 65%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   CURSEUR CUSTOM
============================================= */

#cursor {
    position: fixed;
    top: 0; left: 0;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

#cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(22, 230, 148, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

body.cursor-hover #cursor-ring {
    width: 52px;
    height: 52px;
    border-color: rgba(22, 230, 148, 0.85);
}

@media (hover: none) {
    *, *::before, *::after { cursor: auto; }
    #cursor, #cursor-ring   { display: none; }
}

/* =============================================
   SCENE
============================================= */

#scene {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   CANVAS
============================================= */

#chr {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* =============================================
   OVERLAY DE TRANSITION
============================================= */

#overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    opacity: 0;
    pointer-events: none;
}

/* =============================================
   DIALOGUE
============================================= */

#dialogue {
    position: absolute;
    top: clamp(48px, 11%, 100px);
    width: 100%;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 1.5vh, 16px);
}

#text {
    display: block;
    font-size: clamp(26px, 4.8vw, 62px);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
    background: linear-gradient(135deg, #fff 20%, #57e8c3 60%, #16e694 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
}

#subtext {
    display: block;
    font-size: clamp(9px, 1vw, 12px);
    color: var(--muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 400;
    opacity: 0;
}

/* =============================================
   HINT
============================================= */

#hint {
    position: absolute;
    bottom: clamp(28px, 7%, 64px);
    width: 100%;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

#hint span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    animation: hint-blink 2.8s ease-in-out 2s infinite;
}

@keyframes hint-blink {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}

/* =============================================
   SPEECH — paroles du personnage
============================================= */

#speech {
    position: absolute;
    top: calc(50% + clamp(82px, 13vh, 118px));
    width: 100%;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

#speech-text {
    display: inline-block;
    font-size: clamp(13px, 1.25vw, 17px);
    color: rgba(87, 232, 195, 0.88);
    letter-spacing: 0.05em;
    font-weight: 400;
    font-style: italic;
    opacity: 0;
}

/* =============================================
   UNIVERS — navigation gauche / droite
============================================= */

.universe {
    position: absolute;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: clamp(14px, 2vh, 22px) clamp(18px, 2.5vw, 30px);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.35s ease;
}

#u-dev  { left:  clamp(24px, 5.5vw, 90px); }
#u-game { right: clamp(24px, 5.5vw, 90px); }

.universe.live { pointer-events: auto; }

.universe:hover { border-color: rgba(22, 230, 148, 0.35); }
#u-game:hover   { border-color: rgba(193, 26, 161, 0.35); }

.uni-label {
    font-size: clamp(10px, 0.9vw, 12px);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.universe:hover .uni-label { color: var(--text); }

.uni-count {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.5;
}

#u-dev  .uni-count { color: var(--teal);   }
#u-game .uni-count { color: var(--purple); }

/* =============================================
   RÉSEAUX SOCIAUX
============================================= */

#socials {
    position: absolute;
    bottom: clamp(28px, 6%, 56px);
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    display: flex;
    gap: clamp(12px, 2vw, 20px);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

#socials.live { pointer-events: auto; }

.soc-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(248, 250, 252, 0.35);
    text-decoration: none;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.soc-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.soc-link:hover {
    color: var(--teal);
    border-color: rgba(22, 230, 148, 0.4);
    background: rgba(22, 230, 148, 0.06);
    transform: translateY(-3px);
}

/* =============================================
   RESPONSIVE
============================================= */

/* bouton mail — reset natif */
#soc-mail {
    background: none;
    font: inherit;
}

@media (max-width: 580px) {
    .universe {
        top: 78%;
        padding: 10px 14px;
    }

    #u-dev  { left:  8vw; }
    #u-game { right: 8vw; }

    #dialogue { top: clamp(32px, 8%, 64px); }

    #socials { gap: 10px; }
    .soc-link { width: 34px; height: 34px; }
    .soc-link svg { width: 15px; height: 15px; }
}

/* =============================================
   CONTACT MODAL
============================================= */

#contact-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(3, 4, 5, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#contact-modal.open {
    opacity: 1;
    pointer-events: all;
}

#contact-box {
    position: relative;
    width: min(440px, 90vw);
    background: rgba(7, 7, 8, 0.97);
    border: 1px solid rgba(22, 230, 148, 0.18);
    border-radius: 14px;
    padding: clamp(28px, 5vw, 44px);
    transform: translateY(18px);
    transition: transform 0.32s ease;
}

#contact-modal.open #contact-box {
    transform: translateY(0);
}

#contact-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(248, 250, 252, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}

#contact-close:hover {
    color: var(--teal);
    border-color: rgba(22, 230, 148, 0.4);
}

.cf-overline {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--teal);
    font-weight: 600;
    margin-bottom: 8px;
}

.cf-title {
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8fafc;
    margin-bottom: 24px;
}

.cf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.cf-field label {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.45);
}

.cf-field input,
.cf-field textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    padding: 10px 13px;
    color: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    resize: none;
    transition: border-color 0.2s;
    cursor: text;
}

.cf-field input:focus,
.cf-field textarea:focus {
    border-color: rgba(22, 230, 148, 0.42);
}

/* États valid / invalid */
.cf-field.cf-invalid input,
.cf-field.cf-invalid textarea {
    border-color: rgba(255, 80, 80, 0.60);
    background: rgba(255, 50, 50, 0.05);
}

.cf-field.cf-valid input,
.cf-field.cf-valid textarea {
    border-color: rgba(22, 230, 148, 0.35);
}

/* Message d'erreur par champ */
.cf-field-error {
    font-size: 11px;
    color: #ff6b6b;
    line-height: 1.4;
    animation: cf-fadein 0.2s ease;
}

/* Compteur de caractères */
.cf-counter {
    font-size: 10px;
    color: rgba(248, 250, 252, 0.22);
    text-align: right;
    transition: color 0.25s;
}

.cf-counter--warn { color: rgba(255, 165, 50, 0.75); }
.cf-counter--over { color: #ff6b6b; font-weight: 600; }

.cf-field input::placeholder,
.cf-field textarea::placeholder {
    color: rgba(248, 250, 252, 0.22);
}

.cf-submit {
    width: 100%;
    margin-top: 8px;
    padding: 11px 0;
    background: var(--teal);
    color: #020d08;
    border: none;
    border-radius: 7px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background 0.2s, transform 0.14s;
}

.cf-submit:hover           { background: #57e8c3; }
.cf-submit:active          { transform: scale(0.98); }
.cf-submit:disabled        { opacity: 0.55; }

/* Honeypot — hors écran, invisible pour les humains */
.cf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
}

/* État succès */
.cf-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 36px 0 24px;
    text-align: center;
}

.cf-success svg {
    width: 48px;
    height: 48px;
    color: var(--teal);
    animation: cf-check 0.5s ease forwards;
}

@keyframes cf-check {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1);   }
}

.cf-success p {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
}

.cf-success span {
    font-size: 13px;
    color: rgba(248, 250, 252, 0.45);
}

/* Message d'erreur inline */
.cf-error {
    font-size: 12px;
    color: #ff6b6b;
    margin-top: 10px;
    text-align: center;
    animation: cf-fadein 0.25s ease;
}

@keyframes cf-fadein {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0);   }
}
