/* trove.you while the website is paused (docs/WEBSITE.md, "Paused"): the landing page (index.html), the invalid-link
   page (404.html), About & Privacy and Terms (about.html, terms.html). Public boards are the web app's own page
   (app.html); the app's bar and beta link are trove-bar.css. Black, white and grey, as the iOS app's welcome screen (ios/App/GemLandingD.swift). */
:root {
  color-scheme: dark;
  --bg: #000;
  --text: #fff;
  --muted: #979797; /* the app's troveMuted */
  --line: rgb(255 255 255 / 0.12);
  --tile: #141414;
  --blue: #2f86f6;
  --blue-deep: #1663d6;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --column: 440px;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
img { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the welcome column (landing, invalid link) ---------- */
.welcome { position: relative; min-height: 100vh; padding: 0 0 56px; overflow: hidden; }
/* The gem pile round the wordmark (gem-pile.js), one pixel a block of 2 px. Pulled down (the opening), everything but
   the wordmark fades (--page-shown). */
.gem-pile { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; image-rendering: pixelated; }
.welcome-page > :not(.wordmark, .welcome-top), .welcome-top > :not(.wordmark) { opacity: var(--page-shown, 1); }
.welcome-page { position: relative; z-index: 1; max-width: var(--column); margin: 0 auto; padding: 64px 0 0; }
.wordmark {
  margin: 0 0 36px; text-align: center; font-size: 74px; line-height: 1.05; font-weight: 700; letter-spacing: -1.5px;
}
.wordmark a { text-decoration: none; }
.headline {
  margin: 0 32px 46px; text-align: center; font-size: 26px; line-height: 1.28; font-weight: 600; text-wrap: balance;
}

/* The card: black, lit from inside, with a white edge a point down (the app's InnerEdgeLight and card glow). */
.card {
  position: relative; margin: 0 32px 46px; padding: 48px 41px; border-radius: 44px; background: #000; overflow: hidden;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.32), inset 0 0 0 1px rgb(255 255 255 / 0.06);
}
.card::before {
  content: ""; position: absolute; inset: 18% 6% 8%; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%, rgb(255 255 255 / 0.13), transparent 70%);
  filter: blur(18px);
}
.card > * { position: relative; z-index: 1; }
.card p { margin: 0 10px 24px; color: var(--muted); }
.card p.strong { color: var(--text); font-weight: 600; }
.card p.small { margin: 22px 10px 0; font-size: 15px; }

/* Three small pixel gems between the page's parts. */
.divider { display: flex; justify-content: center; gap: 22px; margin: 0 0 36px; }
.divider-after { margin: 64px 0 0; }
.divider canvas { width: 14px; height: 14px; image-rendering: pixelated; }

.reasons { margin: 0 37px; display: grid; gap: 64px; }
.reasons h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.25; font-weight: 600; }
.reasons p { margin: 0; color: var(--muted); line-height: 1.55; }

.links { margin: 46px 37px 0; display: grid; gap: 24px; justify-items: start; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--text); }

