/*
 * lunalink.ai: the one stylesheet for every page.
 * Plain on purpose: system type, two surfaces, hairline borders. Colours are
 * tokens on :root, and dark mode only swaps the tokens.
 */

:root {
  color-scheme: light dark;
  --ground: #f8f7f4;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #5d5b56;
  --line: #e2dfd7;
  --line-strong: #c9c5bb;
  --gutter: 20px;
  --measure: 640px;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #121212;
    --surface: #1b1b1a;
    --ink: #ecebe7;
    --muted: #a8a59f;
    --line: #2c2b29;
    --line-strong: #4a4844;
  }
}

@media (min-width: 640px) {
  :root { --gutter: 32px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

main { flex: 1; padding: 48px 0 72px; }

/* One column, centred, with the same gutter on both sides at every width. */
.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { color: var(--ink); letter-spacing: -0.015em; text-wrap: balance; }
p, li { text-wrap: pretty; }
h1 { font-size: clamp(30px, 7vw, 40px); line-height: 1.15; font-weight: 650; margin: 0 0 12px; }
h2 { font-size: 21px; line-height: 1.3; font-weight: 620; margin: 44px 0 10px; }
h3 { font-size: 17px; line-height: 1.4; font-weight: 600; margin: 0 0 2px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: 6px; }

.lede { font-size: 19px; line-height: 1.55; color: var(--muted); }
.muted { color: var(--muted); }
.meta { font-size: 14px; color: var(--muted); }
.space-top { margin-top: 36px; }

/* Site header and footer */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand svg { width: 24px; height: 24px; flex: none; }
.brand .tld { color: var(--muted); font-weight: 400; }
.site-nav { display: flex; gap: 22px; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 32px;
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--muted); }

/* App icons: the App Store artwork, with a hairline so it holds its edge on either ground. */

.icon { flex: none; border: 1px solid var(--line); }
.icon-56 { width: 56px; height: 56px; border-radius: 13px; }
.icon-64 { width: 64px; height: 64px; border-radius: 14px; }

.status { margin: 0; font-size: 14px; color: var(--muted); }

.links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; }
.links a { white-space: nowrap; }

/* Home: one card per app */

.apps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 16px; }
.apps li + li { margin-top: 0; }
.app {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.app-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.app-head h2 { font-size: 20px; margin: 0; }
.app-head h2 a { text-decoration: none; }
.app-head h2 a:hover { text-decoration: underline; }
.app > p { color: var(--muted); margin-bottom: 12px; }
.app > p.links { color: var(--ink); margin-bottom: 0; }

.panel {
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel p:last-child { margin-bottom: 0; }
.panel.archive { border-color: var(--line-strong); }

/* App pages: the same identity row and tabs on About, Privacy and Support,
   so switching tabs never moves them. */

.app-hero { display: flex; align-items: center; gap: 16px; }
.app-title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 620; letter-spacing: -0.01em; }

.tabs {
  display: flex;
  gap: 28px;
  margin: 24px 0 36px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.tabs a {
  padding: 10px 0 9px;
  margin-bottom: -1px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.games { list-style: none; padding: 0; margin: 14px 0 14px; border-top: 1px solid var(--line); }
.games li { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.games h3 span { color: var(--muted); font-weight: 400; }
.games p { margin: 0; color: var(--muted); }

.policy h2 { font-size: 19px; margin-top: 36px; }

/* Lists of policies */

.listing { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.listing li + li { margin-top: 0; }
.listing a {
  display: block;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}
.listing a:hover { border-color: var(--line-strong); }
.listing strong { font-weight: 600; }
.listing .label {
  margin-left: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.listing .url { display: block; font-size: 14px; color: var(--muted); }
