/* ============================================
   ARGONOVA · Hub holding
   Landing pleine hauteur, sans scroll sur desktop.
   L'or (#C8A96E) est le fil rouge entre les 3 branches.
   - Productions : lac & montagnes qui défilent (effet d'avancée)
   - Games       : braises / cendres qui montent (Forêt des Cendres)
   - Tech        : réseau de points qui se relient (stigmergie)
   ============================================ */

:root {
    --gold: #C8A96E;
    --gold-soft: #d8bd86;

    --hub-bg: #0b0b0c;
    --hub-bg-2: #0e0f10;

    --prod-1: #0B2027;  --prod-2: #14323f;  --prod-accent: #C8A96E;
    --games-1: #0a0a08; --games-2: #1a1712; --games-accent: #c4a24e; --games-red: #8b2222;
    --tech-1: #0a1219;  --tech-2: #102330;  --tech-accent: #6fb3c9;

    --text: #F0F1EC;
    --text-dim: rgba(240,241,236,0.52);
    --text-faint: rgba(240,241,236,0.34);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'DM Sans', -apple-system, sans-serif;
    --mono: 'Courier Prime', 'Courier New', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    min-height: 100vh;
    display: flex; flex-direction: column;
    font-family: var(--sans);
    color: var(--text);
    background:
        radial-gradient(ellipse 90% 55% at 50% -10%, rgba(200,169,110,0.06) 0%, transparent 55%),
        linear-gradient(180deg, var(--hub-bg) 0%, var(--hub-bg-2) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.grain {
    position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 220px;
}

/* ---------- HUB ---------- */
.hub {
    flex: 1 1 auto;
    width: 100%; max-width: 1280px; margin: 0 auto;
    padding: 1.8rem clamp(1.4rem, 4vw, 3.2rem) 1rem;
    display: flex; flex-direction: column; justify-content: center;
}

.intro { text-align: center; flex-shrink: 0; margin-bottom: clamp(1.2rem, 2.6vh, 2.1rem); }
.intro-title {
    font-family: var(--serif); font-weight: 300;
    font-size: clamp(2.2rem, 4.8vw, 3.9rem); line-height: 1.04; letter-spacing: -0.01em;
    color: var(--text); text-wrap: balance;
    animation: fade-up 1.1s 0.05s var(--ease-out) both;
}
.intro-lead {
    margin: 0.9rem auto 0; max-width: none;
    font-size: 0.96rem; font-weight: 300; line-height: 1.7; color: var(--text-dim);
    animation: fade-up 1.1s 0.18s var(--ease-out) both;
}
.intro-lead-text { white-space: nowrap; }   /* une seule ligne sur desktop, pas d'orphelin */
.intro-cue {
    display: inline-block; margin-top: 0.55rem;
    font-weight: 500; color: var(--gold); letter-spacing: 0.01em; white-space: nowrap;
}

/* ---------- BRANCHES ---------- */
.branches {
    display: grid; grid-template-columns: 1fr;
    gap: clamp(0.9rem, 1.5vw, 1.4rem);
}

.branch {
    --accent: var(--gold);
    position: relative; isolation: isolate;
    display: block; text-decoration: none; color: var(--text);
    border: 1px solid rgba(240,241,236,0.09);
    border-radius: 7px; overflow: hidden;
    background: var(--card-1, #111);
    transition: transform 0.5s var(--ease-out), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
    animation: card-in 0.9s var(--ease-out) both;
    will-change: transform;
}
.branch--productions { --accent: var(--prod-accent); --card-1: var(--prod-1); --card-2: var(--prod-2); animation-delay: 0.3s; }
.branch--games       { --accent: var(--games-accent); --card-1: var(--games-1); --card-2: var(--games-2); animation-delay: 0.4s; }
.branch--tech        { --accent: var(--tech-accent); --card-1: var(--tech-1); --card-2: var(--tech-2); animation-delay: 0.5s; }

.branch::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    border-radius: 7px; border: 1px solid transparent; transition: border-color 0.5s var(--ease);
}
.branch.is-live { cursor: pointer; }
.branch.is-live:hover, .branch.is-live:focus-visible {
    border-color: rgba(240,241,236,0.16);
    box-shadow: 0 30px 60px -28px rgba(0,0,0,0.75);
    outline: none;
}
.branch.is-live:hover::after, .branch.is-live:focus-visible::after { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.branch.is-soon:hover { border-color: rgba(240,241,236,0.13); }

/* background layers */
.branch-bg {
    position: absolute; inset: 0; z-index: 0; overflow: hidden;
    background: linear-gradient(165deg, var(--card-2) 0%, var(--card-1) 62%);
}
.branch-glow {
    position: absolute; inset: 0; opacity: 0.5; transition: opacity 0.6s var(--ease);
    background: radial-gradient(ellipse 80% 50% at 50% 120%, color-mix(in srgb, var(--accent) 26%, transparent) 0%, transparent 60%);
}
.branch:hover .branch-glow { opacity: 1; }

/* Productions : montagnes qui défilent (parallaxe, effet d'avancée) */
.ranges { position: absolute; inset: 0; overflow: hidden; }
.range { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; display: flex; }
.range svg { width: 50%; height: 100%; display: block; }
.range--far { animation: range-scroll 82s linear infinite; }
.range--far path { fill: rgba(232,240,245,0.045); }
.range--back { animation: range-scroll 56s linear infinite; }
.range--back path { fill: rgba(232,240,245,0.075); }
.range--front { animation: range-scroll 34s linear infinite; }
.range--front path { fill: rgba(10,20,26,0.42); }
@keyframes range-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Games : tableau d'enquête, épingles reliées par un fil rouge qui se trace */
.branch-board { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.95; }

.branch-seal {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-11deg);
    font-family: var(--mono); font-size: clamp(1.5rem, 2.8vw, 2.3rem); font-weight: 700;
    letter-spacing: 0.16em; color: var(--games-red);
    opacity: 0.12; white-space: nowrap;
    transition: opacity 0.6s var(--ease), letter-spacing 0.6s var(--ease);
}
.branch--games:hover .branch-seal { opacity: 0.2; letter-spacing: 0.2em; }

/* Tech : grille statique discrète + réseau animé (canvas) */
.branch-grid { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--tech-accent); opacity: 0.07; }
.branch-net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.62; }

