@font-face {
  font-family: "Homemade Apple";
  src: url("../fonts/homemade-apple.woff2") format("woff2");
  /* Briefly hide the signature rather than flash it in the fallback font. */
  font-display: block;
}

:root {
  --text: #1d1d1f;
  --ink: #2b3a55;
  --muted: #6e6e73;
  --accent: #418615;
  --accent-hover: #54ae1a;
  --background-top: #daf0fd;
  --background-bottom: #ffffff;
  --rule: rgba(0, 0, 0, 0.08);
  --on-accent: #fff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8ed;
    --ink: #b8c7e6;
    --muted: #98989d;
    --accent: #7cc644;
    --accent-hover: #9ad86c;
    --background-top: #14212b;
    --background-bottom: #111214;
    --rule: rgba(255, 255, 255, 0.1);
    --on-accent: #111214;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(var(--background-top), var(--background-bottom) 480px) var(--background-bottom);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 24px 48px;
}

header {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 40px;
}

header img {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.tagline {
  margin: 2px 0 0;
  font-size: 19px;
  font-style: italic;
}

.dates {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.letter p {
  margin: 0 0 18px;
}

.letter .signature {
  margin-top: 8px;
  color: var(--ink);
  font-family: "Homemade Apple", cursive;
  font-size: 30px;
  line-height: 1.4;
}

section {
  margin-top: 72px;
  text-align: center;
}

h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

section > p {
  margin: 0 auto;
  max-width: 440px;
  color: var(--muted);
  font-size: 15px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 24px;
}

.gallery.iphone {
  grid-template-columns: repeat(3, 1fr);
  max-width: 440px;
  margin: 0 auto 24px;
}

.gallery button {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.gallery button img {
  display: block;
  width: 100%;
  height: auto;
}

.download {
  display: inline-block;
  margin: 20px 0 12px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.download:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
  text-decoration: none;
}

footer {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}

footer a {
  color: inherit;
  font-weight: 600;
}

.screenshot {
  max-width: 90vw;
  max-height: 90vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.6));
}

.screenshot::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 560px) {
  main {
    padding-top: 40px;
  }

  header {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
