/* =============================================================
   Sandrenyl — Hub de projets
   4 panels plein écran qui se rejoignent au centre ;
   le logo Sandrenyl se superpose par-dessus la jonction.
   Chaque panel reprend l'identité visuelle de son site.
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
    --bg: #08080d;
    --bg-soft: #0f0f17;
    --surface: rgba(255, 255, 255, 0.035);
    --border: rgba(255, 255, 255, 0.09);
    --seam: rgba(255, 255, 255, 0.07);
    --text: #ecebf5;
    --muted: #9a96b4;

    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    --font-ui: 'Inter', system-ui, sans-serif;
    --font-display: 'Sora', system-ui, sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

/* Contenu réservé aux moteurs / lecteurs d'écran (invisible à l'écran). */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Hub layout ---------- */
.hub {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.hub__ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 18% 16%, rgba(0, 255, 233, 0.10), transparent 70%),
        radial-gradient(55% 50% at 82% 16%, rgba(0, 246, 255, 0.08), transparent 70%),
        radial-gradient(55% 50% at 18% 84%, rgba(201, 168, 76, 0.08), transparent 70%),
        radial-gradient(60% 50% at 82% 84%, rgba(255, 255, 255, 0.06), transparent 70%);
}

.hub__stage {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
}

.hub__grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Remplit les grands écrans, mais ne rogne jamais : sur écran court,
       les lignes reprennent la hauteur du contenu et la page défile. */
    grid-template-rows: repeat(2, minmax(min-content, 1fr));
    min-height: 0;
}

/* ---------- Core (logo + nom + tagline, superposé au centre) ---------- */
.hub__core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: max-content;
    max-width: min(78vw, 22rem);
}

.hub__badge {
    display: grid;
    place-items: center;
    width: clamp(108px, 14vw, 176px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, #14141e 0%, var(--bg) 78%);
    border: 1px solid var(--border);
    box-shadow: 0 18px 50px -14px rgba(0, 0, 0, 0.85);
}

.hub__logo {
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

.hub__name {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
    letter-spacing: -0.01em;
    color: var(--text);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.hub__tagline {
    margin-top: 0.3rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(0.72rem, 0.65rem + 0.3vw, 0.86rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: linear-gradient(120deg, #00ffe9, #9254ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Panels ---------- */
.panel {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

/* Coutures internes : seules les arêtes vers le centre sont tracées. */
.panel:nth-child(1) {
    border-right: 1px solid var(--seam);
    border-bottom: 1px solid var(--seam);
}

.panel:nth-child(2) {
    border-bottom: 1px solid var(--seam);
}

.panel:nth-child(3) {
    border-right: 1px solid var(--seam);
}

/* Lueur d'ambiance émanant du coin extérieur (suit le curseur via JS). */
.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(
        70% 70% at var(--pointer-x) var(--pointer-y),
        var(--accent-soft),
        transparent 60%
    );
    transition: opacity var(--transition);
}

.panel:hover {
    box-shadow: inset 0 0 0 1px var(--accent), inset 0 0 90px -40px var(--glow);
}

.panel:hover::before {
    opacity: 1.4;
}

.panel__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: clamp(1.5rem, 3vw, 2.8rem);
    gap: 0.45rem;
}

/* Contenu poussé vers le coin extérieur de chaque quadrant. */
.panel:nth-child(1) .panel__inner { align-items: flex-start; justify-content: flex-start; text-align: left; }
.panel:nth-child(2) .panel__inner { align-items: flex-end; justify-content: flex-start; text-align: right; }
.panel:nth-child(3) .panel__inner { align-items: flex-start; justify-content: flex-end; text-align: left; }
.panel:nth-child(4) .panel__inner { align-items: flex-end; justify-content: flex-end; text-align: right; }

/* Position par défaut de la lueur = coin extérieur du quadrant. */
.panel:nth-child(1) { --pointer-x: 22%; --pointer-y: 26%; }
.panel:nth-child(2) { --pointer-x: 78%; --pointer-y: 26%; }
.panel:nth-child(3) { --pointer-x: 22%; --pointer-y: 74%; }
.panel:nth-child(4) { --pointer-x: 78%; --pointer-y: 74%; }

.panel__logo {
    display: flex;
    height: clamp(48px, 6vh, 64px);
    margin-bottom: 0.3rem;
}

.panel__logo img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px var(--glow));
    user-select: none;
    -webkit-user-drag: none;
}

.panel__name {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    letter-spacing: var(--title-spacing, 0);
    line-height: 1.1;
    color: var(--text);
}

.panel__tagline {
    font-family: var(--font-title);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: var(--accent);
}

.panel__desc {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: clamp(0.88rem, 0.8rem + 0.3vw, 0.97rem);
    max-width: 40ch;
}

.panel__tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.panel:nth-child(2) .panel__tags,
.panel:nth-child(4) .panel__tags {
    justify-content: flex-end;
}

.panel__tags li {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.3rem;
}

.panel:nth-child(2) .panel__actions,
.panel:nth-child(4) .panel__actions {
    justify-content: flex-end;
}

.panel__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.68rem 1.25rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: transform var(--transition), box-shadow var(--transition);
}

.panel__btn--primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #08080d;
}

.panel__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -10px var(--glow);
}

.panel__btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}

