/* Bin Blitz site styles. Same skeleton as the other app sites (Great Circle
   Map's is the source), re-themed to the alley's palette from
   game/src/config/palette.js: charcoal plum brick, gunmetal lines, the gold
   of the game's one primary action as the accent, and the slime lime kept
   for small highlights. */

:root {
  --bg: #15111B;
  --raised: #1E1A24;
  --card: #2A2431;
  --line: #3A3344;
  --accent: #F2B93B;
  --accent-dim: #D8AD25;
  --slime: #9BD13B;
  --text: #F6F0E2;
  --muted: #B8AFC2;
  --dim: #867D92;
  /* The site face stays on the navbar and footer. The page reads in the
     system face (SF on Apple devices) under serif display headlines, New
     York where the browser offers it and Georgia elsewhere. */
  --font-site: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: ui-serif, "New York", Georgia, "Times New Roman", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-site);
  line-height: 1.55;
  padding-top: 56px; /* fixed navbar */
}
body.home { font-family: var(--font-text); }
/* Pinned so the navbar and footer render the same on every page, whatever
   face the page body uses. */
.navbar, footer { font-family: var(--font-site); }

h1, h2, h3, .wordmark, .nav-brand {
  font-family: Montserrat, Roboto, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Fixed navbar: brand on the left, links centered, hamburger on mobile. */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  z-index: 100;
}
/* Wider than the content column: five translated links plus the language
   picker need the room, and the bar collapses to the hamburger below 800px. */
.nav-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-mark { width: 34px; height: 34px; flex: none; border-radius: 22%; }
.nav-menu {
  list-style: none;
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.nav-menu a {
  display: block;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 8px;
  white-space: nowrap;
}
.nav-menu a:hover { color: var(--accent); text-decoration: none; }
.nav-toggler {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  cursor: pointer;
}
.nav-toggler span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  border-radius: 1px;
}

a { color: var(--accent); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }

/* Hero: copy on the left under the logo and a serif display headline, the
   closed iPhone Duo's front on the right, inviting the reader to open it. */
.hero { padding: 72px 0 72px; }
.hero-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}
.hero-head .brand-mark { width: 80px; height: 80px; flex: none; border-radius: 22%; }
.tagline {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -1.5px;
  text-wrap: balance;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
}
.lede { color: var(--muted); font-size: 17px; line-height: 1.6; margin-bottom: 14px; }
/* The store badges with the device line centered under them: a block only
   as wide as the badges, at the left of the copy on wide screens and
   centered when the hero stacks. */
.hero-store {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 28px;
}
/* The hero still is the closed Duo edge to edge, on a clear background. A
   video with the same width and height takes its place with no change. */
.hero-visual { width: 330px; }
.hero-visual img,
.hero-visual video { display: block; width: 100%; height: auto; }
.badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero .badges { justify-content: center; }
/* A row's badges stay clear until both have arrived, then show together
   (js/badges.js); without scripts the page's noscript rule shows them. */
.store-badge { height: 50px; width: auto; opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease; }
.badges.is-ready .store-badge { opacity: 1; }
.store-badge:hover { transform: scale(1.05); }
/* The badge is a picture, not a link, until the game has a listing. */
/* A plain link with a drawn arrow, the way Apple's pages point onward. */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 400;
}
.text-link svg { width: 15px; height: 15px; flex: none; }
.works-on {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
}

/* The phone: six framed screenshots stacked and cross-faded. The cycle
   is driven by carousel.js (a timer plus this transition), which watches
   for and recovers from dropped frames; CSS keyframes could hang blank
   with no way to notice. The webps carry their own transparent bezel. */
.phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 680 / 948; /* the framed webp size, reserved before load */
}
.phone img { width: 100%; height: auto; display: block; }
/* Pin only the top: a bottom pin would squash every frame into whatever
   height the first image happens to have while loading. */
.shot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
}
.shot:first-child { position: relative; }
.shot.is-active { opacity: 1; }

/* iPhone section: the copy beside the carousel. */
.iphone-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 64px;
  align-items: center;
}
.home .iphone-copy .section-intro { margin-bottom: 0; }
/* A Round in the Alley's film takes the carousel's place at its size: the closed
   Duo edge to edge on a clear background. */
.iphone-visual video { display: block; width: 320px; max-width: 100%; height: auto; margin: 0 auto; }

/* Sections and panels. Whatever a section ends on, an intro paragraph, a
   figure, or a card grid, drops its own bottom margin, so the gap between
   any two sections is the padding alone and reads the same down the page. */
section { padding: 64px 0; scroll-margin-top: 64px; }
section .wrap > :last-child { margin-bottom: 0; }
.section-title {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  text-align: center;
  margin-bottom: 28px;
}
/* Features read as columns under a hairline, no boxes, with the icon
   standing above its heading. */
