/* The marketing half of the homepage: the tile word, the App Store pill, the feature
   grid, the phone showcase and What's New. Everything here sits on the tabletop and uses
   its colours; the only other colours are the players', the same eight as the board's
   --p0 to --p7 (play.css, fixtures/player_colors.json). Motion is off under
   prefers-reduced-motion, and the reveal states are only ever added by marketing.js. */

/* ---------- hero: letters popping into squares, one player colour each */
.tiles { display: flex; gap: 6px; margin: 0 0 18px; }
.tiles i {
  --c: 43,124,255;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px;
  font: 700 1.1rem/1 var(--serif); font-style: normal; color: var(--ink);
  background: color-mix(in srgb, rgb(var(--c)) 30%, var(--panel));
  border: 1px solid color-mix(in srgb, rgb(var(--c)) 55%, transparent);
  box-shadow: 0 2px 0 color-mix(in srgb, rgb(var(--c)) 45%, transparent);
}
@media (max-width: 400px) { .tiles i { width: 30px; height: 30px; } }

.appstore-pill {
  display: inline-block; margin: 18px 0; border-radius: 10px; line-height: 0;
  transition: transform .15s ease;
}
.appstore-pill img { display: block; width: 150px; height: 50px; }
.appstore-pill:hover { transform: translateY(-2px); }
.appstore-pill:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
#get-the-app .appstore-pill { margin-top: 0; }

