/* ═══════════════════════════════════════════════════════════════════
   ink-ls · Download
   Shared layout for the Host and Client app download landings.
   The two pages are visually identical except for the accent color.
   The page chooses a theme by adding `theme-client` to `.dl-wrap`;
   default (no class) is the blue host theme.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Theme tokens ────────────────────────────────────────────────────
   Default = host (blue). `theme-client` swaps in the purple palette. */
.dl-wrap {
  --dl-theme: var(--accent);
  --dl-theme-light: var(--accent-light);
  --dl-theme-dim: var(--accent-dim);
  --dl-theme-line: var(--accent-line);
  --dl-tile-glow: rgba(0, 81, 255, 0.15);
  --dl-shadow: rgba(0, 81, 255, 0.35);
  --dl-shadow-icon: rgba(0, 81, 255, 0.4);
  --dl-shadow-shot: rgba(0, 30, 90, 0.35);
  --dl-shadow-light: rgba(0, 81, 255, 0.2);
  --dl-pulse-mid: rgba(0, 81, 255, 0.45);
  --dl-pulse-end: rgba(0, 81, 255, 0);
  --dl-btn-from: var(--accent);
  --dl-btn-to: var(--accent-light);
  --dl-btn-shadow-hover: rgba(0, 81, 255, 0.5);
  --dl-title-grad-from: var(--accent-light);
  --dl-title-grad-to: #a371f7;
}

.dl-wrap.theme-client {
  --dl-theme: #a371f7;
  --dl-theme-light: #c4a1fb;
  --dl-theme-dim: rgba(163, 113, 247, 0.14);
  --dl-theme-line: rgba(163, 113, 247, 0.32);
  --dl-tile-glow: rgba(163, 113, 247, 0.18);
  --dl-shadow: rgba(163, 113, 247, 0.4);
  --dl-shadow-icon: rgba(163, 113, 247, 0.45);
  --dl-shadow-shot: rgba(40, 10, 80, 0.45);
  --dl-shadow-light: rgba(163, 113, 247, 0.25);
  --dl-pulse-mid: rgba(163, 113, 247, 0.5);
  --dl-pulse-end: rgba(163, 113, 247, 0);
  --dl-btn-from: #a371f7;
  --dl-btn-to: var(--accent);
  --dl-btn-shadow-hover: rgba(163, 113, 247, 0.55);
  --dl-title-grad-from: #a371f7;
  --dl-title-grad-to: var(--accent-light);
}

/* ── Page wrapper ────────────────────────────────────────────────── */
.dl-wrap {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 18px 28px 60px;
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: dlLand 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes dlLand {
  from { opacity: 0; transform: scale(1.06); filter: blur(6px); }
  to   { opacity: 1; transform: scale(1);    filter: blur(0); }
}

/* ── Hero ────────────────────────────────────────────────────────── */
.dl-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2px 16px 4px;
}

.dl-hero-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 26px var(--dl-shadow-icon));
  animation: dlFloat 4s ease-in-out infinite;
}
.dl-hero-icon img { width: 100%; height: 100%; object-fit: contain; }

@keyframes dlFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.dl-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.dl-title .accent {
  background: linear-gradient(135deg, var(--dl-title-grad-from), var(--dl-title-grad-to));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.dl-sub {
  font-size: 13px;
  color: var(--fg-muted);
  max-width: 560px;
  line-height: 1.55;
}

.dl-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 11px;
  color: var(--fg-subtle);
  font-family: ui-monospace, monospace;
  margin-top: 2px;
}

