/* ==========================================================================
   Page styles, set B: download.html and release-notes.html.
   Loaded after redesign.css on these two pages only. Tokens, nav, island,
   footer, stars, fireflies and the character slot all come from redesign.css.
   Prefixes: pb- (both pages), dl- (download), rn- (release notes).
   ========================================================================== */

/* ---------- Shared: page head art, ambient gutters, pending copy ---------- */
.pb-page { display: block; }

/* The island's copy sits above its character art. */
.dl-head-grid,
.rn-head-grid { position: relative; z-index: 1; }

/* Character art in the island: phones stack it under the copy, crossing the
   island's bottom edge; wide screens stand it at the right. */
.dl-head-art,
.rn-head-art {
  position: relative;
  margin: 28px 0 -64px auto;
  pointer-events: none;
}
.dl-head-art { width: min(82%, 360px); }
.rn-head-art { width: min(58%, 250px); }

/* Ambient gutter decoration: the blog's stars and fireflies, shown only where
   the pale gutter beside the content is real (content 1000 px + air). */
.pb-ambient { display: none; }
@media (min-width: 1280px) {
  .pb-ambient {
    display: block;
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    --clear: 1100px;
  }
  .dl-apps-inner,
  .rn-body-inner { position: relative; }
  .dl-apps-inner > :not(.pb-ambient),
  .rn-body-inner > :not(.pb-ambient) { position: relative; z-index: 1; }
}

/* Unwritten copy (CLAUDE.md, "Placeholder system"): a visible dashed block. */
.pb-page .pending {
  padding: 16px 18px;
  border: 1.5px dashed rgba(24, 61, 109, .35);
  border-radius: var(--radius-cards);
  background: var(--color-ice-surface);
  color: var(--color-edge-navy);
  font-size: 16px;
  line-height: 1.4;
}
.pb-page .pending-label {
  display: block;
  margin-bottom: 4px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Icon slot for an app icon that is not drawn yet */
.dl-icon-slot,
.rn-icon-slot {
  flex: none;
  width: 64px; height: 64px;
  border-color: rgba(24, 61, 109, .35);
  border-radius: 14px;
  background: var(--color-ice-surface);
  color: var(--color-edge-navy);
  font-size: 11px;
}

/* ========================================================================
   Download
   ======================================================================== */
.dl-head .lede { max-width: 560px; }

.dl-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.dl-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(139, 179, 218, .55);
  border-radius: var(--radius-pills);
  color: var(--color-white-surface);
  font-size: 16px;
  line-height: 19px;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.dl-jump a:hover { background: rgba(139, 179, 218, .14); border-color: var(--color-white-surface); }

@media (min-width: 900px) {
  .dl-head { padding-bottom: 88px; }
  .dl-head-copy { max-width: 540px; }
  .dl-head-art {
    position: absolute;
    right: var(--gutter);
    bottom: -128px;
    width: 380px;
    margin: 0;
  }
}
@media (min-width: 1200px) {
  .dl-head-copy { max-width: 600px; }
  .dl-head-art { width: 430px; right: calc(var(--gutter) + 20px); }
}

.dl-apps { padding: 104px 0 80px; }
@media (min-width: 900px) { .dl-apps { padding: 136px 0 96px; } }

.dl-grid {
  display: grid;
  gap: 24px;
  max-width: 1000px;
  margin-inline: auto;
}
@media (min-width: 900px) { .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; } }

.dl-app {
  display: flex;
  flex-direction: column;
  padding: 26px 20px 28px;
  border-radius: var(--radius-cards);
  background: var(--color-white-surface);
  box-shadow: var(--shadow-xl);
  scroll-margin-top: 96px;
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
}
.dl-app:hover { transform: scale(1.02); box-shadow: 0 10px 40px rgba(24, 61, 109, .09); }
@media (min-width: 640px) { .dl-app { padding: 32px 32px 34px; } }

.dl-app-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--color-mist-divider);
}
.dl-app-icon {
  flex: none;
  width: 64px; height: 64px;
  border-radius: 14px;
}
.dl-app h2 {
  font-size: var(--text-rating);
  line-height: 1.15;
  font-weight: 700;
  color: var(--color-edge-navy);
}
.dl-app-head p {
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-edge-navy);
}

/* Badges: the trimmed store plates at one 44 px height, plus the browser badge */
.dl-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 12px;
  margin-top: 24px;
}
.dl-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.dl-badge .rs-store img { height: 44px; width: auto; }
.dl-badge .rs-store { border-radius: 8px; }
.dl-badge .rs-store--web:focus-visible { outline-color: var(--color-edge-navy); }

/* Store badge not published yet: a dashed slot the size of a badge */
.dl-store-slot {
  flex-direction: column;
  gap: 2px;
  width: 150px;
  min-height: 44px;
  padding: 6px 8px;
  border-color: rgba(24, 61, 109, .35);
  border-radius: 8px;
  background: var(--color-ice-surface);
  color: var(--color-edge-navy);
  font-size: 11px;
  line-height: 1.25;
}
.dl-store-slot .note { font-size: 10px; opacity: .8; }

