/* M4 Eternal — the download page (web/download.html): a tall hero on a loading screen of the client, the two files (Windows PC and
   Android) as framed cards over their own key art, the questions and a last call to create an account. Everything reads without
   JavaScript; download.js only formats the sizes, puts the visitor's platform first and adds the copy buttons. */

/* ---------- hero ---------- */
.dl-hero { min-height: clamp(340px, 34vw, 500px); padding-bottom: var(--sp-12); }
.dl-hero .page-head__art .art-pic, .dl-hero .page-head__art img { display: block; width: 100%; height: 100%; }
.dl-hero .page-head__art img { --focus: 50% 40%; }
.dl-hero h1 { font-size: clamp(42px, 6.4vw, 88px); }
.dl-hero .lede { max-width: 620px; font-size: var(--fs-md); }
.dl-hero__body > * { animation: rise var(--dur-3) var(--ease-out) both; }
.dl-hero__body > :nth-child(2) { animation-delay: 0.06s; }
.dl-hero__body > :nth-child(3) { animation-delay: 0.12s; }
.dl-hero__body > :nth-child(4) { animation-delay: 0.18s; }
.dl-hero__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-5) 0 0; padding: 0; list-style: none; }
.dl-hero__chips .chip { background: rgba(11, 10, 16, 0.6); backdrop-filter: blur(6px); }
.dl-hero__chips .chip--gold { background: rgba(32, 22, 52, 0.72); }

/* ---------- the two cards ---------- */
.dl-page { padding-top: var(--sp-10); }
.dl-ios { margin-bottom: var(--sp-6); }
/* Both cards share seven row tracks (art, head, button, meta, requirements, checksum, steps) through subgrid, so every block starts
   at the same height in the two cards and both end together. The badge sits out of the flow, so it moves nothing. */
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); align-items: stretch; }
.dl-card {
  --pad: var(--sp-8);
  display: grid; gap: var(--sp-6); align-content: start; isolation: isolate;
  box-shadow: var(--sh-2);
  transition: border-color var(--dur-2), box-shadow var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
  animation: rise var(--dur-3) var(--ease-out) both;
}
.dl-grid > .dl-card:nth-child(2) { animation-delay: 0.1s; }
@supports (grid-template-rows: subgrid) {
  .dl-grid { grid-template-rows: repeat(7, auto); }
  .dl-card { grid-row: span 7; grid-template-rows: subgrid; row-gap: var(--sp-6); }
}
.dl-card:hover { border-color: var(--gold-line); box-shadow: var(--sh-2), var(--glow-gold); }
.dl-card--pick { border-color: var(--gold-line); box-shadow: var(--sh-2), var(--glow-gold); }

/* The card's key art: a band across the top that fades into the panel. */
.dl-card__art { position: relative; margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) calc(-1 * var(--sp-16)); height: clamp(170px, 17vw, 230px); overflow: hidden; z-index: -1; }
.dl-card__art .art-pic, .dl-card__art img { display: block; width: 100%; height: 100%; }
.dl-card__art img { object-fit: cover; object-position: var(--focus, 50% 30%); opacity: 0.85; transition: transform 1.4s var(--ease), opacity var(--dur-3); }
.dl-card:hover .dl-card__art img { transform: scale(1.04); opacity: 1; }
[data-platform="pc"] .dl-card__art { --focus: 36% 22%; }
[data-platform="android"] .dl-card__art { --focus: 56% 22%; }
.dl-card__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(18, 14, 25, 1) 4%, rgba(18, 14, 25, 0.5) 50%, rgba(11, 10, 16, 0.05)); }

.dl-card__head { display: flex; align-items: flex-end; gap: var(--sp-4); }
/* The platform logo (Windows panes, Android robot) on a violet glass tile, lit in its brand colour. */
.dl-card__icon {
  --logo-glow: rgba(180, 140, 255, 0.5);
  flex: none; display: grid; place-items: center; width: 84px; height: 84px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, rgba(180, 140, 255, 0.3), rgba(42, 32, 64, 0.85) 58%, rgba(11, 10, 16, 0.9));
  border: 1px solid var(--gold-line);
  box-shadow: var(--glow-gold), 0 0 34px -10px var(--logo-glow), inset 0 1px 0 rgba(243, 238, 231, 0.14);
  transition: box-shadow var(--dur-3) var(--ease);
}
.dl-card__icon::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), transparent 45%); }
.dl-card__icon svg { position: relative; filter: drop-shadow(0 0 7px var(--logo-glow)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); transition: transform var(--dur-3) var(--ease); }
.dl-card__icon--win { --logo-glow: rgba(30, 144, 255, 0.55); }
.dl-card__icon--android { --logo-glow: rgba(61, 220, 132, 0.5); }
.dl-card:hover .dl-card__icon { box-shadow: var(--glow-gold), 0 0 44px -6px var(--logo-glow), inset 0 1px 0 rgba(243, 238, 231, 0.14); }
.dl-card:hover .dl-card__icon svg { transform: scale(1.06); }
.dl-card__badge { position: absolute; top: var(--sp-4); left: var(--pad); z-index: 3; margin: 0; padding: 2px 9px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); font-size: var(--fs-2xs); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--on-accent); background: var(--gold); }
.dl-card__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 2.8vw, 38px); line-height: 1.05; color: var(--text); text-shadow: 0 2px 14px #000; }
.dl-card__sub { margin: 4px 0 0; color: var(--text-soft); font-size: var(--fs-sm); text-shadow: 0 1px 8px #000; }
.dl-card__cta { min-height: 56px; font-size: var(--fs-md); gap: var(--sp-3); }
/* web-qa: a long label (pt «Descarregar para PC» at 360 px) wraps instead of widening the card past the screen. */
.dl-card__cta { white-space: normal; text-align: center; }
.dl-card__cta svg { flex: none; transition: transform var(--dur-2) var(--ease); }
.dl-card__cta:hover svg, .dl-card__cta:focus-visible svg { transform: translateY(2px); }

/* Version, size, file. */
/* The meta list and the PC portable-ZIP link share one row track, so the card keeps exactly seven grid items. */
.dl-card__meta { display: grid; gap: var(--sp-4); align-content: start; }
.dl-card__alt { margin: 0; font-size: var(--fs-sm); }
.dl-meta { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; gap: var(--sp-2) var(--sp-8); margin: 0; }
.dl-meta dt { font-size: var(--fs-2xs); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--faint); }
.dl-meta dd { margin: 2px 0 0; color: var(--text); font-size: var(--fs-base); }
.dl-meta__file { font-family: var(--font-mono); font-size: var(--fs-sm) !important; overflow-wrap: anywhere; }
.dl-meta__aside { color: var(--muted); }

