/* Twibo Games — one stylesheet for every page.

   Two skins, exactly as in the game: the studio pages wear the splash screen's
   indigo and twin-tile colours, and anything that is Square Swipe's own wears
   the game's sky gradient. Colour values come from the game's
   src/ui/palette.ts and design/assets-raw/make-splash.py. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  /* Studio: the splash card. */
  --indigo: #26284f;
  --indigo-glow: #363a6e;
  --indigo-raised: #31345f;
  --indigo-line: #44487a;
  --text: #ffffff;
  --text-soft: #c9cbec;

  /* The mark's three hues, and the game's fourth block colour. */
  --rose: #ff5a5a;
  --cyan: #22c9e8;
  --amber: #ffc93c;
  --lime: #3ee08f;

  /* Square Swipe: the menu's sky. */
  --sky-top: #3bb4f6;
  --sky-bottom: #1c7ed6;
  --sky-shadow: #0e4d80;

  /* Document panels (support and privacy). */
  --paper: #ffffff;
  --paper-wash: #f5f6fc;
  --paper-line: #e3e5f0;
  --ink: #1d1f3d;
  --ink-body: #3a3d5c;
  --ink-muted: #6b6e8a;
  --link-on-paper: #1c6fc4;

  --radius: 22px;
  --wrap: 1080px;
  --gutter: 20px;
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--indigo);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--amber);
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10;
  background: var(--amber);
  color: var(--indigo);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 8px;
}

/* ------------------------------------------------------------------ header */

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: auto;
}

.brand-word {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-word .twibo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-word .games {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.42em;
  color: var(--amber);
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  color: var(--text-soft);
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

@media (max-width: 520px) {
  .site-nav {
    gap: 14px;
    font-size: 16px;
  }

  .brand-word .twibo {
    font-size: 22px;
  }

  .brand img {
    width: 40px;
  }
}

/* -------------------------------------------------------------- shared bits */

.section {
  padding: 64px 0;
}

.section-title {
  margin: 0 0 28px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
}

.button {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--amber);
  color: #3d2a00;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 0 #c99400;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  transform: translateY(1px);
  box-shadow: 0 3px 0 #c99400;
}

.button:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #c99400;
}

.store-badge {
  display: inline-block;
  line-height: 0;
}

.store-badge img {
  width: 160px;
  height: auto;
}

/* ------------------------------------------------------------- studio hero */

.hero {
  background: radial-gradient(ellipse 70% 80% at 50% 40%, var(--indigo-glow), var(--indigo));
  text-align: center;
  padding: 48px 0 80px;
}

.hero-mark {
  width: min(320px, 70vw);
  margin: 0 auto 36px;
  animation: float 3s ease-in-out infinite alternate;
}

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

.hero h1 {
  margin: 0 auto 16px;
  max-width: 14em;
  font-size: clamp(38px, 8vw, 64px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.hero p {
  margin: 0 auto 32px;
  max-width: 32em;
  color: var(--text-soft);
  font-size: clamp(18px, 2.4vw, 21px);
}

/* --------------------------------------------------------------- game card */

.game-card {
  display: grid;
  grid-template-columns: 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 18px 40px rgba(10, 10, 30, 0.35);
}

.game-card-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 36px 24px;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}

.game-card-art .logo {
  width: min(300px, 62%);
  filter: drop-shadow(0 6px 10px rgba(14, 77, 128, 0.35));
}

.game-card-art .icon {
  width: min(120px, 26%);
  border-radius: 22.37%;
  box-shadow: 0 8px 18px rgba(14, 77, 128, 0.4);
}

.game-card-body {
  padding: 28px 28px 32px;
  color: var(--ink-body);
}

.game-card-body h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
}

.game-card-body .meta {
  margin: 0 0 12px;
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 500;
}

.game-card-body p {
  margin: 0 0 12px;
}

/* Where the game can be downloaded: a quiet note, set apart from the pitch. */
.game-card-body .availability {
  width: fit-content;
  margin: 18px 0 0;
  padding: 8px 14px;
  border: 1px solid var(--paper-line);
  border-radius: 12px;
  background: var(--paper-wash);
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.game-card-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
}

.text-link {
  color: var(--link-on-paper);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

@media (min-width: 820px) {
  .game-card {
    grid-template-columns: 1.1fr 1fr;
  }

  .game-card-art {
    padding: 48px 32px;
  }

  .game-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
  }
}

/* ------------------------------------------------------- about and contact */

.about,
.contact {
  text-align: center;
}

.about p,
.contact p {
  margin: 0 auto;
  max-width: 36em;
  color: var(--text-soft);
  font-size: 20px;
}

