/* =====================================================================
   Homeo's World — portail & connexion
   Nuit d'expédition : bleu nuit, or (Travels), turquoise (Amara),
   vert mousse (The Last of Us).
   ===================================================================== */

:root {
    --night:   #0b1118;
    --night-2: #101a24;
    --cream:   #f4e7c8;
    --cream-2: #cdbf9f;
    --cream-3: #8c8470;
    --gold:    #f2b233;
    --gold-2:  #d98b12;
    --sea:     #18a3b8;
    --moss:    #93a651;
    --blood:   #b23b30;
    --line:    rgba(244, 231, 200, .12);
    --ease:    cubic-bezier(.22, 1, .36, 1);
    --serif:   "Fraunces", Georgia, serif;
    --sans:    "Outfit", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    font-family: var(--sans);
    color: var(--cream);
    background: var(--night);
    -webkit-font-smoothing: antialiased;
}

/* ------------------------------ Ciel animé ------------------------------ */
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
       background: radial-gradient(120% 80% at 50% 0%, var(--night-2), var(--night) 70%); }
.orb { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .32; }
.orb--gold { background: var(--gold); top: -30vmax; right: -18vmax; animation: drift 26s ease-in-out infinite alternate; }
.orb--sea  { background: var(--sea);  bottom: -34vmax; left: -22vmax; opacity: .26; animation: drift 32s ease-in-out infinite alternate-reverse; }
.orb--moss { background: var(--moss); bottom: -40vmax; right: -10vmax; opacity: .18; animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); } }

.sky__route { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--gold); opacity: .45; }
.sky__route path { stroke-dashoffset: 0; animation: route 60s linear infinite; }
@keyframes route { to { stroke-dashoffset: -840; } }

.grain {
    position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ------------------------------ Commun ---------------------------------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: .6em;
    margin: 0 0 1rem; font-size: .78rem; font-weight: 500;
    letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
}
.eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(242, 178, 51, .18); }

