/* Tunoova — site vitrine. Couleurs et typo : Doc/Charte Graphique */
:root {
    --violet: #5C4B87;
    --violet-dark: #453868;
    --violet-mid: #7A64B8;
    --lavande: #EDE9F5;
    --creme: #F5E9D3;
    --orange: #E8632A;
    --orange-dark: #C9501C;
    --jaune: #F2B33D;
    --vert: #3E9B5C;
    --bleu: #2D6E9E;

    --bg: #FAFAFC;
    --surface: #FFFFFF;
    --text: #1F1B2E;
    --text-muted: #6B6478;
    --border: #E5E1EC;
    --brand: #5C4B87;

    --rainbow: linear-gradient(90deg, #E8632A, #F2B33D, #3E9B5C, #2D6E9E);
    --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --vh: 100vh;
    color-scheme: light;
}
@supports (height: 100svh) { :root { --vh: 100svh; } }

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17151F;
        --surface: #211E2C;
        --text: #F0EEF7;
        --text-muted: #A79FB8;
        --border: #3A3548;
        --brand: #8A7CC4;
        --lavande: #2A2638;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    overflow-x: clip;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.08; }
p { margin: 0; }
a { color: inherit; }

/* ---------- Nav ---------- */
.nav {
    position: fixed; inset: 0 0 auto 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(0.7rem + env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right)) 0.7rem max(1.25rem, env(safe-area-inset-left));
    background: rgba(69, 56, 104, 0.78);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
}
.nav-logo img { height: 26px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
    color: #fff; text-decoration: none; font-weight: 700; font-size: 0.92rem;
    position: relative;
}
.nav-links a::after {
    content: ''; position: absolute; left: 0; bottom: -5px; height: 3px; width: 0;
    border-radius: 999px; background: var(--jaune); transition: width .25s;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.nav-gh {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 1rem; border-radius: 999px;
    background: var(--orange-dark); font-weight: 800;
    box-shadow: 0 6px 16px rgba(232, 99, 42, 0.35);
    transition: background .25s, transform .25s;
}
.nav-links a.nav-gh::after { display: none; }
.nav-links a.nav-gh:hover { background: var(--orange); transform: translateY(-1px); }
.nav-gh svg { width: 18px; height: 18px; fill: currentColor; }
.lang {
    display: inline-flex; padding: 3px; border: 0; border-radius: 999px; cursor: pointer;
    background: rgba(255, 255, 255, 0.14); font: 800 0.75rem var(--font-body);
}
.lang span { padding: 0.25rem 0.6rem; border-radius: 999px; color: rgba(255, 255, 255, 0.75); }
html[lang="fr"] .lang [data-lang="fr"],
html[lang="en"] .lang [data-lang="en"] { background: var(--creme); color: var(--violet-dark); }
@media (max-width: 560px) { .nav-links a:not(.nav-gh) { display: none; } .nav-links { gap: 0.6rem; } }

/* ---------- Scènes pilotées au scroll : JS pose --p (0 → 1) ---------- */
[data-scene] { --p: 0; position: relative; }
.stage {
    position: sticky; top: 0;
    height: var(--vh); overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding-inline: 1.25rem;
}

/* ---------- Téléphone ---------- */
.phone {
    --pw: 300px;
    width: var(--pw);
    padding: calc(var(--pw) * 0.035);
    border-radius: calc(var(--pw) * 0.16);
    background: #15131c;
    box-shadow: 0 0 0 2px #3b3648 inset, 0 40px 80px -20px rgba(31, 27, 46, 0.45);
    flex: none;
}
.screen {
    position: relative; overflow: hidden;
    aspect-ratio: 780 / 1688;
    border-radius: calc(var(--pw) * 0.125);
    background: #fff;
}
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Hero ---------- */
.hero { height: calc(var(--vh) * 2.2); background: linear-gradient(160deg, var(--violet-dark), var(--violet) 70%); color: #fff; }
.hero .stage { justify-content: flex-start; }
.hero-copy {
    position: relative; z-index: 2; text-align: center; max-width: 54rem;
    padding-top: calc(var(--vh) * 0.2);
    opacity: clamp(0, calc(1 - var(--p) * 2.6), 1);
    transform: translateY(calc(var(--p) * -14vh)) scale(calc(1 - var(--p) * 0.08));
}
.hero h1 {
    animation: slideUp .9s ease-out both;
    font-weight: 700; color: var(--creme);
    font-size: clamp(2.6rem, 7.5vw, 5.6rem); line-height: 1.02; letter-spacing: -0.01em;
}
.hero h1 em { font-style: normal; color: var(--jaune); }
.hero-copy p {
    margin: 1.4rem auto 0; max-width: 34rem;
    font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: rgba(255, 255, 255, 0.85);
    animation: fadeIn .9s ease-out .25s both;
}
.scroll-hint {
    display: block; width: 26px; height: 42px; margin: 2.2rem auto 0;
    border: 2px solid rgba(245, 233, 211, 0.6); border-radius: 999px; position: relative;
    animation: fadeIn 1s ease-out .6s both;
}
.scroll-hint::after {
    content: ''; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
    border-radius: 2px; background: var(--creme); animation: bounce 1.6s ease-in-out infinite;
}
.hero-phone {
    --pw: min(330px, calc(var(--vh) * 0.36), 68vw);
    position: absolute; left: 50%; top: 50%; z-index: 1;
    transform: translate(-50%, calc(-50% + (1 - var(--p)) * var(--vh) * 0.62)) scale(calc(0.92 + var(--p) * 0.12));
    box-shadow: 0 0 0 2px #3b3648 inset, 0 60px 120px -30px rgba(0, 0, 0, 0.6);
}
.ring {
    position: absolute; border-radius: 50%; opacity: 0.16;
    background: radial-gradient(circle closest-side, transparent 0 28%, var(--jaune) 28% 52%, transparent 52% 62%, var(--orange) 62% 100%);
    animation: spin 14s linear infinite;
}
.ring-a { width: 340px; height: 340px; right: -90px; top: 8vh; }
.ring-b {
    width: 240px; height: 240px; left: -80px; bottom: 6vh; animation-direction: reverse;
    background: radial-gradient(circle closest-side, transparent 0 28%, var(--bleu) 28% 52%, transparent 52% 62%, var(--vert) 62% 100%);
}

/* ---------- Mots qui s'allument (trio, manifeste) ---------- */
.trio, .manifesto { height: calc(var(--vh) * 2.4); }
.words { text-align: center; margin: 0; }
.words .w { display: block; opacity: 0.12; transition: opacity .15s linear; }
.words.big {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(3rem, 11vw, 6.5rem); line-height: 1.1; letter-spacing: -0.01em;
}
.words .w.small { font-size: 0.42em; color: var(--text-muted); margin-top: 1.2rem; font-weight: 500; }
.dot { display: inline-block; width: 0.32em; height: 0.32em; border-radius: 50%; margin-right: 0.12em; vertical-align: 0.12em; }
.dot.o { background: var(--orange); } .dot.y { background: var(--jaune); } .dot.g { background: var(--vert); }

.manifesto { background: #120F1A; color: var(--creme); }
.manifesto .words.big { font-size: clamp(2.3rem, 7.5vw, 5.4rem); }
.manifesto-sub {
    max-width: 36rem; margin-top: 2rem; text-align: center; color: rgba(245, 233, 211, 0.7);
    opacity: clamp(0, calc((var(--p) - 0.55) * 4), 1);
}

/* ---------- Fonctions ---------- */
.features {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-width: 1120px; margin: 0 auto; padding: 0 1.5rem;
}
.step {
    min-height: calc(var(--vh) * 0.95);
    display: flex; flex-direction: column; justify-content: center;
    max-width: 30rem; padding-block: 3rem;
    opacity: 0.25; transform: translateY(16px);
    transition: opacity .5s, transform .5s;
}
.step.on { opacity: 1; transform: none; }
.step h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 600; margin: 0.9rem 0 1rem; }
.step p { color: var(--text-muted); font-size: 1.15rem; }
.step .note { margin-top: 1rem; font-size: 0.85rem; padding-left: 0.8rem; border-left: 3px solid var(--jaune); }
.step .sign { font-weight: 700; color: var(--text); margin-top: 1.2rem; font-size: 1rem; }
.step p + p { margin-top: 0.9rem; }
.step .phone.mini, .step .mascot-anim.mini { display: none; }
.sticky-phone {
    position: sticky; top: 0; height: var(--vh);
    display: grid; place-items: center;
}
.sticky-phone > * { grid-area: 1 / 1; transition: opacity .6s ease, transform .7s cubic-bezier(0.34, 1.3, 0.64, 1); }
.sticky-phone .phone { --pw: min(320px, calc(var(--vh) * 0.34)); }
.sticky-phone .screen img { opacity: 0; transform: scale(1.04); transition: opacity .6s ease, transform .8s ease; }
.sticky-phone .screen img.on { opacity: 1; transform: none; }
.sticky-phone .mascot-anim { opacity: 0; transform: scale(0.8) rotate(-4deg); pointer-events: none; }
.sticky-phone.is-story .phone { opacity: 0; transform: scale(0.85) translateY(40px); }
.sticky-phone.is-story .mascot-anim { opacity: 1; transform: none; }

/* ---------- Mascotte animée (genèse) : elle se balance en rythme, ondes sonores et notes ---------- */
.mascot-anim { position: relative; width: min(480px, 40vw); aspect-ratio: 3 / 2; }
.mascot-anim img {
    position: relative; z-index: 1; width: 100%; height: auto;
    transform-origin: 45% 95%;
    animation: groove 1.8s ease-in-out infinite;
}
.mascot-anim .wave {
    position: absolute; left: 50%; top: 50%; width: 70%; aspect-ratio: 1;
    border-radius: 50%; border: 3px solid var(--violet-mid);
    transform: translate(-50%, -50%) scale(0.6); opacity: 0;
    animation: wave 3.6s ease-out infinite;
}
.mascot-anim .wave:nth-child(2) { animation-delay: 1.2s; border-color: var(--orange); }
.mascot-anim .wave:nth-child(3) { animation-delay: 2.4s; border-color: var(--bleu); }
.mascot-anim .note {
    position: absolute; z-index: 2; font: 700 2.2rem var(--font-display); opacity: 0;
    animation: note 3.2s ease-out infinite;
}
.mascot-anim .n1 { left: 6%;  top: 30%; color: var(--orange); }
.mascot-anim .n2 { left: 84%; top: 18%; color: var(--vert); animation-delay: 1.1s; font-size: 2.6rem; }
.mascot-anim .n3 { left: 72%; top: 58%; color: var(--jaune); animation-delay: 2.1s; }
@keyframes groove {
    0%, 100% { transform: rotate(-2.5deg) translateY(0); }
    25%      { transform: rotate(0deg) translateY(-6px); }
    50%      { transform: rotate(2.5deg) translateY(0); }
    75%      { transform: rotate(0deg) translateY(-6px); }
}
@keyframes wave {
    0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.55; }
    100% { transform: translate(-50%, -50%) scale(1.45); opacity: 0; }
}
@keyframes note {
    0%   { opacity: 0; transform: translateY(10px) rotate(-10deg); }
    20%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-90px) rotate(12deg); }
}

