/*
 * Kissimmee Parrots Games: the landing page (index.html). Loaded after pw.css (fonts, colors).
 * The Pathfinders card opens the Pathfinder Bible Challenge directly. Pico, the club mascot,
 * welcomes everyone next to the title.
 */

/* ---------- Landing page ---------- */

/* Paper texture; the title and card artwork have transparent edges so it shows around them. */
body.kp-landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: #FEF8E8 url(../img/paper.webp) repeat;
  font-size: clamp(16px, 0.35vw + 14px, 20px);
  overflow-x: hidden;
}
.kp {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 3vh, 36px) 16px clamp(20px, 4vh, 40px);
}
.kp-title { margin: 0; line-height: 0; }
.kp-title img { display: block; width: clamp(250px, 34vw, 500px); height: auto; }

/* The title in the middle; Pico, the club mascot, welcomes everyone from its left with a
   speech bubble (assets/img/pico-wave.webp: the club's picture of him waving hello, a clean
   cut-out; his raised wing points toward the bubble, clear of it).
   Phones, tablets and small laptops (the column beside the title is too narrow there for a
   bubble that reads well): Pico and his bubble sit under the title.
   (His main picture, assets/img/pico.webp, has a soft ground shadow that shows as a pale patch
   on mid or dark colours: use it on light surfaces only; never edit his pixels.) */
.kp-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(12px, 2vw, 32px);
  width: 100%;
}
.kp-title { grid-column: 2; grid-row: 1; }
.kp-pico {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.kp-pico__img {
  flex: none;
  display: block;
  width: clamp(110px, 13vw, 180px);
  height: auto;
  transform-origin: 50% 94%;
  animation: kp-pico-bob 3.4s ease-in-out infinite;
}
.kp-pico__bubble {
  position: relative;
  max-width: clamp(170px, 17vw, 260px);
  margin: 0 0 14% 6px;
  padding: 0.7em 0.95em;
  border-radius: 1.1em 1.1em 1.1em 0.3em;
  background: #fff;
  box-shadow: 0 6px 18px rgba(6, 60, 42, 0.14);
  color: var(--green);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.92rem, 0.35vw + 0.75rem, 1.08rem);
  line-height: 1.3;
}
/* the bubble's tail, toward Pico */
.kp-pico__bubble::before {
  content: '';
  position: absolute;
  left: -9px;
  bottom: 10px;
  border-width: 7px 10px 7px 0;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
}
@keyframes kp-pico-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.kp-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2.4vw, 32px);
  /* Keep both cards on one laptop screen: each card is about 1.52× as wide as it is tall. */
  width: min(100%, calc((100vh - 330px) * 3.05));
  width: min(100%, calc((100dvh - 330px) * 3.05));
  min-width: min(100%, 640px);
  margin: clamp(6px, 1.5vh, 16px) 0 0;
  padding: 0;
  list-style: none;
}
.kp-card {
  display: block;
  border-radius: 7% / 10.5%;
  transition: transform 0.18s ease;
}
.kp-card img { display: block; width: 100%; height: auto; }
.kp-card:hover { transform: translateY(-4px) scale(1.012); }
.kp-card:active { transform: translateY(-1px) scale(1.004); }
.kp-card:focus-visible { outline: 0.22em solid var(--yellow); outline-offset: -0.1em; }

.kp-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px 18px;
  background: var(--green);
  color: rgba(255, 251, 240, 0.85);
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: left;
}
.kp-footer img { flex: none; width: 52px; height: 52px; }
.kp-footer b { display: block; color: #fff; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.03em; }

/* Phones and portrait tablets: stack the cards, capped by height so both still fit on square screens. */
@media (max-width: 680px), (orientation: portrait) and (max-width: 1024px) {
  .kp-cards {
    grid-template-columns: minmax(0, 1fr);
    /* (about 105 px of the height goes to Pico's welcome under the title) */
    width: min(100%, 520px, calc((100vh - 405px) * 0.76));
    width: min(100%, 520px, calc((100dvh - 405px) * 0.76));
    min-width: min(100%, 300px);
  }
  .kp-head { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 2px; }
  .kp-title, .kp-pico { grid-column: 1; }
  .kp-pico { grid-row: 2; justify-self: center; }
  .kp-pico__img { width: 96px; }
  .kp-pico__bubble { max-width: min(250px, calc(100vw - 150px)); margin-bottom: 14px; font-size: 0.95rem; }
}
/* Small laptops and landscape tablets: the welcome under the title too, the cards side by side
   (about 110 px of the height goes to it, so only on screens tall enough for the cards to keep
   their size: 1024×768, 1180×820 …). Wider or shorter screens keep it beside the title. */
@media (orientation: landscape) and (min-width: 681px) and (max-width: 1180px) and (min-height: 740px) and (max-aspect-ratio: 29/20) {
  .kp-cards {
    width: min(100%, calc((100vh - 415px) * 3.05));
    width: min(100%, calc((100dvh - 415px) * 3.05));
  }
  .kp-head { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 2px; }
  .kp-title, .kp-pico { grid-column: 1; }
  .kp-pico { grid-row: 2; justify-self: center; }
  .kp-pico__img { width: 108px; }
  .kp-pico__bubble { max-width: 330px; margin-bottom: 14px; }
}
/* Portrait tablets: a bigger Pico and a wider bubble (about 130 px under the title). */
@media (orientation: portrait) and (min-width: 700px) and (max-width: 1024px) {
  .kp-cards {
    width: min(100%, 520px, calc((100vh - 430px) * 0.76));
    width: min(100%, 520px, calc((100dvh - 430px) * 0.76));
  }
  .kp-pico__img { width: 128px; }
  .kp-pico__bubble { max-width: 330px; font-size: 1.02rem; }
}
/* Big screens: Pico a little larger beside the title, his bubble a little wider. */
@media (min-width: 1700px) {
  .kp-pico__img { width: 200px; }
  .kp-pico__bubble { max-width: 280px; }
}
@media (max-width: 680px) {
  .kp-title img { width: min(78vw, 340px); }
}
/* Short phones: a smaller welcome (about 80 px), so both cards and the footer still fit. */
@media (max-width: 680px) and (max-height: 680px) {
  .kp-pico__img { width: 76px; }
  .kp-pico__bubble { font-size: 0.85rem; margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .kp-card { transition: none; }
  .kp-card:hover, .kp-card:active { transform: none; }
  .kp-pico__img { animation: none; }
}
