/*
 * joinbits.app (design section 12, docs/design/web-v8). The app's dark base (apps/mobile/src/ui/theme.ts, K tokens)
 * with one butter accent. One stylesheet, one breakpoint at 720px: below it the footer stacks. The header is only the
 * wordmark, linking home; Terms, Privacy and Support live in the footer. No scripts on these pages.
 */
:root {
  --bg: #100D0B;
  --surface: #1C1815;
  --raised: #2A2420;
  --text: #F7F1EA;
  --muted: #A89A8E;
  --accent: #FFD23F;
  --on-accent: #1A1306;
  --hairline: rgba(255, 247, 238, 0.09);
  /* The tile's illustrated halves (design only, not app tokens). */
  --half-warm-from: #8A4636;
  --half-warm-to: #2E1620;
  --skin-warm: #D9A07A;
  --half-cool-from: #5E3D63;
  --half-cool-to: #1D1320;
  --skin-cool: #E3B08E;
  --dashed: rgba(247, 241, 234, 0.18);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.65 Inter, system-ui, -apple-system, sans-serif;
  overflow-wrap: break-word;
}

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

/* Page frame: header, the page's content, footer at the bottom. */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 22px;
}
.page > main { flex: 1 1 auto; }

/* The wordmark: Bricolage Grotesque with the butter dot. */
.wordmark {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  color: var(--text);
  text-decoration: none;
  font: 800 24px/1 "Bricolage Grotesque", Inter, system-ui, sans-serif;
  letter-spacing: -0.027em;
  margin: 0;
}
.wordmark::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--accent);
}

/* Header: the wordmark, linking home. Home has no rule under it. */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.site-header-home { border-bottom: 0; padding: 18px 0 0; }
.site-header-home .wordmark { font-size: 30px; }
.site-header-home .wordmark::after { width: 8px; height: 8px; margin-top: 3px; }

.footer-links a {
  color: var(--muted);
  font: 500 15px Inter, system-ui, sans-serif;
  text-decoration: none;
}
.footer-links a:hover { color: var(--text); }
.footer-links a[aria-current="page"] { color: var(--text); }

/* Footer: the page links and the support email. */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 22px 0 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer .email { font: 500 15px Inter, system-ui, sans-serif; align-self: flex-start; }

