/* Football Tactics: Dare to Dream -- the landing page.
 *
 * Pixel art is only ever blown up a whole number of times: --s is how many
 * screen pixels one pixel of the island gets, --t the same for the title. The
 * 1980 font is drawn on a 16px grid, so type is 16 or 32px and nothing else.
 * Hard edges, no gradients, no fades: the look is the game's own windows. */

@font-face {
  font-family: "1980";
  src: url("assets/fonts/1980-by-Void.ttf") format("truetype");   /* credit in the footer: the licence asks for it */
  font-display: swap;
}

:root {
  --s: 1;
  --t: 1;
  --ink: #2e222f;           /* the game's UI colours (src/ui/ui_theme.gd) */
  --window: #3e3546;
  --edge: #9babb2;
  --edge-dark: #1b1b1b;
  --text: #c7dcd0;
  --light: #e1eee7;
  --accent: #fbb954;
  --ground: #5b5d98;        /* the band under the island; darker in bad weather */
  --over-sky: #2e222f;      /* type laid over the sky */
}

body.dusk {
  --ground: #1e1d3d;
  --over-sky: #e1eee7;
}

@media (min-width: 800px) {
  :root { --s: 2; --t: 3; }
}

@media (min-width: 2600px) and (min-height: 1500px) {
  :root { --s: 3; --t: 4; }
}

* { box-sizing: border-box; }

html { background: var(--ground); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--text);
  font-family: "1980", monospace;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: none;
  font-smooth: never;
  position: relative;
}

img { image-rendering: pixelated; display: block; }

/* the island, and the sky carried out past it by repeating its edge */
.hero {
  position: relative;
  height: calc(400px * var(--s));
  overflow: hidden;
  background-image: var(--sky, url("assets/weather/clear-sky.png"));
  background-repeat: repeat-x;
  background-size: calc(1px * var(--s)) 100%;
  image-rendering: pixelated;
}

.still,
.loop {
  position: absolute;
  top: 0;
  left: 50%;
  left: round(down, 50%, 1px);   /* an odd-width window would put it on half a pixel */
  width: calc(1280px * var(--s));
  height: calc(400px * var(--s));
  margin-left: calc(-640px * var(--s));
  max-width: none;
}

.loop[hidden] { display: none; }

.brand {
  position: absolute;
  top: 12px;
  left: 16px;
  margin: 0;
  color: var(--over-sky);
}

h1 {
  position: absolute;
  top: 44px;
  left: 50%;
  margin: 0 0 0 calc(-127px * var(--t));
}

h1 img {
  width: calc(254px * var(--t));
  height: calc(29px * var(--t));
}

.card:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 2px;
}

/* the links: one of the game's windows each, lit like its focused row on hover */
.links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 16px 16px 32px;
}

.links nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 358px;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 0 16px;
  background: var(--window);
  border: 2px solid var(--edge);
  box-shadow: 4px 4px 0 var(--edge-dark);
  color: var(--text);
  text-decoration: none;
}

.card .name { font-size: 32px; line-height: 32px; }
.card .handle { color: var(--edge); }

.card:hover,
.card:focus-visible {
  background: var(--accent);
  border-color: var(--edge-dark);
  color: var(--ink);
}

.card:hover .handle,
.card:focus-visible .handle { color: var(--ink); }

.pitch {
  margin: 0;
  color: var(--light);
  text-align: center;
}

.studio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 16px 48px;
}

.credit { margin: 0; color: var(--light); }
.credit a { color: var(--light); }
.credit a:hover,
.credit a:focus-visible { background: var(--accent); color: var(--ink); text-decoration: none; }

@media (min-width: 800px) {
  .brand { top: 40px; left: 48px; }
  h1 { top: 72px; }

  .links { gap: 40px; padding: 40px 48px 48px; }
  .links nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
    max-width: none;
  }
  .card { width: 360px; min-height: 96px; padding: 0 24px; gap: 8px; }
}

@media (min-width: 2600px) and (min-height: 1500px) {
  .brand { top: 56px; left: 64px; }
  h1 { top: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  .loop { display: none; }
}