/* Platform emphasis (script at the foot of download.html). The visitor's
   platform moves to the front of each row and gets a navy ring and a tag.
   Nothing is hidden and nothing redirects. */
.dl-badge.match { order: -1; }
.dl-badge.match > .rs-store {
  box-shadow: 0 0 0 3px var(--color-white-surface), 0 0 0 5px var(--color-edge-navy);
}
.dl-store-slot.match { border-style: solid; border-color: var(--color-edge-navy); }
.dl-badge .yours {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 1px 10px;
  border-radius: var(--radius-pills);
  background: var(--color-edge-navy);
  color: var(--color-white-surface);
  font-family: var(--font-rubik);
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  opacity: 1;
}
.dl-store-slot .yours { margin-top: 3px; }

.dl-desk {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 1000px;
  margin: 24px auto 0;
  padding: 18px 20px;
  border: 1px solid var(--color-mist-divider);
  border-radius: var(--radius-cards);
  background: var(--color-ice-surface);
  color: var(--color-edge-navy);
}
@media (min-width: 900px) { .dl-desk { margin-top: 30px; align-items: center; padding: 18px 28px; } }
.dl-desk-icon { flex: none; width: 28px; height: 28px; }
.dl-desk p { font-size: 16px; line-height: 1.4; }
.dl-desk a {
  font-weight: 500;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-signal-blue);
  overflow-wrap: anywhere;
}
.dl-desk a:hover { text-decoration-color: currentColor; }

/* ========================================================================
   Release notes
   ======================================================================== */
.rn-head .lede { max-width: 520px; }

/* Current release: an inset Network Deep card in the island */
.rn-version-card {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin-top: 26px;
  padding: 12px 18px;
  border: 1px solid rgba(139, 179, 218, .28);
  border-radius: var(--radius-cards);
  background: rgba(2, 46, 87, .85);
  color: var(--color-white-surface);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.rn-version-card:hover { border-color: var(--color-signal-blue); background: var(--color-network-deep); }
.rn-version-label {
  font-size: var(--text-caption);
  line-height: 22px;
  color: var(--color-signal-blue);
}
.rn-version-card strong {
  font-size: var(--text-rating);
  line-height: var(--leading-rating);
  font-weight: 700;
}
.rn-version-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-caption);
  line-height: 22px;
}
/* A breathing signal dot beside "Available now" */
.rn-live {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-signal-blue);
}
.rn-live::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--color-signal-blue);
  opacity: 0;
  transform: scale(0);
  animation: rs-breathe 2.8s ease-out infinite;
}

@media (min-width: 900px) {
  .rn-head { padding-bottom: 72px; }
  .rn-head-copy { max-width: 600px; }
  .rn-head-art {
    position: absolute;
    right: calc(var(--gutter) + 24px);
    bottom: -104px;
    width: 260px;
    margin: 0;
  }
}
@media (min-width: 1200px) { .rn-head-art { width: 290px; right: calc(var(--gutter) + 60px); } }

.rn-body { padding: 104px 0 88px; }
@media (min-width: 900px) { .rn-body { padding: 136px 0 120px; } }

.rn-layout {
  display: grid;
  gap: 28px;
  max-width: 1000px;
  margin-inline: auto;
}
@media (min-width: 900px) {
  .rn-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 48px; align-items: start; }
}

/* Release history rail: chips on phones, a sticky list on wide screens */
.rn-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rn-rail p {
  flex-basis: 100%;
  font-size: var(--text-caption);
  line-height: 22px;
  font-weight: 500;
  color: var(--color-edge-navy);
}
.rn-rail a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px 0 8px;
  border-radius: var(--radius-pills);
  background: var(--color-white-surface);
  color: var(--color-edge-navy);
  font-size: 15px;
  line-height: 19px;
  text-decoration: none;
  box-shadow: var(--shadow-xl);
  transition: background-color var(--t-fast) var(--ease);
}
.rn-rail a span {
  display: inline-grid;
  place-items: center;
  min-width: 26px; height: 26px;
  padding: 0 4px;
  border-radius: var(--radius-pills);
  background: var(--color-cloud-canvas);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.rn-rail a:hover { background: var(--color-ice-surface); }
.rn-rail a[aria-current="true"] { font-weight: 500; }
.rn-rail a[aria-current="true"] span { background: var(--color-edge-navy); color: var(--color-white-surface); }
@media (min-width: 900px) {
  .rn-rail {
    position: sticky;
    top: 96px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 18px 12px;
    border-radius: var(--radius-cards);
    background: var(--color-white-surface);
    box-shadow: var(--shadow-xl);
  }
  .rn-rail p { flex-basis: auto; padding: 0 8px 6px; }
  .rn-rail a {
    min-height: 40px;
    padding: 0 10px 0 6px;
    border-radius: var(--radius-buttons);
    box-shadow: none;
  }
  .rn-rail a:hover { background: var(--color-ice-surface); }
  .rn-rail-app { margin-top: 8px; border-top: 1px solid var(--color-mist-divider); padding-top: 8px !important; min-height: 48px !important; border-radius: 0 !important; }
}

/* App heading */
.rn-app-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rn-app-head img {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 12px;
}
.rn-app-head h2 {
  font-size: clamp(30px, 7.6vw, 38px);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-edge-navy);
}

