/* Blencathra Studios — dark forest theme.
   Palette lifted from Flutterfall Frenzy (project.godot clear colour,
   ui_theme.tres button/border colours, the acorn HUD warm tone). */

:root {
  --bg:          #070B06;  /* deeper than the game's clear colour, for depth */
  --bg-raise:    #0A0F08;  /* game clear colour */
  --panel:       #0F2114;  /* button normal */
  --panel-hi:    #16301C;  /* hover-ish */
  --border:      #2B4632;
  --border-soft: rgba(107, 148, 112, 0.28);  /* border mid @ low alpha */
  --accent:      #9ED16B;  /* focus lime */
  --accent-dim:  #6B9470;  /* border mid */
  --warm:        #FFF2B2;  /* acorn label */
  --text:        #E6EFE2;
  --muted:       #9BB097;

  --radius:   18px;
  --radius-sm: 12px;
  --maxw:     1080px;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;

  /* Layered canopy glow — mimics the game's parallax circles fading into dark. */
  background-image:
    radial-gradient(58rem 40rem at 12% -8%,  rgba(39, 85, 22, 0.30), transparent 60%),
    radial-gradient(46rem 34rem at 92% 6%,   rgba(16, 54, 26, 0.34), transparent 62%),
    radial-gradient(70rem 48rem at 50% 108%, rgba(8, 33, 0, 0.75),   transparent 68%);
  background-attachment: fixed;
}

/* Decorative drifting motes sit behind everything */
#motes {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

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

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: clamp(1.5rem, 4vw, 2.75rem);
}

.brand { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }

.brand__mark {
  flex: none;
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  color: var(--accent);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(158, 209, 107, 0.16), transparent 70%);
}
.brand__mark svg { width: 1.6rem; height: 1.6rem; }

.brand__text { display: flex; flex-direction: column; min-width: 0; }

.brand__name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.2vw, 2.35rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: #F3F8EF;
  text-shadow: 0 0 28px rgba(158, 209, 107, 0.18);
}

.brand__tag {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------- socials */

.socials { display: flex; gap: 0.6rem; flex: none; padding-top: 0.25rem; }

.social {
  width: 2.6rem; height: 2.6rem;
  display: grid; place-items: center;
  color: var(--accent-dim);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(15, 33, 20, 0.55);
  transition: color .18s ease, border-color .18s ease,
              background-color .18s ease, transform .18s ease;
}
.social svg { width: 1.25rem; height: 1.25rem; }

.social:hover,
.social:focus-visible {
  color: var(--accent);
  border-color: rgba(158, 209, 107, 0.55);
  background: var(--panel-hi);
  transform: translateY(-2px);
}

/* -------------------------------------------------------------- games grid */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));  /* two per row */
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

@media (max-width: 720px) {
  .grid { grid-template-columns: minmax(0, 1fr); }   /* one per row */
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(22, 48, 28, 0.55), rgba(10, 15, 8, 0.85));
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(158, 209, 107, 0.4);
  box-shadow: 0 26px 52px -26px rgba(0, 0, 0, 0.95);
}

/* Fixed-ratio window: any image size/aspect is scaled to fill and centre-cropped. */
.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--border-soft);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* crop, never squash */
  object-position: center;
  display: block;
  transition: transform .5s ease;
}

.card:hover .card__media img { transform: scale(1.04); }

/* Vignette so bright screenshots still sit in the forest */
.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(7, 11, 6, 0.55));
  pointer-events: none;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: clamp(1rem, 2.2vw, 1.4rem);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  color: var(--warm);
}

.card__blurb {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease,
              color .18s ease, transform .18s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--panel-hi);
  border-color: rgba(158, 209, 107, 0.5);
  transform: translateY(-1px);
}

.btn--primary {
  background: #275516;                 /* game's button hover green */
  border-color: rgba(158, 209, 107, 0.45);
  color: #F2FBEA;
}
.btn--primary:hover,
.btn--primary:focus-visible { background: #2F6A1B; }

.btn__icon { width: 1.05rem; height: 1.05rem; flex: none; }

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

.footer {
  margin-top: auto;
  padding-top: clamp(2rem, 6vw, 3.5rem);
  color: var(--muted);
  font-size: 0.85rem;
}
.footer p { margin: 0; }

/* ------------------------------------------------------------------- a11y  */

a:focus-visible,
.social:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .card:hover { transform: none; }
  .card:hover .card__media img { transform: none; }
}
