/* Archipelago landing page. Tokens and shared parts live in site.css. */

main { overflow-x: clip; }

/* ---- Hero: pitch on the left, the game's own sea chart on the right ------ */
.hero {
  --k: 3;                                   /* chart scale: art px -> CSS px */
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}
.hero-copy { max-width: 600px; }
.hero-logo { margin: 0 0 22px; }
/* The intro splash's title: PixelText over the island sheet, scale capped
   at 3 like SplashScreenView (1.5 at the smallest). */
.hero-logo .ptext { --s: 3; }
.hero-pitch {
  font-size: 21px; line-height: 1.5; color: var(--on-sea);
  margin-bottom: 26px;
}
.hero-cta { margin-bottom: 14px; }
.hero-note { font-size: 15px; color: var(--on-sea); max-width: 46ch; }

/* The chart is laid out in the game's own design units (180 x 270), so every
   isle keeps the size and spot MapIslandCatalog gives it. */
.chart {
  margin: 0;
  width: calc(180px * var(--k));
  aspect-ratio: 180 / 270;
  position: relative;
}
.chart-sea { position: absolute; inset: 0; }
.rock, .isle { position: absolute; transform: translate(-50%, -50%); }
.rock { height: auto; opacity: 0.9; }
.isle {
  padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 calc(var(--k) * 1px) 0 rgb(20 16 42 / 0.25));
}
.isle img { display: block; width: 100%; height: auto; }
.isle:hover img, .isle.is-open img { transform: translateY(calc(var(--k) * -1px)); }
.isle-tag {
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%);
  display: none;
  white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--ink); background: #fff;
  border: 2px solid var(--dialog-ink); border-radius: 6px;
  padding: 4px 10px 5px; z-index: 5;
  box-shadow: inset 3px -3px 0 var(--dialog-shade), 0 3px 0 rgb(20 16 42 / 0.35);
}
.isle-tag small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 13px; }
.isle:hover .isle-tag, .isle:focus-visible .isle-tag, .isle.is-open .isle-tag { display: block; }
.isle:focus-visible { outline: none; }
.isle:focus-visible img { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 8px; }

/* Ambient weather: clouds cross the whole width of the screen, over the sea
   and the isles but behind the title, pitch and button. */
.weather {
  position: absolute; top: 0; bottom: 0;
  left: 50%; width: 100vw; transform: translateX(-50%);
  overflow: hidden; pointer-events: none; z-index: 1;
}
.hero-copy { position: relative; z-index: 2; }
.drift { position: absolute; left: 0; height: auto; will-change: transform; }
.drift-a { width: calc(70px * var(--k) * 0.8); top: 14%; animation: drift 80s linear infinite; animation-delay: -12s; }
.drift-b { width: calc(70px * var(--k) * 0.55); top: 58%; animation: drift 105s linear infinite; animation-delay: -64s; }
.drift-c { width: calc(70px * var(--k) * 0.65); top: 36%; animation: drift 92s linear infinite; animation-delay: -40s; }
.drift-d { width: calc(70px * var(--k) * 0.5); top: 80%; animation: drift 120s linear infinite; animation-delay: -95s; }
@keyframes drift {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100vw); }
}

/* The one orchestrated moment: clouds cover the sea on arrival and part,
   the way the game's launch splash opens. */
.curtain { position: fixed; inset: 0; z-index: 40; pointer-events: none; display: flex; }
.curtain span {
  flex: 1;
  image-rendering: pixelated;
  animation: part 1.3s cubic-bezier(.6,0,.3,1) 0.35s forwards;
}
/* A solid cloud bank with a column of the game's cloud sprite piled on its
   inner edge (assets/decor/curtain-edge*.png tiles vertically). */
