/* landing page */
.hgrid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    grid-template-areas: "head pic" "info pic";
    column-gap: clamp(32px, 5vw, 80px);
    padding: clamp(20px, 4vw, 56px) max(5vw, 16px) clamp(48px, 6vw, 88px);
    max-width: calc(1240px + 10vw);
    margin-inline: auto;
    align-items: end
}

.hhead {
    grid-area: head
}

.hinfo {
    grid-area: info;
    align-self: start
}

.pic {
    grid-area: pic;
    align-self: center
}

.h1 {
    font: 800 clamp(48px, 7.4vw, 104px)/.98 var(--disp);
    letter-spacing: -.03em;
    text-transform: uppercase
}

.h1>span {
    display: block
}

.h1 .y {
    color: var(--yellow)
}

.pill {
    display: inline-block;
    margin-top: 18px;
    font: 700 15px/1.2 var(--text);
    background: #fff;
    color: var(--night);
    padding: 8px 14px;
    border-radius: 999px
}

.meta {
    font: 500 14px/1.6 var(--mono);
    letter-spacing: .04em;
    color: #fff;
    margin-top: 26px
}

.meta b {
    color: var(--yellow);
    font-weight: 700
}

.count {
    margin-top: 26px
}

.cap {
    font: 500 13px/1.3 var(--mono);
    color: #d9d5ff;
    letter-spacing: .04em;
    margin-bottom: 8px
}

.units {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.u {
    background: var(--night);
    border-radius: 14px;
    padding: 10px 12px;
    min-width: 74px;
    text-align: center
}

.v {
    display: block;
    font: 700 26px/1 var(--mono);
    color: var(--yellow);
    font-variant-numeric: tabular-nums
}

.l {
    font: 500 12px/1.4 var(--mono);
    color: #c9c4e8
}

.campus {
    display: block;
    width: 100%;
    max-width: 540px;
    margin-left: auto;
    aspect-ratio: 1;
    border-radius: 6px
}

.off {
    animation: boot .45s ease-out forwards
}

@keyframes boot {
    to {
        opacity: 0
    }
}

@media(max-width:999px) {
    .hgrid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "head" "pic" "info";
        row-gap: 28px
    }

    .campus {
        max-width: 460px;
        margin-inline: 0
    }
}

/* facts */
.facts {
    background: var(--yellow);
    padding-block: 30px
}

.fgrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px
}

.fgrid div {
    border-left: 3px solid var(--night);
    padding-left: 16px
}

.fn {
    display: block;
    font: 800 clamp(28px, 3vw, 42px)/1.05 var(--disp);
    letter-spacing: -.03em;
    white-space: nowrap
}

.fl {
    font-size: 15px;
    color: var(--night)
}

/* défi */
.chalk {
    background: var(--chalk);
    position: relative;
    isolation: isolate
}

.doodles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1
}

.axes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    list-style: none;
    margin: 40px 0 0;
    padding: 0
}

.axes li {
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 16px;
    align-items: start
}

.axes .ax {
    font: 500 12px/1.3 var(--mono);
    letter-spacing: .08em;
    color: var(--indigo)
}

.axes h3 {
    margin-top: 4px
}

.axes p {
    color: var(--body);
    font-size: 15px;
    margin-top: 6px
}

.promise {
    margin-top: 28px;
    background: var(--indigo);
    color: #fff;
    border-radius: 20px;
    padding: 22px 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    align-items: center
}

.promise span {
    font: 500 12px/1.3 var(--mono);
    letter-spacing: .1em;
    color: var(--yellow)
}

.promise p {
    font: 700 19px/1.35 var(--text)
}

/* format */
.two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center
}

.plan {
    background: var(--indigo);
    border-radius: 24px;
    padding: clamp(16px, 2.4vw, 28px)
}

.stage {
    border: 2px solid var(--orange);
    border-radius: 12px;
    text-align: center;
    padding: 10px;
    font: 500 13px/1.2 var(--mono);
    letter-spacing: .08em;
    color: #fff;
    margin-bottom: clamp(14px, 2vw, 22px)
}

.tables {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(8px, 1.6vw, 18px)
}

.t {
    position: relative;
    aspect-ratio: 1
}

.t .top {
    position: absolute;
    inset: 22%;
    border-radius: 50%;
    background: var(--night);
    display: grid;
    place-items: center;
    font: 700 12px/1 var(--mono);
    color: #fff
}

.t i {
    position: absolute;
    width: 17%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--yellow)
}

