/* Postcard Peaks downloads: the game's own palette (its buttons' sage and ochre, its cards' cream) and its font. */
@font-face {
  font-family: "Patrick Hand";
  src: url("fonts/PatrickHand-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #f3e8d2;
  --card: #fbf4e8;
  --edge: #d9c7a4;
  --ink: #33291f;
  --ink-soft: #5b4d3d;
  --sage: #a9b08e;
  --olive: #4b5728;
  --olive-hover: #3c4620;
  --on-olive: #fbf4e8;
  --ochre: #ddab54;
  --focus: #1d4f91;
  --stamp: #c0532f;
  --hand: "Patrick Hand", "Comic Sans MS", "Segoe Print", cursive;
  --text: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1a14;
    --card: #2b241c;
    --edge: #5a4b37;
    --ink: #f3e9d8;
    --ink-soft: #cdbfa8;
    --sage: #7f876a;
    --olive: #b9c48a;
    --olive-hover: #cbd59e;
    --on-olive: #1f1a14;
    --ochre: #e0b35f;
    --focus: #8fb8ff;
    --stamp: #e07a55;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.35), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(120, 90, 40, 0.08), transparent 45%);
  color: var(--ink);
  font: 1.0625rem/1.55 var(--text);
  padding: 24px 16px 40px;
}
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: 0.9em; overflow-wrap: anywhere; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--card); color: var(--ink); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { left: 16px; outline: 3px solid var(--focus); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* the postcard: a card with a stamp, its edge perforated */
.postcard {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  background: var(--card);
  border: 2px dashed var(--edge);
  border-radius: 18px;
  padding: 28px 24px 24px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 12px 30px rgba(70, 50, 20, 0.12);
}
.masthead {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 8px 20px;
  align-items: center;
  padding-right: 64px;
}
.hero { width: 100%; }
.kicker { margin: 0; font: 1.05rem var(--hand); color: var(--ink-soft); letter-spacing: 0.04em; }
h1 { margin: 0; font: 400 clamp(2.4rem, 7vw, 3.6rem)/1 var(--hand); }
h2, h3 { font-family: var(--hand); font-weight: 400; }
.tagline { margin: 8px 0 0; color: var(--ink-soft); }
.stamp {
  position: absolute; top: 18px; right: 18px;
  width: 76px; height: 88px; display: grid; place-items: center;
  border: 3px dotted var(--stamp); border-radius: 6px; transform: rotate(4deg);
  background: var(--paper);
}
.stamp img { width: 52px; }

/* the waiting state */
.state {
  display: flex; gap: 16px; align-items: center;
  margin: 24px 0 8px; padding: 14px 16px;
  border-radius: 12px; background: var(--paper); border: 1px solid var(--edge);
}
.state img { width: 120px; flex: none; }
.state p { margin: 0; }

/* the two downloads */
.downloads {
  display: grid; gap: 16px; margin-top: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  display: flex; flex-direction: column; align-items: stretch;
  padding: 16px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--edge);
}
.card-cat { align-self: center; width: auto; height: 130px; object-fit: contain; margin-bottom: 4px; }
.card h3 { margin: 0 0 10px; font-size: 1.8rem; text-align: center; }
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 10px 16px; border-radius: 26px;
  font: 1.3rem/1.2 var(--hand); text-decoration: none;
  background: var(--olive); color: var(--on-olive); border: 2px solid var(--olive);
}
a.btn:hover { background: var(--olive-hover); border-color: var(--olive-hover); }
a.btn:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.card.waiting .btn {
  background: transparent; color: var(--ink-soft); border: 2px dashed var(--sage); cursor: not-allowed;
}
.note { margin: 10px 0 0; text-align: center; color: var(--ink-soft); font-size: 0.95rem; }
.facts { margin: 14px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.95rem; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; min-width: 0; }
.facts .hash { font-size: 0.78rem; line-height: 1.4; }

/* installing */
.install { margin-top: 28px; }
.install h2 { margin: 0 0 8px; font-size: 1.9rem; }
details { border-top: 1px dashed var(--edge); padding: 10px 0; }
summary { cursor: pointer; font: 1.35rem var(--hand); }
details ol { margin: 8px 0 0; padding-left: 1.4em; }
details li { margin: 6px 0; }
.aside { color: var(--ink-soft); font-size: 0.95rem; margin: 8px 0 0; }

footer {
  display: flex; gap: 14px; align-items: center;
  margin-top: 24px; padding-top: 14px; border-top: 1px dashed var(--edge);
  color: var(--ink-soft); font-size: 0.95rem;
}
footer p { margin: 0; }
.yarn { width: 56px; flex: none; }

@media (max-width: 560px) {
  body { padding: 12px 16px 28px; }
  .postcard { padding: 20px 16px 18px; border-radius: 14px; }
  .masthead { grid-template-columns: 1fr; text-align: center; padding-right: 0; }
  .hero { width: 170px; justify-self: center; }
  .stamp { width: 58px; height: 68px; top: 12px; right: 12px; }
  .stamp img { width: 40px; }
  .state { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: no-preference) {
  a.btn { transition: background-color 0.15s ease; }
}
