/* Draw Bridge home page. Colours are the game's own: the Meadow world in
   Themes.kt and the HUD in Hud.kt. The page reads like one level, top to
   bottom: sky, cliffs, ground, water. */

@font-face {
  font-family: "Lilita One";
  src: url("fonts/LilitaOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --sky-top: #3a86db;
  --sky-mid: #7dbdf0;
  --sky-low: #ddf3ff;
  --sun: #fff3d1;
  --grass: #79cf55;
  --grass-light: #a7ea7b;
  --grass-dark: #4f9c3a;
  --earth-top: #d99d61;
  --earth-bottom: #8f5533;
  --earth-edge: #6e3b20;
  --water-top: #45b2e6;
  --water-bottom: #1a5fa8;
  --foam: #ddf6ff;
  --ink: #2e2b36;
  --ink-soft: #55525f;
  --gray: #737080;
  --paper: #ffffff;
  --card: #f2f5fa;
  --card-edge: #c9d3e3;
  --go: #5bc236;
  --go-light: #7cce5e;
  --go-dark: #3f8f25;
  --shadow: 11, 42, 85;

  --head: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1040px;
  --pad: clamp(20px, 5vw, 48px);
  --gap-section: clamp(64px, 10vw, 120px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

@media (min-width: 700px) {
  body {
    font-size: 1.125rem;
  }
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--head);
  font-weight: 400;
  line-height: 1.02;
  margin: 0;
  letter-spacing: 0.005em;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  margin-bottom: 0.45em;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1em;
  max-width: 36em;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--pad));
  margin-inline: auto;
}

/* The game's button: a bright pill standing on a darker rim. Pressing it
   pushes it down, like in the game. */
.btn {
  display: inline-block;
  font: 1.3rem/1 var(--head);
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--go-light), var(--go) 60%);
  padding: 1em 1.5em 0.95em;
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--go-dark), 0 10px 20px rgba(var(--shadow), 0.18);
  transition: transform 80ms ease, box-shadow 80ms ease;
  white-space: nowrap;
}

.btn:hover {
  background: linear-gradient(#92dd78, var(--go-light) 60%);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--go-dark), 0 4px 10px rgba(var(--shadow), 0.18);
}

.btn:focus-visible {
  outline-offset: 5px;
}

/* Sky: the hero ---------------------------------------------------------- */

.sky {
  position: relative;
  overflow: hidden;
  color: var(--ink);
  --sun-x: calc(100% - 64px);
  --sun-y: 72px;
  --sun-r: 30px;
  background:
    radial-gradient(circle at var(--sun-x) var(--sun-y), var(--sun) 0 var(--sun-r), rgba(255, 243, 209, 0.55) calc(var(--sun-r) + 1px), rgba(255, 243, 209, 0) calc(var(--sun-r) * 2.2)),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-low) 100%);
}

@media (min-width: 760px) {
  .sky {
    --sun-x: 82%;
    --sun-y: 210px;
    --sun-r: clamp(44px, 4.5vw, 64px);
  }
}

.sky h1 span {
  display: block;
}

@media (max-width: 599px) {
  .sky h1 span {
    display: inline;
  }
}