.dl-version-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--dl-theme-light);
  background: var(--dl-theme-dim);
  border: 1px solid var(--dl-theme-line);
  border-radius: 2em;
}
.dl-version-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* ── Primary CTA ─────────────────────────────────────────────────── */
.dl-cta-row {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.dl-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 26px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--dl-btn-from), var(--dl-btn-to));
  border: 1px solid var(--dl-btn-from);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 6px 20px var(--dl-shadow);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease;
  animation: dlPulse 2.8s ease-in-out infinite;
}
.dl-btn::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 55%;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  transform: skewX(-16deg);
  animation: dlSheen 3.6s ease-in-out infinite;
  pointer-events: none;
}
.dl-btn:hover {
  animation: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--dl-btn-shadow-hover);
  text-decoration: none;
}
.dl-btn:hover::after { animation: none; }
.dl-btn:active { transform: translateY(1px); filter: brightness(0.9); }
.dl-btn svg { width: 17px; height: 17px; }

@keyframes dlPulse {
  0%, 100% {
    box-shadow: 0 6px 20px var(--dl-shadow), 0 0 0 0 var(--dl-pulse-mid);
  }
  50% {
    box-shadow: 0 6px 20px var(--dl-shadow), 0 0 0 8px var(--dl-pulse-end);
  }
}
@keyframes dlSheen {
  0%   { left: -60%; }
  55%  { left: 140%; }
  100% { left: 140%; }
}

/* ── Feature strip (4 across) ────────────────────────────────────── */
.dl-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.dl-feature {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}
.dl-feature::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--dl-theme-line), transparent);
}
.dl-feature:hover { border-color: var(--dl-theme-line); }

.dl-feature-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--dl-theme-dim);
  color: var(--dl-theme-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.dl-feature-icon svg { width: 13px; height: 13px; }
.dl-feature-title { font-size: 12px; font-weight: 600; color: var(--fg); margin-bottom: 2px; }
.dl-feature-desc  { font-size: 10.5px; color: var(--fg-muted); line-height: 1.4; }

/* ── Step tree ───────────────────────────────────────────────────── */
.dl-tree-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  text-align: center;
  margin-top: 8px;
}
.dl-tree {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 4px 8px;
}
.dl-tree-step {
  flex: 1;
  min-width: 0;
  text-align: center;
  position: relative;
}
.dl-tree-step + .dl-tree-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--dl-theme-dim), var(--dl-theme-line));
  z-index: 0;
}
.dl-tree-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--dl-theme);
  color: var(--dl-theme-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin: 0 auto 6px;
  position: relative;
  z-index: 1;
  /* Hole-punches the connector line behind the node so the line doesn't
     visibly run through the circle. */
  box-shadow: 0 0 0 4px var(--bg);
}
.dl-tree-label { font-size: 11px; font-weight: 600; color: var(--fg); margin-bottom: 2px; }
.dl-tree-desc  { font-size: 10px; color: var(--fg-muted); line-height: 1.35; padding: 0 6px; }

/* ── Screenshot gallery ──────────────────────────────────────────── */
.dl-shots-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  text-align: center;
  margin-top: 10px;
}
.dl-shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}
.dl-shot {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 5px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, var(--dl-tile-glow), transparent 70%),
    linear-gradient(180deg, var(--bg-elev), var(--bg-surface));
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
  cursor: zoom-in;
}
.dl-shot:hover {
  transform: translateY(-2px);
  border-color: var(--dl-theme-line);
  box-shadow: 0 10px 24px var(--dl-shadow-shot);
}
.dl-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dl-shot-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-subtle);
  background-image:
    linear-gradient(var(--dl-tile-glow) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--dl-tile-glow) 1px, transparent 1px) 0 0 / 24px 24px;
}
.dl-shot-empty svg { width: 22px; height: 22px; color: var(--dl-theme-line); }

.dl-shot-cap {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fg-soft);
  background: rgba(2, 4, 9, 0.7);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-muted);
}

/* ── Lightbox ────────────────────────────────────────────────────── */
.dl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 9, 0.92);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.dl-lightbox.on { display: flex; opacity: 1; }
.dl-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 5px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
              0 0 80px var(--dl-shadow-light);
}

@media (max-width: 768px) {
  .dl-features { grid-template-columns: repeat(2, 1fr); }
  .dl-shots    { grid-template-columns: repeat(2, 1fr); }
}
