/* ===== Download page — rebuilt, dark terminal style ===== */

/* Hero scene */
.dl-hero { position: relative; overflow: hidden; padding: 88px 0 96px; color: var(--text); background: #09100f; }
.dl-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(82, 223, 195, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(82, 223, 195, 0.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 78%, transparent); }
.dl-hero::after { content: ""; position: absolute; top: 18%; left: 50%; width: 640px; height: 380px; border-radius: 50%; pointer-events: none; background: rgba(32, 184, 149, 0.09); filter: blur(110px); transform: translateX(-50%); }
.dl-hero-scene { position: absolute; inset: 0; pointer-events: none; }
.dl-lane { position: absolute; right: 8%; left: 52%; height: 1px; background: rgba(82, 223, 195, 0.14); }
.dl-lane::before { content: ""; position: absolute; top: -7px; bottom: -7px; left: 18%; width: 90px; background: linear-gradient(90deg, transparent, rgba(82, 223, 195, 0.06), transparent); }
.dl-lane-a { top: 24%; } .dl-lane-b { top: 76%; }
.dl-lane i { position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 14px rgba(82, 223, 195, 0.8); animation: dl-packet 5.2s ease-in-out infinite; }
.dl-lane-b i { background: var(--blue); box-shadow: 0 0 14px rgba(120, 168, 255, 0.8); animation-delay: -2.4s; animation-duration: 6.4s; }
.dl-lane i::after { content: ""; position: absolute; top: -7px; left: -7px; width: 19px; height: 19px; border: 1px solid rgba(82, 223, 195, 0.3); border-radius: 50%; animation: dl-ping 1.9s ease-out infinite; }
.dl-lane-b i::after { border-color: rgba(120, 168, 255, 0.3); }
.dl-hero-tag { position: absolute; top: 40px; right: 40px; color: #60716b; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 9px; font-weight: 700; }

/* Hero layout & copy */
.dl-hero-grid { position: relative; z-index: 1; display: grid; align-items: center; grid-template-columns: 1fr 1fr; gap: 64px; }
.dl-hero-copy > * { animation: hero-enter 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.dl-hero-copy > :nth-child(2) { animation-delay: 70ms; }
.dl-hero-copy > :nth-child(3) { animation-delay: 130ms; }
.dl-hero-copy > :nth-child(4) { animation-delay: 180ms; }
.dl-hero-copy > :nth-child(5) { animation-delay: 240ms; }
.dl-hero-copy h1 { margin: 18px 0 24px; font-size: clamp(42px, 4.6vw, 62px); font-weight: 760; line-height: 1.12; }
.dl-lead { max-width: 480px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.9; }
.dl-lead code { color: var(--mint); }
.dl-platforms { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 26px; }
.dl-platforms span { padding: 5px 12px; border: 1px solid var(--line-light); border-radius: 4px; color: var(--muted); font-size: 13px; }
.dl-platforms span:last-child { border-color: #376055; color: #8ce1c2; background: rgba(32, 184, 149, 0.08); }
.dl-hero-links { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }
.dl-hero-links .text-action { color: var(--mint); }

/* Install panel */
.dl-panel { animation: hero-enter 800ms 160ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.install-panel { position: relative; min-width: 0; overflow: hidden; padding: 28px; border: 1px solid #35534b; border-radius: 14px; background: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(82, 223, 195, 0.05), inset 0 1px rgba(255, 255, 255, 0.04); }
.install-panel::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(82, 223, 195, 0.55), transparent); }
.install-panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%); background-size: 220% 100%; animation: tui-sheen 9s ease-in-out infinite; }
.install-panel > * { position: relative; z-index: 1; }
.install-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.install-step { color: var(--muted); font-size: 13px; font-weight: 700; }
.install-step b, .install-next b { display: inline-flex; width: 22px; height: 22px; border: 1px solid #376055; border-radius: 5px; align-items: center; justify-content: center; color: var(--mint); background: #14251f; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.install-live { display: inline-flex; align-items: center; gap: 7px; color: #7f918a; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; letter-spacing: 1px; }
.install-live b { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: tui-pulse 1.8s ease-out infinite; }
.install-panel p { color: var(--muted); line-height: 1.9; }
.install-panel p a { color: var(--mint); }
.install-panel .code-tool { margin: 20px 0; }
.install-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); }
.install-tabs button { flex: 1 0 auto; min-height: 46px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; transition: color 150ms ease, background 150ms ease, border-color 150ms ease; }
.install-tabs button:hover { color: var(--text); }
.install-tabs button[aria-selected="true"] { color: var(--mint); border-bottom-color: var(--mint); background: var(--ink-raised); }
.install-tabs button:focus-visible { outline: 2px solid var(--mint); outline-offset: -4px; }
.install-panel pre { margin: 0; padding: 22px 18px; overflow-x: auto; font-size: clamp(13px, 1.35vw, 16px); }
.install-panel pre code { display: inline-block; min-width: 8px; }
.install-panel pre code.cmd-swap { animation: dl-cmd-in 320ms cubic-bezier(0.22, 1, 0.36, 1); }
.install-hint { margin-bottom: 0; font-size: 13px; }
.install-next { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 14px 16px; border: 1px solid #2c463f; border-radius: 8px; background: #101a17; font-size: 13px; color: var(--muted); transition: border-color 180ms ease; }
.install-next:hover { border-color: #4c7a6d; }
.install-next code { color: var(--mint); font-size: 20px; }
.install-panel .install-hint + .install-hint { margin-top: 6px; }

/* Guide (light band) */
.dl-guide { padding-top: 88px; padding-bottom: 88px; color: var(--text-dark); background: var(--paper); border-top: 1px solid var(--line); }
.terminal-preview { position: relative; margin: 0 0 64px; overflow: hidden; border: 1px solid #35534b; border-radius: 14px; background: #060a09; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease; }
.terminal-preview:hover { transform: translateY(-4px); border-color: #4c7a6d; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(82, 223, 195, 0.08); }
.terminal-preview-bar { display: grid; min-height: 46px; padding: 0 16px; border-bottom: 1px solid #1e2b27; align-items: center; grid-template-columns: 1fr auto 1fr; color: #778781; background: #0e1513; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11px; }
.terminal-preview-bar > span:nth-child(2) { color: #9db3ab; letter-spacing: 1px; }
.terminal-preview-bar .tui-live { justify-self: end; }
.terminal-preview img { width: 100%; height: auto; transition: transform 320ms ease; }
.terminal-preview:hover img { transform: scale(1.012); }
.terminal-preview figcaption { padding: 14px 18px; border-top: 1px solid #1e2b27; color: var(--muted-dark); font-size: 13px; }
.dl-guide .section-heading { margin-bottom: 0; }
.dl-guide .section-heading h2 { font-size: 36px; }
.dl-guide .section-heading > p { color: var(--muted-dark); }

/* Steps */
.dl-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 40px 0 0; padding: 0; list-style: none; }
.dl-steps li { position: relative; display: flex; min-height: 220px; padding: 26px 24px; border: 1px solid var(--line-light); border-radius: 10px; flex-direction: column; background: #1b2522; transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease; }
.dl-steps li::before { content: ""; position: absolute; top: 26px; bottom: 26px; left: 0; width: 2px; background: linear-gradient(180deg, var(--mint), transparent); opacity: 0; transition: opacity 200ms ease; }
.dl-steps li:hover { transform: translateY(-5px); border-color: #53645f; background: #202d29; box-shadow: 0 24px 54px rgba(0, 0, 0, 0.3); }
.dl-steps li:hover::before { opacity: 1; }
.dl-steps li > span { display: inline-flex; width: 34px; height: 34px; border: 1px solid #376055; border-radius: 8px; align-items: center; justify-content: center; color: var(--mint-strong); background: #14251f; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.dl-steps h3 { margin: 18px 0 10px; font-size: 20px; }
.dl-steps p { margin: 0; color: var(--muted-dark); font-size: 14px; line-height: 1.85; }
.dl-steps code { color: var(--mint-strong); overflow-wrap: anywhere; }

/* Details (warm band) */
.dl-details { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-top: 80px; padding-bottom: 80px; color: var(--text-dark); background: var(--paper-warm); border-top: 1px solid var(--line); }
.dl-details article { display: flex; padding: 28px; border: 1px solid var(--line-light); border-radius: 10px; flex-direction: column; background: #1b2522; transition: transform 200ms ease, border-color 200ms ease; }
.dl-details article:hover { transform: translateY(-4px); border-color: #53645f; background: #202d29; }
.dl-details h2 { margin: 6px 0 4px; font-size: 27px; }
.dl-details p { color: var(--muted-dark); line-height: 1.9; }
.dl-details code { color: var(--mint-strong); overflow-wrap: anywhere; }
.dl-details .text-action { margin-top: auto; padding-top: 18px; align-self: flex-start; color: var(--mint-strong); }
.dl-commands { margin: 22px 0; }
.dl-commands div { display: flex; align-items: center; gap: 18px; padding: 11px 12px; border-radius: 6px; transition: background 160ms ease; }
.dl-commands div:hover { background: rgba(32, 184, 149, 0.07); }
.dl-commands dt { min-width: 104px; }
.dl-commands dt code { display: inline-block; padding: 3px 8px; border: 1px solid var(--line-light); border-radius: 5px; background: #17211f; font-size: 13px; }
.dl-commands div:hover dt code { border-color: #376055; }
.dl-commands dd { margin: 0; color: var(--muted-dark); font-size: 14px; }

/* Help (light band) */
.dl-help { padding-top: 24px; padding-bottom: 96px; color: var(--text-dark); background: var(--paper); border-top: 1px solid var(--line); }
.dl-help h2 { margin: 0 0 26px; font-size: 30px; }
.dl-help .faq-list { max-width: 860px; border-color: var(--line-light); }
.dl-help .faq-list details { border-bottom-color: var(--line-light); }

/* Reveal on scroll — hiding is opt-in via html.reveal-on so a missing/failed script never traps content. */
html.reveal-on [data-reveal] { opacity: 0; transform: translateY(22px); }
html.reveal-on [data-reveal].is-visible { opacity: 1; transform: translateY(0); transition: opacity 640ms cubic-bezier(0.22, 1, 0.36, 1), transform 640ms cubic-bezier(0.22, 1, 0.36, 1); }
.dl-steps li[data-reveal]:nth-child(2).is-visible, .dl-details article[data-reveal]:nth-child(2).is-visible { transition-delay: 120ms; }
.dl-steps li[data-reveal]:nth-child(3).is-visible { transition-delay: 240ms; }

@keyframes dl-packet { 0%, 100% { left: 2%; opacity: 0.25; } 50% { left: calc(100% - 7px); opacity: 1; } }
@keyframes dl-ping { 0% { opacity: 0.8; transform: scale(0.45); } 75%, 100% { opacity: 0; transform: scale(1.35); } }
@keyframes dl-cmd-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1000px) {
  .dl-hero-grid { gap: 40px; }
  .install-panel { padding: 22px; }
  .dl-hero-tag { display: none; }
}

@media (max-width: 800px) {
  .dl-hero { padding: 56px 0 64px; }
  .dl-hero-grid { grid-template-columns: 1fr; }
  .dl-lane { right: 4%; left: 30%; opacity: 0.6; }
  .dl-lane-b { display: none; }
  .dl-guide, .dl-details { padding-top: 56px; padding-bottom: 56px; }
  .dl-steps { grid-template-columns: 1fr; }
  .dl-steps li { min-height: 0; }
  .dl-details { grid-template-columns: 1fr; }
  .dl-guide .section-heading h2, .dl-details h2 { font-size: 30px; }
  .terminal-preview { margin-bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html.reveal-on [data-reveal] { opacity: 1; transform: none; }
  .dl-hero-copy > *, .dl-panel { animation: none; }
}