.badge {
    display: inline-block; align-self: flex-start; padding: 0.35em 0.95em; border-radius: 999px;
    font-weight: 800; font-size: clamp(1.6rem, 6vw, 3.1rem); line-height: 1.15;
}
.b-orange { background: #FCE6DC; color: #A8431A; }
.b-jaune  { background: #FDF0D5; color: #8A5F0E; }
.b-vert   { background: #DDEFE3; color: #276B3D; }
.b-bleu   { background: #DCE8F2; color: #1F5079; }
.b-violet { background: #EDE9F5; color: #453868; }

@media (max-width: 820px) {
    .features { grid-template-columns: 1fr; }
    .sticky-phone { display: none; }
    .step { min-height: 0; opacity: 1; transform: none; padding-block: 4rem; margin-inline: auto; text-align: center; align-items: center; }
    .step .badge { align-self: center; }
    .step .note { text-align: left; }
    .step .phone.mini { display: block; --pw: min(260px, 66vw); margin-top: 2.5rem; }
    .step .mascot-anim.mini { display: block; width: min(360px, 86vw); margin-top: 2.5rem; }
}

/* ---------- Reprise multi-appareils ---------- */
.handoff { height: calc(var(--vh) * 2.6); }
.handoff .stage { gap: 0.4rem; }
.section-title { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 600; text-align: center; }
.section-title::after {
    content: ''; display: block; width: 90px; height: 5px; margin: 1rem auto 0;
    border-radius: 999px; background: var(--rainbow);
}
.lead { max-width: 36rem; margin: 1rem auto 0; text-align: center; color: var(--text-muted); font-size: 1.15rem; }
.devices {
    --a: clamp(0, calc((var(--p) - 0.2) * 2.2), 1);
    position: relative; margin-top: 2.5rem;
    display: flex; align-items: flex-end; justify-content: center;
    width: min(900px, 100%);
}
.hand-phone {
    --pw: min(190px, 24vw, calc(var(--vh) * 0.2));
    position: relative; z-index: 2;
    transform: translateX(calc((1 - var(--a)) * 30vw));
}
.link {
    flex: 1 1 0; max-width: 160px; height: 5px; margin: 0 1.2rem calc(var(--vh) * 0.15);
    border-radius: 999px; background: var(--border); overflow: hidden;
    opacity: var(--a);
}
.link span {
    display: block; height: 100%; border-radius: inherit; background: var(--rainbow);
    transform-origin: left; transform: scaleX(clamp(0, calc((var(--p) - 0.45) * 3), 1));
}
.laptop {
    width: min(520px, 52vw);
    opacity: var(--a);
    transform: translateX(calc((1 - var(--a)) * 12vw)) scale(calc(0.9 + var(--a) * 0.1));
    transform-origin: bottom center;
}
.laptop-screen {
    aspect-ratio: 16 / 10; border: clamp(6px, 1.2vw, 12px) solid #15131c; border-bottom-width: clamp(10px, 1.8vw, 18px);
    border-radius: 14px 14px 0 0; background: var(--lavande);
    display: flex; justify-content: center; overflow: hidden;
}
.laptop-screen img { height: 100%; width: auto; max-width: none; box-shadow: 0 0 30px rgba(31, 27, 46, 0.12); }
.laptop-base {
    height: clamp(8px, 1.4vw, 14px); margin: 0 -7%;
    border-radius: 0 0 14px 14px; background: linear-gradient(#c9c4d4, #9d97ab);
}

/* ---------- Et aussi ---------- */
.more { max-width: 1120px; margin: 0 auto; padding: 4rem 1.5rem 7rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-top: 3.5rem; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(31, 27, 46, 0.06);
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-6px); border-color: #9C8AD6; box-shadow: 0 16px 40px rgba(92, 75, 135, 0.18); }
.card h3 { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.97rem; }
.icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1.1rem; }
.icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-orange { background: #FCE6DC; color: #A8431A; }
.i-jaune  { background: #FDF0D5; color: #8A5F0E; }
.i-vert   { background: #DDEFE3; color: #276B3D; }
.i-bleu   { background: #DCE8F2; color: #1F5079; }

/* ---------- Auto-hébergé ---------- */
.selfhost { padding: 6rem 1.5rem 8rem; background: var(--lavande); overflow: hidden; }
.selfhost-copy { max-width: 46rem; margin: 0 auto; }
.browser {
    max-width: 1080px; margin: 4rem auto 0;
    border-radius: 16px; overflow: hidden; background: var(--surface);
    box-shadow: 0 40px 90px -30px rgba(69, 56, 104, 0.45);
    transform: perspective(1600px) rotateX(calc((1 - var(--p)) * 14deg)) scale(calc(0.86 + var(--p) * 0.14));
    transform-origin: top center;
}
.browser-bar { display: flex; gap: 7px; padding: 12px 14px; background: #ECE8F2; }
.browser-bar i { width: 11px; height: 11px; border-radius: 50%; background: #CFC8DB; }
.browser img { width: 100%; height: auto; }

/* ---------- CTA ---------- */
.cta { text-align: center; padding: 6rem 1.5rem 7rem; }
.cta h2 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 600; }
.cta > p { color: var(--text-muted); margin: 1rem auto 2.2rem; max-width: 32rem; }
.cta .contact { margin-top: 2rem; color: var(--text-muted); font-size: 1rem; }
.cta .contact a { color: var(--brand); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--jaune); }
.cta .contact a:hover { color: var(--orange-dark); }
.btn-cta {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.95rem 2.2rem; border-radius: 999px;
    background: var(--orange); color: #fff; text-decoration: none;
    font-weight: 800; font-size: 1.1rem;
    box-shadow: 0 8px 22px rgba(232, 99, 42, 0.35);
    transition: all .25s;
}
.btn-cta svg { width: 22px; height: 22px; }
.btn-cta:hover { background: var(--orange-dark); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(232, 99, 42, 0.45); }

/* ---------- Footer ---------- */
footer { position: relative; background: var(--violet-dark); padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px)); text-align: center; }
footer p { color: rgba(245, 233, 211, 0.78); font-size: 0.88rem; }
footer p.small { font-size: 0.78rem; margin-top: 0.5rem; color: rgba(245, 233, 211, 0.55); }
footer a { color: inherit; }
footer a:hover { color: var(--jaune); }
.rainbow { position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--rainbow); }

/* ---------- Apparition simple ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Animations (charte §10) ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Mouvement réduit : tout est affiché, rien ne bouge */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
    [data-scene] { --p: 1 !important; }
    .hero, .trio, .manifesto, .handoff { height: auto; }
    .stage { position: relative; height: auto; min-height: var(--vh); padding-block: 6rem; }
    .hero-copy { opacity: 1; transform: none; }
    .hero-phone { position: relative; left: auto; top: auto; transform: none; margin-top: 3rem; }
    .words .w, .step, .reveal { opacity: 1 !important; transform: none !important; }
}
