/* Shared look for every page: night sections over the camp, warm paper
   sections for the product, one yellow button per screen. */
:root {
  --night: #131a24;
  --deep: #0d121a;
  --ground: #19212d;
  --bg: #fbf8f1;
  --bg-2: #f4efe2;
  --card: #fff;
  --ink: #18203a;
  --muted: #646d84;
  --line: #e9e3d4;
  --rule: #ddd5c2;
  --sky-ink: #f1f3f6;
  --sky-muted: #a3abb9;
  --sky-line: rgba(255, 255, 255, 0.1);
  --gold: #f3c46b;
  --yellow: #f6c344;
  --teal: #20bbc7;
  --teal-ink: #0f7f86;
  --red: #e5485f;
  --sans: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: min(1200px, calc(100% - 48px));
  --section: clamp(72px, 8.4vw, 120px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, canvas, video { display: block; max-width: 100%; }
p { margin: 0; color: var(--muted); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.wrap { width: var(--wrap); margin-inline: auto; }
.pix { image-rendering: pixelated; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 8px 14px; border-radius: 10px; background: var(--yellow); color: #1b2030; font-weight: 600; }
.skip-link:focus { top: 12px; }
br.narrow { display: none; }

/* Buttons. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 12px; font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap; border: 0; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.btn-primary { background: var(--yellow); color: #1b2030; box-shadow: 0 4px 0 #b88a1c; }
.btn-primary:hover { background: #f8cc5a; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #b88a1c; }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.22); color: #eef1f5; }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.04); }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 4px 0 #000; }
.btn-dark:hover { background: #222b49; }
.btn-dark:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn-line { border: 1.5px solid var(--ink); color: var(--ink); }
.btn[aria-disabled="true"] { cursor: default; opacity: 0.55; transform: none; }
.btn.is-here { box-shadow: 0 4px 0 #b88a1c, 0 0 0 4px rgba(246, 195, 68, 0.28); }
.btn.is-loading { pointer-events: none; opacity: 0.92; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: btn-spin 0.65s linear infinite; flex: none; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.nav-progress { position: fixed; inset: 0 0 auto; height: 2.5px; z-index: 60; background: linear-gradient(90deg, var(--teal), var(--yellow)); transform-origin: left; transform: scaleX(0); opacity: 0; pointer-events: none; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-progress.is-active { opacity: 1; animation: nav-bar 6s cubic-bezier(0.1, 0.6, 0.1, 1) forwards; }
.nav-progress.is-done { opacity: 0; transform: scaleX(1); }
@keyframes nav-bar { 0% { transform: scaleX(0.08); } 40% { transform: scaleX(0.65); } 100% { transform: scaleX(0.9); } }
.textlink { display: inline-block; font-weight: 600; border-bottom: 2px solid var(--yellow); padding-bottom: 2px; }
.textlink:hover { border-color: var(--ink); }

/* Top bar over the night sky. */
.topbar { position: absolute; inset: 0 0 auto; z-index: 20; color: var(--sky-ink); }
.topbar-row { display: flex; align-items: center; gap: 28px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; }
.links { display: flex; gap: 28px; margin-left: 18px; font-size: 14.5px; color: #aab2c0; }
.links a { position: relative; padding: 6px 0; }
.links a:hover, .lang a:hover { color: #fff; }
.links a[aria-current="page"] { color: #fff; }
.links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: var(--yellow); }
.spacer { flex: 1; }
.lang { font-size: 14px; color: #6f7889; }
.lang a, .lang span { color: #aab2c0; padding: 4px 2px; }
.lang [aria-current] { color: #fff; font-weight: 600; }
.topbar .btn-sm + .btn-sm { margin-left: -14px; }
.menu-toggle { display: none; width: 38px; height: 38px; padding: 0; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.22); background: none; cursor: pointer; place-items: center; }
.menu-toggle i { display: block; width: 16px; height: 2px; background: #eef1f5; box-shadow: 0 5px 0 #eef1f5, 0 -5px 0 #eef1f5; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.menu-toggle[aria-expanded="true"] i { transform: rotate(45deg); box-shadow: 0 0 0 transparent, 0 0 0 transparent; }
.menu-toggle[aria-expanded="true"] i::after { content: ""; display: block; width: 16px; height: 2px; background: #eef1f5; transform: rotate(90deg); }
.mobile-nav { position: absolute; left: 12px; right: 12px; top: 64px; display: grid; padding: 10px; border-radius: 16px; background: #182030; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 12px 14px; border-radius: 10px; font-size: 16px; color: #dfe3ea; }
.mobile-nav a:hover, .mobile-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.06); color: #fff; }
.mobile-nav hr { width: 100%; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); margin: 6px 0; }

/* The sky: deep night that reaches the camp's own night at the scene. */
.sky { position: relative; overflow: hidden; color: var(--sky-ink); background: linear-gradient(#0a0e15 0%, #10161f 45%, var(--night) 70%); }
.sky p { color: var(--sky-muted); }
.hero-label { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--sky-muted); }
.hero-label::before { content: ""; width: 8px; height: 8px; background: var(--teal); }
a.hero-label:hover { color: #fff; }
.hero h1 { margin-top: 22px; font-size: clamp(33px, 2.6vw + 17px, 54px); line-height: 1.22; font-weight: 700; }
.hero .lead { margin-top: 20px; font-size: clamp(15.5px, 0.3vw + 14.4px, 18px); max-width: 620px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* On desktop every first screen fills the window and stops at 1100 px on
   very tall ones. Each page sets --hero-copy, the room its copy needs above
   the scene; a short window shrinks the crew rather than cut it off. */
@media (min-width: 901px) {
  .sky.hero { min-height: max(calc(var(--hero-copy, 460px) + 200px), min(100svh, 1100px)); }
  .sky.hero .crew { --crew-max: clamp(200px, calc(min(100svh, 1100px) - var(--hero-copy, 460px)), 330px); }
}

/* A short starry header with the AstrLink star in place of a scene, for
   pages whose content belongs on the first screen (download, changelog).
   The content under it overlaps its bottom 82 px (56 and 48 on smaller
   screens). */
.sky.hero.compact-hero { min-height: 0; overflow: visible; }
.compact-hero .stage { position: absolute; inset: 0; overflow: hidden; }
.compact-hero .hero-copy { position: relative; z-index: 3; padding-top: 112px; padding-bottom: 124px; }
.compact-hero h1 { margin-top: 16px; font-size: clamp(36px, 2.8vw + 16px, 50px); line-height: 1.16; }
.compact-hero .lead { margin-top: 14px; max-width: 580px; color: #c9ced8; text-wrap: balance; }
/* Level with the middle of the copy: half way down, less half the difference
   between the copy's bottom and top padding. */
.compact-hero .orbit, .compact-hero .astr-star { top: calc(50% - 6px); }
.compact-hero .orbit { position: absolute; left: 81%; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, 0.08); transform: translate(-50%, -50%); pointer-events: none; }
.compact-hero .orbit.o1 { width: 176px; height: 176px; border-style: solid; border-color: rgba(246, 195, 68, 0.14); }
.compact-hero .orbit.o2 { width: 276px; height: 276px; }
.compact-hero .astr-star { z-index: 2; left: 81%; width: 82px; height: 82px; margin: -41px 0 0 -41px; animation: glow 5s ease-in-out infinite; }
.compact-hero .astr-star::before { inset: -130px; background: radial-gradient(closest-side, rgba(255, 243, 214, 0.48), rgba(246, 195, 68, 0.14) 28%, rgba(246, 195, 68, 0.04) 60%, rgba(246, 195, 68, 0)); }
.compact-hero .astr-star img { width: 62px; height: 62px; }
@keyframes glow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@media (max-width: 1080px) {
  .compact-hero .lead { max-width: 500px; }
  .compact-hero .orbit, .compact-hero .astr-star { left: 85%; }
}
@media (max-width: 820px) {
  .compact-hero .hero-copy { padding-top: 96px; padding-bottom: 96px; }
  .compact-hero .lead { max-width: 440px; }
  .compact-hero .orbit.o2 { display: none; }
  .compact-hero .orbit.o1 { left: calc(100% - 76px); top: 148px; width: 136px; height: 136px; }
  .compact-hero .astr-star { left: calc(100% - 76px); top: 148px; width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .compact-hero .astr-star::before { inset: -96px; }
  .compact-hero .astr-star img { width: 48px; height: 48px; }
}
@media (max-width: 640px) {
  .compact-hero .hero-copy { padding-top: 88px; padding-bottom: 84px; }
  .compact-hero .orbit, .compact-hero .astr-star { display: none; }
  .compact-hero .lead { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .compact-hero .astr-star { animation: none; }
}
/* Download and changelog share one sky height: whatever of the first screen
   the download cards and the row under them leave. --below is the height
   they take at each size; on phones the cards stack past the fold and the
   sky only has to fit the download page's copy. */
.sky.hero.screen-sky { display: flex; flex-direction: column; justify-content: center; min-height: calc(min(100svh, 1100px) - var(--below, 304px)); }
@media (max-width: 1080px) { .screen-sky { --below: 290px; } }
@media (min-width: 821px) and (max-height: 760px) { .screen-sky { --below: 280px; } }
@media (min-width: 821px) and (max-width: 1080px) and (max-height: 760px) { .screen-sky { --below: 274px; } }
@media (max-width: 820px) { .sky.hero.screen-sky { justify-content: flex-start; min-height: 347px; } }
@media (max-width: 640px) { .sky.hero.screen-sky { min-height: 321px; } }

/* The stars: a fixed field painted once, a few that breathe, and the
   AstrLink light. */
.stars, .threads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.twinkle { position: absolute; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: #f4f6fa; opacity: 0.15; box-shadow: 0 0 6px rgba(244, 246, 250, 0.6); animation: twinkle 5.6s ease-in-out infinite; pointer-events: none; }
.is-paused .twinkle, .is-paused .astr-star { animation-play-state: paused; }
@keyframes twinkle { 0%, 100% { opacity: 0.12; transform: scale(0.8); } 50% { opacity: 0.85; transform: scale(1.2); } }
.astr-star { position: absolute; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: #fffaf0; display: grid; place-items: center; pointer-events: none; }
.astr-star::before { content: ""; position: absolute; inset: -112px; border-radius: 50%; background: radial-gradient(closest-side, rgba(246, 195, 68, 0.17), rgba(246, 195, 68, 0)); }
.astr-star img { position: relative; width: 52px; height: 52px; }

/* Live crew canvases. The box is as tall as the scene is drawn for its
   width; the still picture shows until the live scene has drawn. The width
   is set, not auto, or the aspect ratio would turn the height limits into
   width limits and stop the box at 1440 px; Safari also needs the min-width
   for a box placed absolutely. A still narrower than its box grows to cover
   it. */
.crew { position: relative; overflow: hidden; width: 100%; min-width: 100%; aspect-ratio: 1047 / 240; min-height: var(--crew-min, 200px); max-height: var(--crew-max, 330px); background: var(--night); }
.crew.is-light { background: #f4efe3; }
.crew > img, .crew > canvas { position: absolute; left: 0; bottom: 0; max-width: none; image-rendering: pixelated; }
.crew > img { width: 100%; height: 100%; object-fit: cover; object-position: left bottom; }
.crew > canvas { font-family: var(--sans); visibility: hidden; }
.crew.is-live > img { visibility: hidden; }
.crew.is-live > canvas { visibility: visible; }

/* Section furniture. */
section { padding: var(--section) 0; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-family: var(--mono); color: #8a7a52; }
.kicker::before { content: ""; width: 10px; height: 10px; background: var(--teal); }
h2 { margin-top: 14px; font-size: clamp(28px, 1.5vw + 18px, 40px); line-height: 1.25; font-weight: 700; }
.lede { margin-top: 16px; font-size: clamp(15.5px, 0.2vw + 14.6px, 17px); max-width: 640px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
/* Short points: a square, a title, one line under it. */
.points { display: grid; gap: 24px 40px; }
.points b { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.points b::before { content: ""; width: 8px; height: 8px; background: var(--teal); flex: none; }
.points p { margin: 4px 0 0 18px; font-size: 14.5px; }

/* Original text and its stand-ins. */
.secret, .stand, .restored { padding: 1px 7px; border-radius: 6px; font-family: var(--mono); font-size: 0.875em; white-space: nowrap; }
.secret { background: #fde8eb; color: #c2364f; }
.stand { background: #ddf5f6; color: var(--teal-ink); }
.restored { background: #e3f4ea; color: #227a4e; }
.sky .secret { background: rgba(255, 120, 140, 0.14); color: #ff9aa8; }
.sky .stand { background: rgba(32, 187, 199, 0.16); color: #6fe3ec; }

/* Status pills, as the app shows them. */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.redacted { background: #ddf5f6; color: var(--teal-ink); }
.pill.blocked { background: #fde8eb; color: #c2364f; }
.pill.warned { background: #fdf1d8; color: #a6700c; }
.pill.trusted { background: #e6edf4; color: #35577a; }
.pill.clean { background: #e3f4ea; color: #227a4e; }

/* The last screen: one line, the buttons, and the crew at work below. */
.final { position: relative; padding: 0; overflow: hidden; color: var(--sky-ink); text-align: center; background: linear-gradient(#0a0e15, var(--night) 45%); }
.final .copy { position: relative; z-index: 2; padding: clamp(80px, 8vw, 130px) 0 0; }
.final h2 { margin-top: 0; font-size: clamp(30px, 1.6vw + 20px, 44px); }
.final p { margin-top: 14px; color: var(--sky-muted); text-wrap: balance; }
.final .cta { justify-content: center; margin-top: 28px; }
.final .crew { margin-top: clamp(40px, 5vw, 80px); }

/* Footer. */
.footer { background: var(--ground); color: #8b94a5; font-size: 13.5px; padding: 40px 0; border-top: 4px solid #0b0f17; }
.footer .wrap { display: flex; justify-content: space-between; gap: 40px; }
.footer .brand { color: #e9e3d2; font-size: 17px; }
.footer .brand img { width: 26px; height: 26px; }
.footer .about p { margin-top: 10px; color: #8b94a5; }
.footer .about small { display: block; margin-top: 4px; font-size: 12.5px; color: #677083; }
.footer nav { display: flex; gap: 60px; }
.footer nav div { display: grid; gap: 6px; align-content: start; }
.footer nav b { color: #c9ced8; font-weight: 600; margin-bottom: 4px; }
.footer nav a:hover { color: #fff; }

@media (max-width: 1080px) {
  .topbar-row { gap: 20px; }
  .links { gap: 20px; margin-left: 4px; }
}
@media (max-width: 900px) {
  .nav-github { display: none; }
  .topbar .btn-sm + .btn-sm { margin-left: 0; }
}
@media (max-width: 768px) {
  .topbar-row { height: 60px; gap: 10px; }
  .brand { font-size: 17px; }
  .brand img { width: 26px; height: 26px; }
  .links, .lang { display: none; }
  .menu-toggle { display: grid; }
  .footer .wrap { flex-direction: column; gap: 28px; }
  .footer nav { gap: 40px; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  :root { --wrap: calc(100% - 40px); }
  br.narrow { display: inline; }
  br.wide { display: none; }
  .hero .cta, .final .cta { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .hero .cta .btn, .final .cta .btn { width: 100%; }
  .points { grid-template-columns: 1fr !important; gap: 18px; }
  .footer nav { gap: 28px 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .twinkle { animation: none; opacity: 0.45; }
  .btn { transition: none; }
}
