/* Takeup's palette, from §2.10 of the Release Plan in the app's repo. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Rethink Sans";
  src: url("fonts/rethink-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rethink Sans";
  src: url("fonts/rethink-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #F7F3EB;
  --surface: #FFF8EA;
  --ink: #1B222B;
  --edge: #1B222B;
  --shadow: #1B222B;
  --muted: #4E5761;
  --accent: #B84832;
  --accent-text: #FFFFFF;
  --accent-shadow: #7C2E1F;
  --heading: #B84832;
  --tomato: #E0614A;
  --marigold: #F9B64F;
  --fern: #387D3D;
  --lake: #3E8FB8;
  --fern-fill: #C6E9C6;
  --marigold-fill: #FED7A3;
  --lake-fill: #BFE4FB;
  --film: #1B222B;
  --band: #B84832;
  --band-text: #FFF8EA;
  --mark: #FED7A3;
  --grain-opacity: 0.35;

  --measure: 40rem;
  --display: "Fraunces", ui-serif, Georgia, serif;
  --sans: "Rethink Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1B222B;
    --surface: #242C37;
    --ink: #F7F3EB;
    --edge: #E9E3D7;
    --shadow: #0B0F14;
    --muted: #B9B4AA;
    --accent: #F57055;
    --accent-text: #1B222B;
    --accent-shadow: #8E3424;
    --heading: #F57055;
    --fern-fill: #2B4630;
    --marigold-fill: #4D3B1F;
    --lake-fill: #1F3B4E;
    --film: #0B0F14;
    --band: #8E3424;
    --band-text: #F7F3EB;
    --mark: rgba(249, 182, 79, 0.3);
    --grain-opacity: 0.12;
  }
}

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

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

body {
  position: relative;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
}

/* Film grain over the whole page. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .1 0 0 0 0 .1 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 1rem;
  transform: translateY(-200%);
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 99px;
  z-index: 20;
}
.skip:focus { transform: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  width: min(100% - 2.5rem, 66rem);
  margin-inline: auto;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  line-height: 1.05;
  text-wrap: balance;
}

/* Header and footer */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font: 900 1.5rem/1 var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.brand img {
  width: 40px;
  height: 40px;
}

.site-header nav ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-header nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

.site-footer {
  margin-top: 4rem;
  border-top: 3px solid var(--edge);
  color: var(--muted);
  font-size: 0.9375rem;
}
main:has(> .band:last-child) + .site-footer { margin-top: 0; border-top: 0; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 2rem 3rem;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; font-weight: 600; }

/* Buttons and badges */

.button,
.coming-soon {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin: 0;
  padding: 0.7rem 1.5rem;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 5px 0 var(--accent-shadow);
  font-weight: 800;
  text-decoration: none;
}
.button:hover { filter: brightness(1.06); }
.button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--accent-shadow); }

