/* The page around the web edition: a slim bar with the store links over the
   top of the app (which leaves it that much room: keep --bar in step with
   WebBarSpace in lib/web/web_edition.dart), a page about the web edition
   with its Start button (#about), and once started ("starting", see
   flutter_bootstrap.js) a loading screen until the app's first frame. Fonts
   come from the site (/fonts/). */
@font-face {
  font-family: 'Permanent Marker';
  src: url('/fonts/permanent-marker.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Patrick Hand';
  src: url('/fonts/patrick-hand.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --paper: #fbf6ec;
  --paper-deep: #f2e8d5;
  --ink: #1d1a2f;
  --ink-soft: #5b5670;
  --tomato: #ff5a4e;
  --gold: #f2b33d;
  --bar: 56px;
  --marker: 'Permanent Marker', 'Marker Felt', cursive;
  --hand: 'Patrick Hand', 'Chalkboard SE', 'Comic Sans MS', cursive;
  --note: #fff3c4;
  --card: #fffdf8;
  --body: 'Nunito', ui-rounded, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
}

.starting, .starting body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar);
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--paper-deep);
  border-bottom: 2.5px solid var(--ink);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--marker);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  min-width: 0;
}

.brand img { flex: none; }
.brand b { font-weight: 400; color: var(--tomato); }

.get {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.get-label {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink-soft);
  margin-right: 2px;
}

.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--tomato);
  text-decoration: none;
  line-height: 1.05;
}

.store:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tomato); }
.store:focus-visible { outline: 3px solid var(--tomato); outline-offset: 2px; }

.store small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
}

.store strong { font-size: 15px; font-weight: 900; }

/* Out of the way while a phone's keyboard is up (see flutter_bootstrap.js). */
.kb .bar { display: none; }

/* This device's store first on Android. */
.android .store.google { order: -1; }

/* ---------- The page about the web edition, before it starts ---------- */

.about {
  max-width: 1000px;
  margin: 0 auto;
  padding: calc(var(--bar) + 36px) 20px 72px;
  font-size: 18px;
  line-height: 1.6;
}

.starting .about { display: none; }

.about h1, .about h2 {
  font-family: var(--marker);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 0.45em;
}

.about h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.about h2 { font-size: 1.7rem; }
.about p { margin: 0 0 1em; }
.about a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.about a:hover { color: var(--tomato); }
.about .lede { font-size: 1.2rem; }
.about .fine { font-size: 0.92rem; color: var(--ink-soft); }

.about-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 56px;
}

.about-art {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
}

.start {
  font-family: var(--marker);
  font-size: 1.45rem;
  color: #fff;
  background: var(--tomato);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 12px 30px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}

.start:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.start:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.about-section {
  max-width: 760px;
  margin: 0 0 44px;
}

.about-steps { padding-left: 1.3em; }
.about-steps li { margin: 0 0 0.7em; }

.about-tries {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2em;
  display: grid;
  gap: 10px;
}

.about-tries li {
  font-family: var(--hand);
  font-size: 1.35rem;
  line-height: 1.35;
  background: var(--note);
  border: 2px dashed var(--ink);
  border-radius: 12px;
  padding: 8px 16px;
}

@media (max-width: 860px) {
  .about-hero { grid-template-columns: 1fr; gap: 28px; }
  .about { font-size: 17px; padding-top: calc(var(--bar) + 24px); }
}

/* ---------- Loading, once started ---------- */

html:not(.starting) #loading { display: none; }

#loading {
  position: fixed;
  inset: var(--bar) 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px;
  text-align: center;
  background: var(--paper);
  z-index: 1;
  transition: opacity 0.35s;
}

.ready #loading { opacity: 0; pointer-events: none; }

.jumper { width: 120px; height: 150px; }
.jumper .body { animation: hop 0.9s ease-in-out infinite; transform-origin: 100px 230px; }

@keyframes hop {
  0%, 100% { transform: translateY(0) scaleY(1); }
  15% { transform: translateY(0) scaleY(0.94); }
  50% { transform: translateY(-26px) scaleY(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .jumper .body { animation: none; }
}

.msg {
  margin: 8px 0 0;
  font-family: var(--marker);
  font-size: 22px;
}

.slow-msg, .failed-msg { display: none; max-width: 30em; color: var(--ink-soft); font-weight: 700; }
.slow .slow-msg { display: block; }
.failed .slow-msg, .failed .msg { display: none; }
.failed .failed-msg { display: block; }
.failed-msg .links { display: flex; gap: 14px; justify-content: center; }
#loading a { color: var(--tomato); font-weight: 900; }

/* Phones: just the logo, and the two store buttons. */
@media (max-width: 640px) {
  .get-label { display: none; }
}

@media (max-width: 460px) {
  :root { --bar: 50px; } /* (WebBarSpace.heightFor) */
  .brand span { display: none; }
  .store { padding: 0 10px; height: 38px; }
  .store small { font-size: 9px; }
  .store strong { font-size: 14px; }
}
