/* ==========================================================================
   Wrapped 2026 — lecteur motion design
   ========================================================================== */
.page-wrapped main { overflow-x: clip; }
.wr { --c: #ff3343; position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: var(--bg); isolation: isolate; user-select: none; -webkit-user-select: none; }
.no-js .wr, .wr--static { display: none; }
.wr-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.wr-stage { position: absolute; inset: 0; z-index: 1; touch-action: manipulation; }

/* --- Scènes -------------------------------------------------------------- */
.ws {
    position: absolute; inset: 0; padding: 128px var(--gutter) 158px;
    display: flex; flex-direction: column; justify-content: center; gap: 1.2rem;
    visibility: hidden; opacity: 0; transform-origin: 50% 50%;
}
.ws.is-active { visibility: visible; opacity: 1; }
.ws .ch { display: inline-block; }
.ws-kicker { color: var(--c); margin: 0; }
.ws-sub { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.35rem); max-width: 46ch; margin: 0; }
.ws kbd { font-family: var(--mono); font-size: .7rem; padding: .15rem .4rem; border: 1px solid var(--line); border-radius: 4px; margin: 0 .15rem; color: var(--fg); }

/* Intro */
.ws--intro { justify-content: center; }
.ws-year { font-size: clamp(6rem, 30vw, 26rem); line-height: .8; letter-spacing: -.07em; overflow: hidden; padding-bottom: .04em; color: var(--fg); }
.ws-wrapped { font-size: clamp(2.6rem, 9vw, 8rem); font-weight: 700; letter-spacing: -.05em; line-height: .9; margin: -.1em 0 0 .08em; color: transparent; -webkit-text-stroke: 2px var(--c); }
.ws-hint { color: var(--muted); margin: .4rem 0 0; }

