/* playhoneybun.com: the game's own look. Cream paper with stitched edges, honey for what to press,
   brown words, and buttons of clay. The colours are the game's (src/ui/mod.rs), and so are the two
   fonts (assets/fonts): Fredoka for headings, Nunito for everything that is read. */

@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff5e2;        /* BG */
  --paper-deep: #f9e9cc;   /* BG_SOLID */
  --pale: #fff9ec;         /* PALE */
  --edge: #d6a668;         /* EDGE */
  --stitch: rgba(150, 104, 52, 0.55);
  --text: #543824;         /* TEXT */
  --muted: #7d5f47;        /* MUTED, a little darker so small words read */
  --honey: #ffb84d;        /* ACCENT */
  --honey-hi: #ffce72;     /* ACCENT_HI */
  --honey-low: #dc8826;    /* ACCENT_LOW */
  --picked: #ffe09c;       /* PICKED */
  --strong: #c46810;       /* STRONG */
  --ink: #4a2e14;          /* INK */
  --mint: #2e966e;
  --shadow: 0 10px 28px rgba(120, 70, 20, 0.16), 0 2px 6px rgba(120, 70, 20, 0.10);
  --radius: 22px;
  --page: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper-deep);
  color: var(--text);
  font-family: "Nunito", ui-rounded, system-ui, sans-serif;
  font-weight: 650;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--strong); text-underline-offset: 3px; }
a:hover { color: var(--honey-low); }

h1, h2, h3 {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 22px; }

p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 16px;
}

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--pale); padding: 8px 14px; border-radius: 12px; z-index: 10;
}
.skip:focus { left: 8px; }

/* ---- paper ---- */

.paper {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* a line of stitches just inside the edge, as on the game's big panels */
.paper.stitched::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed var(--stitch);
  border-radius: calc(var(--radius) - 7px);
  pointer-events: none;
}

/* ---- clay buttons ---- */

