/* Slop Check landing page. One column, white paper, black text, navy engraving. */

:root {
  --paper: #ffffff;
  --text: #000000;
  /* The statue keeps its own colour; shader.js holds the matching value. */
  --engraving: #22315c;
  --pill-bg: #fff5b8;
  --pill-border: #f1b82d;
  --pill-text: #5a4300;
  --measure: 34rem;
  /* One value for the page gutter, so the statue lines up with the text. */
  --page-inset: 1.25rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 3.5rem var(--page-inset) 3rem;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--text);
  font: 400 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

/* Sits against the left edge at every width, never centred in the viewport. */
main {
  max-width: var(--measure);
  margin: 0;
}

.top-nav {
  margin: 0 0 2rem;
  padding-left: 1rem;
}

.top-nav a {
  display: inline-block;
  border: 1px solid var(--engraving);
  border-radius: 4px;
  background: var(--engraving);
  color: var(--paper);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: #304578;
}

/* --- statue ------------------------------------------------------------- */

/*
 * The statue is deliberately wider than the text column, so it reads as
 * breaking out of it, and the pill sits on top of the picture rather than
 * below it.
 */
.hero {
  position: relative;
  margin-bottom: 2.5rem;
}

.statue {
  margin: 0;
  width: min(52rem, calc(100vw - var(--page-inset) * 2));
}

#statue-canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* --- masthead ----------------------------------------------------------- */

.masthead {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  margin: 0;
}

/* Kept in the document, kept off the screen. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- pill (same look as the button the extension injects) ---------------- */

.pill {
  appearance: none;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  cursor: pointer;
  font: 600 13px/1.2 system-ui, sans-serif;
  padding: 6px 10px;
  white-space: nowrap;
}

.pill--hero {
  font-size: 1.5rem;
  padding: 12px 22px;
  border-width: 2px;
}

/*
 * One quick wiggle when the pointer arrives, then it settles. Restarts on the
 * next hover rather than running on a loop.
 */
#hero-pill:hover,
#hero-pill:focus-visible {
  background: #ffe96b;
  animation: wiggle 420ms ease-out 1;
}

/* Swings hard first and loses amplitude on each pass back through centre. */
@keyframes wiggle {
  0% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(-5deg);
  }
  32% {
    transform: rotate(4deg);
  }
  50% {
    transform: rotate(-2.5deg);
  }
  68% {
    transform: rotate(1.5deg);
  }
  85% {
    transform: rotate(-0.7deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.pill--inline {
  cursor: default;
  padding: 2px 8px;
}

@media (prefers-reduced-motion: reduce) {
  #hero-pill:hover,
  #hero-pill:focus-visible {
    animation: none;
  }
}

/* --- text --------------------------------------------------------------- */

section {
  margin-bottom: 2rem;
  padding: 0rem 1rem 0rem 1rem
}

h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(0,0,0,0.8)
}

p {
  margin: 0;
  text-wrap: pretty;
  color: rgba(0,0,0,0.8)
}

a {
  color: var(--text);
  text-decoration-color: var(--pill-border);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

a:hover {
  background: var(--pill-bg);
}

footer {
  margin-top: 3rem;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  padding-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.65;
}

/* --- wider screens ------------------------------------------------------ */

/* Tablet and up get a deeper inset, so the column is not jammed to the edge. */
@media (min-width: 48rem) {
  body {
    --page-inset: 3rem;
    padding: 4.5rem var(--page-inset) 4rem;
  }
}

/* --- small screens ------------------------------------------------------ */

@media (max-width: 30rem) {
  /* No top padding: the statue starts at the very top of the screen. */
  body {
    --page-inset: 1.5rem;
    padding: 0 var(--page-inset) 2.5rem;
  }

  /*
   * The statue breaks out of the body gutters and runs edge to edge. The text
   * below keeps its inset.
   */
  .statue {
    width: auto;
    margin-inline: calc(var(--page-inset) * -1);
    overflow: hidden;
  }

  /*
   * Drawn wider than the screen so the picture stands taller; the extra width
   * is clipped off both sides. shader.js reads the canvas width, so it draws
   * at this size rather than being stretched.
   */
  #statue-canvas {
    width: 115%;
    margin-left: -7.5%;
  }

  .masthead {
    left: 0.75rem;
    bottom: 2rem;
  }

  .pill--hero {
    font-size: 1.25rem;
    padding: 10px 18px;
  }
}

/* --- privacy page ------------------------------------------------------- */

/*
 * The privacy page reuses the text styles above and skips the statue, so it
 * only needs a heading block and list styling of its own.
 */
.page-head {
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.page-head h1 {
  margin: 0 0 0.3rem;
  font-size: 1.6rem;
  font-weight: 700;
}

.back {
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.dateline {
  font-size: 0.85rem;
  opacity: 0.65;
}

.page ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: rgba(0, 0, 0, 0.8);
}

.page li {
  margin-bottom: 0.2rem;
}

.page p + p {
  margin-top: 0.7rem;
}

.page code {
  font-size: 0.9em;
}
