/* Version « Le portail sort de la montagne ». */
.p-hero{position: relative; overflow-x: clip; padding: clamp(132px, 16vh, 176px) var(--gutter) 0; text-align: center; isolation: isolate}
.p-sky{position: absolute; inset: 0 0 auto; z-index: -1; height: min(100svh, 980px); pointer-events: none; -webkit-mask-image: linear-gradient(#000 52%, #0000); mask-image: linear-gradient(#000 52%, #0000)}
.p-sky img{width: 100%; height: 100%; object-fit: cover; object-position: 62% 30%; animation: sky-in 2.2s var(--ease) both}
@keyframes sky-in{from{opacity: 0; scale: 1.06}}
.p-hero-copy{position: relative; max-width: 980px; margin: 0 auto}
.p-hero-copy::before{content: ""; position: absolute; inset: -8% -14% -12%; z-index: -1; background: radial-gradient(closest-side, #f4f7fcd1 55%, #f4f7fc00); pointer-events: none}
.p-hero-copy .lead{margin-inline: auto}
.p-hero .hero-actions{justify-content: center}
.hero-access{display: inline-block; margin-top: 18px; padding: 7px 14px; border-radius: 999px; background: #ffffffc7; box-shadow: inset 0 1px 0 #fff, 0 0 0 1px #ffffffd9; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-wrap: balance}
@media (max-width: 720px){.hero-access{border-radius: 16px}}
.js .hero-access{animation: fade-up 1s var(--ease) .4s both}

.p-device-wrap{max-width: 1220px; margin: clamp(56px, 8vh, 88px) auto 0; perspective: 2200px; animation: device-in 1.2s var(--ease) .3s both}
@keyframes device-in{from{opacity: 0; translate: 0 80px}}
.p-device{--r-shell: 34px; --r-core: 27px; transform-origin: 50% 0; text-align: left}
.js .p-device{transform: rotateX(20deg) scale(.9); transition: transform 1.6s var(--ease)}
.js .p-device.flat{transform: none}
@supports (animation-timeline: view()){
  .js .p-device,.js .p-device.flat{transform: none; transition: none; animation: device-tilt linear both; animation-timeline: view(); animation-range: entry 10% cover 42%}
  @keyframes device-tilt{from{transform: rotateX(24deg) scale(.88)}}
}
.p-device-core{overflow: hidden}

.dash{display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 590px; font-size: 14px; background: linear-gradient(180deg, #f8f7f4, #f1f0ed)}
.dash-side{display: flex; flex-direction: column; padding: 24px 12px 18px; background: linear-gradient(155deg, #ffffffc7, #ffffff70 60%, #dfe8ff8c); box-shadow: 1px 0 0 #ffffffd9, 8px 0 30px -24px #48648e59}
.dash-brand{display: flex; align-items: center; gap: 9px; padding: 0 10px; margin-bottom: 34px}
.dash-brand img{width: 34px; height: 21px; object-fit: contain}
.dash-brand>span{font-size: 19px; font-weight: 760; letter-spacing: -.5px; line-height: 1}
.dash-brand small{display: block; margin-top: 2px; font-size: 8px; letter-spacing: 3px; text-align: center; font-weight: 650}
.dash-nav{display: grid; gap: 3px}
.dash-nav li{display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 11px; font-size: 14px; color: var(--ink-2)}
.dash-nav li .icon{width: 19px; height: 19px}
.dash-nav li.on{background: #ffffffd9; color: var(--blue-2); font-weight: 650; box-shadow: 0 0 0 1px #ffffff, 0 6px 14px -10px #1f3b6e59}
.dash-nav b{margin-left: auto; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px}
.dash-me{display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 650; line-height: 1.25}
.dash-me .avatar{width: 34px; height: 34px; font-size: 11px}
.dash-me small{display: block; font-weight: 500; color: var(--muted); font-size: 12px}
.dash-main{position: relative; padding: 26px 26px 24px; isolation: isolate}
.dash-main::before{content: ""; position: absolute; inset: 0 0 auto; z-index: -1; height: 190px; background: url('./assets/alpine-header.webp') right top/auto 100% no-repeat; -webkit-mask-image: linear-gradient(#000 40%, #0000); mask-image: linear-gradient(#000 40%, #0000); opacity: .9}
.dash-head{display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px}
.dash-head small{display: block; font-size: 12.5px; color: var(--ink-2)}
.dash-head strong{display: block; font-size: 30px; font-weight: 740; letter-spacing: -.03em; line-height: 1.15}
.dash-sub{display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: 13.5px}
.dash-sub i{width: 24px; height: 2.5px; border-radius: 2px; background: var(--gold)}
.dash-cols{display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start}
.dash-card{padding: 16px 18px 12px; border-radius: 20px; background: #ffffffe6; box-shadow: inset 0 1px 0 #fff, 0 0 0 1px #ffffffd9, 0 16px 36px -26px #1f3b6e59}
.dash-title{display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 740; margin-bottom: 4px}
.dash-student{padding-bottom: 18px}
.dash-stats{display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px}
.dash-stats div{padding: 10px 12px; border-radius: 14px; background: #f4f6fb}
.dash-stats dt{font-size: 11.5px; font-weight: 650; color: var(--muted)}
.dash-stats dd{font-size: 21px; font-weight: 760; letter-spacing: -.02em; font-variant-numeric: tabular-nums}
.dash-stats dd small{font-size: 12px; font-weight: 600; color: var(--muted)}
.dash-bars{display: flex; align-items: flex-end; gap: 10px; height: 74px}
.dash-bars span{flex: 1; height: calc(var(--h) * 100%); border-radius: 9px 9px 4px 4px; background: linear-gradient(180deg, #c9d8fb, #e5ecfd); transform-origin: bottom; animation: bar-up .9s var(--ease) both; animation-delay: calc(1s + var(--n, 0) * 55ms)}
.dash-bars span:nth-child(2){--n: 1}
.dash-bars span:nth-child(3){--n: 2}
.dash-bars span:nth-child(4){--n: 3; background: linear-gradient(180deg, var(--blue-3), var(--blue))}
@keyframes bar-up{from{scale: 1 0}}
.p-device .todo-row{animation: row-in .6s var(--ease) both; animation-delay: calc(.8s + var(--i) * 55ms)}
@keyframes row-in{from{opacity: 0; translate: 0 10px}}

/* Écran fixé */
.p-stage-section{max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 0}
.stage{display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(40px, 6vw, 96px)}
.stage-step{display: flex; align-items: center; min-height: 82vh}
.stage-step:first-child{min-height: 62vh; align-items: flex-start; padding-top: 8vh}
.stage-step:last-child{min-height: 70vh}
.stage-copy{max-width: 460px}
.stage-copy>p{margin-top: 18px; font-size: 18px; color: var(--ink-2); text-wrap: pretty}
.js .stage-step .stage-copy{transition: opacity .7s var(--ease), translate 1.1s var(--ease), filter .9s var(--ease)}
.js .stage-step:not(.active) .stage-copy.in{opacity: .3}
.stage-inline{display: none}
.stage-frame{position: sticky; top: max(92px, calc(50vh - 340px)); align-self: start; display: grid; gap: 14px}
.stage-rail{position: relative; isolation: isolate; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: #ffffff8c; box-shadow: 0 0 0 1px #ffffffd9; width: max-content}
.stage-rail button{min-height: 36px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--muted); transition: color .3s var(--ease), scale .16s var(--ease)}
.stage-rail button:active{scale: .97}
.stage-rail button[aria-current="step"]{color: var(--blue-2)}
@media (hover: hover) and (pointer: fine){.stage-rail button:hover{color: var(--ink)}
.stage-rail button[aria-current="step"]:hover{color: var(--blue-2)}}
.rail-thumb{position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 0; width: var(--w, 0); border-radius: 999px; background: #fff; box-shadow: 0 1px 2px #0d15301a, 0 8px 18px -10px #0d153040; translate: var(--x, 0) 0; transition: translate .45s var(--ease), width .45s var(--ease)}
.stage-shell{--r-shell: 34px; --r-core: 27px}
.stage-core{position: relative; height: min(620px, calc(100svh - 190px)); overflow: hidden; transition: height .6s var(--ease)}
.stage-panel{position: absolute; inset: 0 0 auto; max-height: 100%; overflow: auto; scrollbar-width: none; opacity: 0; scale: .98; filter: blur(4px); visibility: hidden; transition: opacity .15s var(--ease), scale .25s var(--ease), filter .15s var(--ease), visibility 0s linear .15s}
.stage-panel.on{opacity: 1; scale: 1; filter: none; visibility: visible; transition: opacity .4s var(--ease) .08s, scale .5s var(--ease) .08s, filter .4s var(--ease) .08s, visibility 0s}
.stage-core .panel{padding: 26px}
.stage-core .panel-corps{padding: 20px 24px}
.stage-core .panel-corps .chart{margin-top: 2px}

@media (max-width: 1000px){
  .stage{grid-template-columns: 1fr}
  .stage-frame{display: none}
  .stage-step,.stage-step:first-child,.stage-step:last-child{display: block; min-height: 0; padding: 0 0 clamp(64px, 10vw, 96px)}
  .stage-copy{max-width: 640px}
  .js .stage-step:not(.active) .stage-copy.in{opacity: 1}
  .stage-inline{display: block; margin-top: 28px}
}
@media (max-width: 860px){
  .dash{grid-template-columns: 1fr; min-height: 0}
  .dash-side{display: none}
  .dash-cols{grid-template-columns: 1fr}
  .dash-student{display: none}
}
@media (max-width: 720px){
  .p-hero{padding-top: 112px}
  .p-sky{height: 760px}
  .p-hero .hero-actions{align-items: stretch}
  .p-device-wrap{margin-top: 44px; perspective: 1200px}
  .p-device{--r-shell: 24px; --r-core: 18px; padding: 5px}
  .dash-main{padding: 16px 14px 10px}
  .dash-head .fake-btn{display: none}
  .dash-head strong{font-size: 24px}
  .dash-card{padding: 12px 14px 6px}
  .p-device .todo-row:nth-child(n+4){display: none}
}
@media (prefers-reduced-motion: reduce){
  .p-sky img,.p-device-wrap,.dash-bars span,.p-device .todo-row{animation: none}
  .js .p-device,.js .p-device.flat{transform: none; transition: none; animation: none}
  .stage-panel,.stage-panel.on{scale: 1; filter: none; transition: opacity .2s linear, visibility 0s}
  .rail-thumb{transition: none}
  .stage-core{transition: none}
}
