/* Frank's website. Colours follow docs/drawing-frank.md. */

:root {
  --bg: #FFF8EF;
  --card: #FFFFFF;
  --text: #33231A;
  --muted: #6B4F3F;
  --link: #A84A12;
  --rule: #F0DCC4;
  --button: #1F7A6F;
  --button-text: #FFFFFF;
  --quiet: #F6E6D3;
  --quiet-text: #33231A;
  --invite: #2A9D8F;
  --ledge: #A3A3A3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1714;
    --card: #261F1B;
    --text: #FFF1DE;
    --muted: #D9C3AE;
    --link: #F2A066;
    --rule: #3A2F28;
    --button: #3DB5A6;
    --button-text: #0E1F1C;
    --quiet: #3A2F28;
    --quiet-text: #FFF1DE;
    --invite: #3DB5A6;
    --ledge: #6E6E6E;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 16px 2.5rem;
}

a { color: var(--link); text-underline-offset: 0.15em; }

h1, h2 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); margin: 0 0 0.4rem; }
h2 { font-size: 1.45rem; margin: 2.5rem 0 0.6rem; }

code {
  font-family: "Illinois Mono", ui-monospace, monospace;
  font-size: 0.9em;
  background: var(--quiet);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 2rem;
}

.hero-frank {
  display: block;
  width: min(260px, 70vw);
  height: auto;
}

/* On a phone: Frank peeks over a line (art/frank-ledge.svg). That art is
   512 wide and starts at 40; the ledge in it is at 304, and the page draws
   the line there, behind him, so his paws rest on it. */
.hero-art picture { display: block; }

@media (max-width: 639px) {
  .hero-art {
    --size: min(240px, 64vw);
    position: relative;
    align-self: stretch;
    margin-bottom: 1.2rem;
  }
  .hero-art::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--size) * (304 - 40) / 512 - 1.5px);
    height: 3px;
    background: var(--ledge);
  }
  .hero-frank {
    position: relative;
    width: var(--size);
    height: auto;
    margin: 0 auto;
  }
}

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0;
}

@media (min-width: 640px) {
  .hero {
    flex-direction: row;
    text-align: left;
    gap: 1.5rem;
    padding-top: 3rem;
  }
  .hero-art { flex: none; margin-left: -1.5rem; }
  .hero-frank { width: 240px; }
}

/* Invitation */

.invite {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 6px solid var(--invite);
  border-radius: 12px;
}

.invite h2 { margin-top: 0; }
.invite ol { padding-left: 1.3rem; }
.invite li { margin-bottom: 0.4rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0 0.5rem;
}

.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  color: var(--button-text);
  background: var(--button);
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  cursor: pointer;
}

.button-quiet {
  color: var(--quiet-text);
  background: var(--quiet);
}

.button:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

.copied { color: var(--muted); font-size: 0.95rem; }
.small { font-size: 0.9rem; color: var(--muted); }

/* Content */

.about ul { padding-left: 1.2rem; }
.about li { margin-bottom: 0.5rem; }

.get {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

/* Get Frank: the platforms he's coming to, with their logos (see Attributions). */

.platforms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1rem 0 0;
  padding: 0;
}

.platform {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  font-weight: 500;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.platform .logo { height: 30px; width: auto; }
.platform svg.logo { height: 22px; }

/* The footer, as on Iceblock's site. */

footer { margin-top: 3rem; font-size: 0.85rem; color: var(--muted); }
footer a, footer button.link { color: inherit; }
/* Who makes Frank, and his licence. */
footer p.made { margin: 8px 0 0; }
/* The flag keeps its colours, whatever the theme. */
footer p.made img { vertical-align: -1px; border-radius: 1px; filter: none; forced-color-adjust: none; }
body.home footer, body.lost footer { text-align: center; }

button.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

/* The Attributions popup. */

dialog {
  max-width: min(560px, calc(100vw - 32px));
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0;
}
dialog > div { padding: 22px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog h2 { margin: 0 0 14px; }
dialog h3 { font-size: 1rem; margin: 16px 0 6px; }
dialog p { font-size: 0.93rem; margin: 0 0 10px; }
dialog .close { display: flex; justify-content: flex-end; margin-top: 8px; }
dialog .close button {
  font: inherit;
  font-weight: 600;
  color: var(--button-text);
  background: var(--button);
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
}

/* A page of text: the privacy policy. */

.doc-header { display: flex; align-items: center; gap: 10px; padding-top: 1.5rem; }
.doc-header .home { display: flex; }
.doc-header .site { margin: 0; font-weight: 600; font-size: 1.15rem; }
.doc-header .site a { color: inherit; text-decoration: none; }
.doc-content h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 1.5rem 0 0.3rem; }
.doc-content h3 { font-size: 1.1rem; margin: 2rem 0 0.4rem; }
.muted { color: var(--muted); }

/* Frank peeking in from the right edge. Only where there's room beside the text. */

.peek {
  display: none;
  position: fixed;
  right: 0;
  bottom: 14vh;
  width: 130px;
  height: auto;
  cursor: pointer;
  transform: translateX(105%);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.peek.in { transform: translateX(0); }

@media (min-width: 960px) {
  .peek { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .peek { transition: none; }
}

/* 404 */

body.lost main { text-align: center; padding-top: 3rem; }
.lost-frank { width: 200px; height: auto; transform: rotate(-8deg); }