.t i:nth-child(2) {
    top: 2%;
    left: 41.5%
}

.t i:nth-child(3) {
    top: 41.5%;
    right: 2%
}

.t i:nth-child(4) {
    top: 41.5%;
    left: 2%
}

.t i.m {
    bottom: 2%;
    left: 41.5%;
    background: var(--lilac)
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 22px;
    font-weight: 500
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex: none
}

.rules {
    list-style: none;
    padding: 0;
    margin: 22px 0 0
}

.rules li {
    padding: 14px 0;
    border-top: 1px solid var(--rule)
}

.rules b {
    display: block
}

.rules span {
    color: var(--body)
}

/* parcours */
.route {
    background: var(--indigo);
    color: #fff
}

.route .k {
    color: var(--yellow)
}

.lines {
    display: block;
    width: 100%;
    height: 150px;
    margin-top: 36px
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 20px 0 0
}

.steps .n {
    font: 700 14px/1 var(--mono);
    color: var(--yellow);
    letter-spacing: .06em
}

.steps h3 {
    font: 700 20px/1.2 var(--disp);
    letter-spacing: -.01em;
    margin-top: 10px
}

.steps p {
    color: #d9d5ff;
    margin-top: 8px
}

/* rôles */
.roles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 36px
}

.role {
    border: 2px solid var(--rule);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff
}

.rb {
    padding: 14px 18px;
    font: 700 16px/1.2 var(--disp);
    letter-spacing: -.01em;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center
}

.rb small {
    font: 500 11px/1 var(--mono);
    letter-spacing: .08em
}

.rbody {
    padding: 20px 18px 22px;
    flex: 1
}

.rbody p {
    color: var(--body)
}

.team {
    position: relative;
    width: min(100%, 360px);
    aspect-ratio: 1;
    margin: 6px auto 4px
}

.team .top {
    position: absolute;
    inset: 25%;
    border-radius: 50%;
    background: var(--night);
    display: grid;
    place-items: center;
    text-align: center;
    font: 700 14px/1.35 var(--mono);
    letter-spacing: .06em;
    color: #fff
}

.team i {
    position: absolute;
    width: 20%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--yellow);
    display: grid;
    place-items: center;
    font: 700 14px/1 var(--mono);
    font-style: normal;
    color: var(--night)
}

.team i:nth-of-type(1) {
    top: 2%;
    left: 40%
}

.team i:nth-of-type(2) {
    top: 40%;
    right: 2%
}

.team i:nth-of-type(3) {
    top: 40%;
    left: 2%
}

.team i.m {
    bottom: 2%;
    left: 40%;
    background: var(--lilac)
}

.pgroup {
    margin-top: 36px
}

.pk {
    font: 500 13px/1.3 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--indigo);
    margin-bottom: 14px
}

.logos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px
}

.logo {
    background: none;
    border-radius: 20px;
    min-height: 132px;
    display: grid;
    place-items: center;
    padding: 22px 26px
}

.logo img {
    width: 100%;
    max-width: 260px;
    height: auto
}

.wordm {
    font: 700 20px/1.15 var(--disp);
    letter-spacing: -.02em;
    color: var(--night);
    text-align: center
}

/* sur place */
.place {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 36px
}

.pl {
    background: #fff;
    border-radius: 20px;
    padding: 26px;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    align-items: start
}

.pl p {
    color: var(--body);
    margin-top: 8px
}

/* faq */
.faqg {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start
}

details {
    border-top: 1px solid var(--rule)
}

details:last-child {
    border-bottom: 1px solid var(--rule)
}

summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    font-weight: 700;
    font-size: 17px
}

summary::-webkit-details-marker {
    display: none
}

summary::after {
    content: "+";
    font: 700 20px/1 var(--mono);
    color: var(--indigo);
    flex: none
}

details[open] summary::after {
    content: "_"
}

details p {
    color: var(--body);
    padding: 0 0 20px;
    max-width: 62ch
}

/* cta */
.cta {
    background: var(--night);
    color: #fff;
    position: relative;
    overflow: hidden;
    isolation: isolate
}

.cta .bus {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: min(62%, 820px);
    z-index: -1;
    object-fit: cover;
    object-position: right center
}

.cta h2 {
    font-size: clamp(34px, 5vw, 68px);
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1
}

.cta h2 .y {
    color: var(--yellow)
}

.cta p {
    color: #c9c4e8;
    margin-top: 16px;
    max-width: 46ch;
    font-size: 18px
}