/* card content : nom en haut, cta en bas */
.branch-content {
    position: relative; z-index: 2; height: 100%;
    display: flex; flex-direction: column;
    padding: clamp(1.3rem, 2vw, 1.9rem);
}
.branch-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.branch-head { display: flex; flex-direction: column; }
.branch-kicker {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 0.4rem;
}
.branch-name {
    font-family: var(--serif); font-weight: 400; line-height: 1;
    font-size: clamp(2.1rem, 3.4vw, 3rem); color: var(--text);
    transition: color 0.4s var(--ease);
}
.branch:hover .branch-name { color: var(--gold-soft); }
.branch--games:hover .branch-name, .branch--tech:hover .branch-name { color: var(--text); }

.branch-status {
    display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap;
    font-size: 0.66rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--text-faint); margin-top: 0.3rem;
}
.branch-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.7; }

.branch-body { margin-top: 1.1rem; }
.branch-desc {
    display: block; font-size: 1rem; font-weight: 300; line-height: 1.5;
    color: var(--text-dim); margin-bottom: 0.7rem;
}
.branch-projects {
    display: block; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em;
    color: var(--text-faint);
}

/* zone d'animation confinée : entre le texte et la barre du CTA, invisible mais délimitée */
.branch-anim { position: relative; flex: 1 1 auto; min-height: 130px; overflow: hidden; margin: 0.85rem 0; }

.branch-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(240,241,236,0.1);
}
.branch-cta-domain { font-size: 0.84rem; font-weight: 500; color: var(--text); transition: color 0.4s var(--ease); }
.is-soon .branch-cta-domain { color: var(--text-faint); }
.branch.is-live:hover .branch-cta-domain { color: var(--accent); }
.branch-arrow {
    width: 23px; height: 23px; flex-shrink: 0; fill: none;
    stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.45s var(--ease-out), opacity 0.4s var(--ease);
}
.is-soon .branch-arrow { opacity: 0.3; }
.branch.is-live:hover .branch-arrow { transform: translateX(6px); }