@media (prefers-reduced-motion: no-preference) {
  .tiles i { animation: tile-pop .55s cubic-bezier(.3, 1.6, .5, 1) both; }
  .tiles i:nth-child(1) { animation-delay: .05s; } .tiles i:nth-child(2) { animation-delay: .15s; }
  .tiles i:nth-child(3) { animation-delay: .25s; } .tiles i:nth-child(4) { animation-delay: .35s; }
  .tiles i:nth-child(5) { animation-delay: .45s; } .tiles i:nth-child(6) { animation-delay: .55s; }
  .tiles i:nth-child(7) { animation-delay: .65s; } .tiles i:nth-child(8) { animation-delay: .75s; }
  .tiles i:hover { transform: translateY(-4px) rotate(-6deg); transition: transform .15s; }
  /* The demo board's coloured squares drop in one after another. */
  .boardcard .sq.filled { animation: tile-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
  .boardcard .sq.filled:nth-child(5n+1) { animation-delay: .2s; } .boardcard .sq.filled:nth-child(5n+2) { animation-delay: .4s; }
  .boardcard .sq.filled:nth-child(5n+3) { animation-delay: .6s; } .boardcard .sq.filled:nth-child(5n+4) { animation-delay: .8s; }
  .boardcard .sq.filled:nth-child(5n) { animation-delay: 1s; }
}
@keyframes tile-pop { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- feature grid */
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-grid li {
  --c: 43,124,255;
  padding: 18px 18px 20px; border-radius: 16px; background: var(--panel);
  border: 1px solid var(--rule); border-top: 4px solid rgb(var(--c));
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-grid li:hover { transform: translateY(-3px); box-shadow: 0 8px 18px #082d2822; }
.ftile {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px; border-radius: 6px;
  font: 700 1.05rem/1 var(--serif); color: var(--ink);
  background: color-mix(in srgb, rgb(var(--c)) 30%, var(--panel));
  border: 1px solid color-mix(in srgb, rgb(var(--c)) 55%, transparent);
}
.feature-grid h3 { font: 700 1.05rem/1.3 var(--serif); margin: 0 0 6px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- screenshots in phone frames: a tilted fan on a wide screen, a swipeable row on a narrow one */
.showcase { overflow: hidden; }
.phones { display: flex; justify-content: center; gap: 18px; padding: 24px 0 8px; }
.phone-card { margin: 0; flex: 0 1 220px; min-width: 0; text-align: center; transform: translateY(var(--lift, 0)) rotate(var(--tilt, 0deg)); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.phone-card:hover, .phone-card:focus-within { transform: translateY(-10px) rotate(0deg) scale(1.04); z-index: 1; }
.phone {
  padding: 7px; border-radius: 34px; background: #14201d;
  box-shadow: 0 0 0 2px #3a4a45, 0 14px 28px #082d2845, inset 0 0 0 1px #000;
  position: relative;
}
.phone::before { content: ""; position: absolute; top: 14px; left: 50%; width: 30%; height: 14px; margin-left: -15%; border-radius: 8px; background: #000; z-index: 1; }
.phone img { display: block; width: 100%; height: auto; border-radius: 28px; background: var(--paper); }
.phone-card figcaption { margin-top: 16px; font: .92rem/1.4 var(--serif); color: var(--muted); }
@media (max-width: 900px) {
  .phones { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding: 24px 4px 14px; margin: 0 -4px; -webkit-overflow-scrolling: touch; }
  .phone-card { flex: 0 0 min(220px, 62vw); scroll-snap-align: center; transform: none; }
  .phone-card:hover { transform: none; }
}

/* ---------- What's New, the way the App Store sets it */
.whats-new { padding: 32px 36px; margin: 24px 0; background: var(--paper-fill); border: 1px solid #ffffff73; border-radius: 22px; box-shadow: var(--paper-shadow); scroll-margin-top: 24px; }
.whats-new .sub { margin-bottom: 22px; }
.release { padding: 18px 0; border-top: 1px solid var(--rule); }
.release-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.release h3 { margin: 0; font: 700 1.05rem/1.3 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif; }
.release time, .release-date { color: var(--muted); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.release ul { margin: 10px 0 0; padding: 0; list-style: none; }
.release li { position: relative; padding-left: 16px; margin: 0 0 6px; font-size: .97rem; line-height: 1.55; }
.release li::before { content: ""; position: absolute; left: 1px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); opacity: .6; }
.release.is-latest { border-top: none; padding-top: 0; }
.release.is-latest h3 { font-size: 1.5rem; }
.release.is-latest li { font-size: 1.03rem; }
.release-tag { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; font: 700 .66rem/1.5 ui-sans-serif, -apple-system, sans-serif; letter-spacing: .12em; text-transform: uppercase; vertical-align: middle; background: #e7b974; color: var(--ink); }
.release-next { margin: 22px 0 0; padding: 4px 18px 6px; border: 1.5px dashed var(--line); border-radius: 14px; background: #ffffff40; }
.release-next > .caps { margin: 14px 0 0; }
.release-next .release { border-top: none; }
.release-history { margin-top: 18px; border-top: 1px solid var(--rule); }
.release-history summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 700; font-size: 1rem; list-style: none; color: var(--ink); }
.release-history summary::-webkit-details-marker { display: none; }
.release-history summary::after { content: "+"; margin-left: 10px; font: 700 1.3rem/1 var(--serif); }
.release-history[open] summary::after { content: "\2212"; }
.release-history summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 500px) { .whats-new { padding: 24px 20px; } .release-head { flex-wrap: wrap; gap: 2px 16px; } }

/* ---------- scroll reveals */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); }
  .reveal.in { opacity: 1; transform: none; transition: opacity .6s ease var(--stagger, 0ms), transform .6s cubic-bezier(.2, .9, .3, 1) var(--stagger, 0ms); }
  .phone-card.reveal { transform: translateY(calc(var(--lift, 0px) + 30px)) rotate(var(--tilt, 0deg)); }
  .phone-card.reveal.in { transform: translateY(var(--lift, 0)) rotate(var(--tilt, 0deg)); }
  .phone-card.reveal.in:hover { transform: translateY(-10px) rotate(0deg) scale(1.04); transition-delay: 0s; }
  .feature-grid li.reveal.in:hover { transform: translateY(-3px); transition-delay: 0s; }
}