.cta .k {
    color: var(--yellow)
}

.ctxt {
    max-width: 600px
}

@media(max-width:1000px) {
    .axes {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .two,
    .faqg {
        grid-template-columns: minmax(0, 1fr)
    }

    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .roles {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .fgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .cta .bus {
        position: static;
        display: block;
        width: 100%;
        height: 150px;
        margin-bottom: 28px;
        object-fit: cover;
        object-position: right center
    }
}

@media(max-width:640px) {

    .axes,
    .steps,
    .place,
    .roles {
        grid-template-columns: minmax(0, 1fr)
    }

    .fgrid {
        gap: 18px 12px
    }

    .fgrid div {
        padding-left: 12px
    }

    .pl {
        grid-template-columns: 48px minmax(0, 1fr)
    }

    .lines {
        height: 120px
    }
}

@media(prefers-reduced-motion:reduce) {
    .off {
        animation: none;
        opacity: 0
    }
}
/* animated RIWAM Event logo (partners) — waits until home.js adds .play */
.logo .rw-logo {
    width: 100%;
    max-width: 260px;
    height: auto;
    overflow: visible
}

.logo-riwam {
    cursor: default
}

.rw-icon path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    fill-opacity: 0;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center
}

.rw-letter,
.rw-event,
.rw-glow {
    opacity: 0
}

.rw-letter,
.rw-event {
    transform-box: fill-box
}

.rw-letter {
    transform-origin: 50% 100%
}

.rw-event {
    transform-origin: center
}

.rw-line {
    transform-box: fill-box;
    transform: scaleX(0)
}

.rw-line-l {
    transform-origin: right center
}

.rw-line-r {
    transform-origin: left center
}

.rw-shine {
    transform: translateX(-400px)
}

.rw-logo.play .rw-top {
    animation: rw-draw 1s .15s cubic-bezier(.65, 0, .35, 1) forwards, rw-fill .6s .85s ease-out forwards, rw-slide-top 1.1s .1s cubic-bezier(.2, .8, .2, 1) both
}

.rw-logo.play .rw-down {
    animation: rw-draw 1s .35s cubic-bezier(.65, 0, .35, 1) forwards, rw-fill .6s 1.05s ease-out forwards, rw-slide-down 1.1s .3s cubic-bezier(.2, .8, .2, 1) both
}

.rw-logo.play .rw-letter {
    animation: rw-rise .8s cubic-bezier(.2, .9, .25, 1.15) forwards
}

.rw-logo.play .rw-l1 { animation-delay: 1.15s }
.rw-logo.play .rw-l2 { animation-delay: 1.27s }
.rw-logo.play .rw-l3 { animation-delay: 1.39s }
.rw-logo.play .rw-l4 { animation-delay: 1.51s }
.rw-logo.play .rw-l5 { animation-delay: 1.63s }

.rw-logo.play .rw-line {
    animation: rw-grow .9s 2.25s cubic-bezier(.65, 0, .35, 1) forwards
}

.rw-logo.play .rw-event {
    animation: rw-event .9s 2.4s cubic-bezier(.2, .8, .2, 1) forwards
}

.rw-logo.play .rw-shine {
    animation: rw-sweep 1.3s 3.3s cubic-bezier(.45, 0, .25, 1) forwards
}

.rw-logo.play .rw-glow {
    animation: rw-glow 1.6s 3.2s ease-in-out forwards
}

@keyframes rw-draw { to { stroke-dashoffset: 0 } }
@keyframes rw-fill { to { fill-opacity: 1 } }
@keyframes rw-slide-top { from { transform: translate(-40px, -28px); opacity: 0 } 30% { opacity: 1 } to { transform: none; opacity: 1 } }
@keyframes rw-slide-down { from { transform: translate(40px, 28px); opacity: 0 } 30% { opacity: 1 } to { transform: none; opacity: 1 } }
@keyframes rw-rise { from { opacity: 0; transform: translateY(46px) scaleY(.85) } 60% { opacity: 1 } to { opacity: 1; transform: none } }
@keyframes rw-grow { to { transform: scaleX(1) } }
@keyframes rw-event { from { opacity: 0; transform: translateY(10px) scale(.92) } to { opacity: 1; transform: none } }
@keyframes rw-sweep { from { transform: translateX(-400px) } to { transform: translateX(1300px) } }
@keyframes rw-glow { 0% { opacity: 0 } 45% { opacity: .55 } 100% { opacity: 0 } }

/* no JS or reduced motion: show the finished logo straight away */
html:not(.js) .rw-icon path,
html:not(.js) .rw-letter,
html:not(.js) .rw-event {
    opacity: 1;
    fill-opacity: 1;
    stroke-dashoffset: 0
}

html:not(.js) .rw-line {
    transform: none
}

@media(prefers-reduced-motion:reduce) {
    .rw-logo .rw-icon path,
    .rw-logo .rw-letter,
    .rw-logo .rw-event {
        animation: none !important;
        opacity: 1;
        fill-opacity: 1;
        stroke-dashoffset: 0;
        transform: none
    }

    .rw-logo .rw-line {
        animation: none !important;
        transform: none
    }

    .rw-logo .rw-shine,
    .rw-logo .rw-glow {
        animation: none !important
    }
}

/* organisers: logos of different shapes, shown at the same height */
.orgs {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr))
}

