/* ============================================================================
   download.css — /download only. Built from the kit (components.css: cards
   and their modifiers, chips, buttons, icon tiles, notices, wells, the
   segmented control, steps, .split, the accordion, the empty state, the
   call-out, the subtitle line (.caption), .spotlight, .horizon and the
   .is-entering entrance); this file lays the page out and styles its own
   pieces. Tokens only; media queries only the device ranges (tokens.css).

   JS contract (download.js) kept on purpose: .dl-os-card[data-os]
   (.is-active), .dl-panel (.is-active; .is-entering = the kit entrance),
   .dl-fmt (.is-active), .dl-fmt-panel (.is-active, .is-entering).

   Hovers of the cards and rows here (OS cards)
   are mouse only — a tap on a phone or a tablet does not light them up.

   Contents
     1. Page top        .dl-top (release facts in the meta row, OS cards spacing)
     2. OS cards        .dl-os, .dl-os-card (kit .card), .dl-os-flag
     3. Panels          .dl-panel, .dl-card, .dl-get, .dl-block, .dl-guide
     4. Linux formats   .dl-fmt-panel, .dl-steps-empty
     5. macOS           .dl-soon
     6. Release notes   .dl-notes, .dl-rel (older releases)
     7. Install guides  .dl-guides-header (the cards are the kit .help-cards)
     8. Help            .dl-help
     9. Print
    10. Firefox         the same states without transform
   ========================================================================== */


/* ── 1. Page top: release facts (meta row), room above the OS cards ─────── */
.dl-top__fact,
.dl-top__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
}
.dl-top__fact { color: var(--text-2); }
.dl-top__fact svg { color: var(--text-3); }
.dl-top__link svg { font-size: 0.75em; }
.dl-top .page-header__toolbar { margin-top: var(--space-10); }


/* ── 2. OS cards (role=tablist) ─────────────────────────────────────────────
   Each card is a kit .card (--pad-sm, --sheen; --hover on the ones that
   can be picked). The page lays it out (content column, 20px padding from
   768px, overflow visible for the flags on the top edge) and owns its
   states: pressed, chosen (.is-active) and "soon". */
.dl-os {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .dl-os { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
}

.dl-os-card {
  align-items: flex-start;
  gap: 0.125rem;
  overflow: visible;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--dur-fast) var(--ease-standard),
              background-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-out);
}
@media (min-width: 768px) {
  .dl-os-card { padding: var(--space-5); }
}
@media (hover: hover) and (pointer: fine) {   /* press nudge: mouse only, no tap effect on touch */
  .dl-os-card:active { transform: translateY(1px); }
}
.dl-os-card:focus-visible {
  outline: none;
  box-shadow: var(--highlight-top), var(--focus-ring);
}

.dl-os-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  margin-bottom: var(--space-4);
}
.dl-os-card__icon {
  font-size: 1.25rem;
  transition: color var(--dur-fast) var(--ease-standard),
              background-color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
}
/* Radio-like mark: an empty ring, filled with a check on the chosen card. */
.dl-os-card__radio {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  color: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.625rem;
  transition: color var(--dur-fast) var(--ease-standard),
              background-color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
}
.dl-os-card__name {
  color: var(--text-strong);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.dl-os-card__sub {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  letter-spacing: 0.02em;
}
/* Status labels as a small capsule sitting on the card's top border (half
   above, half below), lined up with the icon. Opaque, with its own hairline
   in the tone colour, so it reads as part of the card's frame — it adds no
   height. Whole-pixel offset (-10px) and no transforms (Firefox). */
.dl-os-card__flags {
  position: absolute;
  top: -0.625rem;
  left: var(--space-4);
  display: flex;
  gap: var(--space-1);
  pointer-events: none;
}
@media (min-width: 768px) {
  .dl-os-card__flags { left: var(--space-5); }
}
.dl-os-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.25rem;
  padding: 0 0.5625rem;
  color: var(--text-2);
  background-color: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.dl-os-flag[hidden] { display: none; }
.dl-os-flag--detected {
  color: var(--success-text);
  background: linear-gradient(var(--success-soft), var(--success-soft)), var(--surface-2);
  border-color: var(--success-line);
}
/* "Twój system": a small live dot with a soft ring breathing around it
   (box-shadow only — nothing moves). */
.dl-os-flag__dot {
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  background-color: var(--success);
  border-radius: 50%;
  animation: dl-flag-live 2.4s var(--ease-in-out) infinite;
}
@keyframes dl-flag-live {
  0%        { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent); }
  70%, 100% { box-shadow: 0 0 0 0.3125rem transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .dl-os-flag__dot { animation: none; }
}

/* Chosen: accent outline, accent icon tile, filled mark, a faint violet
   light from the top-left corner. */
.dl-os-card.is-active {
  background:
    radial-gradient(120% 90% at 0% 0%, var(--accent-soft), transparent 62%),
    var(--sheen),
    var(--surface-1);
  border-color: var(--accent-500);
  box-shadow: var(--highlight-top-strong), 0 0 0 1px var(--accent-500), var(--shadow-md);
}
.dl-os-card.is-active:focus-visible {
  box-shadow: var(--highlight-top-strong), 0 0 0 1px var(--accent-500), var(--focus-ring);
}
.dl-os-card.is-active .dl-os-card__icon {
  color: var(--accent-300);
  background-color: var(--accent-soft);
  border-color: var(--accent-line);
}
.dl-os-card.is-active .dl-os-card__radio {
  color: var(--on-accent);
  background-color: var(--accent-500);
  border-color: var(--accent-500);
}

/* macOS: not available yet — dimmed, no hover (no .card--hover), cannot
   be picked. */
.dl-os-card--soon { cursor: not-allowed; }
.dl-os-card--soon .dl-os-card__top,
.dl-os-card--soon .dl-os-card__name,
.dl-os-card--soon .dl-os-card__sub { opacity: 0.5; }
.dl-os-card--soon .dl-os-card__radio { visibility: hidden; }
.dl-os-card--soon.is-active { border-color: var(--line-strong); box-shadow: var(--highlight-top); background: var(--sheen), var(--surface-1); }


/* ── 3. Panels (DownloadPage/Panel) ─────────────────────────────────────────
   One panel per OS, only the chosen one shows. From 1024px: the download
   card on the left (at the top of the panel, not sticky), the steps on the
   right. A user switch (OS card, Linux format) replays the kit .is-entering
   rise on the new panel (download.js; never on the page-load selection). */
.dl-install { padding-top: calc(var(--section-y) * 0.75); }

.dl-panel { display: none; }
.dl-panel.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-12);
}
.dl-panel:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 8px;
  border-radius: var(--radius-lg);
}
@media (min-width: 1024px) {
  .dl-panel.is-active {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-16);
  }
  .dl-panel--single.is-active { grid-template-columns: minmax(0, 1fr); }
}

