/* Download page. Builds on style.css and home.css (hero, reveals, kicker). The install demo is decorative and loops;
   style.css's prefers-reduced-motion rule stops it, and the finished state shows instead (see the bottom of this file). */

.dl-hero { padding-bottom: clamp(4rem, 8vw, 6rem); }
.dl-hero .kicker { color: var(--sage); }
.dl-hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.dl-main { margin-top: 0.25rem; }
.dl-go { font-size: 1.08rem; min-height: 56px; padding: 0.85rem 1.6rem; gap: 0.65rem; box-shadow: 0 18px 40px -18px rgba(173, 204, 194, 0.55); }
.dl-go .dl-arrow { width: 20px; height: 20px; flex: none; }
.dl-go:hover .dl-arrow { animation: nudge 0.6s ease; }
@keyframes nudge { 50% { transform: translateY(3px); } }
.dl-note { margin: 0.9rem 0 0; color: var(--sage); font-size: 0.95rem; max-width: 34rem; }
.dl-facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 1.5rem 0 0; font-size: 0.88rem; color: var(--sage); }
.dl-facts span { display: inline-flex; align-items: center; gap: 0.5rem; }
.dl-facts span + span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--green); margin-right: 0.75rem; }
.dl-facts a { color: var(--paper); }

/* The install demo: download fills, steps tick off, then the workspace is ready. One 9s loop. */
.install { position: relative; background: var(--paper); color: var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06); }
.win-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.75rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); font-size: 0.8rem; font-weight: 750; color: var(--muted); }
.win-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.win-bar i:first-child { background: #e0a497; } .win-bar i:nth-child(2) { background: #e6cf93; } .win-bar i:nth-child(3) { background: var(--sage); }
.win-bar span { margin-left: 0.6rem; }
.ins-steps { padding: 0.6rem 1.25rem 1.1rem; }
.ins-step { display: grid; grid-template-columns: 30px minmax(0, 1fr) 26px; gap: 0.85rem; align-items: center; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.ins-step:first-child { border-top: 0; }
.ins-step .n { width: 30px; height: 30px; border-radius: 9px; background: var(--card); color: var(--green); font-weight: 800; font-size: 0.85rem; display: grid; place-items: center; }
.ins-step b { display: block; font-size: 0.98rem; }
.ins-step small { display: block; color: var(--muted); font-size: 0.82rem; }
.ins-step .dbar { display: block; height: 7px; border-radius: 999px; background: var(--card); margin-top: 0.45rem; overflow: hidden; }
.ins-step .dbar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--sage)); transform-origin: left; animation: dl-fill 9s ease-in-out infinite; }
.ins-step .ok { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-size: 0.8rem; font-weight: 800; display: grid; place-items: center; transform: scale(0); }
.s1 .ok { animation: dl-pop1 9s ease infinite; }
.s2 .ok { animation: dl-pop2 9s ease infinite; }
.s3 .ok { animation: dl-pop3 9s ease infinite; }
.s2 { animation: dl-dim2 9s ease infinite; }
.s3 { animation: dl-dim3 9s ease infinite; }
.ready { display: flex; align-items: center; gap: 0.85rem; margin: 0 1.25rem 1.25rem; padding: 0.95rem 1rem; border-radius: 16px; background: var(--teal); color: var(--paper); opacity: 0; transform: translateY(10px); animation: dl-ready 9s ease infinite; }
.ready .mk { width: 34px; height: 34px; border-radius: 10px; background: var(--sage); color: var(--teal); font-weight: 800; display: grid; place-items: center; flex: none; }
.ready b { display: block; font-size: 0.98rem; }
.ready small { display: block; color: var(--sage); font-size: 0.84rem; }

