/*
  unfck.it — the one stylesheet for every page on the apex.

  index.html is hand-written; terms.html, privacy.html, support.html and delete-account.html are
  rendered from the apps' own legal documents by scripts/build-landing.mjs. They share this file
  so the documents look like the page that links to them, not like a different site.

  It uses the EDITORIAL type system (Fraunces / Work Sans / IBM Plex Mono), not the in-app 8-bit
  one. ../../BRANDING.md draws that line: 8-bit is how the app runs, the editorial voice is for
  "marketing, the website, and documentation". A pixel-art landing page would promise an arcade
  and hand over a diary.
*/

/*
  The fonts are served from this host, never from Google Fonts (#187): a stylesheet or a font
  fetched from Google's font hosts hands every visitor's IP address to Google on every page load,
  which is a transfer /privacy would then have to disclose. The files in
  /fonts are the exact latin-subset files Google Fonts served for this page's old stylesheet URL,
  with each family's OFL licence beside them, and these rules repeat its @font-face declarations:
  one face per weight, `font-display: swap`. Fraunces and Work Sans are variable files, so both of
  their weights point at one file. tests/no-google-fonts.test.ts fails if a Google Fonts URL comes
  back.
*/
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/work-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/work-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
}

:root {
  --ink: #1a1a20;
  --muted: #5c5c68;
  --paper: #fbf8f4;
  --rule: #e4ddd4;
  --untried: #d9702f;
  --thickskin: #a6382f;
  --comeback: #1b6e52;
}

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

body {
  margin: 0;
  padding: clamp(2rem, 8vw, 6rem) 1.5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: "Work Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 40rem;
  margin: 0 auto;
}

/* The studio mark: one dot per app, in app order, each in its own accent. */
.mark {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.mark span {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}
.mark span:nth-child(1) {
  background: var(--untried);
}
.mark span:nth-child(2) {
  background: var(--thickskin);
}
.mark span:nth-child(3) {
  background: var(--comeback);
}
a.mark {
  width: max-content;
}
a.mark:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.125rem, 3vw, 1.3125rem);
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 3.5rem;
  max-width: 32rem;
}

.apps {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border-block: 1px solid var(--rule);
  margin-bottom: 3rem;
}

.app {
  display: block;
  background: var(--paper);
  padding: 1.75rem 0;
  text-decoration: none;
  color: inherit;
  transition: background 120ms ease;
}
.app:hover,
.app:focus-visible {
  background: #fff;
}
.app:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.theme {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.375rem;
}

.name {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
/* The arrow is decoration, so it is generated rather than typed into the document. */
.app:hover .name::after,
.app:focus-visible .name::after {
  content: " \2192";
  color: var(--accent);
}

.tagline {
  color: var(--muted);
  margin: 0;
}

.app-untried {
  --accent: var(--untried);
}
.app-thickskin {
  --accent: var(--thickskin);
}
.app-comeback {
  --accent: var(--comeback);
}

.free {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 3rem;
}
.free strong {
  color: var(--ink);
  font-weight: 500;
}

footer {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}
footer a {
  color: inherit;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* ── The documents: terms, privacy, support ─────────────────────────────────── */

/* The class names below are the ones the shared legal components already use inside the apps
   (.eyebrow, .dim, .stack), restyled for print-like reading rather than for an arcade. */

.doc header .eyebrow {
  margin: 0 0 0.5rem;
}
.doc header h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  margin-bottom: 0.5rem;
}
.doc header .dim {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  margin: 0 0 2rem;
}
.doc .lede {
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dim {
  color: var(--muted);
}

/* Same specificity, so order matters: reset first, then space siblings. */
.stack > * {
  margin-block: 0;
}
.stack > * + * {
  margin-top: 1rem;
}

.doc section {
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  scroll-margin-top: 1.5rem;
}
.doc section:target h2 {
  color: var(--thickskin) !important;
}
.doc section h2 {
  font-size: 0.8125rem;
}
.doc ul {
  list-style: none;
}
.doc li {
  position: relative;
}
/* The three accents again, as bullets, so a long list still carries the mark. */
.doc li::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 0.7em;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--untried);
}
.doc li:nth-child(3n + 2)::before {
  background: var(--thickskin);
}
.doc li:nth-child(3n)::before {
  background: var(--comeback);
}
/* Steps are numbered, not dotted: the order is the instruction (/delete-account). */
.doc ol li::before {
  content: none;
}
.doc a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}
.doc a:hover {
  text-decoration-color: currentColor;
}
.doc footer {
  margin-top: 3rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f1ec;
    --muted: #a09a92;
    --paper: #101014;
    --rule: #2a2a32;
    --untried: #e88a4c;
    --thickskin: #d06a61;
    --comeback: #3fa07d;
  }
  .app:hover,
  .app:focus-visible {
    background: #1a1a20;
  }
}
