/* Sunrope Games. One bold thing: the rope that hangs from the sun down the left of the page.
   Everything else is quiet: sky, deep-indigo ink, chunky toy outlines with hard offset shadows. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  --sky: #dcefff;
  --ink: #1e2650;
  --ink-soft: #46507f;
  --paper: #ffffff;
  --sun: #ffc83d;
  --rope-light: #e9b955;
  --rope-dark: #b07a22;
  --bg: var(--sky);
  --accent: var(--sun);
  --accent-ink: var(--ink);
  --rope-x: 26px;
  --display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --outline: 3px solid var(--ink);
  --lift: 6px 6px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--text);
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; }

/* The rope: a twisted cord down the left edge of the column, hanging from the sun. */
.rope {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 48px calc(var(--rope-x) + 40px);
}
.rope::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--rope-x);
  width: 7px;
  border-radius: 4px;
  background: repeating-linear-gradient(160deg, var(--rope-light) 0 5px, var(--rope-dark) 5px 9px);
  transform-origin: top;
  animation: rope-drop 1100ms cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rope-drop { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Home */
.hero { position: relative; padding: 150px 0 40px; }
.sun {
  position: absolute;
  top: -96px;
  left: calc(var(--rope-x) + 3px - 40px - 96px);
  width: 192px;
  height: 192px;
  border-radius: 50%;
  background: var(--sun);
  border: var(--outline);
}
.wordmark {
  font-size: clamp(64px, 17vw, 148px);
  line-height: .9;
  letter-spacing: -.015em;
}
.lede {
  max-width: 34em;
  margin: 28px 0 0;
  font-size: 19px;
  color: var(--ink-soft);
}
.games-title { font-size: 30px; margin: 32px 0 20px; }
.games { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }

.card { position: relative; }
.card::before { /* the short line that ties each card to the rope */
  content: "";
  position: absolute;
  top: 50%;
  left: calc(-40px + 3px);
  width: 40px;
  height: 4px;
  background: var(--rope-dark);
}
.card::after { /* the carabiner on the rope */
  content: "";
  position: absolute;
  top: calc(50% - 7px);
  left: calc(-40px - 2px);
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--sky);
}
.card a {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  padding: 12px;
  background: var(--paper);
  border: var(--outline);
  border-radius: 20px;
  box-shadow: var(--lift);
  text-decoration: none;
}
.card img { border-radius: 12px; aspect-ratio: 9 / 16; object-fit: cover; width: 100%; }
.card-body { display: grid; gap: 6px; }
.card-title { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.card-pitch { font-size: 15.5px; line-height: 1.45; color: var(--ink-soft); }
.card a:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.card a:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.card a:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

/* Brand bar */
.bar { display: flex; align-items: center; padding: 18px 20px; }
.bar-rope { padding: 22px 0 8px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  text-decoration: none;
}
.brand-sun { width: 22px; height: 22px; border-radius: 50%; background: var(--sun); border: 2.5px solid var(--ink); }

/* Game page */
.game-main {
  display: grid;
  gap: 24px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 4px 20px 32px;
}
/* The frame is always exactly 9:16, like the trailer, and the trailer is never cropped: its captions sit at the
   very top and bottom. The width follows the screen height, so on a phone the title and Play fit under it. */
.trailer {
  margin: 0 auto;
  width: min(100%, 31.5vh);
  aspect-ratio: 9 / 16;
  border: var(--outline);
  border-radius: 26px;
  box-shadow: var(--lift);
  overflow: hidden;
  background: var(--ink);
}
.trailer video { width: 100%; height: 100%; object-fit: contain; }
.game-title { font-size: clamp(44px, 11vw, 76px); line-height: .95; letter-spacing: -.01em; }
.pitch { font-size: 19px; margin: 14px 0 24px; max-width: 30em; }
.play {
  display: inline-block;
  min-width: 220px;
  padding: 16px 36px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  color: var(--accent-ink);
  background: var(--accent);
  border: var(--outline);
  border-radius: 999px;
  box-shadow: var(--lift);
}
.play:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.play:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.play:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
.game-note { margin: 18px 0 0; font-size: 15px; color: var(--ink-soft); }
.shots {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62%;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.shots li { scroll-snap-align: start; }
.shots img { border: var(--outline); border-radius: 18px; aspect-ratio: 9 / 16; object-fit: cover; width: 100%; }

/* Phones: the Play button stays in reach of the thumb, on a strip of page colour so text never shows through. */
@media (max-width: 759px) {
  .game-main { padding-bottom: 8px; }
  .game-title { font-size: clamp(36px, 10vw, 48px); }
  .pitch { font-size: 17px; margin: 10px 0 16px; }
  .play-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -20px;
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 2px solid color-mix(in srgb, var(--ink) 12%, transparent);
  }
  .play { display: block; width: 100%; }
}

@media (min-width: 760px) {
  .game-main { grid-template-columns: minmax(280px, 380px) 1fr; column-gap: 56px; align-items: center; padding-top: 16px; }
  .trailer { width: min(100%, 45vh); }
  .shots { grid-column: 1 / -1; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-auto-columns: auto; overflow: visible; }
  .card a { grid-template-columns: 120px 1fr; gap: 24px; padding: 14px; }
  .card-title { font-size: 28px; }
  :root { --rope-x: 40px; }
}

/* Coming soon */
.soon { max-width: 640px; margin: 0 auto; padding: 48px 20px 64px; }
.soon-title { font-size: clamp(40px, 10vw, 64px); margin-bottom: 18px; }
.soon p { font-size: 19px; }
.soon-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 28px; }
.play-small { min-width: 0; font-size: 20px; padding: 13px 26px; }

/* Legal pages */
.prose { max-width: 40em; padding: 24px 0 8px; }
.prose h1 { font-size: clamp(40px, 9vw, 60px); margin-bottom: 8px; }
.prose h2 { font-size: 24px; margin: 34px 0 8px; }
.prose p, .prose li { max-width: 38em; }
.effective { color: var(--ink-soft); margin-top: 0; }
.steps { padding-left: 1.3em; }
.steps li { margin: 8px 0; }

/* Footer */
.foot { max-width: 40em; padding: 32px 20px 40px; font-size: 15px; color: var(--ink-soft); }
.rope .foot { padding-left: 0; }
.game .foot { margin: 0 auto; max-width: 1040px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0; }
.foot-copy { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .rope::before { animation: none; }
  .card a, .play { transition: none; }
  .card a:hover, .play:hover { transform: none; }
}