.clay {
  --face: var(--honey);
  --foot: var(--honey-low);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px 12px;
  border-radius: 16px;
  background: linear-gradient(var(--honey-hi), var(--face) 55%);
  color: var(--ink);
  font-family: "Nunito", sans-serif;
  font-weight: 850;
  font-size: 17px;
  text-decoration: none;
  border: 0;
  box-shadow: 0 5px 0 var(--foot), 0 9px 16px rgba(120, 70, 20, 0.22);
  transform: translateY(0);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  cursor: pointer;
}
.clay:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 7px 0 var(--foot), 0 12px 18px rgba(120, 70, 20, 0.22); }
.clay:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--foot), 0 3px 6px rgba(120, 70, 20, 0.2); }
.clay:focus-visible { outline: 3px solid var(--strong); outline-offset: 4px; }
.clay.cream { --face: var(--pale); --foot: var(--edge); background: linear-gradient(#fffdf6, var(--pale) 55%); }
.clay svg { width: 22px; height: 22px; flex: none; }

.chip {
  display: inline-block;
  padding: 5px 14px 4px;
  border-radius: 999px;
  background: var(--picked);
  border: 2px solid var(--edge);
  color: var(--ink);
  font-weight: 850;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- the hero: the scene, the name in its sky ---- */

.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 96px 0 56px;
  overflow: hidden;
  background: #f8c9a0 url("/img/scene-1920.jpg") center 60% / cover no-repeat;
}
.hero::before {
  /* a little more evening at the very top */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 140px;
  background: linear-gradient(rgba(255, 214, 180, 0.55), rgba(255, 214, 180, 0));
  pointer-events: none;
}
.hero .name {
  position: relative;
  width: min(640px, 88vw);
  margin: 0 auto auto;
  filter: drop-shadow(0 6px 10px rgba(110, 50, 60, 0.18));
  animation: bob 6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50% { transform: translateY(-8px) rotate(0.6deg); }
}

.hero-card {
  position: relative;
  width: min(620px, calc(100% - 32px));
  margin-top: 32px;
  padding: 46px 34px 32px;
  text-align: center;
  animation: rise 0.8s cubic-bezier(.2,.9,.3,1.2) both 0.15s;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-card .lede {
  font-size: clamp(19px, 2.6vw, 23px);
  font-weight: 800;
  color: var(--ink);
  margin: 10px 0 18px;
  line-height: 1.4;
}
.actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* bunting: a string of little flags over the card, swaying */
.bunting {
  position: absolute;
  left: 18px; right: 18px; top: -14px;
  height: 46px;
  pointer-events: none;
}
.bunting svg { width: 100%; height: 100%; overflow: visible; }
.bunting .flag { transform-box: fill-box; transform-origin: 50% 0; animation: sway 3.2s ease-in-out infinite; }
.bunting .flag:nth-child(2n) { animation-delay: -1.1s; }
.bunting .flag:nth-child(3n) { animation-delay: -2.2s; }
@keyframes sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

/* ---- sections ---- */

section { padding: 72px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.section-head p { color: var(--muted); font-size: 18px; }

.about {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 42px;
}
.about p { font-size: 18px; }
.about .shot { border-radius: 16px; overflow: hidden; border: 2px solid var(--edge); box-shadow: var(--shadow); }

/* features: cards of paper, each with a little picture drawn in lines in a honey round */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature { padding: 28px 26px 22px; }
.feature .glyph {
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--honey-hi), var(--honey) 70%);
  box-shadow: 0 4px 0 var(--honey-low);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.feature .glyph svg { width: 34px; height: 34px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text); font-size: 16px; margin: 0; }

/* pictures */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.gallery a {
  display: block;
  grid-column: span 2;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow);
  background: var(--paper);
  transition: transform 0.18s ease;
}
.gallery a.big { grid-column: span 3; }
.gallery a:hover { transform: translateY(-3px) rotate(-0.3deg); }
.gallery img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* early access */
.early {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 30px;
  align-items: center;
  padding: 38px 42px;
}
.early img { width: 150px; border-radius: 28px; box-shadow: var(--shadow); }
.early h2 { margin-bottom: 10px; }
.early p:last-child { margin-bottom: 0; }

/* ---- the foot ---- */

footer {
  padding: 34px 0 44px;
  color: var(--muted);
  font-size: 15px;
}
footer .wrap {
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center;
  border-top: 2px dashed var(--stitch);
  padding-top: 24px;
}
footer nav { display: flex; gap: 20px; }
footer a { color: var(--text); }

/* ---- a page of words (privacy) ---- */

.page-top {
  background: var(--paper-deep) url("/img/scene-960.jpg") center 70% / cover no-repeat;
  padding: 92px 0 120px;
  text-align: center;
}
.page-top img { width: min(380px, 70vw); margin: 0 auto; filter: drop-shadow(0 5px 8px rgba(110, 50, 60, 0.18)); }
.doc {
  max-width: 780px;
  margin: -84px auto 0;
  padding: 48px 52px 36px;
}
.doc h1 { font-size: clamp(32px, 5vw, 44px); }
.doc h2 { font-size: 25px; margin-top: 1.6em; }
.doc .when { color: var(--muted); font-size: 15px; margin-bottom: 1.6em; }
.doc ul { padding-left: 1.2em; margin: 0 0 1em; }
.doc li { margin-bottom: 0.3em; }

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

@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; padding: 30px 26px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery a, .gallery a.big { grid-column: span 1; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .hero { min-height: 640px; padding-top: 84px; background-image: url("/img/scene-960.jpg"); }
  .hero-card { padding: 40px 22px 26px; }
  .features { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .early { grid-template-columns: 1fr; text-align: center; padding: 30px 24px; }
  .early img { margin: 0 auto; width: 120px; }
  .doc { padding: 34px 22px 24px; margin-top: -84px; }
  .clay { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
