/* Dawn: install, styles, how it works, questions, footer. Calm, left aligned, 12 columns.
   Sections are separated by space and the dawn type scale, not rules; the one rule is where the sky meets the footer. */

.dawn {
  position: relative;
  color: var(--dawn-ink);
  padding-top: 18vh;
  /* Dawn comes up from below, right under the 07:02 chapter, and Install starts within a screen of it */
  background: linear-gradient(180deg, var(--dusk) 0, #7d86b6 7vh, #c9cde9 13vh, var(--dawn) 18vh, var(--dawn) 100%);
}
/* Over the scroll-linked sky the horizon starts clear, so it blends into whatever blue the sky has reached */
html.sky-on .dawn { background: linear-gradient(180deg, rgba(47, 62, 115, 0) 0, #7d86b6 7vh, #c9cde9 13vh, var(--dawn) 18vh, var(--dawn) 100%); }
.dawn h2 { color: var(--dawn-ink); }
.dawn p,
.dawn li,
.dawn dd { color: var(--dawn-ink); }
.dawn .lead { color: var(--dawn-ink); }
.dawn code { color: inherit; }
.dawn-sec { padding-block: clamp(80px, 7vw + 40px, 160px); row-gap: 28px; }
.dawn-sec + .dawn-sec { padding-top: clamp(40px, 4vw + 24px, 96px); }
.muted { color: var(--dawn-muted) !important; }
.dawn section[id], .dawn .install-alt[id] { scroll-margin-top: 48px; } /* a nav jump lands with air above the heading */

/* ---------- Install ---------- */
.install { padding-top: 0; }
.install-head { grid-column: 1 / span 5; }
.install-head .lead { margin-top: 18px; }
.install-main { grid-column: 7 / -1; }
.next-steps { counter-reset: step; margin-top: 26px; display: grid; gap: 12px; }
.next-steps li {
  counter-increment: step;
  padding-left: 2.2em;
}
.next-steps li::before {
  content: counter(step);
  display: inline-block;
  width: 2.2em;
  margin-left: -2.2em;
  font-variation-settings: "MONO" 1, "CASL" 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  color: var(--dawn-link);
  font-weight: 600;
}
.install-main .small { margin-top: 22px; }
.install-also { margin-top: 18px; max-width: 58ch; font-size: var(--text-small); }
.install-links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 14px; }
.install-alt { grid-column: span 6; margin-top: clamp(40px, 4vw, 72px); }
.install-alt h3 { margin-bottom: 10px; }
.install-alt > p { max-width: 54ch; }
.install-alt .cmd { margin: 14px 0; }

/* ---------- Styles: menu bar (the spinner sheet and preview are in specimen.css) ---------- */
.styles-bar { grid-column: 1 / -1; margin-top: clamp(56px, 5vw + 16px, 104px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px clamp(24px, 4vw, 64px); }
.styles-bar h3 { margin-bottom: 10px; }
.styles-bar p + p { margin-top: 12px; }

/* Speed up when busy: the app's checkbox, then the session count as a segmented control */
.speed { display: grid; justify-items: start; gap: 12px; margin-bottom: 24px; }
.speed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-weight: 640;
  cursor: pointer;
}
.speed-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--dawn-link); cursor: pointer; }
.speed-count { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.speed-count legend { float: left; padding: 0; font-size: var(--text-small); color: var(--dawn-muted); }
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px var(--line-dawn);
}
.seg label { position: relative; display: block; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--dawn-ink);
  transition: background-color 160ms ease, color 160ms ease;
}
.seg label:hover input:not(:checked) + span { background: rgba(255, 255, 255, 0.85); }
.seg input:checked + span { background: var(--dawn-ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--dawn-link); outline-offset: 2px; }
.speed-readout { font-size: var(--text-small); font-weight: 620; }
.styles-bar .speed-tabs { margin-top: -6px; font-size: var(--text-small); color: var(--dawn-muted); }