/* Chiffres */
.ws-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); max-width: 1200px; }
.ws-stats--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ws-stat { border-top: 2px solid var(--c); padding-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.ws-num { font-size: clamp(2.8rem, 7.5vw, 7rem); font-weight: 700; letter-spacing: -.05em; line-height: .9; color: var(--fg); font-variant-numeric: tabular-nums; }
.ws-label { color: var(--muted); }
.ws-note { color: var(--muted); margin: 0; opacity: .8; }

/* Chapitres */
.ws--chapter { justify-content: center; }
.ws-chapter-idx { color: var(--c); }
.ws-month { font-size: clamp(3rem, 15vw, 16rem); line-height: .85; letter-spacing: -.06em; overflow: hidden; padding-bottom: .06em; white-space: nowrap; }
.ws-month--small { font-size: clamp(3.4rem, 12vw, 11rem); color: var(--muted); }
.ws-chapter-meta { color: var(--muted); margin: 0; }
.ws-emoji { position: absolute; z-index: -1; opacity: .9; right: var(--gutter); top: 26%; font-size: clamp(4rem, 12vw, 10rem); filter: drop-shadow(0 0 40px color-mix(in srgb, var(--c) 50%, transparent)); }
.ws-sweep { position: absolute; left: 0; right: 0; bottom: 30%; height: 2px; background: linear-gradient(90deg, var(--c), transparent); transform-origin: 0 50%; }

/* Acte II */
.ws--act { justify-content: center; }
.ws-act { width: fit-content; transform-origin: 0 60%; font-size: clamp(8rem, 28vw, 24rem); line-height: .78; letter-spacing: -.08em; background: linear-gradient(120deg, #ff8a4c, #ff3343 50%, #ff5c8a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ws-act-names { display: flex; flex-wrap: wrap; gap: .6rem; }
.ws-act-names span { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 99px; color: var(--fg); }

/* Projet */
.ws--project { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 90px); align-items: center; align-content: center; }
.ws-proj-head { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.ws-proj-icon { font-size: clamp(2.6rem, 4.5vw, 4rem); line-height: 1; width: fit-content; }
.ws-proj-meta { color: var(--muted); margin: 0; }
.ws-status { color: var(--c); }
.ws-status--yellow { color: #f5c518; }
.ws-proj-title { font-size: clamp(2.4rem, 5.6vw, 5.6rem); line-height: .92; letter-spacing: -.045em; overflow: hidden; padding-bottom: .06em; }
.ws-proj-domain { color: var(--muted); margin: 0; font-size: clamp(.95rem, 1.3vw, 1.15rem); }
.ws-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.ws-tags li { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; padding: .28rem .55rem; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 99px; color: var(--fg); }
.ws-proj-link { color: var(--c); width: fit-content; position: relative; z-index: 2; }
.ws-proj-link:hover { text-decoration: underline; }
.ws-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; min-width: 0; }
.ws-item { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(18, 18, 22, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ws-item-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 10px; font-size: 1.4rem; background: color-mix(in srgb, var(--c) 14%, transparent); }
.ws-item h3 { font-size: clamp(1.02rem, 1.4vw, 1.25rem); letter-spacing: -.01em; line-height: 1.2; margin-bottom: .3rem; }
.ws-item p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ws-items--dense { gap: .55rem; }
.ws-items--dense .ws-item { padding: .7rem .9rem; }
.ws-items--dense .ws-item p { -webkit-line-clamp: 1; }

/* MotionForge : JSON -> rendu */
.wj { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: stretch; max-width: 1300px; }
.wj-code { margin: 0; padding: 1.4rem 1.6rem; border-radius: 14px; background: rgba(12, 12, 15, .85); border: 1px solid var(--line); font-family: var(--mono); font-size: clamp(.78rem, 1.15vw, 1rem); line-height: 1.6; color: #e6e4dc; white-space: pre; overflow: hidden; min-height: 17em; }
.wj-code code { color: inherit; }
.wj-caret { display: inline-block; width: .55em; height: 1.1em; background: var(--c); vertical-align: -.2em; animation: wjBlink 1s steps(1) infinite; }
@keyframes wjBlink { 50% { opacity: 0; } }
.wj-render { display: flex; flex-direction: column; gap: .8rem; }
.wj-bar { position: relative; height: 30px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; }
.wj-bar span { position: absolute; inset: 0; background: var(--c); transform-origin: 0 50%; }
.wj-bar em { position: absolute; left: .8rem; top: 50%; translate: 0 -50%; font-style: normal; color: var(--bg); mix-blend-mode: difference; filter: invert(1); }
.wj-frame { flex: 1; aspect-ratio: 16 / 9; border-radius: 14px; background: radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--c) 30%, #0b0b0e), #0b0b0e 70%); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; overflow: hidden; }
.wj-slam { font-size: clamp(1.8rem, 4.2vw, 4rem); font-weight: 700; letter-spacing: -.05em; margin: 0; overflow: hidden; text-transform: uppercase; }
.wj-big { margin: 0; }
.wj-big .ws-num { color: var(--c); font-size: clamp(2.4rem, 6vw, 5.6rem); }

/* IntimateAI : fil vivant */
.ws--feed { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.wf-text { display: flex; flex-direction: column; gap: 1.4rem; }
.wf-facts { display: grid; gap: 1.1rem; }
.wf-facts li { display: flex; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.wf-facts b { font-size: clamp(2.4rem, 5vw, 4.6rem); letter-spacing: -.05em; color: var(--c); min-width: 2.2ch; }
.wf-facts span { color: var(--muted); }
.wf-feed { height: calc(100svh - 300px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent); }
.wf-col { overflow: hidden; }
.wf-track { display: flex; flex-direction: column; gap: 12px; }
.wf-post { border: 1px solid var(--line); border-radius: 12px; background: rgba(18, 18, 22, .8); padding: .7rem; display: grid; grid-template-columns: 26px 1fr; gap: .35rem .5rem; align-items: center; }
.wf-av { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, hsl(var(--h) 80% 65%), hsl(calc(var(--h) + 60) 70% 45%)); grid-row: span 2; }
.wf-line { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .22); width: 70%; }
.wf-line--s { width: 40%; background: rgba(255, 255, 255, .12); }
.wf-img { grid-column: 1 / -1; aspect-ratio: 4 / 5; border-radius: 8px; background: linear-gradient(160deg, hsl(var(--h) 60% 55% / .55), hsl(calc(var(--h) + 90) 60% 30% / .55)); margin-top: .3rem; }
.wf-likes { grid-column: 1 / -1; color: var(--c); font-size: .65rem; }

/* Top features */
.ws-highlights { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; max-width: 1300px; }
.ws-hl { --hc: var(--c); display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(18, 18, 22, .78); transition: transform .4s var(--ease-out), border-color .3s, background .3s; }
.ws-hl-icon { font-size: 1.3rem; }
.ws-hl b { font-size: 1.02rem; letter-spacing: -.01em; }
.ws-hl-desc { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.ws-hl.is-lit { transform: translateY(-6px) scale(1.04); border-color: var(--hc); background: color-mix(in srgb, var(--hc) 14%, rgba(18, 18, 22, .9)); }

/* Fin */
.ws-end { font-size: clamp(3.2rem, 11vw, 10rem); line-height: .88; letter-spacing: -.06em; overflow: hidden; padding-bottom: .05em; }
.ws-end-o { color: transparent; -webkit-text-stroke: 2px var(--c); }
.ws-end-o .ch { -webkit-text-stroke: inherit; }
.ws-end-btns { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; position: relative; z-index: 2; }

/* --- Interface du lecteur ------------------------------------------------ */
.wr-ui { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.wr-ui > * { pointer-events: auto; }
.wr-top { position: absolute; top: 88px; left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; color: var(--muted); pointer-events: none; }
.wr-now b { color: var(--c); font-weight: 600; transition: color .4s; }
.wr.is-paused .wr-now::after { content: ' · paused'; color: var(--fg); }
.wr-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--gutter) 18px; background: linear-gradient(transparent, rgba(10, 10, 12, .85) 45%); padding-top: 40px; }
.wr-scrub { display: flex; gap: 6px; align-items: flex-start; }
.wr-chap { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wr-segs { display: flex; gap: 2px; }
.wr-seg { position: relative; height: 14px; padding: 0; border: 0; background: none; cursor: pointer; min-width: 3px; }
.wr-seg::before { content: ''; position: absolute; left: 0; right: 0; top: 5px; height: 4px; border-radius: 2px; background: rgba(242, 240, 234, .16); transition: transform .2s, background .2s; }
.wr-seg span { position: absolute; left: 0; right: 0; top: 5px; height: 4px; border-radius: 2px; background: var(--c); transform-origin: 0 50%; transform: scaleX(0); }
.wr-seg:hover::before, .wr-seg:focus-visible::before { transform: scaleY(2); background: rgba(242, 240, 234, .35); }
.wr-seg.is-done span { transform: scaleX(1); }
.wr-chap-label { font-size: .62rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-controls { display: flex; align-items: center; gap: .45rem; margin-top: 10px; }
.wr-spacer { flex: 1; }
.wr-btn { height: 40px; min-width: 40px; padding: 0 .7rem; border-radius: 99px; border: 1px solid var(--line); background: rgba(18, 18, 22, .6); color: var(--fg); cursor: pointer; display: inline-grid; place-items: center; font-size: .85rem; transition: background .25s, color .25s, border-color .25s; }
.wr-btn:hover { border-color: var(--c); color: var(--c); }
.wr-btn--play { width: 52px; height: 52px; background: var(--c); color: var(--bg); border-color: var(--c); font-size: .9rem; }
.wr-btn--play:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.wr-btn--play[aria-pressed="true"] .wr-ico-play, .wr-btn--play[aria-pressed="false"] .wr-ico-pause { display: none; }
.wr-btn[data-wr="sound"][aria-pressed="false"] .wr-ico-on, .wr-btn[data-wr="sound"][aria-pressed="true"] .wr-ico-off { display: none; }
.wr-btn--text { font-size: .7rem; }
.wr-time { color: var(--muted); margin-left: .5rem; font-variant-numeric: tabular-nums; }
.wr.is-holding .ws.is-active { filter: brightness(.85); }

/* Détails */
.wr-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; width: min(500px, 94vw); padding: 90px 1.8rem 2rem; overflow-y: auto; background: rgba(14, 14, 18, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-left: 1px solid var(--line); user-select: text; -webkit-user-select: text; overscroll-behavior: contain; }
.wr-drawer__close { position: absolute; top: 84px; right: 1.2rem; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--fg); cursor: pointer; }
.wr-drawer__close:hover { border-color: var(--c); color: var(--c); }
.wr-drawer__title { font-size: 1.8rem; letter-spacing: -.03em; line-height: 1.05; margin: 0 3rem 1rem 0; color: var(--c); }
.wd-meta { color: var(--muted); margin: 0 0 1.2rem; }
.wd-item + .wd-item { margin-top: 1.3rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.wd-item h4 { font-size: 1.05rem; line-height: 1.25; margin: 0 0 .6rem; letter-spacing: -.01em; }
.wd-item ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: .94rem; line-height: 1.5; }
.wd-item li + li { margin-top: .35em; }
.wd-item code, .wr-log code { font-family: var(--mono); font-size: .85em; padding: .08em .35em; border-radius: 4px; background: rgba(255, 255, 255, .07); color: var(--fg); }
.wd-empty { color: var(--muted); }

/* --- Journal complet ----------------------------------------------------- */
.wr-log__intro { color: var(--muted); font-size: 1.1rem; margin: -2rem 0 3rem; max-width: 50ch; }
.wr-log__month { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); padding: 2.5rem 0; border-top: 1px solid var(--line); }
.wr-log__mname { font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.03em; position: sticky; top: 100px; align-self: start; }
.wr-log__mname span { display: block; color: var(--muted); margin-top: .4rem; }
.wr-log__groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.wr-log__group { padding: 1.3rem; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 12px; background: var(--bg-2); }
.wr-log__group header { display: flex; gap: .9rem; align-items: center; margin-bottom: 1.1rem; }
.wr-log__icon { font-size: 1.8rem; }
.wr-log__group h4 { font-size: 1.25rem; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.wr-log__group header p { color: var(--muted); margin: .3rem 0 0; font-size: .64rem; }
.wr-log__group .wd-item h4 { font-size: .98rem; }
.wr-log__group .wd-item ul { font-size: .88rem; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
    .ws { padding: 112px var(--gutter) 150px; gap: .9rem; }
    .ws--project, .ws--feed { grid-template-columns: 1fr; align-content: center; gap: 1.2rem; }
    .ws-proj-head { gap: .5rem; }
    .ws-proj-icon { font-size: 2.2rem; }
    .ws-proj-title { font-size: clamp(2rem, 9vw, 3.2rem); }
    .ws-tags, .ws-proj-link { display: none; }
    .ws-item { grid-template-columns: 2.2rem 1fr; gap: .7rem; padding: .65rem .8rem; }
    .ws-item-icon { width: 2.2rem; height: 2.2rem; font-size: 1.05rem; }
    .ws-item p { -webkit-line-clamp: 1; font-size: .85rem; }
    .ws-items--dense .ws-item p { display: none; }
    .ws-stats, .ws-stats--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wj { grid-template-columns: 1fr; }
    .wj-code { min-height: 0; font-size: .7rem; padding: 1rem; }
    .wf-feed { height: 36svh; }
    .ws-emoji { top: auto; bottom: 26%; translate: none; font-size: 4rem; }
    .ws-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .ws-hl { padding: .6rem .7rem; }
    .ws-hl-desc { display: none; }
    .wr-top { top: 76px; }
    .wr-chap-label { display: none; }
    .wr-time, .wr-btn--text:not([data-wr]) , .wr-btn[data-wr="fullscreen"] { display: none; }
    .wr-log__month { grid-template-columns: 1fr; }
    .wr-log__mname { position: static; }
}
@media (max-width: 900px) and (max-height: 700px) { .ws-item:nth-child(n+4) { display: none; } }
.ws-proj-title--long { font-size: clamp(2.2rem, 4.2vw, 4.4rem); }
.ws-proj-title--xl { font-size: clamp(2rem, 3.3vw, 3.4rem); line-height: 1; }
.ws-proj-title .word { white-space: normal; }
@media (max-width: 900px) { .ws-proj-title--long, .ws-proj-title--xl { font-size: clamp(1.7rem, 7vw, 2.6rem); } }

@media (max-width: 900px) {
    .ws-month { font-size: clamp(2.6rem, 14vw, 6rem); }
    .ws-month--small { font-size: clamp(2.4rem, 12vw, 5rem); }
    .wr-now [data-wr-label] { display: none; }
    .ws-hl:nth-child(n+9) { display: none; }
    .ws-hl-icon { font-size: 1rem; }
    .ws-hl b { font-size: .88rem; }
    .wf-facts { gap: .5rem; }
    .wf-facts li { padding-bottom: .5rem; }
    .wf-facts b { font-size: 2rem; }
    .wf-feed { height: 24svh; }
    .ws--json .ws-sub { display: none; }
    .wj-frame { aspect-ratio: 16 / 7; }
    .wj-slam { font-size: 1.5rem; }
    .wj-big .ws-num { font-size: 2.2rem; }
}

.wr:focus { outline: none; }