.contact .email {
  display: inline-block;
  margin-top: 16px;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.divider {
  border: 0;
  height: 1px;
  margin: 0;
  background: var(--indigo-line);
}

/* --------------------------------------------------------- game page hero */

.game-hero {
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  text-align: center;
  padding: 40px 0 56px;
}

.game-hero .icon {
  width: 96px;
  margin: 0 auto 18px;
  border-radius: 22.37%;
  box-shadow: 0 8px 18px rgba(14, 77, 128, 0.4);
}

.game-hero h1 {
  margin: 0;
}

.game-hero h1 img {
  width: min(420px, 82vw);
  margin: 0 auto;
  filter: drop-shadow(0 8px 12px rgba(14, 77, 128, 0.35));
}

/* Phones: smaller hero art, so the headline and the store badge sit near the top. */
@media (max-width: 600px) {
  /* The mark floats up 12px, so the top padding is that much more than it looks. */
  .hero {
    padding: 44px 0 56px;
  }

  .hero-mark {
    width: 180px;
    margin-bottom: 24px;
  }

  .game-hero {
    padding: 28px 0 44px;
  }

  .game-hero .icon {
    width: 64px;
    margin-bottom: 14px;
  }

  .game-hero h1 img {
    width: min(250px, 66vw);
  }
}

/* White on sky, outlined the way the game outlines its own labels. */
.game-hero .tagline {
  margin: 20px auto 8px;
  font-size: clamp(24px, 4.4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  text-shadow:
    0 3px 0 var(--sky-shadow),
    0 0 2px var(--sky-shadow),
    0 0 12px rgba(14, 77, 128, 0.45);
}

.game-hero .logline {
  margin: 0 auto 28px;
  max-width: 28em;
  font-size: 19px;
  font-weight: 500;
  text-shadow:
    0 2px 0 var(--sky-shadow),
    0 0 2px var(--sky-shadow),
    0 0 10px rgba(14, 77, 128, 0.5);
}

/* Under the store badge: where the game can be downloaded. The same note as
   on the home page's game card, tinted for the sky. */
.game-hero .availability {
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: rgba(14, 77, 128, 0.35);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

/* -------------------------------------------------------------- screenshots */

.screens {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.screens li {
  flex: 0 0 auto;
  width: 260px;
}

.screens img {
  width: 100%;
  border-radius: 28px;
  border: 4px solid #12132b;
  box-shadow: 0 18px 36px rgba(5, 5, 20, 0.45);
}

/* Phones: one shot at a time, swiped sideways. */
@media (max-width: 860px) {
  .screens {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 24px;
    scroll-padding: 0 var(--gutter);
  }

  .screens li {
    width: min(240px, 68vw);
    scroll-snap-align: start;
  }
}

/* ---------------------------------------------------------------- features */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--indigo-raised);
  border: 1px solid var(--indigo-line);
}

.features h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.features p {
  margin: 0;
  color: var(--text-soft);
}

/* A block in one of the game's four colours. */
.block {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.block-rose {
  background: var(--rose);
}

.block-cyan {
  background: var(--cyan);
}

.block-lime {
  background: var(--lime);
}

.block-amber {
  background: var(--amber);
}

.game-cta {
  text-align: center;
}

/* ------------------------------------------------------- document pages */

.doc-head {
  padding: 32px 0 0;
}

.crumb {
  margin: 0 0 12px;
  font-size: 15px;
}

.crumb a {
  color: var(--text-soft);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--text);
}

.doc-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
}

.doc-tabs a {
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 500;
  text-decoration: none;
  background: var(--indigo-raised);
}

.doc-tabs a:hover {
  color: var(--text);
}

.doc-tabs a[aria-current="page"] {
  background: var(--amber);
  color: #3d2a00;
}

.doc {
  max-width: 760px;
  margin: 0 auto 64px;
  padding: 40px clamp(20px, 5vw, 48px) 32px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink-body);
  font-size: 17px;
  line-height: 1.7;
}

.doc h1 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.doc h2 {
  margin: 2.2em 0 0.4em;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 600;
}

.doc h3 {
  margin: 1.6em 0 0.3em;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 600;
}

.doc p {
  margin: 0 0 1em;
}

.doc a {
  color: var(--link-on-paper);
}

.doc .effective {
  margin: 0 0 2em;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.doc .summary {
  margin: 0 0 2em;
  padding: 18px 22px;
  border: 1px solid var(--paper-line);
  border-radius: 14px;
  background: var(--paper-wash);
}

.doc .summary p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- not found */

.not-found {
  padding: 72px 0 96px;
  text-align: center;
}

.not-found img {
  width: 200px;
  margin: 0 auto 28px;
}

.not-found h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 6vw, 48px);
}

.not-found p {
  margin: 0 0 28px;
  color: var(--text-soft);
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  border-top: 1px solid var(--indigo-line);
  padding: 28px 0 36px;
  color: var(--text-soft);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text-soft);
}

.site-footer a:hover {
  color: var(--text);
}

/* ------------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-mark {
    animation: none;
  }

  .button {
    transition: none;
  }
}