/* The timeline: a line down the left, one dot per release, one white card each */
.rn-timeline {
  position: relative;
  margin: 28px 0 0;
  padding: 0 0 0 26px;
  list-style: none;
}
.rn-timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 40px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--color-signal-blue), rgba(139, 179, 218, .25));
}
@media (min-width: 640px) { .rn-timeline { padding-left: 40px; } .rn-timeline::before { left: 9px; } }

.rn-entry { position: relative; scroll-margin-top: 96px; }
.rn-entry + .rn-entry { margin-top: 24px; }
@media (min-width: 900px) { .rn-entry + .rn-entry { margin-top: 30px; } }
.rn-entry::before {                  /* the release's dot on the line */
  content: "";
  position: absolute;
  left: -26px;
  top: 30px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid var(--color-edge-navy);
  background: var(--color-white-surface);
}
@media (min-width: 640px) { .rn-entry::before { left: -38px; width: 18px; height: 18px; top: 34px; } }
.rn-entry:first-child::before { background: var(--color-edge-navy); }
.rn-entry:first-child::after {       /* the current release breathes */
  content: "";
  position: absolute;
  left: -34px;
  top: 22px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--color-signal-blue);
  opacity: 0;
  transform: scale(0);
  animation: rs-breathe 2.8s ease-out infinite;
  pointer-events: none;
}
@media (min-width: 640px) { .rn-entry:first-child::after { left: -44px; top: 28px; } }

.rn-entry article {
  padding: 22px 20px 26px;
  border-radius: var(--radius-cards);
  background: var(--color-white-surface);
  box-shadow: var(--shadow-xl);
  color: var(--color-edge-navy);
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
}
.rn-entry article:hover { transform: scale(1.01); box-shadow: 0 10px 40px rgba(24, 61, 109, .09); }
@media (min-width: 640px) { .rn-entry article { padding: 28px 32px 32px; } }

/* Version (and state) in caption style */
.rn-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: var(--text-caption);
  line-height: 22px;
  font-weight: 500;
}
.rn-release-state {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: var(--radius-pills);
  background: var(--color-cloud-canvas);
  font-size: 12px;
  line-height: 22px;
  font-weight: 500;
}
.rn-entry h3 {
  margin-top: 4px;
  font-size: clamp(22px, 6vw, var(--text-rating));
  line-height: 1.25;
  font-weight: 700;
  text-wrap: balance;
}

.rn-change-group {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--color-mist-divider);
}
@media (min-width: 1024px) {
  .rn-entry article { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .rn-entry-head,
  .rn-platform-note { grid-column: 1 / -1; }
  .rn-entry-head + .rn-change-group:last-child { grid-column: 1 / -1; }
}
.rn-change-kicker {
  font-size: var(--text-caption);
  line-height: 22px;
  font-weight: 400;
}
.rn-change-group h4,
.rn-platform-note h4 {
  margin: 0;
  font-size: var(--text-card-title);
  line-height: var(--leading-card-title);
  font-weight: 700;
}
.rn-change-list { margin-top: 12px; }
.rn-change-list li {
  position: relative;
  padding-left: 30px;
  font-size: 16px;
  line-height: 1.45;
}
.rn-change-list li + li { margin-top: 10px; }
.rn-change-list li strong { font-weight: 700; }
.rn-change-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--color-cloud-canvas) center / 12px 12px no-repeat;
}
.rn-change-list--new li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1.5v9M1.5 6h9' stroke='%23183d6d' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rn-change-list--fixed li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.3l2.6 2.5L10 3.4' fill='none' stroke='%23183d6d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.rn-platform-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: var(--radius-cards);
  background: var(--color-ice-surface);
}
.rn-platform-tag {
  flex: none;
  padding: 2px 12px;
  border-radius: var(--radius-pills);
  background: var(--color-edge-navy);
  color: var(--color-white-surface);
  font-size: 13px;
  line-height: 22px;
  font-weight: 500;
}

/* Rep Forge: its own app, its own notes (pending) */
.rn-app--rf { margin-top: 88px; scroll-margin-top: 96px; }
@media (min-width: 900px) { .rn-app--rf { margin-top: 120px; } }
.rn-rf-card {
  display: grid;
  gap: 18px;
  padding: 24px 20px 26px;
  border-radius: var(--radius-cards);
  background: var(--color-white-surface);
  box-shadow: var(--shadow-xl);
}
.rn-rf-copy .pending { margin-top: 20px; }
.rn-rf-art { width: min(62%, 220px); margin: -8px 0 0 auto; order: -1; margin-top: -72px; }
@media (min-width: 640px) {
  .rn-rf-card { grid-template-columns: minmax(0, 1fr) 210px; align-items: end; gap: 28px; padding: 30px 32px; }
  .rn-rf-art { order: 0; width: 100%; margin: -96px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dl-app:hover,
  .rn-entry article:hover { transform: none; }
}