.orgs .logo {
    min-height: 150px;
    padding: 12px
}

.orgs .logo img {
    width: auto;
    max-width: 100%;
    height: 110px;
    object-fit: contain;
    mix-blend-mode: multiply
}

.orgs .logo img.small {
    height: 88px
}

/* phones: partner logos two per row (an odd last logo is centred on its own row) */
@media (max-width: 640px) {
    .logos,
    .orgs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px
    }

    .logo {
        min-height: 96px;
        padding: 10px
    }

    .orgs .logo {
        min-height: 110px;
        padding: 8px
    }

    .orgs .logo img {
        height: 84px
    }

    .orgs .logo img.small {
        height: 66px
    }

    .logos .logo:last-child:nth-child(odd) {
        grid-column: 1 / -1
    }
}

/* background music button (fixed, bottom right) */
.music-btn {
    position: fixed;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    z-index: 50;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    border: 3px solid var(--yellow);
    background: var(--night);
    color: #fff;
    box-shadow: 0 8px 24px rgba(21, 17, 46, .3);
    cursor: pointer;
    transition: transform .15s, background-color .15s
}

.music-btn:hover { transform: scale(1.06) }
.music-btn:active { transform: scale(.94) }
.music-btn:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px }

.music-btn .eq { display: none; align-items: flex-end; gap: 3px; height: 20px }
.music-btn .eq i { width: 4px; height: 100%; border-radius: 2px; background: var(--yellow); transform-origin: bottom; animation: eq 1s ease-in-out infinite }
.music-btn .eq i:nth-child(2) { background: var(--orange); animation-delay: -.3s }
.music-btn .eq i:nth-child(3) { background: var(--lilac); animation-delay: -.6s }
.music-btn .eq i:nth-child(4) { background: var(--mint); animation-delay: -.15s }

.music-btn.on .eq { display: flex }
.music-btn.on .mute { display: none }

/* autoplay blocked: a soft pulse invites the first tap */
.music-btn.waiting { animation: musicPulse 1.8s ease-out infinite }

@keyframes eq { 0%, 100% { transform: scaleY(.3) } 50% { transform: scaleY(1) } }
@keyframes musicPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 196, 46, .55) } 100% { box-shadow: 0 0 0 16px rgba(255, 196, 46, 0) } }

@media (prefers-reduced-motion: reduce) {
    .music-btn .eq i, .music-btn.waiting { animation: none }
    .music-btn .eq i { transform: scaleY(.7) }
}

/* hint next to the button while the browser waits for a first click / tap to allow sound (music.js) */
.music-hint {
    position: fixed;
    right: calc(max(16px, env(safe-area-inset-right, 0px)) + 68px);
    bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 10px);
    z-index: 50;
    max-width: min(260px, calc(100vw - 110px));
    margin: 0;
    padding: 9px 14px;
    border-radius: 12px;
    background: var(--night);
    color: #fff;
    font: 500 13px/1.35 var(--text);
    box-shadow: 0 8px 24px rgba(21, 17, 46, .3);
    pointer-events: none;
    animation: musicHintIn .35s ease-out both
}

.music-hint::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--night);
    transform: translateY(-50%) rotate(45deg)
}

@keyframes musicHintIn { from { opacity: 0; transform: translateX(8px) } }

@media (prefers-reduced-motion: reduce) { .music-hint { animation: none } }

/* secondary button on light sections */
.outl { background: #fff; color: var(--night); border-color: var(--rule) }
.outl:hover { border-color: var(--indigo) }