.pill {
  display: inline-block;
  padding: 0.1rem 0.65rem;
  border: 2px solid var(--edge);
  border-radius: 99px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.pill.fern { background: var(--fern-fill); }
.pill.marigold { background: var(--marigold-fill); }
.pill.lake { background: var(--lake-fill); }

/* Home page: hero */

.hero {
  position: relative;
  padding-bottom: 5.5rem;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 3rem;
  align-items: center;
  padding-top: 2.5rem;
}
.hero h1 {
  margin: 0 0 1.25rem;
  color: var(--heading);
  font-size: clamp(2.75rem, 6.2vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.hero h1 em { color: var(--ink); }
.lede {
  max-width: 30rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.1875rem;
  text-wrap: pretty;
}
.downloads {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2rem;
}
.requirements {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
}

.stripes {
  position: absolute;
  inset: auto 0 1.5rem;
  display: grid;
  grid-template-rows: repeat(4, 12px);
}
.stripes i:nth-child(1) { background: var(--tomato); }
.stripes i:nth-child(2) { background: var(--marigold); }
.stripes i:nth-child(3) { background: var(--fern); }
.stripes i:nth-child(4) { background: var(--lake); }

/* Home page: the drawing of Takeup sorting a card */

.stage {
  position: relative;
  isolation: isolate;
  padding: 1.5rem 0.5rem 1.5rem 1.75rem;
}
.stage::before {
  content: "";
  position: absolute;
  inset: -2.5rem -1rem;
  z-index: -1;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--marigold-fill) 0 10deg, transparent 10deg 20deg);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
}
.app {
  position: relative;
  background: var(--surface);
  border: 3px solid var(--edge);
  border-radius: 22px;
  box-shadow: 9px 9px 0 var(--shadow);
}
.app-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  padding: 0.65rem 0.9rem;
  border-bottom: 3px solid var(--edge);
  font-weight: 800;
  font-size: 0.875rem;
}
.app-bar .tabs {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}
.app-bar .pill { font-size: 0.6875rem; }
.app-bar .pill.on { background: var(--ink); color: var(--paper); }
.shots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.9rem;
}
.shot {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 7px;
  background: linear-gradient(180deg, #F2A65A 0 45%, #C4553F 45% 60%, #3E6B5A 60%);
}
.shot:nth-child(3n) { background: linear-gradient(180deg, #9FD0E6 0 55%, #E6C58A 55%); }
.shot:nth-child(5n) {
  background:
    radial-gradient(circle at 70% 35%, #FBD27A 0 14%, transparent 15%),
    linear-gradient(#E78B5E, #7E3B45);
}
.shot.current { outline: 3px solid var(--tomato); outline-offset: 2px; }
.shot.rejected::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7F3EB' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / 34% no-repeat,
    rgba(27, 34, 43, 0.72);
}
.app-import {
  display: block;
  width: max-content;
  margin: 0 0.9rem 0.9rem auto;
  padding: 0.35rem 1rem;
  border: 2px solid var(--edge);
  border-radius: 99px;
  background: var(--tomato);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.8125rem;
}
.key {
  position: absolute;
  left: 0;
  top: 48%;
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border: 3px solid var(--edge);
  border-radius: 12px;
  background: var(--marigold);
  box-shadow: 0 5px 0 var(--shadow);
  color: #1B222B;
  font: 900 1.4rem/1 var(--display);
}
.callout {
  position: absolute;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.callout.top { top: 0.2rem; right: 1.5rem; }
.callout.bottom { bottom: 0.2rem; left: 3rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .stage::before { animation: spin 80s linear infinite; }
  .key { animation: press 3.2s infinite; }
  .shot.rejected::after { animation: reject 3.2s infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes press {
  20% { transform: translateY(5px); box-shadow: 0 0 0 var(--shadow); }
  28% { transform: none; box-shadow: 0 5px 0 var(--shadow); }
}
@keyframes reject {
  0%, 20% { opacity: 0; }
  28%, 100% { opacity: 1; }
}

/* Home page: sections */

section { padding-block: 2.5rem; }
section > h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
}

.film {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin: 0;
  padding: 1.6rem 0.8rem;
  border-radius: 10px;
  background: var(--film);
  list-style: none;
}
.film::before,
.film::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  height: 9px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, #F7F3EB 0 11px, transparent 11px 22px);
}
.film::before { top: 0.45rem; }
.film::after { bottom: 0.45rem; }
.film li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.6rem;
  border-radius: 7px;
  background: var(--surface);
  text-align: center;
}
.film .num {
  color: var(--heading);
  font: 900 2rem/1 var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.film .num svg { width: 1.9rem; height: 2rem; }
.film strong { font-size: 0.9375rem; line-height: 1.25; }
.film span { color: var(--muted); font-size: 0.875rem; }
.film .pill { color: var(--ink); }

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}
.card {
  padding: 1.3rem 1.4rem;
  border: 3px solid var(--edge);
  border-radius: 22px;
  background: var(--surface);
}
.card.lake { background: var(--lake-fill); }
.card.marigold { background: var(--marigold-fill); }
.card.fern { background: var(--fern-fill); }
.card h3 { margin: 0 0 0.35rem; font-size: 1.6rem; }
.card p { margin: 0; }
.card a { color: inherit; font-weight: 700; }

.band {
  margin-top: 2.5rem;
  background: var(--band);
  color: var(--band-text);
}
.band .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  padding-block: 2.5rem;
}
.band h2 { margin: 0 0 0.25rem; font-size: clamp(2rem, 4.5vw, 2.75rem); }
.band p { margin: 0; }
.band a { color: inherit; font-weight: 800; }

/* Privacy and support pages */

.doc {
  max-width: var(--measure);
  margin-inline: auto;
  padding-top: 1.5rem;
}
.doc h1 {
  margin: 1rem 0 1.25rem;
  color: var(--heading);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1;
}
.doc h2 {
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 3px solid var(--edge);
  font-size: 1.85rem;
}
.doc h3 { margin: 2rem 0 0.5rem; font-size: 1.35rem; }
.doc li { margin-block: 0.35rem; }
.doc li > ul, .doc li > ol { margin-block: 0.35rem; }
.doc .question { display: inline-block; margin-top: 0.5rem; font-size: 1.0625rem; }
.doc h2, .doc h3 { scroll-margin-top: 1rem; }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--marigold-fill);
}

.table {
  overflow-x: auto;
  margin-block: 1rem;
  border: 3px solid var(--edge);
  border-radius: 14px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9688rem;
}
th, td {
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--edge);
  text-align: left;
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
th { font-weight: 800; }

mark.placeholder {
  background: var(--mark);
  color: inherit;
  padding: 0 0.2em;
  border-radius: 4px;
}

/* Small screens */

@media (max-width: 52rem) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2.5rem; }
  .film { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
}

@media (max-width: 34rem) {
  body { font-size: 1rem; }
  .site-header nav ul { gap: 1rem; }
  .hero .wrap { padding-top: 1.25rem; }
  .stage { padding-left: 1.25rem; }
  .key { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; }
  .callout.top { right: 0.5rem; }
  .callout.bottom { left: 2rem; }
  .shots { gap: 0.35rem; padding: 0.65rem; }
  .downloads { flex-direction: column; align-items: stretch; }
  .button, .coming-soon { justify-content: center; text-align: center; }
  .cards { grid-template-columns: 1fr; }

  /* The strip turns to run down the page, sprockets on each side. */
  .film { grid-template-columns: 1fr; padding: 0.8rem 1.7rem; }
  .film::before, .film::after {
    top: 0.8rem;
    bottom: 0.8rem;
    left: 0.5rem;
    right: auto;
    width: 9px;
    height: auto;
    background: repeating-linear-gradient(180deg, #F7F3EB 0 11px, transparent 11px 22px);
  }
  .film::after { left: auto; right: 0.5rem; }
  .film li {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    justify-items: start;
    align-items: center;
    column-gap: 0.75rem;
    text-align: left;
  }
  .film .num { grid-row: span 2; justify-self: center; }
}
