/* ============================================================
 * Product downloads — /products/:product/downloads
 *
 * Ported from the handoff "Imaginando Downloads.html" inline <style>.
 * Global tokens, nav, footer, .btn and .crumbs already live in
 * public/style.css; this sheet only carries the download-page chrome.
 *
 * Accent tinting (--p-1 / --p-2 / --p-3) aliases the site-wide --accent
 * so the download page matches the global brand accent rather than a
 * per-product palette.
 * ============================================================ */

.dl-page {
  --p-1: var(--accent);
  --p-2: var(--accent);
  --p-3: var(--accent);
  padding: 40px 0 90px;
}

.dl-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 0;
  border: 0.5px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: var(--card);
}
@media (max-width: 1000px) {
  .dl-grid { grid-template-columns: 1fr; }
}

/* ─── LEFT · product identity ──────────────────── */
.dl-aside {
  position: relative;
  padding: 40px;
  border-right: 0.5px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in oklab, var(--p-2) 22%, transparent), transparent 60%),
    radial-gradient(100% 70% at 0% 100%, color-mix(in oklab, var(--p-1) 18%, transparent), transparent 55%),
    var(--bg-2);
}
@media (max-width: 1000px) {
  .dl-aside { border-right: 0; border-bottom: 0.5px solid var(--line); }
}
.dl-aside .grain {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 7px);
  pointer-events: none;
}
.dl-id { position: relative; display: flex; align-items: center; gap: 18px; }
.dl-icon {
  width: 78px; height: 78px; border-radius: 18px; object-fit: cover;
  border: 0.5px solid var(--line-strong);
  box-shadow: 0 18px 50px -16px color-mix(in oklab, var(--p-2) 60%, transparent);
  background: #000; flex: none;
}
.dl-id .meta .kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--fg-faint);
}
.dl-id .meta h1 {
  font-family: var(--display); font-weight: 600; font-size: 40px;
  letter-spacing: -0.03em; line-height: 0.95; margin: 6px 0 0;
}
.dl-id .meta .full {
  font-family: var(--serif); font-style: italic; font-size: 18px;
  color: var(--fg-dim); margin-top: 4px;
}

.dl-tagline {
  position: relative; font-family: var(--display); font-weight: 500;
  font-size: clamp(22px, 2.4vw, 28px); line-height: 1.12; letter-spacing: -0.02em;
  margin: 0; text-wrap: balance; color: var(--fg);
}
.dl-tagline em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }

.dl-facts {
  position: relative; display: flex; flex-direction: column; gap: 0;
  border: 0.5px solid var(--line); border-radius: 14px;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.dl-fact {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 0.5px solid var(--line);
}
.dl-fact:last-child { border-bottom: 0; }
.dl-fact .k {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-faint); white-space: nowrap;
}
.dl-fact .v {
  font-family: var(--display); font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
  color: var(--fg); display: flex; align-items: center; gap: 8px;
  /* Allow long values (e.g. the platforms list "iPad · Android · macOS ·
     Windows") to wrap right-aligned instead of overflowing off-screen on
     narrow phones. min-width:0 lets the flex value shrink past its content. */
  flex-wrap: wrap; justify-content: flex-end; text-align: right;
  min-width: 0;
}

/* licence / session status chip */
.dl-status {
  position: relative; margin-top: auto; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px; border: 0.5px solid var(--line-strong);
  background: color-mix(in oklab, var(--bg) 50%, transparent);
}
.dl-status .ico {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  flex: none; border: 0.5px solid var(--line);
}
.dl-status.locked .ico { color: var(--fg-dim); }
.dl-status.open .ico { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.dl-status .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-status .tx b { font-family: var(--display); font-weight: 500; font-size: 13.5px; letter-spacing: -0.005em; }
.dl-status .tx span {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--fg-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-status .signout {
  margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-faint); background: none; border: 0; padding: 4px;
}
.dl-status .signout:hover { color: var(--fg); }
.dl-status.locked { cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
.dl-status.locked:hover { border-color: var(--fg-dim); background: color-mix(in oklab, var(--bg) 35%, transparent); }
.dl-status.locked:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dl-status .go { margin-left: auto; font-family: var(--mono); color: var(--fg-faint); transition: transform 0.2s ease, color 0.2s ease; }
.dl-status.locked:hover .go { color: var(--fg); transform: translateX(2px); }

/* ─── RIGHT · workflow stage ───────────────────── */
.dl-stage {
  position: relative; padding: 40px; display: flex; flex-direction: column; min-height: 560px;
}
@media (max-width: 560px) {
  .dl-aside, .dl-stage { padding: 28px 22px; }
}

.stage-head { margin-bottom: 24px; }
.stage-head .mono { display: block; margin-bottom: 12px; }
.stage-head h2 {
  font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.6vw, 46px);
  line-height: 0.98; letter-spacing: -0.025em; margin: 0; text-wrap: balance;
}
.stage-head h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }
.stage-head p {
  color: var(--fg-dim); font-size: 14.5px; line-height: 1.55; margin: 14px 0 0;
  max-width: 50ch; text-wrap: pretty;
}

