/* Borax the Rad Rat site styles. Same skeleton as the other app sites
   (Great Circle Map's is the source, by way of Bin Blitz's), re-themed to
   the game's palette from game/css/game.css: the night yard's ink navy,
   cream text, the orange of the game's Play button as the accent, and the
   toxic lime kept for small highlights. */

:root {
  --bg: #0D0A2E;
  --raised: #14103E;
  --card: #1C1752;
  --line: #2B2562;
  --accent: #FF6A13;
  --accent-dim: #D9560B;
  --toxic: #B8FF3C;
  --text: #F4EAD2;
  --muted: #B9B2D6;
  --dim: #8580A8;
  /* 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: 50px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -1.5px;
  text-wrap: balance;
}
/* The tagline sets in two lines at every width, never three (the owner,
   2026-11-10): its second line is held together, and the sizes below are
   the largest at which that line fits its column. */
.tagline .keep { white-space: nowrap; }
.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; }
.store-badge { height: 50px; width: auto; transition: transform 0.2s ease; }
.store-badge:hover { transform: scale(1.05); }
/* The badge is a picture, not a link, until the game has a listing. */
.store-badge.is-pending:hover { transform: none; }
/* 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: five 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; }
/* The framed still or loop takes the carousel's place at its size, edge to
   edge on a clear background. */
.iphone-visual video, .iphone-visual img { 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 cure, as it rolls down a chute,
   or a piece of the game's own art over a how-it-plays card. A wide panel
   stands lower so it weighs what the others do, and a picture with its own
   ground takes the corners of a plate. */
.card-icon { display: block; width: auto; height: 84px; margin-bottom: 16px; }
.card-icon.is-wide { height: 60px; margin-top: 12px; margin-bottom: 28px; }
.card-icon.is-plate { border-radius: 12px; }
.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;
}
.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%; }

/* The brand mark's dose (js/mark.js): the painted mutation faces stack over
   the icon and snap on one at a time, then a cure drops into his mouth and
   he snaps back. Each frame is 384x336 around the 256 tile at 64,80, so his
   ears and whiskers break out past the icon's top and sides. The icon is never hidden. */
.mark-live { position: relative; display: inline-block; flex: none; line-height: 0; }
.mark-live > .mark-dose {
  position: absolute;
  left: -25%;
  top: -31.25%;
  width: 150%;
  height: 131.25%;
  max-width: none;
  opacity: 0;
  pointer-events: none;
}
.mark-live > .mark-dose.is-on { opacity: 1; }
.mark-live > .mark-cure {
  position: absolute;
  left: 50%;
  top: 0;
  height: 46%;
  width: auto;
  opacity: 0;
  transform: translate(-50%, -160%);
  pointer-events: none;
  z-index: 1;
}
.mark-live > .mark-cure.is-falling {
  opacity: 1;
  transform: translate(-50%, 100%) rotate(-8deg);
  transition: transform 420ms cubic-bezier(0.55, 0, 0.9, 0.45);
}
.mark-live.is-zapped { animation: mark-zap 180ms steps(3, end); }
.mark-live.is-cured { animation: mark-cured 320ms ease-out; }
@keyframes mark-zap {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-1.5px, 1px) rotate(-2deg); }
  66% { transform: translate(1.5px, -1px) rotate(2deg); }
  100% { transform: translate(0, 0); }
}
@keyframes mark-cured {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* 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 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. */
/* The film is square so the turning Duo's corners clear it, which leaves it
   empty above and below the Duo. The figure is pulled up until the upright
   Duo's top stands 6 points under the intro (the film's clear 6.25 percent
   and the intro's 44 point margin taken back), and the section's end is
   pulled up by the same, with the section's 80 point padding taken back, so
   the Duo stands as far from the section's end as from the intro in every
   pose (the owner, 2026-11-12, "higher, and equalize the margin below").
   --film is the film's side as laid out below. */
section .wrap > .duo-film {
  --film: min(880px, 100vw - 32px, max(260px, 100vh - 280px));
  margin: calc(-38px - var(--film) * 0.0625) auto calc(-74px - var(--film) * 0.0625);
  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;
}

/* Borax's six looks in one row, feet on one line, three to a row on a
   narrow screen. */
.stages {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 40px;
}
.stages img { display: block; width: 100%; height: auto; }

/* The dose: twelve rows in two columns under a hairline, the step, its
   name in the game, and the meter's reading there. */
.dose-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
}
.dose-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.dose-steps .step-n { color: var(--toxic); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.dose-steps .step-name { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.dose-steps .step-reading { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }

/* The yard's four states, each painting over its name. */
.yard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 32px;
}
.yard-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.yard-grid figcaption { margin-top: 12px; font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }

/* 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: clamp(34px, calc((100vw - 464px) / 7.95), 48px); letter-spacing: -1.2px; }
  .hero-head .brand-mark { width: 76px; height: 76px; }
  .iphone-visual video, .iphone-visual img { 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; }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .iphone-visual video, .iphone-visual img { 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: min(46px, calc((100vw - 450px) / 7.95)); }
  .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, .iphone-visual img { width: 264px; }
  .features { grid-template-columns: 1fr; }
  .dose-steps { grid-template-columns: 1fr; }
  .yard-grid { grid-template-columns: 1fr; gap: 28px; }
  /* 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: min(36px, calc((100vw - 114px) / 7.95)); 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; }
  .card { padding: 22px 0 28px; }
}

@media (max-width: 360px) {
  .hero-head .brand-mark { width: 52px; height: 52px; }
  .tagline { font-size: min(32px, calc((100vw - 106px) / 7.95)); }
  .home .section-title { font-size: 28px; }
  .get-mark { width: 46px; height: 46px; }
}
