/* CLAC · iPhone en code (écrans de l'appli, fidèles à la DA Cobalt)
   Usage : <div class="phone" data-phone="sieste" data-mode="Devoirs" data-reste="29:48"></div>
   Taille : --phone-w (n'importe quelle longueur : 260px, 72vw, clamp(...)). Mode d'emploi : /_brief/composants.md */

.phone {
  --phone-w: 300px;
  position: relative; display: block; flex: none;
  width: var(--phone-w); max-width: 100%;
  aspect-ratio: 306 / 628;
  isolation: isolate;
  -webkit-user-select: none; user-select: none;
}
.phone[data-cadre="nu"] { aspect-ratio: 290 / 612; }
.phone__k { position: absolute; left: 0; top: 0; width: 306px; height: 628px; transform-origin: 0 0; transform: scale(var(--k, 1)); }
.phone[data-cadre="nu"] .phone__k { width: 290px; height: 612px; }
.phone__body {
  position: relative; width: 100%; height: 100%; padding: 8px; border-radius: 54px;
  background: linear-gradient(150deg, #34343B 0%, #141417 22%, #0C0C0F 60%, #26262C 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 0 0 3px #060608, 0 0 0 .5px rgba(11, 11, 13, .4), 0 46px 80px -40px rgba(11, 11, 13, .55), 0 18px 30px -24px rgba(11, 11, 13, .35);
}
.phone__body::before, .phone__body::after { content: ""; position: absolute; width: 3px; border-radius: 2px; background: linear-gradient(90deg, #1A1A1E, #3A3A41); }
.phone__body::before { left: -2.5px; top: 118px; height: 54px; box-shadow: 0 70px 0 #26262B; }
.phone__body::after { right: -2.5px; top: 158px; height: 84px; }
.phone[data-cadre="nu"] .phone__body { padding: 0; border-radius: 46px; background: none; box-shadow: 0 0 0 1px rgba(11, 11, 13, .08), 0 40px 70px -36px rgba(11, 11, 13, .45); }
.phone[data-cadre="nu"] .phone__body::before, .phone[data-cadre="nu"] .phone__body::after { display: none; }
.phone[data-glow]::before { content: ""; position: absolute; z-index: -1; inset: 12% -22% 8%; border-radius: 50%; background: radial-gradient(50% 50% at 35% 40%, rgba(51, 85, 255, .55), rgba(51, 85, 255, 0) 70%), radial-gradient(45% 45% at 70% 60%, rgba(123, 92, 255, .45), rgba(123, 92, 255, 0) 70%); filter: blur(30px); pointer-events: none; }

/* Écran */
.ph-screen {
  --p-cobalt: #3355FF; --p-violet: #7B5CFF; --p-ice: #A8BCFF; --p-ink: #0B0B0D; --p-ink2: #66656B;
  --f-sans: "Mona Sans", "Mona Sans Fallback", system-ui, sans-serif; --f-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace; --f-sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  position: relative; width: 290px; height: 612px; border-radius: 46px; overflow: hidden;
  background: var(--p-bg); color: var(--p-fg);
  font: 400 14px/1.35 var(--f-sans); letter-spacing: normal; text-align: left; text-transform: none;
  -webkit-font-smoothing: antialiased; transform: translateZ(0);
}
.ph-screen *, .ph-screen *::before, .ph-screen *::after { box-sizing: border-box; margin: 0; }
.ph-screen img { display: block; max-width: none; }
.ph-screen svg { display: block; }
.ph-day { --p-bg: #EEEDE9; --p-card: #FFFFFF; --p-fg: #0B0B0D; --p-fg2: #66656B; --p-line: rgba(11, 11, 13, .08); --p-line2: rgba(11, 11, 13, .11); }
.ph-night { --p-bg: #060609; --p-card: #111117; --p-fg: #F3F3F6; --p-fg2: #8D8D99; --p-line: rgba(255, 255, 255, .08); --p-line2: rgba(255, 255, 255, .13); }
.ph-fade { animation: ph-fade .5s cubic-bezier(.22, .8, .24, 1); }
@keyframes ph-fade { from { opacity: 0; filter: blur(4px); } }

/* Typo */
.ph-disp { font-family: var(--f-sans); font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: -.005em; line-height: .92; display: block; }
.ph-num { font-family: var(--f-sans); font-stretch: 75%; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ph-num small { font-size: .5em; font-weight: 600; margin-inline: 1px; letter-spacing: 0; }
.ph-mono { font-family: var(--f-mono); font-stretch: 75%; font-weight: 450; font-size: 10px; line-height: 1.3; letter-spacing: .04em; text-transform: uppercase; color: var(--p-fg2); }

/* Chrome iOS */
.ph-island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 86px; height: 26px; border-radius: 20px; background: #000000; z-index: 6; }
.ph-status { position: relative; z-index: 5; display: flex; justify-content: space-between; align-items: center; height: 44px; padding: 4px 26px 0; font: 600 13px var(--f-sys); font-variant-numeric: tabular-nums; }
.ph-status .ph-sb { display: flex; gap: 5px; align-items: center; }
.ph-status .ph-sig { width: 17px; height: 11px; }
.ph-status .ph-bat { width: 25px; height: 12px; }
.ph-status--light { color: #FFFFFF; }
.ph-pad { position: relative; z-index: 2; padding: 4px 16px 0; display: grid; gap: 10px; }
.ph-card { background: var(--p-card); border: 1px solid var(--p-line); border-radius: 20px; }
.ph-tabbar { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 76px; padding: 10px 38px 0; display: flex; justify-content: space-between; background: color-mix(in srgb, var(--p-bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--p-line); }
.ph-tab { display: grid; justify-items: center; align-content: start; gap: 4px; width: 60px; font: 500 10.5px var(--f-sans); color: var(--p-fg2); }
.ph-tab svg { width: 22px; height: 22px; }
.ph-tab.on { color: var(--p-fg); }
.ph-tab.on::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--p-cobalt); }
.ph-home { position: absolute; z-index: 7; bottom: 8px; left: 50%; transform: translateX(-50%); width: 112px; height: 4.5px; border-radius: 3px; background: currentColor; opacity: .85; }

/* Boutons de l'appli */
.ph-btn { position: relative; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 20px 0 7px; border-radius: 999px; font: 650 15.5px var(--f-sans); white-space: nowrap; }
.ph-btn i { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-style: normal; }
.ph-btn i svg { width: 22px; height: 22px; }
.ph-btn em { margin-left: auto; font-style: normal; }
.ph-btn--cobalt { background: var(--p-cobalt); color: #FFFFFF; box-shadow: 0 12px 24px -12px rgba(51, 85, 255, .8); }
.ph-btn--cobalt i { background: #FFFFFF; color: var(--p-cobalt); }
.ph-btn--cobalt em { color: rgba(255, 255, 255, .72); }
.ph-btn--white { background: #FFFFFF; color: var(--p-ink); }
.ph-btn--white i { background: var(--p-ink); color: #FFFFFF; }
.ph-btn--white em { color: var(--p-ink2); }
.phone[data-interactif] [data-ph-tap] { cursor: pointer; transition: transform .18s; }
.phone[data-interactif] [data-ph-tap]:active { transform: scale(.97); }
.phone[data-interactif] [data-ph-tap] i { animation: ph-invite 2.4s cubic-bezier(.22, .8, .24, 1) infinite; }
@keyframes ph-invite { 0%, 60%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); } 30% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); } }

/* Segments */
.ph-seg { display: grid; grid-template-columns: repeat(var(--n, 10), 1fr); gap: 2px; height: 6px; }
.ph-seg i { border-radius: 1.5px; background: var(--p-line2); transition: background-color .4s; }
.ph-seg i.on { background: var(--p-fg); }
.ph-seg.c i.on { background: var(--p-cobalt); }

/* 1. Bienvenue */
.ph-welcome .ph-photo { position: absolute; inset: 0 0 auto; height: 300px; width: 100%; object-fit: cover; object-position: 50% 62%; }
.ph-welcome .ph-scrim { position: absolute; inset: 0 0 auto; height: 302px; background: linear-gradient(180deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 28%, rgba(238, 237, 233, 0) 70%, #EEEDE9 99%); }
.ph-wel { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 0 20px 26px; display: grid; gap: 14px; }
.ph-wel-t { font-size: 35px; }
.ph-wel-t span { color: var(--p-cobalt); }
.ph-wel-p { font-size: 14px; line-height: 1.45; color: var(--p-ink2); }
.ph-alt { justify-self: center; font: 500 13px var(--f-sans); color: var(--p-ink2); text-decoration: underline; text-underline-offset: 3px; }

/* 2. Accueil */
.ph-hd { display: flex; justify-content: space-between; align-items: end; padding-top: 4px; }
.ph-hd > div { display: grid; gap: 5px; }
.ph-hd-t { font-size: 32px; }
.ph-streak { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--p-card); border: 1px solid var(--p-line); }
.ph-streak svg { width: 14px; height: 14px; color: var(--p-cobalt); }
.ph-streak b { font-size: 19px; }
.ph-hero { position: relative; height: 196px; border-radius: 26px; overflow: hidden; background: #ECEBE6; }
.ph-hero img { position: absolute; right: -112px; bottom: -122px; width: 320px; height: 320px; object-fit: cover; object-position: 50% 50%; -webkit-mask-image: radial-gradient(closest-side, #000 64%, transparent 100%); mask-image: radial-gradient(closest-side, #000 64%, transparent 100%); }
.ph-hero-txt { position: relative; padding: 14px 16px; display: grid; gap: 8px; justify-items: start; }
.ph-state { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .75); color: var(--p-ink); }
.ph-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2DBE6C; box-shadow: 0 0 0 3px rgba(45, 190, 108, .2); }
.ph-hero-t { font-size: 48px; margin-top: 2px; }
.ph-stats3 { display: grid; grid-template-columns: repeat(3, 1fr); padding: 12px 0; }
.ph-stats3 > div { display: grid; gap: 6px; padding: 0 12px; }
.ph-stats3 > div + div { border-left: 1px solid var(--p-line); }
.ph-stats3 b { font-size: 26px; line-height: 1; }
.ph-chips { display: flex; gap: 7px; }
.ph-chip { padding: 10px 14px; border-radius: 999px; background: var(--p-card); border: 1px solid var(--p-line); font: 550 13px/1 var(--f-sans); white-space: nowrap; }
.ph-chip.on { background: var(--p-ink); color: #FFFFFF; border-color: transparent; }
.ph-chip.add { color: var(--p-fg2); }

/* 3. Sieste */
.ph-aurora { position: absolute; inset: -40px -40px auto; height: 360px; background: radial-gradient(55% 45% at 28% 18%, rgba(51, 85, 255, .55), rgba(51, 85, 255, 0) 70%), radial-gradient(50% 40% at 82% 10%, rgba(123, 92, 255, .5), rgba(123, 92, 255, 0) 70%); filter: blur(10px); animation: ph-breathe 9s ease-in-out infinite; }
@keyframes ph-breathe { 50% { opacity: .78; transform: translateY(8px) scale(1.04); } }
.ph-nap { justify-items: center; text-align: center; }
.ph-nap-top { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.ph-chip-mode { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--p-fg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ph-chip-mode::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--p-ice); }
.ph-rbtn { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.ph-rbtn svg { width: 17px; height: 17px; }
.ph-dial { position: relative; width: 240px; height: 240px; display: grid; place-items: center; margin-top: 2px; }
.ph-ring { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(51, 85, 255, .55)); }
.ph-ring .ph-head { animation: ph-head 2.2s ease-in-out infinite; }
@keyframes ph-head { 50% { opacity: .55; } }
.ph-dial-in { position: relative; display: grid; justify-items: center; gap: 6px; }
.ph-timer { font-size: 74px; line-height: .85; }
.ph-line3 { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); padding: 12px 0; border-block: 1px solid var(--p-line); }
.ph-line3 > div { display: grid; gap: 6px; }
.ph-line3 > div + div { border-left: 1px solid var(--p-line); }
.ph-line3 b { font-size: 22px; line-height: 1; }
.ph-nap .ph-btn { width: 100%; margin-top: 6px; }
.ph-note { font-size: 12px; color: var(--p-fg2); }

/* 4. Écran verrouillé */
.ph-lock { color: #FFFFFF; background: radial-gradient(90% 55% at 20% 100%, rgba(51, 85, 255, .45), rgba(51, 85, 255, 0) 70%), radial-gradient(70% 45% at 100% 70%, rgba(123, 92, 255, .35), rgba(123, 92, 255, 0) 70%), linear-gradient(180deg, #0B0C14, #07070B); }
.ph-lock-head { position: relative; z-index: 2; display: grid; justify-items: center; gap: 2px; margin-top: 8px; color: #FFFFFF; }
.ph-lock-date { font: 600 16px var(--f-sys); opacity: .9; }
.ph-lock-time { font: 700 92px/1 var(--f-sys); letter-spacing: -.03em; opacity: .95; font-variant-numeric: tabular-nums; }
.ph-lock-widgets { display: flex; gap: 12px; margin-top: 8px; }
.ph-acc { position: relative; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; }
.ph-acc svg { position: absolute; inset: 5px; width: 40px; height: 40px; transform: rotate(-90deg); }
.ph-acc b { font: 650 13px var(--f-sys); font-variant-numeric: tabular-nums; }
.ph-acc b small { font-size: 9px; }
.ph-la { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 104px; padding: 14px; border-radius: 26px; background: rgba(22, 22, 30, .72); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); color: #FFFFFF; display: grid; gap: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
.ph-la-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.ph-thumb { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: #000000; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.9); }
.ph-la-row > div { display: grid; gap: 4px; }
.ph-la-row b { font: 650 16px var(--f-sans); }
.ph-la-row strong { font-size: 40px; line-height: .9; }
.ph-la .ph-seg { height: 7px; }
.ph-la .ph-seg i { background: rgba(255, 255, 255, .14); }
.ph-la .ph-seg i.on { background: var(--p-cobalt); }
.ph-la-foot { display: flex; justify-content: space-between; }
.ph-la .ph-mono { color: rgba(255, 255, 255, .62); }
.ph-lock-btns { position: absolute; z-index: 2; left: 44px; right: 44px; bottom: 36px; display: flex; justify-content: space-between; }
.ph-lock-btns span { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; color: #FFFFFF; }
.ph-lock-btns svg { width: 20px; height: 20px; }

/* 5. Blocage (forme Apple : fond uni, icône, titre, texte, bouton, police système) */
.ph-shield { background: #000000; color: #F3F3F6; }
.ph-sh-body { position: absolute; inset: 44px 22px 30px; display: grid; grid-template-rows: 1fr auto; gap: 16px; color: #F3F3F6; }
.ph-sh-mid { display: grid; justify-items: center; align-content: center; gap: 12px; text-align: center; }
.ph-sh-mid img { width: 210px; height: 210px; margin-block: -30px -24px; object-fit: cover; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.ph-sh-t { margin-top: 6px; font: 600 23px/1.2 var(--f-sys); }
.ph-sh-p { font: 400 15px/1.4 var(--f-sys); color: #8D8D99; max-width: 230px; }
.ph-sh-btn { height: 50px; border-radius: 14px; background: var(--p-cobalt); color: #FFFFFF; display: grid; place-items: center; font: 600 16px var(--f-sys); }

/* 6. Ta semaine */
.ph-nav { display: flex; justify-content: space-between; align-items: center; }
.ph-back { display: inline-flex; align-items: center; gap: 1px; margin-left: -6px; font: 550 15px var(--f-sans); color: var(--p-cobalt); }
.ph-back svg { width: 20px; height: 20px; }
.ph-tog { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--p-card); border: 1px solid var(--p-line); font: 550 12px var(--f-sans); }
.ph-tog > * { padding: 6px 11px; border-radius: 999px; }
.ph-tog b { background: var(--p-ink); color: #FFFFFF; font-weight: 550; }
.ph-total { display: flex; align-items: center; gap: 10px; }
.ph-tot { font-size: 66px; line-height: .9; }
.ph-delta { padding: 5px 8px; border-radius: 6px; background: rgba(51, 85, 255, .12); color: var(--p-cobalt); font-weight: 550; }
.ph-sub { font-size: 12.5px; color: var(--p-fg2); margin-top: -4px; }
.ph-chart { padding: 14px 14px 10px; display: grid; gap: 8px; }
.ph-chart-top { display: flex; justify-content: space-between; }
.ph-matrix { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.ph-col { display: grid; gap: 7px; justify-items: center; }
.ph-col .ph-blocks { width: 100%; display: grid; grid-template-rows: repeat(10, 7px); gap: 2px; }
.ph-col .ph-blocks i { border-radius: 2px; background: var(--p-line); }
.ph-col .ph-blocks i.on { background: var(--p-ink); }
.ph-col.today .ph-blocks i.on { background: var(--p-cobalt); }
.ph-col.today .ph-mono { color: var(--p-ink); font-weight: 600; }
.ph-bento { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph-tile { padding: 12px; display: grid; gap: 8px; }
.ph-tile b { font-size: 30px; line-height: .9; }
.ph-tile.wide { grid-column: 1 / -1; }
.ph-heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; }
.ph-heat i { aspect-ratio: 1; border-radius: 3px; background: var(--p-line); }
.ph-heat i.l1 { background: rgba(51, 85, 255, .25); }
.ph-heat i.l2 { background: rgba(51, 85, 255, .55); }
.ph-heat i.l3 { background: var(--p-cobalt); }

/* 7. Applis d'un mode */
.ph-mode-head { display: grid; gap: 5px; padding-top: 2px; }
.ph-seltabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: var(--p-card); border: 1px solid var(--p-line); font: 550 12.5px var(--f-sans); text-align: center; }
.ph-seltabs > * { padding: 8px 0; border-radius: 999px; color: var(--p-fg2); }
.ph-seltabs b { background: var(--p-ink); color: #FFFFFF; font-weight: 550; }
.ph-apps { padding: 4px 14px; }
.ph-apps-head { display: flex; justify-content: space-between; padding: 10px 0 8px; border-bottom: 1px solid var(--p-line); }
.ph-app { display: grid; grid-template-columns: 30px 1fr 22px; gap: 12px; align-items: center; height: 44px; border-bottom: 1px solid var(--p-line); font: 550 14px var(--f-sans); }
.ph-app:last-child { border-bottom: 0; }
.ph-app-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--ic, #2A2A31); color: var(--ic-fg, #FFFFFF); font: 700 13px/1 var(--f-sans); font-style: normal; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .12); }
.ph-tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--p-line2); display: grid; place-items: center; }
.ph-tick.on { background: var(--p-cobalt); border-color: var(--p-cobalt); }
.ph-tick.on::after { content: ""; width: 11px; height: 11px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.ph-app.off { color: var(--p-fg2); }
.ph-bottom { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 30px 16px 26px; background: linear-gradient(180deg, rgba(238, 237, 233, 0), #EEEDE9 34%); }

/* Onde NFC au toucher (mode interactif) */
.ph-wave { position: absolute; z-index: 8; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(51, 85, 255, .8); pointer-events: none; animation: ph-wave .7s cubic-bezier(.22, .8, .24, 1) forwards; }
@keyframes ph-wave { from { transform: scale(.2); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ph-aurora, .ph-ring .ph-head, .phone[data-interactif] [data-ph-tap] i { animation: none; }
}