/* The eight marks sit in one light menu bar (the app's light strip colour, square like the real one), names under it */
.bar-samples {
  --strip: 44px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  row-gap: 22px;
}
.bar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background:
    linear-gradient(180deg, transparent 0 var(--strip), var(--line-dawn) var(--strip) calc(var(--strip) + 1px), transparent calc(var(--strip) + 1px)),
    linear-gradient(180deg, rgba(246, 245, 249, 0.92) 0 var(--strip), transparent var(--strip));
}
.bar-cell .pill { margin-top: calc((var(--strip) - 18px) / 2); transform: scale(1.5); } /* menu bar size, shown larger */
.bar-cell-name { margin-top: 6px; font-size: 0.875rem; font-weight: 560; color: var(--dawn-ink); }
.bar-names { display: grid; gap: 8px; margin-top: 18px; font-size: var(--text-small); }
.bar-names div { display: grid; grid-template-columns: 5.2em 1fr; gap: 10px; }
.bar-names dt { font-weight: 650; }
.bar-gallery { margin-top: 16px; }
.bar-gallery summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 620;
  color: var(--dawn-link);
}
.bar-gallery img { width: 100%; height: auto; margin-top: 10px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line-dawn); }
html.rm .bar-gallery img { display: none; }
.rm-note { display: none; }
html.rm .rm-note { display: block; margin-top: 8px; }

/* Menu bar styles drawn from PillView.swift timings */
.bs .pill-mark > * { transform-origin: 50% 50%; }
.bs-spin .pill-mark svg { animation: bs-spin 1.6s linear infinite; }
.bs-breathe .pill-mark svg { animation: bs-breathe 0.9s ease-in-out infinite alternate; }
.bs-hop .pill-mark svg { transform-origin: 50% 90%; animation: bs-hop 1.1s linear infinite; }
.bs-orbit .pill-mark svg { transform: scale(0.62); }
.bs-orbit-arm { position: absolute; inset: 0; animation: bs-spin 1.4s linear infinite; }
.bs-orbit-arm::before {
  content: "";
  position: absolute;
  left: 4.9px;
  top: 0.6px;
  width: 3.2px;
  height: 3.2px;
  border-radius: 50%;
  background: currentColor;
}
.bs-radar .pill-mark .bs-star { transform: scale(0.5); }
.bs-ring { position: absolute; inset: 0; animation: bs-radar 1.6s cubic-bezier(0, 0, 0.58, 1) infinite; }
.bs-ring + .bs-ring { animation-delay: -0.8s; }
.bs-dot {
  position: absolute;
  top: 4.75px;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: currentColor;
  animation: bs-wave 0.9s ease-in-out infinite;
}
.bs-dot:nth-child(1) { left: 0.25px; animation-delay: -0.9s; }
.bs-dot:nth-child(2) { left: 4.75px; animation-delay: -0.747s; }
.bs-dot:nth-child(3) { left: 9.25px; animation-delay: -0.594s; }
.bs-bar {
  position: absolute;
  bottom: 1.5px;
  width: 2.2px;
  height: 10px;
  border-radius: 1.1px;
  background: currentColor;
  transform-origin: 50% 100%;
  transform: scaleY(var(--still));
  animation: var(--eq) var(--dur) ease-in-out infinite;
}
.bs-bloom .pill-mark { display: grid; place-items: center; font-family: var(--font-glyph); font-size: 13px; line-height: 1; }

@keyframes bs-spin { to { transform: rotate(360deg); } }
@keyframes bs-breathe { from { transform: scale(0.7); opacity: 0.55; } to { transform: scale(1.06); opacity: 1; } }
@keyframes bs-hop {
  0% { transform: translateY(1.3px) scale(1.15, 0.8); }
  15% { transform: translateY(-0.65px) scale(0.9, 1.1); }
  45% { transform: translateY(-4.5px) scale(1); }
  80% { transform: translateY(0.52px) scale(1.05, 0.92); }
  100% { transform: translateY(1.3px) scale(1.15, 0.8); }
}
@keyframes bs-radar { from { transform: scale(0.3); opacity: 0.95; } to { transform: scale(1.15); opacity: 0; } }
@keyframes bs-wave {
  0%, 100% { transform: translateY(2px); opacity: 0.5; }
  50% { transform: translateY(-3px); opacity: 1; }
}
@keyframes bs-eq0 { 0%, 100% { transform: scaleY(0.3); } 25% { transform: scaleY(1); } 50% { transform: scaleY(0.5); } 75% { transform: scaleY(0.8); } }
@keyframes bs-eq1 { 0%, 100% { transform: scaleY(0.75); } 25% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } 75% { transform: scaleY(0.45); } }
@keyframes bs-eq2 { 0%, 100% { transform: scaleY(0.5); } 25% { transform: scaleY(0.9); } 50% { transform: scaleY(0.3); } 75% { transform: scaleY(1); } }
@keyframes bs-eq3 { 0%, 100% { transform: scaleY(0.9); } 25% { transform: scaleY(0.4); } 50% { transform: scaleY(0.7); } 75% { transform: scaleY(0.3); } }