.foot {
    position: relative; z-index: 1; margin-top: auto;
    padding: 1.6rem 16px 2rem; text-align: center;
    font-size: .82rem; color: var(--cream-3);
}
.heart { color: var(--blood); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    border: 0; cursor: pointer; font: 600 1rem/1 var(--sans);
    padding: 1.05rem 1.4rem; border-radius: 14px;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), filter .3s;
}
.btn--gold {
    color: #24180a;
    background: linear-gradient(135deg, #ffd27a, var(--gold) 45%, var(--gold-2));
    box-shadow: 0 14px 30px -12px rgba(242, 178, 51, .65), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -14px rgba(242, 178, 51, .8), inset 0 1px 0 rgba(255,255,255,.45); }
.btn--gold:hover svg { transform: translateX(3px); }
.btn svg { transition: transform .3s var(--ease); }
.btn:disabled { filter: grayscale(.8); opacity: .55; cursor: not-allowed; transform: none; }

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

/* =====================================================================
   Connexion
   ===================================================================== */
.login__wrap {
    position: relative; z-index: 1; flex: 1;
    display: grid; place-items: center; padding: 48px 16px 16px;
}
.login__card {
    width: 100%; max-width: 430px;
    padding: 2.6rem 2.2rem 2rem;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(20, 32, 44, .78), rgba(11, 17, 24, .78));
    border: 1px solid var(--line);
    box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(244, 231, 200, .06);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    animation: rise .9s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.login__title {
    margin: 0; font-family: var(--serif); font-weight: 600;
    font-size: clamp(2.3rem, 7vw, 3rem); line-height: 1; letter-spacing: -.02em;
}
.login__title span { color: var(--gold); }
.login__title em { font-style: italic; font-weight: 500; color: var(--gold); }
.login__lead { margin: .8rem 0 1.8rem; color: var(--cream-2); font-weight: 300; font-size: 1.05rem; }

.alert {
    margin: 0 0 1.2rem; padding: .8rem 1rem; border-radius: 12px;
    background: rgba(178, 59, 48, .14); border: 1px solid rgba(178, 59, 48, .45);
    color: #f3c1bb; font-size: .92rem;
    animation: shake .45s var(--ease);
}
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.form { display: grid; gap: 1.05rem; }
.field { display: grid; gap: .45rem; }
.field__label { font-size: .8rem; font-weight: 500; letter-spacing: .06em; color: var(--cream-2); }
.field__row { position: relative; display: block; }
.field__input {
    width: 100%; font: 400 1.02rem var(--sans); color: var(--cream);
    padding: .95rem 1rem; border-radius: 12px;
    background: rgba(244, 231, 200, .05);
    border: 1px solid rgba(244, 231, 200, .14);
    transition: border-color .25s, background .25s, box-shadow .25s;
}
.field__row .field__input { padding-right: 3rem; }
.field__input:hover { border-color: rgba(244, 231, 200, .26); }
.field__input:focus { outline: none; border-color: var(--gold); background: rgba(244, 231, 200, .08); box-shadow: 0 0 0 4px rgba(242, 178, 51, .16); }
.field__input:disabled { opacity: .5; }
.field__eye {
    position: absolute; right: .45rem; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; display: grid; place-items: center;
    border: 0; border-radius: 10px; background: transparent; color: var(--cream-3); cursor: pointer;
}
.field__eye:hover, .field__eye[aria-pressed="true"] { color: var(--gold); background: rgba(244, 231, 200, .06); }
.form .btn { margin-top: .5rem; width: 100%; }

.login__worlds {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem;
    list-style: none; margin: 1.8rem 0 0; padding: 1.3rem 0 0;
    border-top: 1px solid var(--line); font-size: .82rem; color: var(--cream-3);
}
.login__worlds li { display: inline-flex; align-items: center; gap: .45rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot--gold { background: var(--gold); }
.dot--sea  { background: var(--sea); }
.dot--moss { background: var(--moss); }

/* =====================================================================
   Portail
   ===================================================================== */
.bar {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    max-width: 1320px; width: 100%; margin: 0 auto; padding: 22px 16px;
}
.bar__brand { font: 600 1.35rem var(--serif); color: var(--cream); text-decoration: none; letter-spacing: -.01em; }
.bar__brand span, .bar__brand em { color: var(--gold); }
.bar__brand em { font-weight: 500; }
.bar__out {
    display: inline-flex; align-items: center; gap: .5rem;
    font: 500 .88rem var(--sans); color: var(--cream-2);
    padding: .6rem 1rem; border-radius: 999px; cursor: pointer;
    background: rgba(244, 231, 200, .05); border: 1px solid var(--line);
    transition: color .25s, border-color .25s, background .25s;
}
.bar__out:hover { color: var(--cream); border-color: rgba(242, 178, 51, .5); background: rgba(242, 178, 51, .08); }

.hub { position: relative; z-index: 1; max-width: 1320px; width: 100%; margin: 0 auto; padding: 3vh 16px 0; }
.hub__head { margin-bottom: clamp(1.6rem, 4vh, 2.6rem); animation: rise .8s var(--ease) both; }
.hub__title {
    margin: 0; font: 600 clamp(2.1rem, 5.4vw, 4rem)/1.02 var(--serif); letter-spacing: -.025em;
    max-width: 16ch;
}
.hub__title em { font-style: italic; font-weight: 500; color: var(--gold); }
.hub__hint { margin: 1.6rem 0 0; font-size: .82rem; color: var(--cream-3); text-align: center; }
kbd {
    display: inline-block; min-width: 1.6em; padding: .1em .45em; border-radius: 6px;
    font: 500 .78rem var(--sans); color: var(--cream-2); text-align: center;
    background: rgba(244, 231, 200, .06); border: 1px solid var(--line); border-bottom-width: 2px;
}
@media (hover: none) { .hub__hint { display: none; } }

/* ------------------------------ Cartes ---------------------------------- */
.worlds {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px);
}
.world { animation: rise .9s var(--ease) both; animation-delay: calc(var(--i) * 110ms + 120ms); }

.world__link {
    --accent: var(--gold);
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-direction: column; height: 100%;
    min-height: clamp(460px, 64vh, 620px);
    padding: 1.4rem; border-radius: 26px;
    text-decoration: none; color: var(--cream);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 30px 70px -36px rgba(0, 0, 0, .95);
    transition: transform .6s var(--ease), box-shadow .6s var(--ease), border-color .6s;
}
.world__link:hover, .world__link:focus-visible {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
    box-shadow: 0 46px 90px -40px rgba(0, 0, 0, .95), 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 30px 80px -30px color-mix(in srgb, var(--accent) 55%, transparent);
}
.world__link:focus-visible { outline: none; }

.world__bg {
    position: absolute; inset: 0; z-index: -2;
    background-size: cover; background-position: center;
    transform: scale(1.06); transition: transform 1.6s var(--ease), filter 1s;
}
.world__link:hover .world__bg { transform: scale(1.14); }
.world__shade { position: absolute; inset: 0; z-index: -1; }

.world__top { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.world__no { font-weight: 600; }
.world__count {
    padding: .4rem .75rem; border-radius: 999px; letter-spacing: .06em; text-transform: none; font-weight: 500;
    background: rgba(0, 0, 0, .28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .14);
}

.world__logo {
    display: block; width: 92%; max-width: 420px; margin: auto auto 0;
    aspect-ratio: 3 / 2; object-fit: contain;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45));
    transition: transform .8s var(--ease);
}
.world__link:hover .world__logo { transform: translateY(-6px) scale(1.035); }

