/*
 * One stylesheet for every page on puzzledeckapp.com.
 *
 * It used to be five copies of the same declarations, pasted into the <style>
 * block of each page — index, privacy, terms, delete-account and credits — and
 * they had already drifted: the home page laid out with flexbox and a footer
 * pinned to the bottom, the legal pages did not, and the table styling existed
 * only in privacy.html. A token changed in one place stayed wrong in four.
 *
 * This is deliberately hand-written CSS with no build step beyond being copied
 * into the output, because the marketing site is static HTML and the whole
 * point of it is that a search engine gets the finished page.
 */

:root {
  color-scheme: light dark;
  --bg: #f7f8f9;
  --fg: #101418;
  --muted: #5a6672;
  --line: #dfe4e8;
  --accent: #1f6feb;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --fg: #e9edf1;
    --muted: #9aa7b2;
    --line: #262d35;
    --accent: #6ea8fe;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent);
}

/* ------------------------------------------------------------------ header */

.masthead {
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  width: min(100%, var(--measure));
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
}

.masthead__brand {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  margin-right: auto;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

.masthead nav a[aria-current='page'] {
  color: var(--fg);
  text-decoration: none;
}

/* -------------------------------------------------------------------- main */

main {
  flex: 1;
  width: min(100%, var(--measure));
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* The home page wants a wider opening than a policy does. */
main.is-home {
  padding-top: 4rem;
}

h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

/* A policy heading is a heading, not a hero. */
.is-doc h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.15rem;
  margin: 2.5rem 0 0.5rem;
}

.is-home h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.35rem;
}

.tagline {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
}

.lead {
  font-size: 1.1rem;
}

.updated {
  color: var(--muted);
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

ul,
ol {
  margin: 0;
  padding-left: 1.1rem;
}

li {
  margin-bottom: 0.4rem;
}

code {
  font-size: 0.9em;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: color-mix(in srgb, var(--line) 40%, transparent);
}

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1rem;
  border-radius: 6px;
  margin: 1.25rem 0;
}

/* ------------------------------------------------------------------- deck */

.deck {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.deck li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
  margin: 0;
}

/* A list of puzzles, each a link to its own page. */
.puzzles {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.75rem;
}

.puzzles li {
  margin: 0;
}

.puzzles a {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
  color: inherit;
}

.puzzles__emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.puzzles__name {
  font-weight: 600;
  color: var(--accent);
}

.puzzles__genre {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------- calls */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.button {
  font: inherit;
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--fg);
}

.button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ----------------------------------------------------------------- footer */

footer.sitefoot {
  border-top: 1px solid var(--line);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

footer.sitefoot a {
  color: inherit;
}

/* A footer inside a document, as the legal pages have. */
main > footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- consent */

/*
 * Built by analytics.js rather than by any page, which is why the markup is
 * not here and the styles are. Nothing loads until somebody says yes.
 */
.consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.25rem;
  background: var(--bg);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.consent p {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
}

.consent__actions {
  display: flex;
  gap: 0.5rem;
}

.consent button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.consent__yes {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