.panel__btn--ghost:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.panel__soon {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: var(--border);
}

/* ---------- Thèmes par projet (repris de chaque site) ---------- */

/* Track History — néon cyan → violet, police monospace */
.panel--track-history {
    --accent: #00ffe9;
    --accent-2: #9254ff;
    --accent-soft: rgba(0, 255, 233, 0.13);
    --glow: rgba(0, 255, 233, 0.45);
    --font-title: 'Kode Mono', monospace;
    --title-spacing: -0.02em;
}

/* Voltrine — cyan stratégique (repris du site), serif Cinzel */
.panel--voltrine {
    --accent: #00f6ff;
    --accent-2: #00c4cc;
    --accent-soft: rgba(0, 246, 255, 0.13);
    --glow: rgba(0, 246, 255, 0.4);
    --font-title: 'Cinzel Decorative', serif;
}

/* TTRPG — parchemin & orange, serif Cinzel */
.panel--ttrpg {
    --accent: #c9a84c;
    --accent-2: #e8833a;
    --accent-soft: rgba(201, 168, 76, 0.13);
    --glow: rgba(232, 131, 58, 0.4);
    --font-title: 'Cinzel Decorative', serif;
}

/* Sohnaris — épure noir & blanc, police Marhey */
.panel--sohnaris {
    --accent: #f4f4f8;
    --accent-2: #b9b9c6;
    --accent-soft: rgba(255, 255, 255, 0.08);
    --glow: rgba(255, 255, 255, 0.28);
    --font-title: 'Marhey', cursive;
}

/* ---------- Page d'erreur ---------- */
.error {
    position: relative;
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    padding: clamp(2.5rem, 8vw, 6rem) 1.5rem;
    text-align: center;
}

.error__inner {
    position: relative;
    z-index: 1;
    max-width: 32rem;
}

.error__code {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(4rem, 16vw, 8rem);
    line-height: 1;
    background: linear-gradient(120deg, #00ffe9, #9254ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin-top: 0.5rem;
}

.error__text {
    color: var(--muted);
    margin-top: 0.75rem;
}

.error__btn {
    display: inline-block;
    margin-top: 1.8rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    color: #08080d;
    background: linear-gradient(120deg, #00ffe9, #9254ff);
    transition: transform var(--transition), box-shadow var(--transition);
}

.error__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -10px rgba(0, 255, 233, 0.45);
}

/* ---------- Page légale ---------- */
.legal {
    position: relative;
    flex: 1 1 auto;
    padding: clamp(3rem, 8vw, 6rem) 1.5rem;
}

.legal__inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin-inline: auto;
}

.legal__back {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    transition: color var(--transition);
}

.legal__back:hover {
    color: var(--text);
}

.legal__heading {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.legal__section {
    padding-block: 1.4rem;
    border-top: 1px solid var(--seam);
}

.legal__section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.legal__section-body {
    color: var(--muted);
}

.legal__fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.45rem 1.5rem;
    margin-top: 1rem;
}

.legal__fields dt {
    font-weight: 600;
    color: var(--text);
}

.legal__fields dd {
    margin: 0;
    color: var(--muted);
}

.legal__fields a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 520px) {
    .legal__fields {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .legal__fields dd {
        margin-bottom: 0.6rem;
    }
}

/* ---------- Footer ---------- */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.footer__inner {
    max-width: 1180px;
    margin-inline: auto;
    padding: 1.4rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer__copy {
    color: var(--muted);
    font-size: 0.9rem;
}

.footer__link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--muted);
    transition: color var(--transition);
}

.footer__link:hover {
    color: var(--text);
}

.lang {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem;
}

.lang__link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    transition: color var(--transition), background var(--transition);
}

.lang__link:hover {
    color: var(--text);
}

.lang__link.is-active {
    color: #08080d;
    background: linear-gradient(120deg, #00ffe9, #9254ff);
}

/* ---------- Animation d'entrée ---------- */
.panel {
    opacity: 0;
    animation: fade-in 0.7s ease forwards;
}

.panel:nth-child(1) { animation-delay: 0.05s; }
.panel:nth-child(2) { animation-delay: 0.15s; }
.panel:nth-child(3) { animation-delay: 0.25s; }
.panel:nth-child(4) { animation-delay: 0.35s; }

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .panel {
        animation: none;
        opacity: 1;
    }
}

/* ---------- Responsive : empilement vertical ---------- */
@media (max-width: 880px) {
    .hub__stage {
        display: flex;
        flex-direction: column;
    }

    .hub__grid {
        order: 1;
        grid-template-columns: 1fr;
        grid-template-rows: none;
        min-height: 0;
    }

    .hub__core {
        position: static;
        transform: none;
        order: 0;
        margin: clamp(2rem, 8vw, 3rem) auto;
    }

    /* Coutures : simple séparateur horizontal entre panels empilés. */
    .panel {
        border: 0 !important;
        border-bottom: 1px solid var(--seam) !important;
    }

    .panel__inner,
    .panel:nth-child(n) .panel__inner {
        align-items: center;
        justify-content: center;
        text-align: center;
        padding-block: clamp(2.2rem, 9vw, 3rem);
    }

    .panel:nth-child(n) .panel__actions {
        justify-content: center;
    }

    .panel__desc {
        max-width: 46ch;
    }
}