.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
}
.card {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
}
.card h3 {
  font-family: var(--font-text);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.3;
  margin-bottom: 8px;
}
.card h3 svg { display: block; width: 22px; height: 22px; color: var(--accent); margin-bottom: 14px; }
/* A painted icon above a card's heading: a bin, as it stands in the alley. */
.card-icon { display: block; width: auto; height: 84px; margin-bottom: 16px; }
.card p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.section-intro {
  color: var(--muted);
  font-size: 16px;
  text-align: left;
  max-width: 620px;
  margin: 0 auto 36px;
}

/* Home sections: a hairline between every section, every other section on
   the raised band, and left aligned serif headings over a wider intro. The
   bands are counted, not classed, from the first section after the hero,
   so the hero stays on the page and the Duo section opens the bands. The
   count has to end on the page, with the closing badges on the page above
   the raised footer, so the page keeps an even number of sections; two
   topics share one section (.section-part) rather than leave the count
   odd. Sections land just
   under the top edge, so a nav jump puts the heading clear of the bar with
   as much of the section, and on the iPhone Duo link as much of the film,
   in view as the window allows; a part inside a section lands the same. */
.home section {
  padding: 80px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}
.home section:nth-of-type(odd) { background: var(--raised); }
.home .section-part { scroll-margin-top: 96px; }
.home .section-part + .section-part { margin-top: 72px; }
.home .section-part > :last-child { margin-bottom: 0; }
.home .section-title {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.8px;
  text-transform: none;
  text-align: left;
  margin-bottom: 18px;
  text-wrap: balance;
}
.home .section-intro {
  font-size: 17px;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 0 44px;
}
/* A section's second and third paragraphs follow the first at a paragraph's
   distance, and a bold lead-in label runs in before its text. */
.home .section-intro + .section-intro { margin-top: -26px; }
.section-intro .lead-in { color: var(--text); font-weight: 600; }
.home .section-intro a,
.home .lede a { font-weight: 400; }
#get .wrap { text-align: center; }
.home #get .section-title { text-align: center; }
.home #get .section-intro { margin: 0 auto 32px; }
/* The app icon left of the title, sized to the title as the hero's mark is
   to the tagline. */
.get-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 18px;
}
.home #get .get-head .section-title { margin-bottom: 0; }
.get-mark { width: 64px; height: 64px; flex: none; border-radius: 22%; }
/* Step Into the Alley's mark gets a fly (js/mark.js): one of the game's
   flies comes in from the upper left, lands on the brim of Arman's hat at
   the icon's top edge, and leaves to the upper right when he twitches. The
   fly's moves are measured in its own size. The icon is never hidden. */
.mark-live { position: relative; display: inline-block; flex: none; line-height: 0; }
.mark-live > .mark-fly {
  position: absolute;
  left: 0;
  top: 0;
  width: 38%;
  height: auto;
  max-width: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-260%, -190%) rotate(-14deg);
}
.mark-live > .mark-fly.is-in {
  opacity: 1;
  transform: translate(118%, -52%) rotate(6deg);
  transition: transform 900ms cubic-bezier(0.3, 0.1, 0.3, 1), opacity 200ms linear;
}
.mark-live > .mark-fly.is-still { width: 29%; transform: translate(170%, -18%) rotate(6deg); transition: none; }
.mark-live > .mark-fly.is-out {
  opacity: 0;
  transform: translate(430%, -280%) rotate(-22deg);
  transition: transform 650ms ease-in, opacity 300ms 350ms ease-in;
}
.mark-live.is-twitch > .get-mark { animation: mark-twitch 280ms ease-in-out; }
@keyframes mark-twitch {
  0% { transform: rotate(0); }
  30% { transform: rotate(-4deg); }
  65% { transform: rotate(3deg); }
  100% { transform: rotate(0); }
}

/* Demo video: a muted loop in a bordered panel. Capped at 600px so the
   1280-wide capture never upscales past crisp. */
