/* The Flying Farm — site styles
   Palette taken from the game: logo orange/yellow on red-brown wood,
   night-blue sky with a cream full moon, teal wooden UI planks, thick dark outlines. */

@font-face {
  font-family: "Lilita One";
  src: url("../fonts/lilita-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-var.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --night-900: #061017;
  --night-800: #0c1d27;
  --night-700: #13293a;
  --night-500: #42616e;
  --teal-700: #1a3540;
  --teal-500: #277f9a;
  --teal-300: #63c3dc;
  --orange: #f9801b;
  --orange-dark: #c2520b;
  --yellow: #fdcd46;
  --wood: #7e3915;
  --wood-dark: #4a1d12;
  --moon: #f8f1dc;
  --ink: #170c08;
  --sky-top: #3fa7dc;
  --sky-bottom: #bfe8f7;
  --grass: #7cb83a;
  --text: #eef4f2;
  --text-muted: #b9cdd1;

  --font-display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --outline: 4px solid var(--ink);
  --max: 1180px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--night-800);
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--yellow); }
a:hover { color: #fff; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: .6rem 1rem; border-radius: 10px;
  font-weight: 800;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ---------- Display type: chunky cartoon titles like the logo ---------- */
.title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 .4em;
  color: var(--yellow);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--wood-dark), 0 6px 14px rgb(0 0 0 / .35);
}
.title--xl { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.title--lg { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.title--md { font-size: 1.5rem; -webkit-text-stroke-width: 1.5px; text-shadow: 0 3px 0 var(--wood-dark); }
.title .accent { color: var(--orange); }

.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-head p { color: var(--text-muted); max-width: 44rem; margin: 0 auto; font-size: 1.125rem; }

/* ---------- Buttons: wooden, chunky, with a "pressable" bottom edge ---------- */
.btn {
  --btn-bg: var(--orange);
  --btn-bg-2: var(--yellow);
  --btn-edge: var(--wood);
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 2px 0 rgb(0 0 0 / .35);
  padding: .95rem 1.6rem 1rem;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--btn-bg-2) -40%, var(--btn-bg) 55%);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / .35), 0 6px 0 var(--btn-edge), 0 10px 18px rgb(0 0 0 / .35);
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  cursor: pointer;
}
.btn:hover { color: #fff; filter: brightness(1.07); transform: translateY(-2px);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / .35), 0 8px 0 var(--btn-edge), 0 14px 22px rgb(0 0 0 / .35); }
.btn:active { transform: translateY(4px);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / .25), 0 2px 0 var(--btn-edge), 0 4px 8px rgb(0 0 0 / .3); }
.btn--teal { --btn-bg: var(--teal-500); --btn-bg-2: var(--teal-300); --btn-edge: #0f3a47; }
.btn--sm { font-size: 1.05rem; padding: .6rem 1rem .65rem; border-radius: 11px; }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Wooden panel (texture from the in-game sign) ---------- */
.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgb(255 255 255 / .06), rgb(0 0 0 / .18)),
    url("../img/wood-dark.webp") center / cover,
    var(--teal-700);
  border: var(--outline);
  border-radius: var(--radius);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .12), 0 10px 0 rgb(0 0 0 / .25), 0 18px 40px rgb(0 0 0 / .35);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(6 16 23 / .82);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--ink);
}
.site-header .container { display: flex; align-items: center; gap: 1.25rem; min-height: 66px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff; }
.brand img { width: 42px; height: 42px; filter: drop-shadow(0 2px 0 var(--ink)); }
.brand span { font-family: var(--font-display); font-size: 1.3rem; color: var(--yellow);
  -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--wood-dark); }