@keyframes dl-fill { 0% { transform: scaleX(0); } 30%, 100% { transform: scaleX(1); } }
@keyframes dl-pop1 { 0%, 31% { transform: scale(0); } 35%, 95% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes dl-pop2 { 0%, 45% { transform: scale(0); } 49%, 95% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes dl-pop3 { 0%, 59% { transform: scale(0); } 63%, 95% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes dl-dim2 { 0%, 32% { opacity: 0.45; } 36%, 100% { opacity: 1; } }
@keyframes dl-dim3 { 0%, 46% { opacity: 0.45; } 50%, 100% { opacity: 1; } }
@keyframes dl-ready { 0%, 64% { opacity: 0; transform: translateY(10px); } 70%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(10px); } }

/* Reduced motion: show the finished install, standing still. */
@media (prefers-reduced-motion: reduce) {
  .ins-step .dbar i, .ins-step .ok, .ready { transform: none; opacity: 1; }
}

/* All downloads */
.dl-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(2rem, 4vw, 2.75rem); }
.dl-card { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 1rem; padding: 1.4rem 1.3rem 1.2rem; border-radius: 20px; background: var(--card); color: var(--ink); text-decoration: none; border: 1.5px solid transparent; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.7s ease; }
.dl-card:hover, .js .dl-card.rv.in:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -28px rgba(17,22,20,.55); border-color: var(--sage); }
.dl-card .os { width: 46px; height: 46px; border-radius: 13px; background: var(--paper); color: var(--green); display: grid; place-items: center; }
.dl-card .os svg { width: 24px; height: 24px; }
.dl-card b { display: block; font-size: 1.08rem; }
.dl-card small { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.dl-card .meta { display: flex; justify-content: space-between; align-items: center; padding-top: 0.85rem; border-top: 1px solid var(--line); font-size: 0.85rem; }
.dl-card .ver { color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-card .get { font-weight: 750; color: var(--green); }
.dl-card .here { position: absolute; top: 1.1rem; right: 1.1rem; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; background: var(--gold); color: var(--teal); border-radius: 999px; padding: 0.25rem 0.6rem; display: none; }
.dl-card.match { background: var(--teal); color: var(--paper); }
.dl-card.match .here { display: block; }
.dl-card.match .os { background: rgba(247,247,245,.1); color: var(--sage); }
.dl-card.match small, .dl-card.match .ver { color: var(--sage); }
.dl-card.match .get { color: var(--paper); }
.dl-card.match .meta { border-top-color: var(--on-dark-line); }

/* Installing */
.dl-how { background: var(--card); }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: clamp(2rem, 4vw, 2.75rem); align-items: start; }
.how { background: var(--paper); border-radius: 22px; padding: 1.5rem; }
.how .os { width: 44px; height: 44px; border-radius: 12px; background: var(--card); color: var(--green); display: grid; place-items: center; margin-bottom: 1rem; }
.how .os svg { width: 22px; height: 22px; }
.how h3 { font-size: 1.3rem; }
.how .tag { display: inline-block; margin: 0.5rem 0 0.25rem; font-size: 0.78rem; font-weight: 750; border-radius: 999px; padding: 0.25rem 0.65rem; background: #f0e3c9; color: #6b5223; }
.how .tag.good { background: #d6e6df; color: var(--green); }
.how .why { color: var(--muted); font-size: 0.93rem; margin: 0.6rem 0 0; }
.how ol { list-style: none; counter-reset: s; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.how li { counter-increment: s; position: relative; padding-left: 2.3rem; min-height: 26px; font-size: 0.96rem; line-height: 1.55; }
.how li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: var(--paper); font-size: 0.78rem; font-weight: 800; display: grid; place-items: center; }
.how code { font-size: 0.85em; background: var(--card); border-radius: 6px; padding: 0.05rem 0.35rem; overflow-wrap: anywhere; }

/* Help */
.dl-help .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 2rem; align-items: end; }

@media (max-width: 1000px) { .dl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .how-grid { grid-template-columns: minmax(0, 1fr); }
  .dl-help .wrap { grid-template-columns: minmax(0, 1fr); align-items: start; }
}
@media (max-width: 560px) { .dl-cards { grid-template-columns: minmax(0, 1fr); } .dl-go { width: 100%; justify-content: center; } }
@media (max-width: 560px) { .dl-facts { flex-direction: column; gap: 0.35rem; } .dl-facts span + span::before { display: none; } }

/* Phones: the steps for this browser (from app-install.js), in the hero. */
.ph-guide[hidden], .ph-alt[hidden], .ph-steps[hidden] { display: none; }
.ph-guide .dl-note { margin-top: 1.1rem; color: var(--paper); font-weight: 650; }
.ph-steps { list-style: none; counter-reset: p; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.75rem; max-width: 34rem; }
.ph-steps li { counter-increment: p; position: relative; padding-left: 2.4rem; color: var(--sage); line-height: 1.5; animation: ph-rise 0.5s cubic-bezier(.2,.7,.2,1) both; }
.ph-steps li:nth-child(2) { animation-delay: 0.25s; } .ph-steps li:nth-child(3) { animation-delay: 0.5s; } .ph-steps li:nth-child(4) { animation-delay: 0.75s; } .ph-steps li:nth-child(5) { animation-delay: 1s; }
.ph-steps li::before { content: counter(p); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--teal); font-size: 0.8rem; font-weight: 800; display: grid; place-items: center; }
.ph-steps strong { color: var(--paper); }
.ph-steps li.after { color: var(--paper); font-weight: 650; }
.ph-steps li.after::before { content: none; }
.ph-row { display: flex; align-items: center; justify-content: space-between; margin-top: 0.55rem; padding: 0.6rem 0.85rem; border-radius: 12px; background: var(--paper); color: var(--teal); font-weight: 650; box-shadow: 0 0 0 3px var(--gold); }
.ph-row svg { width: 20px; height: 20px; }
.ph-alt { margin: 0.9rem 0 0; font-size: 0.88rem; color: var(--sage); max-width: 34rem; }
@keyframes ph-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ph-steps li { animation: none; } }

/* The phone card in "Installing": the QR code for people reading this on a computer. */
.how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.how.phone { background: var(--teal); color: var(--paper); }
.how.phone .os { background: rgba(247,247,245,.1); color: var(--sage); }
.how.phone .why, .how.phone li { color: var(--sage); }
.how.phone a { color: var(--paper); }
.how.phone li::before { background: var(--gold); color: var(--teal); }
.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; }
.qr-wrap { display: block; width: 140px; padding: 8px; border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 4px rgba(201,168,106,.5); }
.qr-wrap .qr { display: block; width: 100%; height: auto; }
.on-phone .qr-wrap { display: none; }
.on-phone .phone-row { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .how-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .phone-row { grid-template-columns: minmax(0, 1fr); } .qr-wrap { width: 160px; } }
.on-phone .dl-facts span:nth-child(-n+2) { display: none; }
