/* /download/ page. Own classes are dl-; everything shared comes from /b2.css. */

/* Hero: a warm sunrise wash of slow light pools */
:root {
  --dl-spring: cubic-bezier(.22, 1.35, .36, 1);
  --dl-berry: var(--b2-light-berry, #F6C1D3);
  --dl-peach: var(--b2-light-peach, #FBD9C2);
  --dl-gold: var(--b2-light-gold, #F6E2A8);
  --dl-blue: var(--b2-light-blue, #CFD6F7);
  --dl-mint: var(--b2-light-mint, #C9EBD9);
}
.dl-hero { position: relative; isolation: isolate; overflow-x: clip; margin-bottom: clamp(24px, 4vw, 48px); }
.dl-hero::before, .dl-hero::after { content: ""; position: absolute; z-index: -1; inset: -10% 0 -50%; pointer-events: none; }
.dl-hero::before {
  background:
    radial-gradient(28% 34% at 80% 42%, var(--dl-berry), transparent 70%),
    radial-gradient(26% 32% at 10% 40%, var(--dl-gold), transparent 70%),
    radial-gradient(30% 22% at 46% 62%, var(--dl-peach), transparent 70%);
  opacity: .9; animation: dl-drift-a 28s ease-in-out infinite alternate;
}
.dl-hero::after { background: radial-gradient(18% 20% at 94% 58%, var(--dl-blue), transparent 70%); animation: dl-drift-b 34s ease-in-out infinite alternate; }
.dl-hero:not(.is-live)::before, .dl-hero:not(.is-live)::after { animation-play-state: paused; }
@keyframes dl-drift-a { to { transform: translate(4%, 6%) scale(1.08); } }
@keyframes dl-drift-b { to { transform: translate(-8%, -6%) scale(1.12); } }
.dl-hero__in { padding-block: clamp(56px, 10vw, 128px) clamp(40px, 7vw, 88px); display: grid; gap: 20px; }
.dl-u { display: inline-block; }
.dl-hero.is-run .dl-u { opacity: 0; transform: translateY(.45em); }
.dl-hero.is-run.is-in .dl-u { opacity: 1; transform: none; transition: opacity .6s var(--b2-ease) calc(var(--i) * 55ms), transform .7s var(--b2-ease) calc(var(--i) * 55ms); }

/* Ways */
.dl-ways { position: relative; z-index: 1; display: grid; gap: 20px; }
.dl-way {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px;
  padding: clamp(24px, 4vw, 48px); border-radius: var(--b2-radius-l);
}
@media (min-width: 820px) {
  .dl-way { grid-template-columns: 300px minmax(0, 1fr); gap: 56px; align-items: center; }
}
.dl-copy { display: grid; gap: 14px; justify-items: start; min-width: 0; }
.dl-title { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.12; letter-spacing: -.025em; }
.dl-text { margin: 0; color: var(--b2-ink-2); font-size: 1.05rem; line-height: 1.6; max-width: 34em; text-wrap: pretty; }
.dl-text a { color: var(--b2-berry-ink); text-underline-offset: 3px; }
.dl-copy .b2-btn { margin-top: 6px; white-space: normal; text-align: center; }

/* Device scenes: built from DOM, decorative, each plays a short loop while on screen (download.mjs) */
.dl-art {
  position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center;
  min-height: 236px; padding: 24px 20px; border-radius: var(--b2-radius);
  background: #FCF4EE; box-shadow: inset 0 1px 0 #fff;
}
.dl-art::before { content: ""; position: absolute; z-index: -1; inset: 0; }
.dl-art--web::before { background: radial-gradient(60% 60% at 85% 10%, var(--dl-berry), transparent 70%), radial-gradient(60% 55% at 10% 90%, var(--dl-gold), transparent 70%); }
.dl-art--install::before { background: radial-gradient(60% 60% at 15% 15%, var(--dl-blue), transparent 70%), radial-gradient(60% 55% at 90% 90%, var(--dl-peach), transparent 70%); }
.dl-art--wa::before { background: radial-gradient(60% 60% at 80% 85%, var(--dl-mint), transparent 70%), radial-gradient(55% 55% at 15% 15%, var(--dl-gold), transparent 70%); }

.dl-browser { width: min(250px, 100%); border-radius: 14px; background: #fff; box-shadow: 0 2px 6px rgb(27 26 31 / .05), 0 22px 40px -18px rgb(120 40 70 / .3); overflow: hidden; }
.dl-browser__bar { display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-bottom: 1px solid var(--b2-line); background: #FBF8F4; }
.dl-browser__bar i { width: 7px; height: 7px; border-radius: 50%; background: #F2A7A0; }
.dl-browser__bar i:nth-child(2) { background: #F3D38A; }
.dl-browser__bar i:nth-child(3) { background: #A8D8B6; }
.dl-url { margin-left: 8px; flex: 1; padding: 3px 8px; border-radius: 6px; background: #fff; border: 1px solid var(--b2-line); font: 500 .625rem/1 var(--b2-body); color: var(--b2-ink-2); }
.dl-chat { display: grid; gap: 10px; padding: 14px 12px 16px; min-height: 150px; align-content: start; }
.dl-b { margin: 0; font-size: .75rem; line-height: 1.45; }
.dl-b--me { justify-self: end; max-width: 88%; padding: 8px 11px; border-radius: 13px 13px 4px 13px; background: var(--b2-ink); color: #FAF7F2; }
.dl-b--berri { display: flex; align-items: flex-end; gap: 6px; max-width: 94%; }
.dl-b--berri img { flex: none; width: 22px; height: 22px; border-radius: 6px; }
.dl-b--berri p { margin: 0; padding: 8px 11px; border-radius: 13px 13px 13px 4px; background: #FBEFE6; }

.dl-home { display: grid; justify-items: center; width: 150px; height: 214px; padding: 22px 14px 10px; border-radius: 26px; border: 5px solid var(--b2-ink); background: linear-gradient(170deg, #FDE6D6, #F4D6E4 55%, #DCE0FA); box-shadow: 0 24px 40px -18px rgb(60 40 90 / .4); }
.dl-home__grid { display: grid; grid-template-columns: repeat(4, 24px); gap: 12px 8px; align-content: start; }
.dl-t { width: 24px; height: 24px; border-radius: 7px; background: rgb(255 255 255 / .75); }
.dl-t--2 { background: #F6E2A8; } .dl-t--4 { background: #CFD6F7; } .dl-t--5 { background: #C9EBD9; } .dl-t--7 { background: #FBD9C2; }
.dl-app { position: relative; display: grid; justify-items: center; gap: 3px; }
.dl-app img { width: 24px; height: 24px; border-radius: 7px; box-shadow: 0 4px 10px -3px rgb(206 36 96 / .6); }
.dl-app b { position: absolute; top: 26px; font: 600 .5rem/1 var(--b2-body); color: var(--b2-ink); white-space: nowrap; }
.dl-home__dock { display: flex; gap: 8px; margin-top: auto; padding: 6px 8px; border-radius: 12px; background: rgb(255 255 255 / .55); }
.dl-home__dock i { width: 20px; height: 20px; border-radius: 6px; background: rgb(255 255 255 / .9); }
.dl-home { display: flex; flex-direction: column; align-items: center; }

.dl-wa { width: min(220px, 100%); border-radius: 18px; overflow: hidden; background: #F6EFE4; box-shadow: 0 2px 6px rgb(27 26 31 / .05), 0 22px 40px -18px rgb(30 90 60 / .32); }
.dl-wa__top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; font: 700 .8125rem/1 var(--b2-display); border-bottom: 1px solid var(--b2-line); }
.dl-wa__top img { width: 26px; height: 26px; border-radius: 50%; }
.dl-wa__body { display: grid; gap: 8px; padding: 14px 10px 16px; min-height: 140px; align-content: start; }
.dl-m { margin: 0; max-width: 86%; padding: 7px 10px; font-size: .75rem; line-height: 1.45; border-radius: 10px; box-shadow: 0 1px 1px rgb(27 26 31 / .06); }
.dl-m--me { justify-self: end; background: #FBE3EC; border-radius: 10px 10px 3px 10px; }
.dl-m--berri { background: #fff; border-radius: 10px 10px 10px 3px; }
.dl-ticks { display: inline-block; width: 16px; height: 11px; margin-left: 6px; vertical-align: -1px; fill: none; stroke: #2F7DD6; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* scene beats: .is-run hides the parts, .is-s1 / .is-s2 / .is-s3 bring them in */
.dl-k1, .dl-k2, .dl-k3 { transition: opacity .35s var(--b2-ease), transform .35s var(--b2-ease); }
.is-run .dl-k1, .is-run .dl-k2, .is-run .dl-k3 { opacity: 0; transform: translateY(8px) scale(.96); }
.is-run.is-s1 .dl-k1, .is-run.is-s2 .dl-k2, .is-run.is-s3 .dl-k3 { opacity: 1; transform: none; transition: opacity .4s var(--b2-ease), transform .6s var(--dl-spring); }
.is-run .dl-app.dl-k1 { transform: translateY(-120px) scale(1.3); }
.is-run.is-s1 .dl-app.dl-k1 { transform: none; transition: opacity .25s, transform .9s var(--dl-spring); }
.dl-u { transition: opacity .2s; }
.dl-u-w { white-space: nowrap; }
.is-run .dl-u { opacity: 0; }
.is-run.is-s1 .dl-k1 .dl-u { opacity: 1; transition: opacity .05s linear calc(var(--i) * 40ms + .3s); }
.is-run.is-s2 .dl-k2 .dl-u { opacity: 1; transition: opacity .3s var(--b2-ease) calc(var(--i) * 80ms + .2s); }

/* reveal as each option scrolls into view (only when download.mjs runs) */
.dl-reveal .dl-art, .dl-reveal .dl-copy > * { opacity: 0; transform: translateY(22px); }
.dl-reveal.is-in .dl-art, .dl-reveal.is-in .dl-copy > * { opacity: 1; transform: none; transition: opacity .7s var(--b2-ease), transform .8s var(--b2-ease); }
.dl-reveal.is-in .dl-copy > :nth-child(1) { transition-delay: .12s; }
.dl-reveal.is-in .dl-copy > :nth-child(2) { transition-delay: .2s; }
.dl-reveal.is-in .dl-copy > :nth-child(n+3) { transition-delay: .28s; }

/* Install control and steps */
.dl-install:has(> :not([hidden])) { margin-top: 6px; }
.dl-done { margin: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--b2-ok); }
.dl-done::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dl-steps { display: grid; width: 100%; margin-top: 4px; border-top: 1px solid var(--b2-line); }
.dl-step { border-bottom: 1px solid var(--b2-line); }
.dl-step summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; cursor: pointer; list-style: none; font-weight: 600;
}
.dl-step summary::-webkit-details-marker { display: none; }
.dl-step summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 1.5px solid var(--b2-ink-2); border-bottom: 1.5px solid var(--b2-ink-2);
  transform: rotate(45deg); transition: transform .3s var(--b2-ease);
}
.dl-step[open] summary::after { transform: rotate(225deg); }
.dl-step p { margin: 0 0 18px; color: var(--b2-ink-2); max-width: 36em; }

/* On the way */
.dl-soon { margin-top: clamp(56px, 8vw, 96px); display: grid; gap: 14px; }
.dl-soon__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--b2-ink-2); font-size: 1.05rem; }

/* Device note */
.dl-note { margin-top: clamp(48px, 7vw, 80px); display: grid; gap: 16px; }
.dl-note .b2-hair { margin-bottom: 24px; }

@media (prefers-reduced-motion: reduce) {
  .dl-step summary::after { transition: none; }
  .dl-hero::before, .dl-hero::after { animation: none; }
}

/* Platform steps: the detected one is first, open and tagged. */
.dl-step summary { gap: 10px; }
.dl-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px; background: var(--b2-berry-soft); color: var(--b2-berry-ink); font: 600 .72rem/1 var(--b2-body); }
.dl-step ol { margin: 0 0 18px; padding-left: 1.2em; color: var(--b2-ink-2); display: grid; gap: 6px; max-width: 36em; }
.dl-macapp { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 18px; padding: 14px 16px; border: 1px dashed var(--b2-line-strong); border-radius: 14px; }
.dl-macapp b { font: 650 1rem/1.2 var(--b2-display); }
.dl-macapp__state { font-size: .875rem; color: var(--b2-ink-2); }

/* Room above the shared footer (the footer carries no top margin of its own). */
body > main#main { padding-bottom: clamp(64px, 9vw, 112px); }