/* The download card: the action of the page — a kit .card with a violet
   light in its corner, a stronger edge and a deep shadow. */
.dl-card {
  gap: var(--space-6);
  padding: var(--space-6);
  background:
    radial-gradient(90% 55% at 0% 0%, var(--ambient-violet-soft), transparent 70%),
    var(--sheen),
    var(--surface-1);
  border-color: var(--line-strong);
  box-shadow: var(--highlight-top-strong), var(--shadow-lg);
}
@media (min-width: 768px) {
  .dl-card { padding: var(--space-8); }
}
.dl-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}
.dl-card__heading {
  display: flex;
  flex: 1 1 10rem;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.dl-card__title {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.dl-card__sub {
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.dl-card__badge { align-self: flex-start; }
.dl-card__hint {
  margin: calc(var(--space-2) * -1) 0 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.dl-card__hint strong { color: var(--text-1); }

/* The big download button (DownloadPage/Get): kit primary .btn--split with
   the small underlight (.btn--glow-sm), laid out the other way round — the
   label on top, the file name in mono under it. */
.dl-get {
  justify-content: flex-start;
  gap: 0.875rem;
  min-height: 4rem;
  padding: 0.625rem 1.25rem;
  white-space: normal;
}
.dl-get .btn__icon { font-size: 1.375rem; }
.dl-get .btn__label {
  flex-direction: column-reverse;
  gap: 0.1875rem;
  min-width: 0;
}
.dl-get .btn__name { font-size: 1.0625rem; line-height: 1.25; }
.dl-get .btn__hint {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.01em;
  opacity: 0.85;
  overflow-wrap: anywhere;
}

/* Requirements / checksum blocks under the button, split by hairlines;
   each opens with a muted eyebrow. */
.dl-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line-subtle);
}
.dl-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The steps column. */
.dl-guide { display: flex; flex-direction: column; min-width: 0; }
.dl-guide__title {
  margin: var(--space-3) 0 var(--space-8);
  color: var(--text-strong);
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
@media (min-width: 1024px) {
  .dl-guide { padding-top: var(--space-4); }
}
.dl-update { margin-top: var(--space-10); }
.dl-update strong { color: var(--text-strong); }


/* ── 4. Linux formats ───────────────────────────────────────────────────── */
.dl-fmt-panel { display: none; }
.dl-fmt-panel.is-active {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.dl-card .dl-fmt-panel.is-active { margin-top: var(--space-2); }
.dl-guide .dl-fmt-panel.is-active { gap: 0; }
.dl-steps-empty { padding-block: var(--space-10); }


/* ── 5. macOS (coming soon) ─────────────────────────────────────────────── */
.dl-soon { align-items: flex-start; }
.dl-soon__copy { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.dl-soon__text {
  max-width: 56ch;
  margin: 0;
  color: var(--text-2);
  line-height: 1.65;
}
.dl-soon__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (min-width: 768px) {
  .dl-soon {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-6);
  }
}


/* ── 6. Release notes (kit .split: header left, notes right) ─────────────
   The newest release is a kit card (--pad, --sheen, --shadow; 32px padding
   from 768px). */
.dl-notes { gap: var(--space-6); }
@media (min-width: 768px) {
  .dl-notes { padding: var(--space-8); }
}
.dl-notes__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line-subtle);
}
.dl-notes__name {
  color: var(--text-strong);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}
.dl-notes__date {
  margin-left: auto;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.dl-notes__desc {
  margin: 0;
  color: var(--text-1);
  line-height: 1.7;
  text-wrap: pretty;
}
.dl-notes__group { display: flex; flex-direction: column; gap: var(--space-3); }
.dl-notes__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}
.dl-notes__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.dl-notes__list li {
  position: relative;
  padding-left: var(--space-5);
  color: var(--text-1);
  font-size: 0.9375rem;
  line-height: 1.65;
  text-wrap: pretty;
}
.dl-notes__list li::before {
  content: '';
  position: absolute;
  top: 0.82em;
  left: 0.125rem;
  width: 0.5rem;
  height: 1px;
  background-color: var(--accent-400);
}
.dl-notes__list strong { color: var(--text-strong); }
.dl-notes__list code {
  padding: 0.0625rem 0.375rem;
  color: var(--accent-300);
  background-color: var(--surface-active);
  border-radius: var(--radius-xs);
  font-size: 0.8125em;
}
.dl-notes__list a {
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.2em;
}
.dl-notes__desc--empty { color: var(--text-2); }

/* Older releases: the kit accordion (.acc, boxed) under the latest card.
   A summary is one compact row — version chip, title, the date pushed to
   the right — beside the kit chevron; the body is the card's notes markup
   (DownloadPage/ReleaseNotes) laid out like the card: one column, the kit
   .acc__body type and spacing reset, a hairline under the row. */
.dl-rel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-10);
}
.dl-rel .acc__summary {
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
}
.dl-rel__row {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
}
.dl-rel__name {
  min-width: 0;
  color: var(--text-strong);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}