.dl-block { border-top: 1px solid var(--gold-hair); padding-top: var(--sp-5); }
.dl-block--sha { display: flex; flex-direction: column; }
.dl-block--sha .dl-sha { flex: 1; }
.dl-block__title { margin: 0 0 var(--sp-3); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }

.dl-req { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2); color: var(--text-soft); font-size: var(--fs-sm); }
.dl-req li { position: relative; padding-left: 20px; }
.dl-req li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--gold); }

/* The checksum: the full hash, wrapped, and a copy button (added by download.js). */
.dl-sha { display: flex; align-items: stretch; gap: var(--sp-2); }
.dl-sha__hash {
  flex: 1; min-width: 0; padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.55; color: var(--text); word-break: break-all;
  background: var(--surface-1); border: 1px solid var(--line); user-select: all;
}
.dl-sha__copy { flex: none; min-width: 92px; }
.dl-sha__copy[data-done] { color: var(--jade); border-color: rgba(139, 224, 176, 0.5); }

.dl-steps { margin: 0; padding: 0; list-style: none; counter-reset: dl-step; display: grid; gap: var(--sp-3); }
.dl-steps li { counter-increment: dl-step; position: relative; padding-left: 42px; min-height: 28px; color: var(--text-soft); font-size: var(--fs-sm); line-height: 1.55; }
.dl-steps li::before {
  content: counter(dl-step); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-size: var(--fs-md); color: var(--gold-hi); border: 1px solid var(--gold-line); background: var(--gold-wash);
}
.dl-note { margin: var(--sp-4) 0 0; padding-left: var(--sp-3); border-left: 2px solid var(--cyan-line); color: var(--cyan); font-size: var(--fs-sm); }

/* ---------- questions ---------- */
.dl-faq { padding-top: 0; }
.dl-faq__list { display: grid; gap: var(--sp-3); max-width: 880px; }
.dl-q { background: var(--panel-grad); border: 1px solid var(--gold-hair); transition: border-color var(--dur-2); }
.dl-q[open] { border-color: var(--gold-line); }
.dl-q summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5); font-size: var(--fs-md); color: var(--text);
}
.dl-q summary::-webkit-details-marker { display: none; }
.dl-q summary::after { content: "+"; flex: none; font-family: var(--font-display); font-size: 24px; line-height: 1; color: var(--gold); transition: transform var(--dur-2) var(--ease); }
.dl-q[open] summary::after { transform: rotate(45deg); }
.dl-q summary:hover { color: var(--gold-hi); }
.dl-q summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.dl-q > p, .dl-q > pre { margin: 0 var(--sp-5) var(--sp-4); color: var(--text-soft); font-size: var(--fs-sm); line-height: 1.6; }
.dl-q[open] > :not(summary) { animation: rise var(--dur-3) var(--ease-out) both; }
.dl-code { overflow-x: auto; padding: var(--sp-3); background: var(--surface-1); border: 1px solid var(--line); }
.dl-code code { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text); white-space: pre; }

/* ---------- last call ---------- */
.dl-call__body { display: grid; justify-items: center; text-align: center; gap: var(--sp-3); }
.dl-call__body .lede { margin: 0 0 var(--sp-3); }
.dl-call .band__art img { opacity: 0.62; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .dl-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .dl-card { grid-row: auto; grid-template-rows: none; }
}
@media (max-width: 640px) {
  .dl-hero { min-height: 360px; padding-bottom: var(--sp-8); }
  .dl-card { --pad: var(--sp-5); gap: var(--sp-5); }
  .dl-card__art { height: 150px; }
  .dl-card__icon { width: 68px; height: 68px; }
  .dl-card__icon svg { width: 40px; height: 40px; }
  .dl-meta { grid-template-columns: repeat(2, minmax(0, auto)); gap: var(--sp-3) var(--sp-6); }
  .dl-meta > div:last-child { grid-column: 1 / -1; }
  .dl-sha { flex-direction: column; }
  .dl-sha__copy { width: 100%; }
  .dl-q summary { padding: var(--sp-3) var(--sp-4); }
  .dl-q > p, .dl-q > pre { margin: 0 var(--sp-4) var(--sp-4); }
}

@media (prefers-reduced-motion: reduce) {
  .dl-hero__body > *, .dl-card, .dl-q[open] > :not(summary) { animation: none; }
  .dl-card, .dl-card__art img, .dl-card__cta svg, .dl-card__icon, .dl-card__icon svg { transition: none; }
  .dl-card:hover .dl-card__art img, .dl-card:hover .dl-card__icon svg { transform: none; }
}
