/* Styles beyond the vendored Tailwind build: the orbit hero, the story card,
   the store badges and the collapsible lists. */

:root {
  --page: #fffcf9;
  --ink: #111827;
  --body: #374151;
  --muted: #6b7280;
  --line: #9fb4cc;
  --line-soft: #bfcddd;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
}

body {
  background-color: var(--page);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* width is explicit so the height orbit.js sets cannot widen it through
   aspect-ratio, which only sizes the stage until the script runs. */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.04;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

@media (min-width: 480px) {
  .stage { aspect-ratio: 1 / 0.8; }
}

/* A dot grid that fades out toward the edges. */
.stage-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(120, 110, 100, 0.3) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 45%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 70% at 50% 45%, #000 35%, transparent 100%);
}

.orbit-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.orbit-lines .ring {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 0 9;
  animation: ring-flow 2.4s linear infinite;
}

.orbit-lines .chord {
  stroke: var(--line-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 0 7;
  transition: stroke 0.2s ease, opacity 0.2s ease;
}

.orbit-lines .chord.lit {
  stroke: var(--accent);
}

.orbit-lines .packet {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 1.5;
}

@keyframes ring-flow {
  to { stroke-dashoffset: -9; }
}

.orbit-node {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--node-w, 100px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

.orbit-node picture,
.orbit-node img {
  display: block;
  width: 100%;
  height: auto;
}

.orbit-node img {
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 10px 16px rgba(31, 41, 55, 0.18));
  transition: filter 0.2s ease, opacity 0.5s ease;
}

.orbit-node.ready img {
  opacity: 1;
}

.orbit-node.active img {
  filter: drop-shadow(0 16px 26px rgba(37, 99, 235, 0.32));
}

.orbit-label {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 6px);
  font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
  white-space: nowrap;
  opacity: var(--label-opacity, 1);
}

.orbit-node:focus {
  outline: none;
}

.orbit-node:focus-visible img {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 14%;
}

.stage-bird {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 15;
  width: 25%;
  max-width: 150px;
  transform: translate(-50%, -50%);
}

/* A soft halo of the page colour, so the lines and the phones behind the
   bird fade out around it. */
.stage-bird::before {
  content: "";
  position: absolute;
  inset: -36%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 252, 249, 1) 45%, rgba(255, 252, 249, 0.8) 70%, rgba(255, 252, 249, 0));
  pointer-events: none;
}

.stage-bird img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.stage-bird:hover img {
  transform: scale(1.06);
}

/* ---------- Story card ---------- */

.story-card {
  position: absolute;
  z-index: 40;
  width: 300px;
  max-width: calc(100% - 24px);
  padding: 14px 16px 16px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.18), 0 2px 6px rgba(31, 41, 55, 0.08);
  text-align: left;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.story-card.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.story-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.story-card h3 {
  margin: 8px 30px 6px 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.story-text {
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
}

.story-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
  line-height: 28px;
  text-align: center;
}

.story-close:hover,
.story-close:focus-visible {
  background: #f3f4f6;
  color: var(--ink);
  outline: none;
}

/* On a phone the card sits at the bottom of the screen. */
@media (max-width: 639px) {
  .story-card {
    position: fixed;
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: 12px;
    width: auto;
    max-width: none;
  }
}

/* ---------- Downloads ---------- */

.download-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.dl-break {
  flex-basis: 100%;
  height: 0;
}

.download-grid a,
.download-grid button {
  display: block;
  line-height: 0;
  border-radius: 8px;
}

.dl-desktop img {
  width: 6rem;
}

.dl-store img {
  width: auto;
  height: 40px;
}

.download-grid img {
  transition: opacity 0.15s ease;
}

.download-grid a:hover img,
.download-grid button:hover img {
  opacity: 0.75;
}

.download-grid a:focus,
.download-grid button:focus {
  outline: none;
}

.download-grid a:focus-visible,
.download-grid button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (min-width: 640px) {
  .download-grid {
    display: grid;
    grid-template-columns: repeat(6, 72px);
    justify-content: center;
    gap: 14px 0;
  }

  .dl-break { display: none; }
  .dl-desktop { grid-column: span 2; justify-self: center; }
  .dl-desktop img { width: 8rem; }
  .dl-ios { grid-column: 2 / 4; justify-self: center; }
  .dl-android { grid-column: 4 / 6; justify-self: center; }
}

/* The release version, at the start of each download list. */
.release-tag {
  display: inline-block;
  margin-right: 2px;
  padding: 0 8px;
  border: 1px solid #eab308;
  border-radius: 999px;
  background: #fef9c3;
  color: #ca8a04;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  vertical-align: 1px;
}

.download-hint {
  color: var(--muted);
  font-size: 0.85em;
}

/* ---------- Collapsible lists ---------- */

.fold {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.fold + .fold {
  margin-top: 10px;
}

.fold > summary {
  position: relative;
  padding: 12px 44px 12px 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.fold > summary::-webkit-details-marker {
  display: none;
}

.fold > summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
}

.fold[open] > summary::after {
  content: "\2212";
}

.fold > summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 12px;
}

.fold-body {
  padding: 0 16px 14px;
}

.fold-body > ul {
  margin-top: 0;
}

kbd {
  padding: 1px 6px;
  border: 1px solid #d1d5db;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #f9fafb;
  font: 0.85em/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .orbit-lines .ring { animation: none; }
  .story-card { transition: none; }
}

/* ---------- Simple pages: /mobile/, and later a blog or news ---------- */

.page-nav {
  display: flex;
  padding-top: 16px;
}

/* Positioned, so it paints above the hero's dot grid. */
.back-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.back-link:hover {
  background: #f3f4f6;
}

.back-link:focus {
  outline: none;
}

.back-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.platform-card {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}

@media (min-width: 640px) {
  .platform-card { padding: 24px 28px; }
}

.steps {
  margin-top: 8px;
  counter-reset: step;
}

.steps > li {
  position: relative;
  margin-top: 18px;
  padding-left: 44px;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
}

.steps h3 {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.steps p {
  margin-top: 2px;
  color: var(--body);
}

.step-link {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.step-link:hover {
  background: #dbeafe;
}

.store-badge {
  display: inline-block;
  margin-top: 10px;
  line-height: 0;
  border-radius: 10px;
}

.store-badge img {
  width: auto;
  height: 44px;
  transition: opacity 0.15s ease;
}

.store-badge:hover img {
  opacity: 0.8;
}

.store-badge:focus,
.step-link:focus {
  outline: none;
}

.store-badge:focus-visible,
.step-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.note {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
  color: #14532d;
}

.apk-option {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.apk-option h3 {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.apk-option p {
  margin-top: 4px;
  color: var(--body);
}