.device-shot {
  margin: 40px auto 0;
  max-width: 600px;
}
/* Stacked figures and figures after a card grid get a full beat of air. */
.device-shot + .device-shot,
.features + .device-shot { margin-top: 56px; }
.device-shot > img,
.device-shot > video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.device-shot figcaption {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
/* Shots with the device bezel baked in bring their own chrome. */
.device-shot.framed > img,
.device-shot.framed > video {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Android: a Pixel 10 Pro and the Xiaomi 18 Fold open and closed, at true
   relative size (scripts/android-lineup.mjs), as on Borax's, Great Circle
   Map's and The Poker Calculator's sites, at the open Duo's width. The
   captions sit on a grid whose columns are the devices' widths and the gaps
   between them in millimetres, as the script stands them and prints them,
   so each caption centers under its device. */
.device-shot.android-lineup { max-width: 880px; margin-top: 8px; }
.android-lineup .lineup-names {
  display: grid;
  grid-template-columns: minmax(0, 72.1fr) minmax(0, 10fr) minmax(0, 164.5fr) minmax(0, 10fr) minmax(0, 83.6fr);
  text-wrap: balance;
}
.android-lineup .lineup-pixel { grid-column: 1; }
.android-lineup .lineup-open { grid-column: 3; }
.android-lineup .lineup-closed { grid-column: 5; }
/* On a phone the two narrow devices' captions also take the gap beside
   them and break into even lines. */
@media (max-width: 600px) {
  .android-lineup .lineup-names { font-size: 12px; line-height: 1.35; margin-top: 12px; }
  .android-lineup .lineup-pixel { grid-column: 1 / 3; }
  .android-lineup .lineup-closed { grid-column: 4 / 6; }
}

/* The open Duo: a still with the bezel drawn in on a clear background, for
   a transparent video of the same size to replace. Its height is capped to
   the window below the heading, so the iPhone Duo link shows the whole
   device on the open Duo's landscape display. */
.duo-film { margin: 8px auto 0; max-width: 880px; }
.duo-film img,
.duo-film video {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 280px);
  min-height: 260px;
  object-fit: contain;
}

/* The ranks: twelve rows in two columns under a hairline, each rank's
   portrait before its name and its count after. */
.ranks {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
}
.ranks li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.ranks img { display: block; width: 88px; height: 88px; }
.ranks .rank-name { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.ranks .rank-at { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }

/* The picture under the selling model's intro: the folded Duo in on a joke,
   on a clear background, as The Poker Calculator's Duo kicks the table. */
.gag-art { max-width: 880px; margin: 0 auto; }
.gag-art img { display: block; width: 100%; height: auto; }

/* Footer. */
footer {
  border-top: 1px solid var(--line);
  background: var(--raised);
  padding: 30px 0 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
footer p { margin: 6px 0; }

/* Responsive. iPads from 768pt up keep the two-column hero with a smaller
   headline. Below 760px (the open Duo upright, phones, and the Duo's outer
   display) the hero and the iPhone section stack with the copy first,
   still left aligned, and the device beneath it. */
@media (max-width: 960px) {
  .hero-grid { gap: 40px; }
  .hero-visual { width: 290px; }
  .tagline { font-size: 48px; letter-spacing: -1.2px; }
  .hero-head .brand-mark { width: 76px; height: 76px; }
  .iphone-visual video { width: 290px; }
}

@media (max-width: 760px) {
  .hero { padding: 44px 0 56px; }
  section { padding: 48px 0; }
  .home section { padding: 64px 0; scroll-margin-top: 28px; }
  .hero-head { gap: 18px; margin-bottom: 24px; }
  .hero-head .brand-mark { width: 76px; height: 76px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { width: 280px; justify-self: center; }
  /* Stacked, the store badges and the device line sit centered over the
     Duo below them. */
  .hero-store { margin-left: auto; margin-right: auto; }
  .hero-text { max-width: 620px; }
  .tagline { font-size: 44px; letter-spacing: -1.1px; }
  .section-intro { text-align: center; }
  .home .section-intro { text-align: left; }
  .home .section-title { font-size: 36px; }
  .get-mark { width: 58px; height: 58px; }
  .iphone-grid { grid-template-columns: 1fr; gap: 40px; }
  .iphone-visual video { width: 280px; }
}

/* The link row collapses into the hamburger menu well above phone width,
   because the longest translations (French, Russian) outgrow a single
   row at 800px, well before the hero does. */
@media (max-width: 800px) {
  .nav-toggler { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--raised);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
    padding: 6px 12px 10px;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 10px 8px; }
}

/* Short landscape windows (laptops, iPads, and the open Duo on its side):
   tighten the hero so the open Duo sits above the fold. */
@media (min-width: 761px) and (max-height: 800px) {
  .hero { padding: 40px 0 40px; }
  .hero-head { margin-bottom: 22px; }
  .hero-head .brand-mark { width: 72px; height: 72px; }
  .tagline { font-size: 46px; }
  .hero-visual { width: 280px; }
  .lede { font-size: 16px; }
}

/* Phones. Mid sizes above this (iPad mini portrait, split view) keep the
   two-column cards, which still fit there. */
@media (max-width: 640px) {
  .iphone-visual video { width: 264px; }
  .features { grid-template-columns: 1fr; }
  .ranks { grid-template-columns: 1fr; }
  /* The title can wrap here, so it starts from the column's left edge
     beside the mark, as the intro below it does. */
  .get-head { justify-content: flex-start; }
  .home #get .section-title { text-align: left; }
}

/* Narrow phones and the Duo's outer display. */
@media (max-width: 480px) {
  .home section { padding: 56px 0; }
  .hero-head { gap: 14px; }
  .hero-head .brand-mark { width: 60px; height: 60px; }
  .tagline { font-size: 36px; letter-spacing: -0.8px; }
  .lede, .home .section-intro { font-size: 16px; }
  .home .section-title { font-size: 31px; letter-spacing: -0.5px; }
  .get-head { gap: 12px; }
  .get-mark { width: 50px; height: 50px; }
  .home .section-intro { margin-bottom: 36px; }
  .home .section-intro + .section-intro { margin-top: -20px; }
  .card { padding: 22px 0 28px; }
}

@media (max-width: 360px) {
  .hero-head .brand-mark { width: 52px; height: 52px; }
  .tagline { font-size: 32px; }
  .home .section-title { font-size: 28px; }
  .get-mark { width: 46px; height: 46px; }
}
