/* ==========================================================================
   Pixel Blue — download site (single-screen)
   Brand: Adwaita blue family (#3584e4 · #2f63a9 · #1a5fb4 · #62a0ea · #99c1f1)
   Source of truth: github.com/zhchmmx/pixel-blue-logos
   ========================================================================== */

:root {
  /* Declare support for both schemes so UA chrome (scrollbars, form
     controls, over-scroll glow) follows the OS preference too. */
  color-scheme: light dark;

  /* Brand */
  --blue: #3584e4;        /* primary — ring fill / wordmark accent */
  --blue-ink: #2f63a9;    /* ring stroke, deep accents */
  --blue-deep: #1a5fb4;   /* gradient start, hover */
  --blue-bright: #62a0ea; /* gradient highlight */
  --blue-pale: #99c1f1;   /* soft tints */

  /* Ink & neutrals (Adwaita-aligned) */
  --ink: #1a1a1a;
  --ink-soft: #4e4c54;
  --ink-faint: #77767b;
  --line: #e4e6ec;
  --line-soft: #eef0f5;
  --bg: #fafbfd;
  --surface: #ffffff;
  --tint: #f0f5fc;
  --night: #241f31;       /* logo shadow tone — dark surfaces */

  /* Effects */
  --gradient: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 55%, var(--blue-bright) 100%);
  --gradient-text: var(--gradient);   /* headline only — needs its own ramp per scheme */
  --grid-line: rgba(53, 132, 228, 0.09);
  --shadow-sm: 0 1px 2px rgba(36, 31, 49, 0.05), 0 6px 20px rgba(36, 31, 49, 0.06);
  --shadow-md: 0 2px 6px rgba(36, 31, 49, 0.05), 0 18px 40px rgba(36, 31, 49, 0.10);
  --shadow-blue: 0 16px 36px -12px rgba(26, 95, 180, 0.55);

  /* Semantic slots — the only things the dark scheme has to restate */
  --link: var(--blue-ink);
  --link-hover: var(--blue-deep);
  --selection: rgba(53, 132, 228, 0.24);
  --nav-bg: rgba(255, 255, 255, 0.74);
  --nav-line: rgba(228, 230, 236, 0.8);
  --footer-bg: var(--night);
  --footer-ink: rgba(232, 234, 242, 0.55);
  --footer-border: transparent;
  --glow-a: rgba(53, 132, 228, 0.16);
  --glow-b: rgba(153, 193, 241, 0.35);
  --hero-shadow: 0 12px 24px rgba(26, 95, 180, 0.35);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
}

/* ==========================================================================
   Automatic dark scheme — follows prefers-color-scheme, no toggle, no JS.
   Only the semantic slots above change; component rules stay untouched.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f7;
    --ink-soft: #aeb6c4;
    --ink-faint: #8b93a3;
    --line: #2a2f3a;
    --line-soft: #232833;
    --bg: #0f1116;
    --surface: #171a21;
    --tint: #1d222c;

    --gradient-text: linear-gradient(135deg, var(--blue-bright) 0%, #8fc0f5 50%, var(--blue) 100%);
    --grid-line: rgba(98, 160, 234, 0.10);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 0, 0, 0.45);
    --shadow-blue: 0 16px 36px -12px rgba(53, 132, 228, 0.45);

    --link: var(--blue-bright);
    --link-hover: #8fc0f5;
    --selection: rgba(98, 160, 234, 0.3);
    --nav-bg: rgba(15, 17, 22, 0.72);
    --nav-line: rgba(255, 255, 255, 0.07);
    --footer-bg: #0a0c10;
    --footer-ink: rgba(214, 220, 232, 0.5);
    --footer-border: rgba(255, 255, 255, 0.07);
    --glow-a: rgba(53, 132, 228, 0.22);
    --glow-b: rgba(98, 160, 234, 0.14);
    --hero-shadow: 0 14px 34px rgba(53, 132, 228, 0.4);
  }

  /* On dark surfaces shadows read as nothing, so raised elements get a
     hairline top highlight instead — the Adwaita dark-window trick. */
  .version-pill,
  .nav-github {
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .download-card {
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Single-screen layout: nav / stage / footer, no page scroll by design. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--selection); }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

code { font-family: var(--mono); font-size: 0.92em; }

/* ==========================================================================
   Navigation — slim glass bar
   ========================================================================== */

.nav {
  position: relative;
  z-index: 10;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--nav-line);
}

.nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-symbol {
  width: 28px;
  height: 28px;
  flex: none;
  filter: drop-shadow(0 2px 4px rgba(36, 31, 49, 0.18));
}

.wordmark {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.wordmark-accent { color: var(--blue); }

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(36, 31, 49, 0.06);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.nav-github:hover { border-color: var(--blue-pale); color: var(--link-hover); text-decoration: none; }

/* ==========================================================================
   Stage — the whole page is one centered screen
   ========================================================================== */

.stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 28px 24px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 25%, transparent 75%);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}
.hero-glow-a {
  width: 480px; height: 480px;
  top: -260px; left: 50%;
  transform: translateX(-80%);
  background: radial-gradient(circle, var(--glow-a), transparent 65%);
}
.hero-glow-b {
  width: 420px; height: 420px;
  bottom: -220px; right: -100px;
  background: radial-gradient(circle, var(--glow-b), transparent 65%);
}

.stage-inner {
  position: relative;
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.hero-symbol {
  width: 76px;
  height: 76px;
  filter: drop-shadow(var(--hero-shadow));
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-title {
  margin: 18px 0 6px;
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero-title-accent {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  margin: 0 auto 18px;
  font-size: clamp(1rem, 2.6vw, 1.18rem);
  font-weight: 550;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.version-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 3px solid var(--blue);
  box-sizing: content-box;
  background: transparent;
  flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(53, 132, 228, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(53, 132, 228, 0); }
}

/* ---- Download card — button + checksum, the visual centre ---- */

.download-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 16px 24px;
  border-radius: 16px;
  background: var(--gradient);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-blue);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 44px -12px rgba(26, 95, 180, 0.6);
  filter: saturate(1.1) brightness(1.04);
  text-decoration: none;
}
.btn-primary:active { transform: translateY(-1px) scale(0.995); }
.btn-primary:focus-visible {
  outline: 3px solid rgba(53, 132, 228, 0.45);
  outline-offset: 3px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.16);
}

.btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.3;
}

.btn-label {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-sub {
  font-size: 0.83rem;
  font-weight: 500;
  opacity: 0.85;
}

/* ---- Checksum strip, tucked right under the button ---- */

.checksum-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  background: var(--tint);
  border: 1px solid var(--line-soft);
}

.checksum-label {
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue);
}

.checksum-value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
}

/* ---- Copy buttons ---- */

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-copy:hover { border-color: var(--blue-pale); color: var(--link-hover); }
.btn-copy:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-copy.is-copied {
  border-color: var(--blue);
  background: var(--tint);
  color: var(--link-hover);
}

/* ==========================================================================
   Footer bar — one slim line, still one screen overall
   ========================================================================== */

.footer-bar {
  background: var(--footer-bg);
  color: var(--footer-ink);
  border-top: 1px solid var(--footer-border);
  padding: 12px 24px;
  text-align: center;
}

.footer-line {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.6;
}

.footer-line a { color: var(--blue-bright); }
.footer-line a:hover { color: #fff; }
.footer-line span { opacity: 0.5; }

/* ==========================================================================
   Small screens / short viewports — keep everything on one screen
   ========================================================================== */

@media (max-width: 560px) {
  .stage { padding: 20px 16px; }
  .hero-symbol { width: 64px; height: 64px; }
  .hero-title { margin-top: 14px; }
  .version-pill { margin-bottom: 18px; }
  .download-card { padding: 16px 14px 14px; border-radius: 20px; }
  .btn-primary { padding: 13px 16px; gap: 12px; }
  .btn-icon { width: 40px; height: 40px; }
  .btn-label { font-size: 1rem; }
  .checksum-row { flex-wrap: wrap; }
  .checksum-value { white-space: normal; word-break: break-all; font-size: 0.72rem; }
  .checksum-value { flex: 1 1 100%; order: 3; }
  .footer-line { font-size: 0.7rem; }
}

@media (max-height: 760px) and (min-width: 561px) {
  .stage { padding: 16px 24px; }
  .hero-symbol { width: 60px; height: 60px; }
  .hero-title { margin: 12px 0 4px; font-size: 2rem; }
  .hero-tagline { margin-bottom: 12px; font-size: 1rem; }
  .version-pill { margin-bottom: 16px; padding: 5px 13px; font-size: 0.8rem; }
  .download-card { padding: 16px 18px 16px; }
  .btn-primary { padding: 13px 20px; }
  .btn-icon { width: 40px; height: 40px; }
  .checksum-row { margin-top: 12px; }
}