.dl-rel__date {
  margin-left: auto;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.dl-rel .acc__item.is-open .dl-rel__version {
  --tone: var(--accent-text);
  --tone-soft: var(--accent-soft);
  --tone-line: var(--accent-line);
}
.dl-rel .acc__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin: 0 var(--space-5);
  padding: var(--space-5) 0 var(--space-6);
  color: var(--text-1);
  font-size: inherit;
  line-height: inherit;
  border-top: 1px solid var(--line-subtle);
}
.dl-rel .acc__body > * + * { margin-top: 0; }
.dl-rel .acc__body .dl-notes__list { padding-left: 0; }
.dl-rel .acc__body .dl-notes__list strong { color: var(--text-strong); }
.dl-rel__link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.4375rem;
  font-size: var(--fs-sm);
}
.dl-rel__link svg { font-size: 0.75em; }
@media (min-width: 768px) {
  .dl-rel .acc__body { margin-inline: var(--space-8); }
  .dl-rel .acc__summary { padding-left: var(--space-8); }
}


/* ── 7. Install guides (DownloadPage/InstallGuides) ──────────────────────────
   The section header, then the Help Center install guides as the kit help
   cards (HelpPage/ArticleCard in .help-cards — components.css 42), then the
   help call-out. */
.dl-guides-header { margin-bottom: var(--space-10); }


/* ── 8. Help call-out ─────────────────────────────────────────────────── */
.dl-help { margin-top: var(--space-16); }
.dl-help__caption { align-self: flex-start; margin-top: var(--space-2); }
@media (max-width: 767px) {
  .dl-help { margin-top: var(--space-12); }
}


/* ── 9. Print ───────────────────────────────────────────────────────────── */
@media print {
  .dl-os,
  .dl-get { display: none !important; }
  .dl-panel { display: block !important; }
  .dl-top { padding-top: 0; }
}


/* ── 10. Firefox: the same states without transform ─────────────────────────
   Firefox puts an element that moves with a transform on its own layer at
   its exact sub-pixel position and drops the layer when the motion ends:
   text and icons then re-snap to whole pixels, a visible 0.5–1px jump.
   There this page keeps its own motion transform-free (Chrome/Edge
   unchanged):
   - the system cards have no press nudge.
   The panel switch (kit .is-entering), buttons, the format picker, the
   guide cards, the toast, the accordion chevron and tooltips carry their
   own Firefox rules in components.css.
   (-moz-appearance = Firefox.) */
@supports (-moz-appearance: none) {
  .dl-os-card:active { transform: none; }
}
