/* Badnotes website: the app's hand-drawn (sketchbook-ui) look — paper, pencil lines, ink and Caveat handwriting. */
@font-face {
  font-family: 'Caveat';
  src: url('fonts/caveat-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Caveat';
  src: url('fonts/caveat-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #f1ebdd;
  --card: #fbf8f1;
  --ink: #2a2a2a;
  --text: #2a2a2a;
  --muted: #5c564a;
  --pencil: #8a8578;
  --line: #d8cfbb;
  --highlight: #8ecbff;
  --soft: color-mix(in srgb, var(--highlight) 45%, #fbf8f1);
  --link: #22467f;
  --wobble: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --wobble-sm: 12px 5px 11px 6px / 6px 11px 5px 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1b18;
    --card: #2a2925;
    --ink: #e9e3d3;
    --text: #ece6d6;
    --muted: #bdb5a3;
    --pencil: #8f887a;
    --line: #4a463d;
    --soft: color-mix(in srgb, var(--highlight) 38%, #2a2925);
    --link: #bfd0ff;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html {
  background: var(--paper);
}
body {
  margin: 0;
  padding-inline: 16px;
  color: var(--text);
  font: 17px/1.55 'Caveat', 'Segoe Print', 'Comic Sans MS', cursive;
  font-size-adjust: ex-height 0.5;
  background: var(--paper);
}
/* Faint paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  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 type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
main {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding-block: 48px 64px;
}
h1,
h2 {
  font-weight: 700;
  line-height: 1.15;
}
h1 {
  margin: 0;
  font-size: 2.6rem;
}
h2 {
  margin: 30px 0 8px;
  font-size: 1.7rem;
}
p,
li {
  color: var(--muted);
}
a {
  color: var(--link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
strong {
  color: var(--text);
}

/* Title with a pencil underline */
header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 30px;
}
.logo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.tagline {
  color: var(--muted);
  font-size: 1.2rem;
}
.scribble {
  display: block;
  width: 190px;
  height: 14px;
  margin: -4px 0 2px;
}
.scribble path {
  stroke: var(--ink);
}

/* Paper cards with a hand-drawn border */
.card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--wobble);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.1), 5px 10px 22px rgba(0, 0, 0, 0.06);
  padding: 22px 26px;
  margin-top: 26px;
  transform: rotate(-0.3deg);
}
.card:nth-of-type(even) {
  transform: rotate(0.35deg);
}
.card h2:first-child {
  margin-top: 0;
}
/* A strip of tape holding the card down */
.card.taped::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  width: 96px;
  height: 24px;
  margin-left: -48px;
  background: color-mix(in srgb, var(--soft) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--pencil) 40%, transparent);
  transform: rotate(-3deg);
}

/* Hand-drawn ticks for lists */
ul {
  list-style: none;
  padding-left: 4px;
}
li {
  position: relative;
  padding-left: 30px;
  margin: 6px 0;
}
li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.35em;
  width: 18px;
  height: 18px;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M 4 13 Q 7 15, 9 18 L 10 19 Q 14 12, 20 5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M 4 13 Q 7 15, 9 18 L 10 19 Q 14 12, 20 5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.8;
}

/* Download buttons: sticky notes in the highlight colour */
.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 12px 0 16px;
}
.dl {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 20px;
  background: var(--soft);
  color: var(--text);
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: var(--wobble-sm);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.14);
  transform: rotate(-1deg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dl:nth-child(2) {
  transform: rotate(0.8deg);
}
.dl strong {
  font-size: 1.6rem;
}
.dl span {
  color: var(--muted);
}
.dl:hover {
  transform: translate(-2px, -2px) rotate(-1.5deg);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.16);
}
.dl:active {
  transform: translate(1px, 1px) rotate(0deg);
  box-shadow: none;
}
.version {
  display: inline-block;
  padding: 0 10px;
  border: 1.5px dashed var(--pencil);
  border-radius: var(--wobble-sm);
  color: var(--muted);
}

code {
  font: 0.95em ui-monospace, Consolas, monospace;
  font-size-adjust: none;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--wobble-sm);
  padding: 0 6px;
  overflow-wrap: anywhere;
}
.meta {
  color: var(--muted);
}
.back {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

footer {
  margin-top: 44px;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
  color: var(--muted);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
  .dl,
  .dl:hover {
    transition: none;
    transform: none;
  }
}