/* ---------- FOOTER ---------- */
.site-footer {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; gap: 0.7rem;
    padding: 0.9rem 1.5rem 1rem;
    font-size: 0.74rem; color: var(--text-faint); letter-spacing: 0.03em;
    animation: fade-up 1s 0.7s var(--ease-out) both;
}
.foot-sep { opacity: 0.5; }
.foot-contact {
    font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.03em;
    color: var(--text-dim); background: none; border: none; cursor: pointer;
    padding: 0.2rem 0.1rem; transition: color 0.3s; position: relative;
}
.foot-contact::after {
    content: ''; position: absolute; left: 0; bottom: -1px; width: 0; height: 1px;
    background: var(--gold); transition: width 0.35s var(--ease);
}
.foot-contact:hover { color: var(--gold); }
.foot-contact:hover::after { width: 100%; }

/* ---------- CONTACT MODAL ---------- */
.modal {
    position: fixed; inset: 0; z-index: 1000; display: none;
    align-items: center; justify-content: center; padding: 1.5rem;
}
.modal.open { display: flex; }
.modal-backdrop {
    position: absolute; inset: 0; background: rgba(6,7,8,0.78);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    animation: fade 0.35s var(--ease) both;
}
.modal-card {
    position: relative; width: 100%; max-width: 440px;
    background: linear-gradient(165deg, #14161a 0%, #0d0e10 100%);
    border: 1px solid rgba(200,169,110,0.18); border-radius: 10px;
    padding: clamp(1.8rem, 4vw, 2.6rem);
    box-shadow: 0 40px 90px -30px rgba(0,0,0,0.8);
    animation: modal-in 0.45s var(--ease-out) both;
}
.modal-x {
    position: absolute; top: 0.9rem; right: 1rem; background: none; border: none;
    color: var(--text-faint); font-size: 1.6rem; line-height: 1; cursor: pointer;
    padding: 0.3rem 0.5rem; transition: color 0.3s;
}
.modal-x:hover { color: var(--gold); }
.modal-kicker {
    font-size: 0.64rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 0.6rem;
}
.modal-title {
    font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.1;
    color: var(--text); margin-bottom: 0.7rem;
}
.modal-text { font-size: 0.9rem; font-weight: 300; line-height: 1.6; color: var(--text-dim); margin-bottom: 1.6rem; }
.modal-form { display: flex; flex-direction: column; gap: 0.8rem; }
.modal-input {
    font-family: var(--sans); font-size: 0.92rem; color: var(--text);
    background: rgba(255,255,255,0.03); border: 1px solid rgba(240,241,236,0.12);
    border-radius: 5px; padding: 0.8rem 0.9rem; transition: border-color 0.3s, box-shadow 0.3s; outline: none;
}
.modal-input::placeholder { color: rgba(240,241,236,0.3); }
.modal-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,169,110,0.12); }
.modal-textarea { resize: vertical; min-height: 96px; }
.modal-submit {
    font-family: var(--sans); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
    color: #14161a; background: var(--gold); border: none; border-radius: 5px;
    padding: 0.9rem 1.4rem; margin-top: 0.3rem; cursor: pointer; transition: background 0.3s, transform 0.3s;
}
.modal-submit:hover { background: var(--gold-soft); transform: translateY(-1px); }
.modal-done { font-size: 0.95rem; line-height: 1.6; color: var(--gold); padding: 1rem 0; }

/* ---------- ANIMATIONS ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-in { from { opacity: 0; transform: translateY(30px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- DESKTOP : pleine hauteur, sans scroll ---------- */
@media (min-width: 881px) {
    html, body { height: 100%; overflow: hidden; }
    body { min-height: 0; }
    .hub { min-height: 0; }
    .branches {
        grid-template-columns: repeat(3, 1fr);
        flex: 1 1 auto; min-height: 0;
    }
    .branch { height: 100%; min-height: 0; }
    .branch.is-live:hover, .branch.is-live:focus-visible { transform: translateY(-8px); }
    .branch.is-soon:hover { transform: translateY(-4px); }
}

/* ---------- MOBILE ---------- */
@media (max-width: 880px) {
    .hub { padding: 2rem 1.4rem 1rem; justify-content: flex-start; }
    .intro { margin-bottom: 1.8rem; }
    .intro-title { font-size: clamp(2.3rem, 11vw, 3.2rem); }
    /* phrase d'intro : pas d'orphelin, lignes équilibrées */
    .intro-lead-text { white-space: normal; display: inline-block; max-width: 19rem; text-wrap: balance; }
    .branch-content { padding: 1.4rem; }
    .branch-body { margin-top: 1.6rem; }
    .branch-cta { margin-top: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .branch:hover { transform: none !important; }
    .branch-board, .branch-net { display: none; }
}
