/* Night sky, in two designed modes. Every colour is a token with a light and a
   dark value. The page follows the device; the footer switch can pin one. */
:root {
  color-scheme: light dark;
  --bg: #f7f6ff;
  --bg-glow: #e4e0ff;
  --card: #ffffff;
  --raised: #efedff;
  --ink: #17153a;
  --muted: #55527e;
  --line: #dcd9f3;
  --brand: #3b2fb8;
  --accent: var(--brand);
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(23 21 58 / 6%), 0 8px 24px rgb(23 21 58 / 6%);
  --star: rgb(59 47 184 / 18%);
}
:root[data-theme="dark"] {
  --bg: #0a0b1f;
  --bg-glow: #2b2470;
  --card: #15173a;
  --raised: #1d2050;
  --ink: #ecebff;
  --muted: #b1afdc;
  --line: #2a2d5e;
  --brand: #ffd98a;
  --on-accent: #17153a;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 35%);
  --star: rgb(255 255 255 / 55%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b1f;
    --bg-glow: #2b2470;
    --card: #15173a;
    --raised: #1d2050;
    --ink: #ecebff;
    --muted: #b1afdc;
    --line: #2a2d5e;
    --brand: #ffd98a;
    --on-accent: #17153a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 35%);
    --star: rgb(255 255 255 / 55%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 50% -12%, var(--bg-glow) 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 17px/1.6 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
/* a light dusting of stars, drawn in CSS so there's no image to load */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 12%, var(--star) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 64% 34%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 52%, var(--star) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 90% 60%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 80%, var(--star) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 48% 88%, var(--star) 50%, transparent 51%);
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; min-height: 44px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a {
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600;
  padding: 10px 12px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); background: var(--raised); }

/* hero */
.hero { padding: 48px 0 32px; }
.hero h1 { font-size: clamp(34px, 7vw, 56px); line-height: 1.08; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero p.lede { font-size: clamp(18px, 2.6vw, 21px); color: var(--muted); margin: 0; max-width: 40ch; }
.at { color: var(--accent); }

h2 { font-size: 24px; line-height: 1.25; margin: 48px 0 16px; letter-spacing: -0.01em; }
h3 { font-size: 18px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* app cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow);
}
a.card { display: block; color: inherit; text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.app-card { display: flex; flex-direction: column; gap: 12px; }
.app-card .head { display: flex; gap: 14px; align-items: center; }
.app-card img { width: 64px; height: 64px; border-radius: 15px; flex: none; }
.app-card .name { font-size: 20px; font-weight: 700; }
.app-card .kind { color: var(--muted); font-size: 14px; }
.app-card p { margin: 0; }
.app-card .more { color: var(--app); font-weight: 600; font-size: 15px; margin-top: auto; }
.pill {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--raised); border-radius: 999px; padding: 3px 10px;
}

/* product page */
.product-hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 40px 0 16px; }
.product-hero img { width: 128px; height: 128px; border-radius: 29px; box-shadow: var(--shadow); }
.product-hero h1 { font-size: clamp(32px, 6vw, 48px); margin: 6px 0 4px; line-height: 1.1; }
.product-hero .tag { font-size: 20px; color: var(--muted); margin: 0; }
@media (max-width: 560px) {
  .product-hero { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; }
  .product-hero img { width: 96px; height: 96px; border-radius: 22px; }
}
.intro { font-size: 19px; max-width: 60ch; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 20px; border-radius: 999px; font-weight: 700; text-decoration: none;
  background: var(--accent); color: var(--on-accent);
}
.button.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 0; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.features .card p { margin: 0; color: var(--muted); }
.note { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; color: var(--muted); }

/* long text (privacy, terms, support, writing) */
.prose { max-width: 680px; }
.prose h1 { font-size: clamp(30px, 6vw, 40px); line-height: 1.15; margin: 32px 0 6px; }
.prose h2 { font-size: 20px; margin: 32px 0 8px; color: var(--accent); }
.prose ul { padding-left: 22px; }
.prose .card { margin: 16px 0; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; }
.prose pre { background: var(--raised); padding: 14px; border-radius: 12px; overflow-x: auto; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.subnav a {
  font-size: 15px; font-weight: 600; text-decoration: none; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); min-height: 44px; display: inline-flex; align-items: center;
}
.subnav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }

/* list rows (writing, links) */
.rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rows a.card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; min-height: 56px; }
.rows .date { color: var(--muted); font-size: 14px; white-space: nowrap; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* footer */
footer.site {
  margin-top: 72px; padding: 24px 0 40px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center;
}
footer.site a { color: var(--muted); }
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.theme-switch button {
  font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; min-height: 40px; min-width: 48px;
}
.theme-switch button[aria-pressed="true"] { background: var(--raised); color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