/* ---------- the landing page and the invalid-link page: the logo in its gems, the app's icon and a few lines ---------- */
:is([data-page="landing"], [data-page="invalid"]) .welcome { padding: 0; }
:is([data-page="landing"], [data-page="invalid"]) .welcome-page {
  max-width: none; min-height: 100vh; min-height: 100svh; padding: 0 24px; display: flex; flex-direction: column;
}
.welcome-top { flex: 1; padding: 48px 0 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.welcome-top .wordmark a { text-decoration: none; }
.welcome-top .wordmark { cursor: default; -webkit-user-select: none; user-select: none; }
/* The headline, the line about Trove, and the app's icon beside its beta link (the App Store once it's out, site.js).
   The mouse on the logo turns them all black, the logo too (gem-pile.js, --page-dark): their colours are set here only,
   so nothing later sets them back. */
.welcome-top .wordmark { margin-bottom: 64px; }
.welcome-top .headline {
  margin: 0 0 22px; font-size: 22px; color: color-mix(in srgb, var(--text), #000 calc(var(--page-dark, 0) * 100%));
}
.intro {
  max-width: 340px; margin: 0 0 48px; text-align: center; font-size: 17px; line-height: 1.2; text-wrap: balance;
  color: color-mix(in srgb, var(--muted), #000 calc(var(--page-dark, 0) * 100%));
}
.get-beta {
  display: flex; align-items: center; gap: 18px; text-decoration: none; font-size: 17px; line-height: 1.2;
  color: color-mix(in srgb, #3b8cff, #000 calc(var(--page-dark, 0) * 100%));
}
/* The icon in a frame of its own, so its inner glow lies over the picture (an image's own inset shadow is drawn under
   it). The mouse on the logo turns the icon black and fades in a white glow inside its edge: a bloom round the black
   icon. */
.get-beta-icon {
  position: relative; flex: none; width: 72px; height: 72px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 1px rgb(255 255 255 / calc(0.08 * (1 - var(--page-dark, 0))));
}
.get-beta-icon img { width: 100%; height: 100%; filter: brightness(calc(1 - var(--page-dark, 0))); }
.get-beta-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 14px 1px rgb(255 255 255 / calc(0.55 * var(--page-dark, 0)));
}
.get-beta:hover span { text-decoration: underline; text-underline-offset: 3px; }
:is([data-page="landing"], [data-page="invalid"]) .links a { color: color-mix(in srgb, var(--muted), #000 calc(var(--page-dark, 0) * 100%)); }
:is([data-page="landing"], [data-page="invalid"]) .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; margin: 0; padding: 0 0 32px; }
:is([data-page="landing"], [data-page="invalid"]) .links a { font-size: 15px; }
:is([data-page="landing"], [data-page="invalid"]) .links a:hover { color: var(--text); }
@media (min-width: 760px) {
  .welcome-top .wordmark { font-size: clamp(74px, 8vw, 104px); letter-spacing: -2px; margin-bottom: 72px; }
  .welcome-top .headline { font-size: clamp(22px, 2.6vw, 30px); }
  .intro { max-width: 460px; font-size: 19px; margin-bottom: 56px; }
  .get-beta { font-size: 19px; gap: 22px; }
  .get-beta-icon { width: 88px; height: 88px; border-radius: 20px; }
}

.site-foot { max-width: 1400px; margin: 0 auto; padding: 0 24px 40px; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.site-foot a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-foot a:hover { color: var(--text); }

/* ---------- About & Privacy, Terms (about.html, terms.html) ---------- */
.text-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: rgb(0 0 0 / 0.82); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.text-head .trove-mark { font-size: 28px; }
.text-page { max-width: 680px; margin: 0 auto; padding: 40px 24px 64px; }
.text-page h1 { margin: 0 0 28px; font-size: 34px; line-height: 1.15; font-weight: 700; }
.text-page h2 { margin: 40px 0 12px; font-size: 22px; line-height: 1.25; font-weight: 600; scroll-margin-top: 90px; }
.text-page p, .text-page li { color: #d6d6d6; }
.text-page ul { padding-left: 22px; }
.text-page li { margin: 0 0 10px; }
.text-page a { color: #8cc0ff; }

/* ---------- the gem pile's debug panel (gem-pile.js; trove.you/?debug) ---------- */
.gem-debug {
  position: fixed; top: 12px; right: 12px; z-index: 100; width: 290px; max-height: calc(100vh - 24px); overflow: auto;
  padding: 10px 12px; border-radius: 12px; background: rgb(24 24 24 / 0.94); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
  color: #ddd; font: 12px/1.3 var(--font);
}
.gem-debug h3 { margin: 10px 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #888; }
.gem-debug h3:first-child { margin-top: 0; }
.gem-debug label { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; margin: 0 0 6px; }
.gem-debug label.changed span { color: #6cf; }
.gem-debug output { font-variant-numeric: tabular-nums; color: #fff; }
.gem-debug input { grid-column: 1 / -1; width: 100%; margin: 2px 0 0; }
.gem-debug-buttons { display: flex; gap: 6px; margin-top: 8px; }
.gem-debug-buttons button { flex: 1; padding: 6px 4px; border: 0; border-radius: 7px; background: #333; color: #eee; font: inherit; cursor: pointer; }
.gem-debug-buttons button:hover { background: #444; }
.gem-debug.folded > :not(.gem-debug-buttons) { display: none; }
.gem-debug.folded .gem-debug-buttons { margin-top: 0; }
.gem-debug h2 { margin: 14px 0 2px; font-size: 13px; font-weight: 700; color: #fff; }
.gem-debug-states { display: flex; gap: 4px; margin: 0 0 4px; }
.gem-debug-states button { flex: 1; padding: 5px 4px; border: 0; border-radius: 7px; background: #333; color: #bbb; font: inherit; cursor: pointer; }
.gem-debug-states button.on { background: #3b8cff; color: #fff; }
.gem-debug label.last span { text-decoration: underline; text-underline-offset: 3px; }
.gem-debug-curve { display: block; margin: 6px 0 4px; border-radius: 8px; touch-action: none; cursor: crosshair; }
.gem-debug code { display: block; margin: 0 0 6px; font: 11px ui-monospace, Menlo, monospace; color: #aaa; }