.nav { display: flex; gap: 1.4rem; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-weight: 800; font-size: .98rem; }
.nav a:hover { color: var(--yellow); }
.lang { display: flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.lang a, .lang span { padding: .3rem .55rem; font-weight: 800; font-size: .85rem; text-decoration: none; line-height: 1.2; }
.lang a { color: var(--text-muted); background: var(--night-700); }
.lang a:hover { color: #fff; }
.lang [aria-current] { background: var(--teal-500); color: #fff; }

@media (max-width: 860px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
  .brand span { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--night-900);
  border-bottom: 4px solid var(--ink);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 85% 30%; }
.hero-content { position: relative; }
.hero-logo { margin: 0; }
.hero-logo img { width: min(100%, 520px); height: auto; filter: drop-shadow(0 12px 24px rgb(0 0 0 / .45)); }
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 3px 0 var(--ink), 0 0 18px rgb(0 0 0 / .6);
  margin: 1.2rem 0 1.6rem;
  max-width: 30ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem 1.2rem; align-items: center; }
.hero-note { margin: 1rem 0 0; color: var(--text-muted); font-weight: 700; font-size: .95rem;
  text-shadow: 0 2px 6px rgb(0 0 0 / .8); }

@media (min-width: 901px) {
  .hero { min-height: clamp(520px, 40vw, 820px); display: grid; align-items: center; }
  .hero-art { position: absolute; inset: 0; z-index: -1; }
  .hero::after { /* darken the left so the text stays readable */
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, rgb(6 16 23 / .78) 0%, rgb(6 16 23 / .35) 38%, transparent 60%),
                linear-gradient(0deg, rgb(6 16 23 / .55), transparent 30%);
  }
  .hero-content { padding-block: 4rem 5rem; }
}
@media (max-width: 900px) {
  .hero-art { display: block; aspect-ratio: 900 / 1189; max-height: 78vh; }
  .hero-art img { object-position: 50% 0; }
  .hero-logo img { display: none; } /* the logo is part of the portrait art */
  .hero-content { margin-top: -5.5rem; padding-bottom: 2.75rem; text-align: center; }
  .hero-tagline { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero::before { content: ""; position: absolute; left: 0; right: 0; top: 40%; height: 60%; z-index: 0;
    background: linear-gradient(180deg, transparent, var(--night-900) 45%); pointer-events: none; }
}

/* ---------- Generic sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); position: relative; }

/* Night sky with a sprinkle of stars */
.section--night {
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, rgb(255 255 255 / .7), transparent 60%),
    radial-gradient(1px 1px at 28% 72%, rgb(255 255 255 / .55), transparent 60%),
    radial-gradient(1.5px 1.5px at 47% 30%, rgb(255 255 255 / .6), transparent 60%),
    radial-gradient(1px 1px at 66% 12%, rgb(255 255 255 / .5), transparent 60%),
    radial-gradient(1.5px 1.5px at 82% 58%, rgb(255 255 255 / .65), transparent 60%),
    radial-gradient(1px 1px at 92% 22%, rgb(255 255 255 / .5), transparent 60%),
    radial-gradient(1px 1px at 8% 88%, rgb(255 255 255 / .45), transparent 60%),
    linear-gradient(180deg, var(--night-900), var(--night-700) 70%, #1d3a48);
}

/* Daytime sky with clouds at the bottom (the Skyland look) */
.section--sky {
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 85%);
  border-block: 4px solid var(--ink);
  overflow: hidden;
}
.section--sky::after {
  content: ""; position: absolute; left: -5%; right: -5%; bottom: -40px; height: 140px; pointer-events: none;
  background:
    radial-gradient(closest-side, #fff 96%, transparent) 0 30px / 220px 140px repeat-x,
    radial-gradient(closest-side, #f3fbff 96%, transparent) 110px 0 / 260px 150px repeat-x;
  opacity: .95;
}
.section--sky > .container { position: relative; z-index: 1; }
.section--sky .section-head p { color: #173947; font-weight: 700; }

/* ---------- Story + trailer ---------- */
.story { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .story { grid-template-columns: 5fr 6fr; } }
.story-text { padding: 2rem 2rem 1.75rem; }
.story-text p { margin: 0 0 1em; }
.story-text p:last-child { margin-bottom: 0; }
.story-marvin { position: absolute; width: 120px; right: -26px; top: -70px; transform: rotate(8deg);
  filter: drop-shadow(0 8px 10px rgb(0 0 0 / .4)); display: none; }
@media (min-width: 900px) { .story-marvin { display: block; } }

.video-frame {
  position: relative;
  border: var(--outline);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 0 rgb(0 0 0 / .25), 0 18px 40px rgb(0 0 0 / .45);
  aspect-ratio: 16 / 9;
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Features ---------- */
.features { display: grid; gap: 2.75rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-top: 4.5rem; }
.feature { padding: 1.5rem 1.4rem 1.4rem; }
.feature-icon {
  width: 72px; height: 72px !important; margin: -3.4rem 0 .8rem;
  border-radius: 10px; transform: rotate(-4deg);
  box-shadow: 0 5px 0 rgb(0 0 0 / .35);
}
.feature:nth-child(even) .feature-icon { transform: rotate(4deg); }
.feature p { margin: 0; color: var(--text-muted); font-size: 1rem; }

/* ---------- Worlds ---------- */
.worlds { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.world {
  position: relative; margin: 0;
  border: var(--outline); border-radius: var(--radius); overflow: hidden;
  background: var(--night-700);
  box-shadow: 0 6px 0 rgb(0 0 0 / .25);
  transition: transform .2s ease;
}
.world:hover { transform: translateY(-4px) rotate(-.4deg); }
.world img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.world figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.2rem 1rem .8rem;
  background: linear-gradient(180deg, transparent, rgb(6 16 23 / .85));
  color: #fff;
}
.world-num { font-family: var(--font-display); color: var(--yellow); font-size: .95rem; display: block;
  -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.world-name { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1;
  text-shadow: 0 2px 0 var(--ink); }

/* ---------- Characters ---------- */
.cast { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem 1.1rem; }
.char { margin: 0; text-align: center; flex: 0 1 152px; }
@media (max-width: 520px) { .char { flex-basis: calc(50% - .6rem); } }
.char img {
  width: 100%; aspect-ratio: 7 / 8; object-fit: cover;
  border: var(--outline); border-radius: var(--radius);
  background: #e9e9e9;
  box-shadow: 0 6px 0 rgb(0 0 0 / .3);
  transition: transform .2s ease;
}
.char:hover img { transform: translateY(-4px) rotate(1.5deg); }
.char figcaption { margin-top: .7rem; }
.char strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; color: var(--yellow);
  -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--wood-dark); }
.char span { color: var(--text-muted); font-size: .95rem; }

/* ---------- Gallery + lightbox ---------- */
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.gallery button {
  padding: 0; border: var(--outline); border-radius: 14px; overflow: hidden; cursor: zoom-in;
  background: #000; box-shadow: 0 6px 0 rgb(0 0 0 / .3);
  transition: transform .2s ease;
}
.gallery button:hover { transform: scale(1.025); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.lightbox {
  width: min(96vw, 1600px); max-height: 94vh; padding: 0; border: var(--outline); border-radius: var(--radius);
  background: #000; overflow: visible;
}
.lightbox::backdrop { background: rgb(4 10 14 / .88); backdrop-filter: blur(4px); }
.lightbox img { width: 100%; height: auto; max-height: calc(94vh - 8px); object-fit: contain; border-radius: 14px; }
.lightbox-btn {
  position: absolute; display: grid; place-items: center;
  width: 48px; height: 48px; padding: 0;
  font: 400 1.6rem/1 var(--font-display); color: #fff;
  background: var(--teal-500); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 0 4px 0 #0f3a47; cursor: pointer;
}
.lightbox-btn:hover { filter: brightness(1.12); }
.lightbox-close { top: -18px; right: -18px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Final call to action ---------- */
.cta { text-align: center; overflow: hidden; }
.cta-moon {
  position: absolute; width: min(70vw, 640px); aspect-ratio: 1; left: 50%; top: 50%;
  transform: translate(-50%, -45%); border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 45% 40%, #fffbea, var(--moon) 55%, #e9dcb6 70%, transparent 71%);
  box-shadow: 0 0 120px 30px rgb(248 241 220 / .25);
  opacity: .1;
}
.cta .container { position: relative; z-index: 1; }
.cta .title { margin-bottom: .3em; }
.cta p.lead { color: var(--text-muted); font-size: 1.15rem; margin: 0 auto 2rem; max-width: 36rem; }
.steam-widget { margin: 2.5rem auto 0; max-width: 646px; }
.steam-widget iframe { width: 100%; height: 190px; border: 0; border-radius: 10px; display: block; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--night-900);
  border-top: 4px solid var(--ink);
  color: var(--text-muted);
  padding-block: 2.5rem;
  font-size: .95rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; justify-content: space-between; }
.footer-studios { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-studios img { height: 28px; width: auto; opacity: .9; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: var(--text); font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--yellow); }
.site-footer p { margin: 0; }

/* Floating idle animation for Marvin & the farm */
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(8deg); } 50% { transform: translateY(-10px) rotate(5deg); } }
.story-marvin { animation: bob 4s ease-in-out infinite; }

.features { list-style: none; padding: 0; }
.section--flush-top { padding-top: 0; }

/* Mystery world card: the last world is a story spoiler */
.mystery-art {
  aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: clamp(5rem, 9vw, 7.5rem); line-height: 1;
  color: var(--yellow);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--wood-dark), 0 0 40px rgb(253 205 70 / .35);
  background:
    radial-gradient(1.5px 1.5px at 15% 25%, rgb(255 255 255 / .8), transparent 60%),
    radial-gradient(1px 1px at 35% 70%, rgb(255 255 255 / .6), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 20%, rgb(255 255 255 / .7), transparent 60%),
    radial-gradient(1px 1px at 85% 60%, rgb(255 255 255 / .6), transparent 60%),
    radial-gradient(1px 1px at 55% 85%, rgb(255 255 255 / .5), transparent 60%),
    radial-gradient(circle at 50% 45%, #1f4152, var(--night-800) 70%);
}
.mystery-art span { display: block; animation: mystery 3s ease-in-out infinite; }
@keyframes mystery { 0%, 100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.04); } }
.world--mystery:hover .mystery-art span { animation-duration: .8s; }

/* ---------- 404 page ---------- */
.lost { min-height: calc(100vh - 69px); display: grid; place-items: center; text-align: center; padding-block: 2.5rem; }
.lost .container { display: flex; flex-direction: column; align-items: center; }
.lost-marvin { width: 120px; filter: drop-shadow(0 14px 12px rgb(0 0 0 / .45));
  animation: lost-bob 3.5s ease-in-out infinite; }
@keyframes lost-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
.lost-code { margin: 1rem 0 1.25rem; font-family: var(--font-display); font-size: clamp(4rem, 10vw, 6rem); line-height: 1;
  color: var(--orange); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--wood-dark); }
.lost-text { width: 100%; max-width: 30rem; display: flex; flex-direction: column; align-items: center; }
.lost-text p { color: var(--text-muted); margin: 0 0 1.4rem; }
.lost-text + .lost-text { margin-top: 2.25rem; padding-top: 2.25rem; border-top: 3px dashed rgb(255 255 255 / .15); }