.curtain-l {
  --dir: -1;
  background:
    url("../assets/decor/curtain-edge.png") right top / 270px 444px repeat-y,
    linear-gradient(#fff, #fff) left top / calc(100% - 160px) 100% no-repeat;
  margin-right: -120px;
}
.curtain-r {
  --dir: 1;
  background:
    url("../assets/decor/curtain-edge-r.png") left 0 top 120px / 270px 444px repeat-y,
    linear-gradient(#fff, #fff) right top / calc(100% - 160px) 100% no-repeat;
  margin-left: -120px;
}
@keyframes part { to { transform: translateX(calc(var(--dir) * (100% + 320px))); } }
.js-seen .curtain { display: none; }

/* ---- Bands ---------------------------------------------------------------- */
.band { max-width: 1180px; margin: 0 auto; padding: 0 20px 36px; }

.loop-body {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 32px; align-items: center; margin-top: 18px;
}
.field-frame {
  line-height: 0;
  border: var(--px) solid var(--panel-outline);
  border-radius: calc(var(--px) * 3);
  box-shadow: 0 0 0 var(--px) var(--panel-lo);
  overflow: hidden;
}
.field { display: block; width: 480px; max-width: 100%; height: auto; image-rendering: pixelated; }
.loop-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.loop-steps li {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 10px 14px; border-radius: 10px;
  border: 2px solid transparent;
  transition: background-color 200ms, border-color 200ms;
}
.loop-steps li.is-active { background: rgb(255 205 117 / 0.1); border-color: var(--gold); }
.step-art { display: flex; align-items: center; justify-content: center; gap: 4px; }
.loop-steps h3 { margin: 0 0 2px; font-size: 19px; }
.loop-steps p { color: var(--text-dim); font-size: 16px; margin: 0; }

/* Island route: a real sequence, so it reads left to right as a voyage. */
.route {
  list-style: none; margin: 22px 0 0; padding: 0 0 8px;
  display: flex; gap: 0; overflow-x: auto;
  scroll-snap-type: x proximity;
}
.route li {
  flex: 1 0 92px; scroll-snap-align: start;
  display: grid; justify-items: center; align-content: start; gap: 4px;
  text-align: center; position: relative; padding: 0 6px;
}
.route li::before {                     /* the dotted sea lane between isles */
  content: ""; position: absolute; top: 34px; left: 0; right: 0;
  border-top: 3px dotted var(--panel-hi); opacity: 0.45; z-index: 0;
}
.route li:first-child::before { left: 50%; }
.route li:last-child::before { right: 50%; }
.route li > img { position: relative; z-index: 1; width: auto; height: 60px; margin-bottom: 6px; }
.route strong { font-weight: 700; font-size: 15px; line-height: 1.2; }
.route-when { font-size: 14px; color: var(--gold); font-weight: 700; }
.route-what { display: flex; gap: 4px; justify-content: center; min-height: 24px; }
.route-what img { width: 24px; height: 24px; object-fit: contain; }

/* ---- The goose's dialog box, used as the page's way onward ---------------- */
/* The game's own dialog frame (GooseDialogBox, 1:1 as the app draws it),
   9-sliced like GooseOverlayView (left 60, right 24). The app's box is never
   much taller than the art, so its 24px top and bottom caps work there; this
   one is much taller, so the caps are 33 (the rounded corner ends at y = 30)
   and 60 (the lower-left shading starts at y = 60), or both would be
   stretched down the whole left edge. */
.goose-box {
  position: relative;
  margin-top: 8px;
  color: #40334c;
  padding: 46px 28px 40px;
  filter: drop-shadow(0 3px 6px rgb(0 0 0 / 0.3));
}
.goose-box::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-style: solid;
  border-width: 33px 24px 60px 60px;
  border-image: url("../assets/goose/GooseDialogBox.png") 33 24 60 60 fill / 33px 24px 60px 60px stretch;
  image-rendering: pixelated;
}
.goose-box { isolation: isolate; }
.goose-box h2 { color: var(--ink); }
.goose-box p { color: var(--ink); }
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 18px; }
.next a {
  display: block; text-decoration: none; color: var(--ink);
  background: #fff; border: 2px solid var(--ink); border-radius: 8px;
  padding: 12px 14px 14px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}
.next a:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.next a:focus-visible { outline-color: var(--plum); }
.next strong { display: block; font-weight: 700; font-size: 18px; margin-bottom: 2px; }
.next span { font-size: 15px; line-height: 1.4; display: block; }

/* ---- Smaller screens ---------------------------------------------------- */
@media (max-width: 1100px), (max-height: 860px) {
  .hero { --k: 2; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 8px; }
  .hero-copy { max-width: none; }
  .chart { justify-self: center; }
  .loop-body { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 640px) {
  .hero { padding: 12px 16px 36px; }
  .hero-pitch { font-size: 18px; }
  .hero-logo .ptext { --s: 1.5; }
  .btn-gold { font-size: 18px; padding: 12px 16px 14px; }
  .chart { width: min(360px, calc(100vw - 32px)); }
  .band { padding: 0 16px 28px; }
  .loop-steps li { grid-template-columns: 56px minmax(0, 1fr); padding: 8px 10px; }
  .step-art img { max-width: 48px; height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .curtain, .drift { display: none; }
}