/* Reading pages: Terms, Privacy (680) and Support (880). */
.reading {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 0 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reading-wide { max-width: 880px; }

.reading h1,
.missing h1 {
  margin: 0;
  font: 700 30px/1.1 Inter, system-ui, sans-serif;
  letter-spacing: -0.6px;
}
.reading h2 {
  margin: 8px 0 0;
  font: 700 18px/1.3 Inter, system-ui, sans-serif;
}
.reading p, .reading ul { margin: 0; color: var(--muted); text-wrap: pretty; }
.reading ul { padding-left: 20px; }
.reading li + li { margin-top: 4px; }
.reading strong { color: var(--text); font-weight: 600; }
.updated { font-size: 13px; line-height: 1.4; }

/* Support cards. */
.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reading .card h2 { margin: 0; font: 600 16px/1.3 Inter, system-ui, sans-serif; }
.reading .card p { font-size: 14px; line-height: 1.55; }
.card-email { gap: 4px; }
.card-email .email { font: 600 17px/1.4 Inter, system-ui, sans-serif; align-self: flex-start; }
.help-cards { display: flex; flex-direction: column; gap: 12px; }

/* The tile: two halves side by side. Locked (home): one half shown, the other locked until both are in.
   Missing (not found): one half and an empty dashed outline. --w and --h size one half; the figure is centred in its
   half and scales with --w. */
.tile { display: flex; flex: none; --w: 150px; --h: 240px; }
.tile-locked {
  border-radius: 22px;
  overflow: hidden;
  gap: 2px;
  background: var(--bg);
  box-shadow: rgba(0, 0, 0, 0.8) 0 40px 80px -40px;
}
.tile-missing { --w: 120px; --h: 190px; --r: 22px; gap: 2px; }

.half { width: var(--w); height: var(--h); position: relative; overflow: hidden; flex: none; }
.half-shown { background: linear-gradient(165deg, var(--half-warm-from), var(--half-warm-to)); --skin: var(--skin-warm); }
.tile-missing .half-shown {
  background: linear-gradient(165deg, var(--half-cool-from), var(--half-cool-to));
  --skin: var(--skin-cool);
  border-radius: var(--r) 0 0 var(--r);
}
.half .head,
.half .body { position: absolute; background: var(--skin); }
.half .head {
  width: calc(var(--w) * 0.36);
  height: calc(var(--w) * 0.36);
  left: calc(var(--w) * 0.32);
  top: calc(var(--h) * 0.25);
  border-radius: 50%;
}
.half .body {
  width: calc(var(--w) * 0.72);
  height: var(--h);
  left: calc(var(--w) * 0.14);
  top: calc(var(--h) * 0.25 + var(--w) * 0.36 + 6px);
  border-radius: calc(var(--w) * 0.36) calc(var(--w) * 0.36) 0 0;
  opacity: 0.9;
}
.half-locked {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.half-empty {
  border: 2px dashed var(--dashed);
  border-left: 0;
  border-radius: 0 var(--r) var(--r) 0;
}

/* The lock: a shackle over a body, sized by --lock (the body's width). */
.lock { --lock: 26px; display: flex; flex-direction: column; align-items: center; }
.shackle {
  width: calc(var(--lock) * 0.62);
  height: calc(var(--lock) * 0.5);
  border: calc(var(--lock) * 0.09) solid var(--text);
  border-bottom: 0;
  border-radius: calc(var(--lock) * 0.31) calc(var(--lock) * 0.31) 0 0;
  margin-bottom: -1px;
}
.lock-body {
  width: var(--lock);
  height: calc(var(--lock) * 0.78);
  border-radius: calc(var(--lock) * 0.16);
  background: var(--text);
}

/* Home (12a). */
.home { display: flex; }
.hero {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 44px 0 48px;
}
.hero .tile { order: -1; align-self: center; }
.hero-text { display: flex; flex-direction: column; gap: 22px; }
.wordmark-big { display: none; }
.pitch {
  margin: 14px 0 0;
  font: 700 30px/1.15 Inter, system-ui, sans-serif;
  letter-spacing: -0.7px;
  text-wrap: pretty;
}
.soon {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 500 15px Inter, system-ui, sans-serif;
}
.soon .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* Not found (12e). */
.not-found { display: flex; }
.missing {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 48px 0;
}
.missing .tile { align-self: center; }
.missing-text { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
.missing h1 { line-height: 1.15; }
.missing p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.button {
  align-self: flex-start;
  height: 52px;
  padding: 0 24px;
  border-radius: 26px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 17px Inter, system-ui, sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* Laptop and up. */
@media (min-width: 720px) {
  .page { padding: 0 80px; }

  .site-header { padding: 28px 0; }
  .site-header .wordmark { font-size: 28px; }
  .site-header .wordmark::after { width: 8px; height: 8px; margin-top: 3px; }
  .site-header-home { padding: 36px 0; }
  .site-header-home .wordmark { font-size: 30px; }

  .site-footer {
    padding: 28px 0 36px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .footer-links { gap: 28px; }
  .site-footer .email { align-self: auto; }

  .reading { padding: 80px 0 120px; gap: 16px; }
  .reading h1 { font-size: 48px; letter-spacing: -1.2px; }
  .reading-wide h1 { margin-bottom: 12px; }
  .reading h2 { margin-top: 24px; font-size: 21px; }
  .reading p, .reading ul { font-size: 18px; }
  .updated { font-size: 15px; }

  .card { border-radius: 22px; padding: 22px 24px; gap: 8px; }
  .reading .card h2 { font-size: 18px; }
  .reading .card p { font-size: 16px; }
  .card-email { padding: 24px 26px; }
  .reading .card-email p { font-size: 15px; }
  .card-email .email { font-size: 24px; text-underline-offset: 5px; }
  .help-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

  .tile { --w: 210px; --h: 380px; }
  .tile-locked { border-radius: 28px; }
  .lock { --lock: 34px; }
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 96px;
    align-items: center;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 0 80px;
  }
  .hero .tile { order: 0; }
  .hero-text { gap: 32px; }
  .wordmark-big { display: inline-flex; align-self: flex-start; font-size: 112px; gap: 6.72px; }
  .wordmark-big::after { width: 30px; height: 30px; margin-top: 11px; }
  .pitch { margin: 0; font-size: 48px; line-height: 1.1; letter-spacing: -1.4px; max-width: 600px; }

  .tile-missing { --w: 160px; --h: 260px; --r: 26px; }
  .missing {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 88px;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 0;
  }
  .missing-text { gap: 20px; margin-top: 0; }
  .missing h1 { font-size: 48px; line-height: 1.1; letter-spacing: -1.2px; text-wrap: pretty; }
  .missing p { font-size: 18px; }
  .button { height: 56px; padding: 0 28px; border-radius: 28px; margin-top: 8px; }
}
