/* Save the Tux home page. The look is the game's ice world: the sky and snow
   from art/world/ice, the ice bricks as the ground, and the ice buttons and
   cards from art/ui. Headings are set in Lilita One. */

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

/* Lilita One has no c, n, l, t, d with a caron, which Slovak needs. In Slovak
   the headings use Titan One instead (also OFL, also round and chunky). */
@font-face {
  font-family: "Titan One";
  src: url("fonts/TitanOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --sky: #4aa3ee;
  --snow: #f2faff;
  --ice: #dcf0fd;
  --ice-edge: #9fd3f7;
  --blue: #3f97e0;
  --blue-dark: #1f6bb8;
  --navy: #17508f;
  --ink: #1d3b5f;
  --ink-soft: #3f6489;
  --shadow: 18, 70, 130;

  --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(18px, 5vw, 48px);
  --gap-section: clamp(56px, 9vw, 104px);
}

html[lang="sk"] {
  --head: "Titan One", "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}

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

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

/* English is the default. lang.js sets <html lang>; the text in the other
   language is hidden. */
html[lang="en"] [lang="sk"],
html[lang="sk"] [lang="en"] {
  display: none;
}

/* The switch needs JavaScript. */
html:not(.js) .langs {
  display: none;
}

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

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

img {
  max-width: 100%;
}

a {
  color: var(--blue-dark);
}

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

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

h2 {
  font-size: clamp(2rem, 4.8vw, 2.9rem);
  color: var(--navy);
  margin-bottom: 0.5em;
}

/* A little ice bar under each heading, like the ink bar in the game. */
.steps > h2::after,
.characters > h2::after,
.screens h2::after,
.worlds > h2::after {
  content: "";
  display: block;
  width: 84px;
  height: 9px;
  margin-top: 12px;
  border-radius: 9px;
  background: linear-gradient(#7fd0ff, var(--blue) 70%);
  box-shadow: 0 0 0 3px #fff, 0 3px 6px rgba(var(--shadow), 0.25);
}

h3 {
  font-size: 1.5rem;
  color: var(--navy);
}

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

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

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

/* The game's ice card, cut in nine pieces so it fits any size. */
.panel {
  border-style: solid;
  border-width: 32px 26px 24px;
  border-image: url("img/ui-card.webp") 86 76 62 fill / 32px 26px 24px stretch;
  padding: 0 4px 4px;
  filter: drop-shadow(0 8px 10px rgba(var(--shadow), 0.18));
}

/* Hero: the ice sky, the title, the characters on the ice ground ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(92vh, 780px);
  color: var(--ink);
  background: #8fcbf7 url("img/hero-bg.webp") center 24% / cover no-repeat;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 1.45rem/1 var(--head);
  text-decoration: none;
  color: var(--navy);
  text-shadow: 0 1px 0 #fff, 0 0 8px rgba(255, 255, 255, 0.8);
}

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

.langs {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2px var(--ice-edge), 0 3px 8px rgba(var(--shadow), 0.2);
}

.langs button {
  font: 1rem/1 var(--head);
  letter-spacing: 0.04em;
  color: var(--navy);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px 8px;
  cursor: pointer;
}

.langs button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(#5cbcff, var(--blue-dark));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.hero-grid {
  display: grid;
  flex: 1;
  align-content: space-between;
  gap: 8px;
  padding-top: clamp(28px, 6vw, 48px);
}

.hero h1 {
  font-size: clamp(3rem, 12vw, 5.2rem);
  color: #fff;
  -webkit-text-stroke: 0.13em var(--blue-dark);
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0 var(--blue-dark), 0 0.1em 0.2em rgba(var(--shadow), 0.35);
  margin-bottom: 0.2em;
}

/* Titan One is wider than Lilita One. */
html[lang="sk"] .hero h1 {
  font-size: clamp(2.6rem, 10vw, 4.4rem);
}

html[lang="sk"] .brand {
  font-size: 1.2rem;
  white-space: nowrap;
}

.lead {
  font: clamp(1.3rem, 3.6vw, 1.75rem)/1.2 var(--head);
  color: var(--navy);
  letter-spacing: 0.01em;
  max-width: 19em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 14px rgba(255, 255, 255, 0.9);
}

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

/* The big button: the game's title plate with its play button on it. */
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font: clamp(1.25rem, 5.4vw, 1.95rem)/1 var(--head);
  letter-spacing: 0.01em;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
  border-style: solid;
  border-width: 26px 40px 22px;
  border-image: url("img/ui-plate.webp") 62 150 52 fill / 26px 40px 22px stretch;
  padding: 2px 0 4px;
  filter: drop-shadow(0 8px 8px rgba(var(--shadow), 0.3));
  transition: transform 90ms ease, filter 90ms ease;
}

.btn-play img {
  width: 1.9em;
  height: auto;
  flex: none;
}

.btn-play:hover {
  transform: translateY(-3px) scale(1.02);
  filter: drop-shadow(0 12px 10px rgba(var(--shadow), 0.3)) brightness(1.04);
}

.btn-play:active {
  transform: translateY(2px);
  filter: drop-shadow(0 4px 5px rgba(var(--shadow), 0.3));
}

.btn-play:focus-visible {
  outline-offset: 2px;
  border-radius: 24px;
}

.note {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  text-shadow: 0 0 10px #fff, 0 0 4px #fff;
}

/* The scene: Šiši runs at the line, Tux and Viki stand under it. Sizes are
   in percent of a 720 x 440 box, so it scales as one picture. */
.scene {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  margin: 12px auto 0;
  aspect-ratio: 720 / 440;
}

.scene svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.scene img {
  position: absolute;
  bottom: 0;
  height: auto;
}

.scene .sisi {
  left: 1.4%;
  width: 17.6%;
  transform-origin: 50% 100%;
  animation: hop 0.55s ease-in-out infinite alternate;
}

.scene .tux {
  left: 30.3%;
  width: 27.4%;
}

.scene .viki {
  left: 60%;
  width: 26.5%;
}

.scene .line {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1;
  animation: draw 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

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

@keyframes hop {
  to {
    transform: translateY(-5%) rotate(-2deg);
  }
}

/* The ice ground: the game's middle piece, repeated. The scene stands in the
   snow, so the ground starts a little under the feet. */
.ground {
  position: relative;
  z-index: 1;
  height: clamp(84px, 12vw, 138px);
  margin: calc(clamp(84px, 12vw, 138px) * -0.32) 0 -6px;
  background: url("img/ground-middle.webp") center bottom / auto 100% repeat-x;
}

@media (min-width: 600px) {
  .btn-play {
    border-width: 28px 52px 24px;
    border-image-width: 28px 52px 24px;
  }
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: 1fr;
    align-items: end;
    gap: 24px;
  }
  .hero-text {
    align-self: center;
    padding-bottom: 36px;
  }
  .scene {
    width: 100%;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scene .line {
    animation: none;
    stroke-dashoffset: 0;
  }
  .scene .sisi {
    animation: none;
  }
}

/* Content ------------------------------------------------------------------ */

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

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

/* How to play */
.steps ol {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 36px;
}

.step .panel {
  margin-bottom: 14px;
}

.step .panel img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.step h3 {
  display: flex;
  align-items: center;
  gap: 0.45em;
}

.step .n {
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  flex: none;
  color: #fff;
  font-size: 1.05em;
  border-radius: 50%;
  background: linear-gradient(#5cbcff, var(--blue-dark));
  box-shadow: 0 0 0 3px #fff, 0 3px 6px rgba(var(--shadow), 0.3);
}

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

@media (min-width: 800px) {
  .steps ol {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

/* The characters */
.characters ul {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 28px;
}

.char .panel {
  padding: 4px 12px 12px;
  text-align: center;
}

.char .pic {
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 14px;
}

.char .pic img {
  width: auto;
  max-width: 100%;
  filter: drop-shadow(0 6px 6px rgba(var(--shadow), 0.22));
}

.char .tux img { height: 215px; }
.char .viki img { height: 250px; }
.char .sisi img { height: 150px; }

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

@media (min-width: 800px) {
  .characters ul {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

/* The screens: six phones. On a small screen they are a row you scroll; on a
   wider one a grid of three, and on a wide one all six in a row. */
.phones {
  list-style: none;
  margin: 28px 0 0;
  padding: 10px var(--pad) 46px;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad);
  scrollbar-width: thin;
  scrollbar-color: var(--ice-edge) transparent;
}

.phones li {
  flex: 0 0 clamp(190px, 58vw, 260px);
  scroll-snap-align: start;
}

.phone {
  margin: 0;
  padding: 8px;
  border-radius: 28px;
  background: linear-gradient(#27578f, #143457);
  box-shadow: 0 0 0 3px #fff, 0 14px 28px rgba(var(--shadow), 0.3);
}

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

@media (min-width: 860px) {
  .phones {
    width: min(var(--wrap), 100% - 2 * var(--pad));
    margin-inline: auto;
    padding: 10px 0 20px;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 36px;
  }
  .phones li {
    max-width: 280px;
    justify-self: center;
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .phones {
    width: min(1240px, 100% - 2 * var(--pad));
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
  }
  .phone {
    padding: 6px;
    border-radius: 22px;
  }
  .phone img {
    border-radius: 16px;
  }
}

/* The worlds: one tile each. To add a world, add one <li> line. */
.world-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 20px;
}

@media (min-width: 700px) {
  .world-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1000px) {
  .world-list {
    grid-template-columns: repeat(6, 1fr);
    gap: 26px 20px;
  }
}

.world-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.world-list img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 18px;
  background: var(--ice);
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--ice-edge), 0 10px 18px rgba(var(--shadow), 0.25);
  margin-bottom: 6px;
}

.world-list b {
  font: 1.15rem/1.1 var(--head);
  color: var(--navy);
  text-align: center;
}

/* Android */
.android-row {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 36px);
  padding: 6px clamp(0px, 2vw, 16px) 10px;
}

.mini-phone {
  flex: none;
  width: clamp(64px, 14vw, 92px);
  padding: 6px 5px 10px;
  border-radius: 16px;
  background: linear-gradient(#27578f, #143457);
  box-shadow: 0 6px 12px rgba(var(--shadow), 0.3);
}

.mini-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.android h2 {
  font-size: clamp(1.7rem, 4.2vw, 2.4rem);
  margin-bottom: 0.3em;
}

.android p {
  margin: 0;
  color: var(--ink-soft);
}

/* About */
.panel.big {
  padding: 4px clamp(4px, 2.4vw, 28px) 12px;
}

.about-row {
  display: grid;
  gap: 8px;
}

.about-pic {
  display: none;
}

@media (min-width: 800px) {
  .about-row {
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: end;
  }
  .about-pic {
    display: block;
    height: 300px;
    width: auto;
    margin: 0 8px -4px 0;
    filter: drop-shadow(0 6px 6px rgba(var(--shadow), 0.22));
  }
}

.about h2 {
  margin-bottom: 0.3em;
}

.about .dedication {
  font: clamp(1.5rem, 3.6vw, 2rem)/1.15 var(--head);
  color: var(--blue-dark);
  margin-bottom: 0.6em;
}

.about h3 {
  margin: 1.4em 0 0.4em;
  font-size: 1.3rem;
}

.credits {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.97rem;
  color: var(--ink-soft);
}

.credits li {
  margin-bottom: 0.4em;
  max-width: 40em;
}

/* Footer: ice bricks under a dark blue sheet. */
.foot {
  color: #fff;
  background:
    linear-gradient(rgba(14, 54, 104, 0.82), rgba(14, 54, 104, 0.9)),
    url("img/ground-fill.webp") center top / auto 73px repeat;
  border-top: 5px solid #fff;
  padding: clamp(28px, 5vw, 48px) 0 clamp(32px, 6vw, 56px);
  font-size: 0.97rem;
}

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

.foot a {
  color: #fff;
}

.foot .small {
  color: rgba(255, 255, 255, 0.78);
}
