/**
 * SOURCE OF TRUTH KEYWORDS: site-download-styles, mac-options, chip-icons, release-timeline,
 *   release-notes-style, download-modal, badge
 * WHAT:  Styling for the parts of the launch page that depend on the release: the Apple Silicon and
 *        Intel download options, the small chip badges, the Releases timeline, and the "download
 *        started" dialog.
 * WHY:   Kept apart from sections.css so that file stays one responsibility and so everything that
 *        is filled in by downloads.js is in one place. Values come from tokens.css; nothing here
 *        introduces a raw colour or size.
 * WHERE: Fifth stylesheet loaded by site/index.html, before responsive.css so its media queries win.
 */

/* Chip badges under the hero */
.chips-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
}
.chip-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  border-radius: var(--radius-full);
  background: var(--card);
  border: 0.5px solid var(--hairline);
  font-size: 13.5px;
  font-weight: 560;
  color: var(--text-2);
}
.chip-mini svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

/* The two download options */
.mac-options {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.mac-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-card);
  background: var(--card);
  border: 0.5px solid var(--hairline);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: transform var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.mac-option:hover {
  border-color: var(--accent);
}
.mac-option:active {
  transform: scale(0.99);
}
.mac-option > svg {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 7px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.mac-option-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.mac-option-text strong {
  font-size: 17px;
  line-height: 1.3;
}
.mac-option-text small {
  font-size: 14px;
  color: var(--text-2);
}
.mac-option-go {
  flex: none;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
}

/* Releases: one featured card, then a timeline of one-line rows */
.release-feature {
  margin-top: var(--space-8);
  max-width: 820px;
}
.release-feature-card {
  padding: var(--space-6);
  border-radius: var(--radius-card);
  background: var(--card);
  border: 0.5px solid var(--hairline);
  box-shadow: var(--shadow-card);
}
.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.release-head h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.015em;
}
.release-head .btn {
  margin-left: auto;
}
.release-date {
  font-size: 14px;
  color: var(--text-3);
}
.badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-muted {
  background: var(--sunken-strong);
  color: var(--text-2);
}

.release-search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 820px;
  margin-top: var(--space-8);
}
.release-search[hidden] {
  display: none;
}
.release-search label {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.release-search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 var(--space-4);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-full);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.release-search input::placeholder {
  color: var(--text-3);
}

/* The timeline: a rail down the left, a dot per release, a heading per year. */
.timeline {
  position: relative;
  max-width: 820px;
  margin: var(--space-5) 0 0;
  padding: 0 0 0 var(--space-6);
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--hairline);
}
.timeline:empty {
  display: none;
}
.rel-year {
  margin: var(--space-6) 0 var(--space-2);
  font-family: var(--font-display);
  padding-left: var(--space-4);
  font-size: 26px;
  line-height: 1;
  color: var(--text-2);
}
.rel-year:first-child {
  margin-top: 0;
}
.rel {
  position: relative;
}
.rel::before {
  content: "";
  position: absolute;
  left: calc(var(--space-6) * -1 + 3px);
  top: 21px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--page);
  border: 1.5px solid var(--text-3);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.rel:hover::before,
.rel:has(details[open])::before {
  border-color: var(--accent);
  background: var(--accent);
}
.rel-row {
  border-radius: var(--radius-input);
  transition: background var(--motion-fast) var(--ease);
}
.rel-row:hover,
.rel-row[open] {
  background: var(--sunken);
}
.rel-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
}
.rel-summary::-webkit-details-marker {
  display: none;
}
.rel-summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-left: var(--space-1);
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform var(--motion-fast) var(--ease);
}
.rel-row[open] > .rel-summary::after {
  transform: rotate(-135deg);
}
.rel-version {
  flex: none;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
}
.rel-gist {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  color: var(--text-2);
}
.rel-date {
  flex: none;
  font-size: 14px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.rel-body {
  padding: 0 var(--space-4) var(--space-5);
}
.rel-body .notes {
  margin-top: 0;
}
.rel-body .btn {
  margin-top: var(--space-4);
}

.release-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  max-width: 820px;
  margin-top: var(--space-5);
  padding-left: var(--space-6);
}
.release-more[hidden] {
  display: none;
}
.release-more .fine {
  margin: 0;
}

.notes {
  margin-top: var(--space-4);
  font-size: 16px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.notes h4 {
  margin: var(--space-5) 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.notes h4:first-child {
  margin-top: 0;
}
.notes ul {
  margin: 0;
  padding-left: 1.2em;
}
.notes li {
  margin-bottom: var(--space-2);
}
.notes p {
  margin: 0 0 var(--space-2);
}
.notes strong {
  color: var(--text);
  font-weight: 600;
}
.notes code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--sunken-strong);
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text);
}
.notes a {
  color: var(--accent);
}

/* "Download started": the dialog that explains the first launch */
.modal {
  width: min(640px, calc(100vw - var(--space-6)));
  max-height: calc(100dvh - var(--space-6));
  margin: auto;
  padding: 0;
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--page);
  color: var(--text);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.modal::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal[open] {
  animation: modal-in var(--motion-medium) var(--ease);
}
.modal[open]::backdrop {
  animation: modal-fade var(--motion-medium) var(--ease);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}
@keyframes modal-fade {
  from {
    opacity: 0;
  }
}
.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--space-6));
  padding: var(--space-8) var(--space-8) var(--space-6);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-card h2 {
  margin: var(--space-2) 0 var(--space-3);
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.15;
}
.modal-card .sub {
  margin: 0 0 var(--space-6);
  font-size: 16.5px;
}
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--sunken);
  color: var(--text-2);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover {
  background: var(--sunken-strong);
  color: var(--text);
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-5);
  border-top: 0.5px solid var(--hairline);
}
.modal-retry {
  font-size: 15px;
  color: var(--text-2);
}
.modal-retry:hover {
  color: var(--text);
}