.world__body { display: grid; gap: .55rem; margin-top: auto; padding-top: 1rem; }
.world__name { font-size: 1.5rem; line-height: 1.08; }
.world__teaser { font-size: .95rem; line-height: 1.5; font-weight: 300; opacity: .88; max-width: 36ch; }
.world__cta {
    display: inline-flex; align-items: center; gap: .5rem; justify-self: start;
    margin-top: .6rem; padding: .75rem 1.15rem; border-radius: 999px;
    font-weight: 600; font-size: .95rem;
    background: var(--accent); color: var(--cta-ink, #1b1205);
    transition: gap .4s var(--ease), padding .4s var(--ease);
}
.world__link:hover .world__cta { gap: .9rem; padding-right: 1.35rem; }

/* --- Travels : bleu nuit + or --- */
.world--travels .world__shade {
    background:
        linear-gradient(180deg, rgba(13, 25, 34, .25) 0%, rgba(13, 25, 34, .15) 35%, rgba(13, 25, 34, .92) 78%, #0d1922 100%),
        radial-gradient(80% 50% at 50% 100%, rgba(242, 178, 51, .22), transparent 70%);
}
.world--travels .world__no { color: var(--gold); }
.world--travels .world__name { font-family: "Spectral", Georgia, serif; font-weight: 500; }

/* --- Amara : sable, soleil, turquoise --- */
.world--amara .world__link { --accent: #18a3b8; --cta-ink: #fffaf0; color: #36281a; border-color: rgba(54, 40, 26, .12); }
.world--amara .world__shade {
    background:
        radial-gradient(90% 55% at 70% 0%, rgba(242, 178, 51, .55), transparent 65%),
        linear-gradient(180deg, rgba(251, 244, 230, .1) 0%, rgba(246, 236, 216, .55) 55%, rgba(246, 236, 216, .96) 80%, #f6ecd8 100%);
}
.world--amara .world__no { color: #b3600a; }
.world--amara .world__count { background: rgba(255, 250, 240, .6); border-color: rgba(54, 40, 26, .12); color: #6f5a3f; }
.world--amara .world__name { font-family: var(--serif); font-weight: 600; color: #0a4a54; }
.world--amara .world__teaser { color: #6f5a3f; opacity: 1; }
.world--amara .world__link:hover .world__bg { filter: saturate(1.15); }

/* --- The Last of Us : noir mousse, os, sang --- */
.world--tlou .world__link { --accent: var(--moss); --cta-ink: #0c0f0b; color: #e9e3d1; }
.world--tlou .world__bg { filter: saturate(.55) brightness(.75); }
.world--tlou .world__link:hover .world__bg { filter: saturate(.95) brightness(.85); }
.world--tlou .world__shade {
    background:
        radial-gradient(130% 90% at 50% 30%, transparent 40%, rgba(0, 0, 0, .55) 100%),
        linear-gradient(180deg, rgba(12, 15, 11, .2) 0%, rgba(12, 15, 11, .25) 35%, rgba(12, 15, 11, .94) 78%, #0c0f0b 100%);
}
.world--tlou .world__no { color: var(--moss); }
.world--tlou .world__name { font-family: "Saira Condensed", "Arial Narrow", sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; font-size: 1.7rem; }
.world--tlou .world__name::after { content: ""; display: block; width: 46px; height: 3px; margin-top: .5rem; background: var(--blood); }

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 980px) {
    .worlds { grid-template-columns: 1fr; }
    .world__link { min-height: 0; aspect-ratio: auto; display: grid; grid-template-columns: 1fr; padding: 1.2rem; }
    .world__logo { width: 70%; max-width: 340px; margin: .6rem auto 0; }
}
@media (min-width: 640px) and (max-width: 980px) {
    .world__link { grid-template-columns: 1fr 1.1fr; grid-template-rows: auto 1fr; column-gap: 1.2rem; min-height: 300px; }
    .world__top { grid-column: 1 / -1; }
    .world__logo { width: 100%; margin: auto 0; }
    .world__body { align-self: end; }
}
@media (max-width: 480px) {
    .login__card { padding: 2rem 1.3rem 1.6rem; border-radius: 22px; }
    .bar__out { padding: .55rem .8rem; }
    .bar__out { font-size: 0; gap: 0; }
    .bar__out svg { width: 19px; height: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