/* gate hint banner */
.gate-hint {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 13px; margin-bottom: 18px;
  border: 0.5px solid color-mix(in oklab, var(--accent) 26%, var(--line));
  background: linear-gradient(100deg, color-mix(in oklab, var(--accent) 9%, transparent), transparent 70%);
}
.gate-hint .gi {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none;
  color: var(--accent); border: 0.5px solid color-mix(in oklab, var(--accent) 35%, var(--line));
}
.gate-hint .gt { font-size: 13px; line-height: 1.45; color: var(--fg-dim); flex: 1; }
.gate-hint .gt b { color: var(--fg); font-weight: 500; }
.gate-hint .ga {
  font-family: var(--display); font-weight: 500; font-size: 13px; color: var(--accent);
  background: none; border: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.gate-hint .ga:hover { text-decoration: underline; }

/* build rows */
.builds { display: flex; flex-direction: column; gap: 10px; }
.build {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  padding: 18px; border: 0.5px solid var(--line); border-radius: 14px;
  background: color-mix(in oklab, var(--bg) 40%, transparent);
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.build:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.build.reco {
  border-color: color-mix(in oklab, var(--p-2) 45%, var(--line));
  background: linear-gradient(100deg, color-mix(in oklab, var(--p-2) 12%, transparent), transparent 60%);
}
.build .os-ic {
  width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; flex: none;
  border: 0.5px solid var(--line-strong); background: color-mix(in oklab, var(--bg) 60%, transparent); color: var(--fg);
}
.build.reco .os-ic { border-color: color-mix(in oklab, var(--p-2) 40%, var(--line)); color: #fff; }
.build .info { min-width: 0; }
.build .info .name {
  font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.reco-tag {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--p-2); padding: 3px 8px; border-radius: 999px;
  font-weight: 600; white-space: nowrap;
}
.build .act { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.build .info .ver { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--fg-faint); white-space: nowrap; margin-top: 5px; }
.dlbtn {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 20px; border-radius: 999px;
  border: 0.5px solid var(--line-strong); background: var(--fg); color: var(--bg);
  font-family: var(--display); font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.dlbtn:hover { transform: translateY(-2px); }
.build.reco .dlbtn {
  background: var(--p-2); color: var(--accent-ink); border-color: var(--p-2);
  box-shadow: 0 10px 30px -10px color-mix(in oklab, var(--p-2) 70%, transparent);
}
.dlbtn.store { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.dlbtn.store:hover { border-color: var(--fg); }
.dlbtn svg { width: 15px; height: 15px; }
@media (max-width: 560px) {
  .build { grid-template-columns: auto 1fr; gap: 14px; }
  .build .act { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
}

/* secondary row under builds */
.builds-foot { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.older-toggle {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); background: none; border: 0;
  align-self: flex-start; padding: 0; text-decoration: none;
}
.older-toggle:hover { color: var(--fg); }
.older-toggle .chev { transition: transform 0.25s ease; }

.buy-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; border: 0.5px dashed var(--line-strong); border-radius: 13px;
  color: var(--fg-dim); font-size: 13.5px;
}
.buy-strip b { color: var(--fg); font-weight: 500; }

/* ─── AUTH panel ───────────────────────────────── */
.auth-ctx { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); background: none; border: 0;
  padding: 0; white-space: nowrap;
}
.back-link:hover { color: var(--fg); }
.back-link .arrow { transition: transform 0.2s ease; }
.back-link:hover .arrow { transform: translateX(-3px); }
.ctx-chip {
  display: inline-flex; align-items: center; gap: 9px; margin-left: auto; padding: 7px 13px; border-radius: 999px;
  border: 0.5px solid color-mix(in oklab, var(--p-2) 40%, var(--line));
  background: color-mix(in oklab, var(--p-2) 12%, transparent);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--fg); white-space: nowrap;
}
.ctx-chip .d { width: 7px; height: 7px; border-radius: 50%; background: var(--p-2); box-shadow: 0 0 10px var(--p-2); }

.auth-tabs { display: flex; gap: 0; border-bottom: 0.5px solid var(--line); margin-bottom: 26px; }
.auth-tab {
  position: relative; font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -0.01em;
  color: var(--fg-faint); background: none; border: 0; padding: 0 2px 14px; margin-right: 28px; transition: color 0.2s ease;
}
.auth-tab.on { color: var(--fg); }
.auth-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.5px; height: 2px; background: var(--accent); border-radius: 2px; }
.auth-tab:hover { color: var(--fg); }

.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-faint); margin-bottom: 9px;
}
.field .ipt { position: relative; display: flex; align-items: center; }
.field input {
  width: 100%; height: 52px; border-radius: 12px; border: 0.5px solid var(--line-strong);
  background: color-mix(in oklab, var(--bg) 55%, transparent); color: var(--fg);
  font-family: var(--body); font-size: 15px; padding: 0 16px; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder { color: var(--fg-faint); }
.field input:focus {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 14%, transparent);
}
.field .peek {
  position: absolute; right: 8px; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: none; border: 0; color: var(--fg-faint);
}
.field .peek:hover { color: var(--fg); }
.field .peek svg { width: 18px; height: 18px; }
.field input[data-peek] { padding-right: 50px; }
.auth-err { font-family: var(--mono); font-size: 10.5px; color: #ff7b6b; margin: -6px 0 14px; letter-spacing: 0.02em; }

/* password strength meter + hint + captcha (create tab) */
.pw-hint { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--fg-faint); margin: 0 0 16px; }
.dl-strength { display: flex; flex-direction: column; gap: 7px; margin: -6px 0 10px; }
.dl-strength .bars { display: flex; gap: 5px; }
.dl-strength .bars i { flex: 1; height: 3px; border-radius: 2px; background: var(--line-strong); transition: background 0.3s ease; }
.dl-strength.s1 .bars i:nth-child(1) { background: #ff5f56; }
.dl-strength.s2 .bars i:nth-child(-n + 2) { background: #ffb84d; }
.dl-strength.s3 .bars i:nth-child(-n + 3) { background: #ffb84d; }
.dl-strength.s4 .bars i { background: var(--accent); }
.dl-strength .lbl { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); }
.dl-strength .lbl b { font-weight: 500; color: var(--fg-dim); }
.dl-captcha { min-height: 78px; }

.auth-submit {
  width: 100%; height: 54px; border-radius: 13px; font-family: var(--display); font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em; margin-top: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0.5px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  transition: background 0.2s ease, transform 0.2s ease;
}
.auth-submit:hover { background: color-mix(in oklab, var(--accent) 88%, white); transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.6; cursor: default; transform: none; }
.auth-submit .arrow { transition: transform 0.2s ease; }
.auth-submit:hover .arrow { transform: translateX(3px); }

.auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.auth-foot .lnk { font-size: 13px; color: var(--p-1); background: none; border: 0; padding: 0; cursor: pointer; }
.auth-foot .lnk:hover { text-decoration: underline; }
.auth-note { font-size: 12px; color: var(--fg-faint); line-height: 1.5; margin-top: 18px; text-wrap: pretty; }
.auth-note a { color: var(--fg-dim); text-decoration: underline; text-underline-offset: 2px; }

/* ─── DONE / downloading ───────────────────────── */
.done-wrap { display: flex; flex-direction: column; gap: 24px; }
.done-hero { display: flex; align-items: flex-start; gap: 18px; }
.done-check {
  width: 54px; height: 54px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  border: 0.5px solid color-mix(in oklab, var(--accent) 40%, var(--line)); color: var(--accent);
}
.done-hero h2 {
  font-family: var(--display); font-weight: 500; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.02em;
  line-height: 1.02; margin: 2px 0 8px;
}
.done-hero p { color: var(--fg-dim); font-size: 14px; line-height: 1.55; margin: 0; max-width: 46ch; }
.dl-file {
  display: flex; align-items: center; gap: 16px; padding: 18px; border: 0.5px solid var(--line-strong);
  border-radius: 14px; background: color-mix(in oklab, var(--bg) 45%, transparent);
}
.dl-file .ficon {
  width: 44px; height: 44px; border-radius: 11px; flex: none; display: grid; place-items: center;
  border: 0.5px solid var(--line); color: var(--p-2);
}
.dl-file .fmeta { flex: 1; min-width: 0; }
.dl-file .fname { font-family: var(--mono); font-size: 13px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-file .fstat { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--fg-faint); margin-top: 8px; }
.dl-restart { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--p-1); background: none; border: 0; padding: 0; }
.dl-restart:hover { text-decoration: underline; }

.next-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 680px) { .next-grid { grid-template-columns: 1fr; } }
.next-card { padding: 18px; border: 0.5px solid var(--line); border-radius: 13px; background: color-mix(in oklab, var(--bg) 35%, transparent); }
.next-card .ix { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--fg-faint); }
.next-card h4 { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.005em; margin: 10px 0 6px; }
.next-card p { font-size: 12.5px; color: var(--fg-dim); line-height: 1.5; margin: 0; text-wrap: pretty; }
.done-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.done-foot .other {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim);
  background: none; border: 0; display: inline-flex; align-items: center; gap: 8px;
}
.done-foot .other:hover { color: var(--fg); }

/* fade between states */
.dl-swap { animation: dl-swap 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes dl-swap { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: none; } }

/* loading / empty fallbacks */
.dl-loading { color: var(--fg-faint); font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; padding: 40px 0; }