html.is-paused .bs *,
html.is-paused .bs .pill-mark svg { animation-play-state: paused; }
html.rm .bs *,
html.rm .bs .pill-mark svg { animation: none; }
html.rm .bs-ring { opacity: 0; }
html.rm .bs-ring + .bs-ring { opacity: 0.6; transform: scale(0.8); }
html.rm .bs-dot { transform: none; opacity: 1; }

/* ---------- How it works ---------- */
.how-head { grid-column: 1 / span 7; }
.how-head .lead { margin-top: 18px; max-width: 58ch; }
.flow {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 16px;
  counter-reset: flow;
}
.flow li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 16px 0 0;
}
.flow li::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--dawn-accent) 0 10px, var(--line-dawn) 10px);
}
.flow li::after {
  content: "";
  position: absolute;
  left: 0;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dawn-accent);
}
.flow-name {
  font-size: 1rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.flow-name.is-path { font-variation-settings: "MONO" 1, "CASL" 0; font-size: 0.9375rem; font-weight: 600; }
.flow-what { font-size: var(--text-small); color: var(--dawn-muted); }

.json { grid-column: 1 / span 6; margin-top: 24px; }
.json pre {
  padding: 22px 24px;
  border-radius: 14px;
  background: #1e1a2b;
  color: #e9e6f7;
  font-size: 0.875rem;
  line-height: 1.65;
  overflow-x: auto;
}
.json .j-key { color: #c4a1f5; }
.json .j-str { color: #e9e6f7; }
.json .j-wait { color: #f0a35e; }
.json .j-num { color: #c9cbe0; }
.json figcaption { margin-top: 10px; font-size: var(--text-small); color: var(--dawn-muted); }
.trust { grid-column: 8 / -1; margin-top: 24px; display: grid; gap: 26px; align-content: start; }
.trust h3 { margin-bottom: 6px; }
.trust p { max-width: 48ch; }

/* ---------- Questions ---------- */
.faq h2 { grid-column: 1 / span 4; }
.faq-list { grid-column: 5 / -1; }
.faq details + details { margin-top: 2px; }
.faq summary {
  position: relative;
  display: block;
  padding: 16px 44px 16px 0;
  font-size: 1.125rem;
  font-weight: 660;
  font-variation-settings: "CASL" 0.4, "MONO" 0;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before,
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--dawn-link);
  transition: transform 220ms var(--ease-out);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq details p { max-width: 62ch; padding: 0 0 24px; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  background: var(--dawn-deep);
  color: var(--dawn-ink);
  padding: clamp(56px, 6vw, 96px) 0 48px;
  box-shadow: inset 0 1px 0 var(--line-dawn); /* the one rule: where the dawn sky meets the footer */
}
.footer-inner { row-gap: 28px; }
.footer-star { grid-column: 1 / span 6; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.footer-star p { font-size: 1.25rem; line-height: 1.45; font-weight: 560; font-variation-settings: "CASL" 0.5, "MONO" 0; max-width: 32ch; }
.footer-links { grid-column: 8 / -1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 12px 28px; }
.footer-legal { grid-column: 1 / -1; margin-top: 24px; font-size: var(--text-small); color: var(--dawn-muted); }

/* ---------- Narrow ---------- */
@media (max-width: 900px) {
  .install-head, .install-main, .install-alt,
  .how-head,
  .json, .trust, .faq h2, .faq-list,
  .footer-star, .footer-links { grid-column: 1 / -1; }
  .styles-bar { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .flow li { padding: 0 0 20px 26px; }
  .flow li::before { left: 4px; right: auto; top: 6px; bottom: 0; width: 2px; height: auto; background: var(--line-dawn); }
  .flow li:last-child::before { display: none; }
  .flow li::after { top: 2px; }
}
@media (max-width: 600px) {
  .bar-samples { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .seg span, .faq summary::before, .faq summary::after { transition: none; }
}