.sky .wrap {
  padding-top: 22px;
  padding-bottom: clamp(16px, 3vw, 40px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 1.5rem/1 var(--head);
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(var(--shadow), 0.25);
}

.sky h1 {
  font-size: clamp(2.6rem, 7.6vw, 5.25rem);
  margin: clamp(32px, 6vw, 64px) 0 0.3em;
  max-width: 11em;
}

.lead {
  font-size: clamp(1.1rem, 2.1vw, 1.3rem);
  max-width: 30em;
  color: var(--ink);
}

.cta {
  margin: 1.6em 0 1em;
}

.note {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
}

/* The scene at the bottom of the sky: two cliffs, the drawn line, the train.
   Tall screens show the whole picture; narrow screens crop the sides so the
   gap stays big enough to see. */
.scene {
  display: block;
  width: 100%;
  height: clamp(230px, 36vw, 440px);
  margin-top: 8px;
}

@media (min-width: 760px) {
  .sky .wrap {
    padding-bottom: 0;
  }
  .scene {
    margin-top: -40px;
  }
}

.scene .line {
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  animation:
    draw 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards,
    drop 0.3s cubic-bezier(0.3, 0, 0.7, 1) 1.65s both;
}

.scene .train {
  transform: translate(125px, -67px);
  animation: drive 2.6s cubic-bezier(0.5, 0.05, 0.5, 0.95) 2.1s forwards;
}

.scene .wheel {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: spin 2.6s cubic-bezier(0.5, 0.05, 0.5, 0.95) 2.1s forwards;
}

.scene .wheel.small {
  animation-name: spin-small;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drop {
  from {
    transform: translateY(-12px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes drive {
  0% {
    transform: translate(125px, -67px);
  }
  50% {
    transform: translate(340px, -63px);
  }
  100% {
    transform: translate(555px, -67px);
  }
}

@keyframes spin {
  to {
    transform: rotate(830deg);
  }
}

@keyframes spin-small {
  to {
    transform: rotate(1210deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scene .line {
    animation: none;
    stroke-dashoffset: 0;
  }
  .scene .train {
    animation: none;
    transform: translate(340px, -63px);
  }
  .scene .wheel {
    animation: none;
  }
}

/* Ground: the content ---------------------------------------------------- */

main > section {
  padding-top: var(--gap-section);
}

main > section:last-child {
  padding-bottom: var(--gap-section);
}

.intro {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--ink-soft);
}

/* Phone frames around the Android screenshots. */
.phone {
  margin: 0;
  background: var(--ink);
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 14px 30px rgba(var(--shadow), 0.18);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 17px;
  background: var(--sky-mid);
}

/* How to play: three steps, each with its screenshot. */
.steps ol {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 28px;
}

.step {
  display: grid;
  grid-template-columns: minmax(96px, 120px) 1fr;
  gap: 18px;
  align-items: start;
}

.step .phone {
  border-radius: 16px;
  padding: 5px;
}

.step .phone img {
  border-radius: 12px;
}

.step h3 {
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  margin-top: 4px;
}

.step .n {
  color: var(--sky-top);
  font-size: 1.25em;
}

.step p {
  margin: 0.4em 0 0;
  color: var(--ink-soft);
}

@media (min-width: 760px) {
  .steps ol {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
  .step {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .step .phone {
    width: min(100%, 230px);
    border-radius: 24px;
    padding: 8px;
  }
  .step .phone img {
    border-radius: 17px;
  }
}

/* Worlds: a row of phones you can scroll on a small screen, then the sky of
   every world as a small chip. */
.phones {
  list-style: none;
  margin: 28px 0 0;
  padding: 10px var(--pad) 30px;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad);
  scrollbar-width: thin;
  scrollbar-color: var(--card-edge) transparent;
}

.phones li {
  flex: 0 0 clamp(150px, 41vw, 192px);
  scroll-snap-align: start;
}

.phones figcaption {
  margin-top: 12px;
  font-family: var(--head);
  font-size: 1.2rem;
  color: var(--ink);
}

.phones figcaption small {
  display: block;
  font: 0.9rem/1.4 var(--body);
  color: var(--gray);
}

@media (min-width: 1120px) {
  .phones {
    width: min(var(--wrap), 100% - 2 * var(--pad));
    margin-inline: auto;
    padding-inline: 0;
    justify-content: space-between;
    overflow: visible;
  }
  .phones li {
    flex-basis: 184px;
  }
}

.chips {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.chips i {
  width: 30px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(var(--a), var(--b) 55%, var(--c));
  box-shadow: inset 0 0 0 1px rgba(var(--shadow), 0.12);
}

/* Things in the way: name and one line each. */
.hazards dl {
  margin: 28px 0 0;
  display: grid;
  gap: 22px 40px;
}

@media (min-width: 700px) {
  .hazards dl {
    grid-template-columns: 1fr 1fr;
  }
}

.hazards dt {
  font-family: var(--head);
  font-size: 1.4rem;
  line-height: 1.1;
}

.hazards dd {
  margin: 0.25em 0 0;
  color: var(--ink-soft);
  max-width: 28em;
}

/* Play in your browser: a browser frame for the web screenshots. */
.browser {
  margin: 0;
  background: var(--ink);
  border-radius: 16px;
  padding: 0 7px 7px;
  box-shadow: 0 14px 30px rgba(var(--shadow), 0.18);
}

.browser .bar {
  display: flex;
  align-items: center;
  padding: 10px 6px;
}

.browser .url {
  flex: 1;
  font-size: 0.85rem;
  color: var(--card);
  background: #4a4756;
  border-radius: 999px;
  padding: 5px 14px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--sky-mid);
}

.web-shots {
  margin-top: 28px;
  display: grid;
  gap: 24px;
}

@media (min-width: 700px) {
  .web-shots {
    grid-template-columns: 1fr 1fr;
  }
  .web-shots .browser:first-child {
    grid-column: 1 / -1;
  }
}

.web .cta {
  margin-top: 36px;
}

/* For grown-ups: a card like the game's About card. */
.card {
  background: var(--card);
  border-radius: 28px;
  padding: clamp(24px, 4.5vw, 52px);
  box-shadow: 0 3px 0 var(--card-edge), 0 18px 40px rgba(var(--shadow), 0.1);
}

.card ul {
  margin: 0 0 1.2em;
  padding-left: 1.2em;
}

.card li {
  margin-bottom: 0.3em;
}

.card blockquote {
  margin: 1.6em 0 0;
  padding: 0 0 0 1em;
  border-left: 5px solid var(--grass);
  font-family: var(--head);
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  line-height: 1.25;
  max-width: 24em;
}

.card blockquote p {
  margin: 0;
  max-width: none;
}

.card blockquote footer {
  margin-top: 0.6em;
  font: 0.95rem/1.4 var(--body);
  color: var(--gray);
}

/* Water: the footer ------------------------------------------------------ */

.water {
  color: #fff;
  background: linear-gradient(var(--water-top), var(--water-bottom));
  border-top: 4px solid var(--foam);
  padding: clamp(32px, 5vw, 56px) 0 clamp(36px, 6vw, 64px);
  font-size: 0.95rem;
}

.water p {
  margin: 0 0 0.5em;
  max-width: none;
}

.water a {
  color: #fff;
}

.water .small {
  color: rgba(255, 255, 255, 0.8);
}
