/* Landing page. Design: Pencil file catan.pen → 20 · Landing — Desktop 1440. Same tokens and fonts
   as the app (src/ui/styles/global.css). No sideways scrolling from 320 px up, in every language. */

@font-face {
  font-family: 'Alegreya SC';
  font-weight: 800;
  font-display: swap;
  src: url('fonts/alegreya-sc-latin-800-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212;
}
@font-face {
  font-family: 'Alegreya SC';
  font-weight: 800;
  font-display: swap;
  src: url('fonts/alegreya-sc-cyrillic-800-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Sans';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/pt-sans-latin-400-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212;
}
@font-face {
  font-family: 'PT Sans';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/pt-sans-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Sans';
  font-weight: 700;
  font-display: swap;
  src: url('fonts/pt-sans-latin-700-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212;
}
@font-face {
  font-family: 'PT Sans';
  font-weight: 700;
  font-display: swap;
  src: url('fonts/pt-sans-cyrillic-700-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Spectral';
  font-weight: 800;
  font-display: swap;
  src: url('fonts/spectral-latin-800-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Mono';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/pt-mono-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'PT Mono';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/pt-mono-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0400-045F;
}

:root {
  --sea-deep: #0d3f5e;
  --sea: #1d6b99;
  --parchment: #f3e6c8;
  --light: #fbf5e7;
  --surface: #fcf6e8;
  --sunk: #e9dcb9;
  --border: #dcc89c;
  --ink: #2f2415;
  --ink-soft: #6b5a3e;
  --ink-faint: #9a8763;
  --on-sea: #f6ecd6;
  --on-sea-soft: #a9cbe0;
  --accent: #b8432b;
  --accent-dark: #8a2e1c;
  --accent-tint: #f3dccd;
  --blue: #1b6fae;
  --blue-tint: #d6e7f4;
  --gold: #e8bb3f;
  --gold-text: #f0c24f;
  --wood: #2f2415;
  --sea-bg: radial-gradient(110% 80% at 50% 0%, #2a7db5 0%, #1a5f8c 45%, #0d3f5e 100%);
  --display: 'Alegreya SC', Georgia, serif;
  --body: 'PT Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --num: 'Spectral', Georgia, serif;
  --mono: 'PT Mono', ui-monospace, Menlo, monospace;
  --wrap: 1200px;
  --radius: 18px;

  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--light);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: break-word;
}

h2 {
  font-size: clamp(30px, 4vw, 46px);
}

h3 {
  font-size: 21px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

.wrap {
  width: min(100% - 40px, var(--wrap));
  margin: 0 auto;
}

.center {
  text-align: center;
}

.center .section-lead {
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.gold {
  color: var(--gold-text);
}

.section {
  padding: clamp(64px, 9vw, 112px) 0;
}

.tinted {
  background: var(--parchment);
}

.section-lead {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 19px;
}

:focus-visible {
  outline: 3px solid var(--gold-text);
  outline-offset: 3px;
}

/* ---- Buttons --------------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff7e8;
  /* Sans, like every control: the serif is for headings only (#43). */
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    inset 0 -3px 0 rgb(0 0 0 / 22%),
    inset 0 1px 0 rgb(255 255 255 / 22%),
    0 6px 14px rgb(59 15 6 / 25%);
  transition:
    transform 120ms ease-out,
    box-shadow 120ms ease-out,
    background-color 120ms ease-out;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 -3px 0 rgb(0 0 0 / 22%),
    inset 0 1px 0 rgb(255 255 255 / 22%),
    0 10px 20px rgb(59 15 6 / 30%);
}

.button:active {
  background: var(--accent-dark);
  transform: translateY(2px);
}

.button.small {
  min-height: 46px;
  padding: 0 18px;
  font-size: 16px;
}

.button.ghost {
  background: rgb(246 236 214 / 10%);
  color: var(--on-sea);
  box-shadow: inset 0 0 0 1px rgb(246 236 214 / 30%);
}

.button.ghost:hover {
  background: rgb(246 236 214 / 18%);
}

/* ---- Nav ------------------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(13 63 94 / 92%);
  backdrop-filter: blur(10px);
  color: var(--on-sea);
  box-shadow: 0 1px 0 rgb(246 236 214 / 10%);
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand strong {
  font-family: var(--display);
  font-size: 22px;
}

.brand small {
  color: var(--on-sea-soft);
  font-size: 13px;
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.nav-links a {
  color: var(--on-sea);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  opacity: 0.85;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.lang {
  position: relative;
  margin-left: 12px;
}

.lang summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgb(246 236 214 / 10%);
  box-shadow: inset 0 0 0 1px rgb(246 236 214 / 25%);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.lang summary::-webkit-details-marker {
  display: none;
}

.lang[open] .chevron {
  transform: rotate(180deg);
}

.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 30px rgb(0 0 0 / 25%);
  list-style: none;
}

.lang a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.lang a:hover {
  background: var(--parchment);
}

.lang a[aria-current='page'] {
  background: var(--accent-tint);
  color: var(--accent);
}

.lang .short,
.chips .full {
  display: none;
}

.nav .button.small {
  margin-left: 0;
}

/* ---- Sea sections --------------------------------------------------------------------------- */

.sea {
  position: relative;
  overflow: hidden;
  color: var(--on-sea);
  background: var(--sea-bg);
}

.sea .lead {
  color: rgb(246 236 214 / 85%);
  font-size: 20px;
}

/* ---- Hero ------------------------------------------------------------------------------------ */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding: 64px 0 0;
}

.hero-text {
  padding-bottom: 64px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.badges li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgb(246 236 214 / 10%);
  box-shadow: inset 0 0 0 1px rgb(246 236 214 / 22%);
  font-weight: 700;
  font-size: 14.5px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.08;
}

.hero .lead {
  max-width: 600px;
  margin: 22px 0 32px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--on-sea-soft);
  font-size: 15.5px;
}

.checks li::before {
  content: '✓';
  margin-right: 8px;
  color: #8fd18b;
  font-weight: 700;
}

.hero-art {
  position: relative;
  align-self: end;
  justify-self: center;
  width: min(100%, 420px);
}

.hero-art .phone {
  position: relative;
  z-index: 2;
  margin: 0 auto -120px;
  width: min(100%, 400px);
}

.float {
  position: absolute;
  z-index: 1;
  display: block;
  filter: drop-shadow(0 10px 14px rgb(0 0 0 / 30%));
}

.float.hex {
  width: 88px;
}

.float.token {
  z-index: 3;
  width: 58px;
}

.float svg {
  display: block;
  width: 100%;
  height: auto;
}

.f1 {
  left: -34%;
  top: 10%;
  rotate: -8deg;
}
.f2 {
  right: -14%;
  top: 6%;
  rotate: 10deg;
}
.f3 {
  left: -22%;
  top: 46%;
  rotate: 6deg;
}
.f4 {
  right: -24%;
  top: 44%;
  rotate: -6deg;
}
.f5 {
  left: -14%;
  top: 76%;
  rotate: -12deg;
}
.t1 {
  left: -10%;
  top: 34%;
}
.t2 {
  right: -12%;
  top: 30%;
}
.t3 {
  left: -6%;
  top: 64%;
}
.t4 {
  right: -10%;
  top: 70%;
}

/* ---- Phones ---------------------------------------------------------------------------------- */

/* One phone, drawn to scale (#26): a current phone's body, about 1 : 2.07, around the whole
   780 × 1688 screenshot. The phone is a size container and every length is a share of its width
   (cqi), so a small phone is the big one scaled down:
   - the screen is 92.4 % wide with 12.8 % corners, inside a 3.8 % bezel: black glass, then rim;
   - the body's corners are 16.6 %, the screen's plus the bezel, so the two stay concentric;
   - the buttons stand out of the rim: action button and volume rocker left, side button right. */
.phone {
  container-type: inline-size;
  position: relative;
  margin: 0;
  /* 16.6 % of the width on both axes: the body is 2.0756 times as tall as it is wide. */
  border-radius: 16.6% / 8%;
  background: linear-gradient(150deg, #7a6a58, #3a3027 30%, #231d17 55%, #4b3f33 85%, #6e5f4f);
  box-shadow:
    inset 0 0 0 1px rgb(255 240 215 / 18%),
    var(--phone-shadow, 0 30px 60px rgb(0 0 0 / 35%));
}

.phone img {
  display: block;
  width: 92.4cqi;
  height: auto;
  margin: 3.8cqi;
  border-radius: 12.8cqi;
  /* The black glass between the screen and the rim. */
  box-shadow: 0 0 0 2.6cqi #0d0b09;
}

.phone::before,
.phone::after {
  content: '';
  position: absolute;
  width: 0.9cqi;
  background: #4b3f33;
}

/* The action button and the volume rocker, as gaps in one strip. */
.phone::before {
  right: 100%;
  top: 21cqi;
  height: 47cqi;
  border-radius: 0.5cqi 0 0 0.5cqi;
  background: linear-gradient(
    #4b3f33 0 6.5cqi,
    transparent 0 12.5cqi,
    #4b3f33 0 26cqi,
    transparent 0 30cqi,
    #4b3f33 0
  );
}

.phone::after {
  left: 100%;
  top: 34cqi;
  height: 21cqi;
  border-radius: 0 0.5cqi 0.5cqi 0;
}

/* ---- What you need ---------------------------------------------------------------------------- */

.need {
  background: var(--accent-tint);
  border-bottom: 1px solid #e6c6b4;
}

.need-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 36px 0;
}

.hex-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 60px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 24px;
}

.hex-badge.accent {
  width: 66px;
  height: 74px;
  background: var(--accent);
  color: #fff7e8;
  font-size: 28px;
}

.need-text {
  flex: 1;
  min-width: 260px;
}

.need-text h2 {
  font-size: 26px;
}

.need-text p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.need-cards {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.need-cards li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px #e6c6b4;
}

.need-cards strong {
  font-size: 16.5px;
}

.need-cards small {
  color: var(--ink-soft);
  font-size: 14px;
}

.tag {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tag.required {
  background: var(--accent);
  color: #fff7e8;
}

.tag.optional {
  background: var(--sunk);
  color: var(--ink-soft);
}

/* Who made the game and where to buy it (#41), under what you need. */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 40px;
  padding: 26px 0 34px;
  border-top: 1px solid #e6c6b4;
  list-style: none;
}

.facts > li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.fact-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 46px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--surface);
  color: var(--accent);
  font-size: 19px;
}

.facts p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

.facts .fact-label {
  margin-bottom: 2px;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.facts .fact-name,
.shops {
  margin: 0 0 4px;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
}

.facts a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgb(184 67 43 / 45%);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.facts a:hover {
  text-decoration-color: currentColor;
}

/* One shop a line; its note follows the name, or goes under it as a whole when there's no room. */
.shops {
  display: grid;
  gap: 4px;
  padding: 0;
  list-style: none;
}

.shops li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
}

.shops a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.shops .icon {
  width: 0.9em;
  height: 0.9em;
  color: var(--accent);
}

.shops small {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 13.5px;
}

/* ---- Stats ------------------------------------------------------------------------------------- */

.stats {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 auto;
  padding: 40px 0;
  list-style: none;
}

.stats-row li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 12px;
  padding: 0 28px;
  border-left: 1px solid var(--border);
}

.stats-row li:first-child {
  border-left: 0;
  padding-left: 0;
}

.stats-row b {
  grid-row: span 2;
  color: var(--accent);
  font-family: var(--num);
  font-weight: 800;
  font-size: 62px;
  line-height: 1;
}

.stats-row strong {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stats-row span {
  grid-column: 1 / -1;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---- Cards ------------------------------------------------------------------------------------- */

.cards {
  display: grid;
  gap: 24px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.cards.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: 28px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.card h3 {
  margin: 24px 0 12px;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
}

/* ---- Gallery ---------------------------------------------------------------------------------- */

/* Whole phones about 300 px wide, so each row of three fits on a laptop screen. */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px clamp(24px, 4vw, 56px);
  max-width: 1040px;
  margin: 48px auto 0;
  padding: 0;
  list-style: none;
  text-align: start;
}

.gallery h3 {
  margin: 22px 0 8px;
}

.gallery p {
  margin: 0;
  color: var(--ink-soft);
}

/* ---- How it works -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hex-num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 62px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--accent);
  color: #fff7e8;
  font-family: var(--num);
  font-weight: 800;
  font-size: 24px;
}

.hex-num.small {
  width: 34px;
  height: 38px;
  font-size: 16px;
}

.steps p {
  min-height: 3em;
  color: var(--ink-soft);
}

.demo {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 24px 18px;
  border-radius: 22px;
  background: var(--sunk);
}

.mini-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.mini-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: rgb(252 246 232 / 60%);
  box-shadow: inset 0 0 0 1px var(--border);
  text-align: start;
}

.mini-tile.selected {
  background: var(--surface);
  box-shadow:
    inset 0 0 0 2px var(--accent),
    0 6px 14px rgb(47 36 21 / 12%);
}

.mini-tile strong {
  margin-top: 12px;
  font-size: 17px;
}

.mini-tile small {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
}

.mini-hex {
  display: grid;
  place-items: center;
  width: 32px;
  height: 36px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--accent-tint);
  color: var(--accent);
}

.mini-hex.seafarers {
  background: var(--blue-tint);
  color: var(--blue);
}

.mini-check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--border);
  color: #fff7e8;
  font-size: 13px;
}

.mini-tile.selected .mini-check {
  background: var(--accent);
  box-shadow: none;
}

.mini-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff7e8;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  box-shadow:
    inset 0 -3px 0 rgb(0 0 0 / 22%),
    0 5px 12px rgb(59 15 6 / 22%);
}

.mini-button.secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px var(--border),
    inset 0 -3px 0 rgb(47 36 21 / 9%);
}

.mini-button.wide {
  width: 100%;
  font-size: 17px;
}

.mini-code {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 6px 8px 6px 18px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.mini-code span {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 22px;
}

.mini-code code {
  flex: 1;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-code .icon {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
}

/* ---- The deal ----------------------------------------------------------------------------------- */

.frames {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}

.frames p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 15px;
}

.frames time {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--wood);
  color: var(--gold-text);
  font-family: var(--mono);
  font-size: 12.5px;
}

.frames img {
  width: 100%;
  aspect-ratio: 1 / 1.25;
  object-fit: cover;
  border-radius: 20px;
  background: var(--sea-deep);
}

/* ---- The math ----------------------------------------------------------------------------------- */

.math {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 56px;
}

.ticks {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
}

.ticks li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ticks li::before {
  content: '✓';
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff7e8;
  font-size: 13px;
}

.chart {
  margin: 0;
  padding: 28px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--border),
    0 14px 30px rgb(47 36 21 / 8%);
}

.chart figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.chart figcaption strong {
  font-family: var(--display);
  font-size: 19px;
}

.chart figcaption small {
  color: var(--ink-faint);
}

.bars {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  height: 260px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bars li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
}

.bars .ways {
  color: var(--ink-soft);
  font-family: var(--num);
  font-weight: 800;
  font-size: 14px;
}

.bars .red .ways {
  color: var(--accent);
}

.bars .bar {
  width: 100%;
  height: calc(var(--h) * 30px);
  border-radius: 8px 8px 3px 3px;
  background: #d8c38e;
}

.bars .red .bar {
  background: #c23a2c;
}

.bars .seven .bar {
  background: var(--wood);
}

.bars .roll {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 34px;
  aspect-ratio: 1;
}

.bars .roll svg {
  width: 100%;
  height: auto;
}

.bars .dark {
  display: grid;
  place-items: center;
  width: 82%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--wood);
  color: #fff7e8;
  font-family: var(--num);
  font-weight: 800;
  font-size: 15px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 14px;
}

.chart-legend li::before {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  border-radius: 3px;
  background: #d8c38e;
}

.chart-legend .red::before {
  background: #c23a2c;
}

.chart-legend .seven::before {
  background: var(--wood);
}

/* ---- Seafarers ---------------------------------------------------------------------------------- */

/* The section, not the game: `.mini-hex.seafarers` is Seafarers' icon in "How it works", and this
   padding made it a tall sliver (#34). */
section.seafarers {
  padding: clamp(64px, 9vw, 110px) 0;
}

.sea-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 48px;
}

.sea-text .lead {
  margin: 18px 0 0;
}

.sea-ticks {
  font-weight: 400;
}

.sea-ticks li::before {
  background: var(--blue);
}

.requires {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgb(246 236 214 / 10%);
  box-shadow: inset 0 0 0 1px rgb(246 236 214 / 25%);
  font-weight: 700;
}

.sea-phones {
  position: relative;
  min-height: 640px;
}

.sea-phones .phone {
  position: absolute;
  width: 46%;
}

.sea-phones .front {
  left: 27%;
  top: 0;
  z-index: 2;
}

.sea-phones .back {
  top: 12%;
  opacity: 0.95;
}

.sea-phones .left {
  left: 0;
}

.sea-phones .right {
  right: 0;
}

/* ---- Scenarios ------------------------------------------------------------------------------- */

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  text-align: start;
}

.scenario {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.scenario-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scenario .hex-num {
  background: var(--blue);
}

.scenario.base .hex-num {
  background: var(--accent);
}

.scenario .tag {
  background: var(--blue-tint);
  color: var(--blue);
}

.scenario.base .tag {
  background: var(--accent-tint);
  color: var(--accent);
}

.scenario h3 {
  font-size: 20px;
}

.scenario p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.scenario .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 14px;
}

.scenario .meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* The last card is the sea, as in design 20. It is also a `.scenario`, whose surface comes later
   in this file than `.sea` and would win, leaving the card's cream text on cream (#33). */
.cta-card {
  justify-content: space-between;
  min-height: 200px;
  background: var(--sea-bg);
  box-shadow: none;
}

.cta-card strong {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.15;
}

.cta-card a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-text);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}

.cta-card a:hover {
  text-decoration: underline;
}

/* ---- Languages ------------------------------------------------------------------------------- */

.lang-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  text-align: start;
}

.lang-cards li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.lang-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lang-head strong {
  font-family: var(--display);
  font-size: 21px;
}

.code-badge {
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--wood);
  color: #fff7e8;
  font-weight: 700;
  font-size: 12.5px;
}

.lang-cards small {
  color: var(--ink-faint);
  font-size: 14px;
}

.lang-cards .mini-button {
  margin: 14px 0 12px;
}

.lang-cards code {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ---- Install ---------------------------------------------------------------------------------- */

.install {
  padding: clamp(64px, 9vw, 100px) 0 0;
}

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: end;
  gap: 48px;
}

.install-grid > div {
  padding-bottom: 80px;
}

.install .lead {
  margin: 18px 0 28px;
}

.platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.platforms div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: 16px;
  background: rgb(246 236 214 / 8%);
  box-shadow: inset 0 0 0 1px rgb(246 236 214 / 22%);
}

.platforms strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.platforms strong .icon {
  color: var(--gold-text);
}

.platforms span {
  color: rgb(246 236 214 / 80%);
  font-size: 15.5px;
}

.install-phone {
  justify-self: center;
  width: min(100%, 400px);
  margin-bottom: -260px;
}

.install {
  margin-bottom: 0;
}

/* ---- FAQ -------------------------------------------------------------------------------------- */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 56px;
  align-items: start;
}

/* A real border, not an inset shadow: an open item's background would paint over the shadow
   (#27). */
.accordion {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  overflow: hidden;
}

.accordion details + details {
  border-top: 1px solid var(--border);
}

.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 16px 24px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  list-style: none;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  content: '+';
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sunk);
  color: var(--ink-soft);
  font-size: 20px;
  font-weight: 400;
}

.accordion details[open] {
  background: #f9ebdd;
}

.accordion details[open] summary::after {
  content: '−';
  background: var(--accent);
  color: #fff7e8;
}

/* Padding, not a bottom margin: the margin collapsed out of <details>, so the open item's tint
   stopped short of the next divider (#27). */
.accordion p {
  margin: -6px 0 0;
  padding: 0 24px 22px;
  color: var(--ink-soft);
}

/* ---- Run your own copy ------------------------------------------------------------------------- */

.host-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.host-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 28px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--border),
    0 14px 30px rgb(47 36 21 / 8%);
}

.host-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.host-head h3 {
  font-size: 24px;
}

.host-card p {
  margin: 0;
  color: var(--ink-soft);
}

.host-card .host-note {
  font-size: 15px;
}

.terminal {
  overflow: hidden;
  border-radius: 14px;
  background: var(--wood);
  color: var(--on-sea);
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 8px 0 16px;
  background: rgb(246 236 214 / 7%);
}

/* A terminal window's three lights, in brick, wheat and pasture. */
.dots {
  width: 44px;
  height: 10px;
  background:
    radial-gradient(circle at 5px 50%, #c8553d 4.5px, transparent 5px),
    radial-gradient(circle at 22px 50%, #e5b93d 4.5px, transparent 5px),
    radial-gradient(circle at 39px 50%, #8dbe4d 4.5px, transparent 5px);
  opacity: 0.9;
}

.copy {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: rgb(246 236 214 / 12%);
  color: var(--on-sea);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.copy:hover {
  background: rgb(246 236 214 / 20%);
}

.copy[hidden] {
  display: none;
}

/* Long lines wrap rather than scroll: what gets copied is the text, not the wrapping. */
.terminal pre {
  margin: 0;
  padding: 16px 20px 20px;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.host-more {
  margin: 28px 0 0;
}

.host-more a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.host-more a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---- Footer ----------------------------------------------------------------------------------- */

.footer {
  padding: 64px 0 40px;
  background: var(--wood);
  color: rgb(246 236 214 / 80%);
}

/* The last column is as wide as its five language chips, which never wrap (#39). */
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgb(246 236 214 / 14%);
}

.footer .brand strong {
  color: var(--on-sea);
}

.footer-brand p {
  max-width: 340px;
  margin: 18px 0 0;
  font-size: 15.5px;
}

.footer h2 {
  margin-bottom: 14px;
  color: var(--gold-text);
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer a {
  color: var(--on-sea);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer .chips {
  display: flex;
  gap: 8px;
}

.footer .chips a {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 9px;
  background: rgb(246 236 214 / 8%);
  box-shadow: inset 0 0 0 1px rgb(246 236 214 / 18%);
  font-weight: 700;
  font-size: 13.5px;
}

.footer .chips a[aria-current='page'] {
  background: var(--on-sea);
  color: var(--wood);
}

.legal {
  padding-top: 28px;
  font-size: 13.5px;
}

.legal p {
  margin: 0 0 10px;
}

.legal strong {
  color: var(--on-sea);
}

.legal .faint {
  color: rgb(246 236 214 / 50%);
}

/* ---- Narrower screens ------------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .nav-links {
    display: none;
  }
  .lang {
    margin-left: auto;
  }
  .need-row {
    flex-wrap: wrap;
  }
  .need-cards {
    width: 100%;
  }
  .need-cards li {
    flex: 1;
    min-width: 0;
  }
  .scenario-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lang-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .math,
  .sea-grid,
  .install-grid,
  .faq {
    grid-template-columns: 1fr;
  }
  .hero-text {
    padding-bottom: 24px;
  }
  .hero-art {
    width: min(78%, 360px);
  }
  .hero-art .phone {
    margin-bottom: -160px;
  }
  .hero {
    padding-bottom: 0;
  }
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 28px;
  }
  .stats-row li:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }
  .cards.three,
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .frames {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sea-phones {
    min-height: 0;
    aspect-ratio: 1 / 1.1;
  }
  .install-phone {
    width: min(78%, 360px);
    margin-bottom: -220px;
  }
  .install-grid > div {
    padding-bottom: 0;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .host-grid {
    grid-template-columns: 1fr;
  }
  .facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    font-size: 16px;
  }
  .nav .button.small {
    display: none;
  }
  .brand small {
    display: none;
  }
  .need-cards {
    flex-direction: column;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .stats-row li {
    border-left: 0;
    padding: 0;
  }
  .cards.three,
  .steps,
  .scenario-grid,
  .platforms {
    grid-template-columns: 1fr;
  }
  .lang-cards {
    grid-template-columns: 1fr 1fr;
  }
  /* Whole phones one under another would be six screens long: swipe through them instead, the
     next one peeking in. The row runs to the screen's edges, with room for the shadows. */
  .gallery {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(70%, 280px);
    gap: 24px;
    max-width: none;
    margin: 40px -20px 0;
    padding: 4px 20px 32px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    scrollbar-width: none;
  }
  .gallery > li {
    scroll-snap-align: start;
  }
  /* Alone on its row, the card needs no height to match its neighbours. */
  .cta-card {
    min-height: 0;
    gap: 28px;
  }
  .float.hex {
    width: 64px;
  }
  .float.token {
    width: 44px;
  }
  .bars {
    gap: 4px;
    height: 220px;
  }
  .bars .bar {
    height: calc(var(--h) * 24px);
  }
  .chart {
    padding: 18px;
  }
  .host-card {
    padding: 22px 18px;
  }
  .terminal pre {
    padding: 14px 16px 18px;
    font-size: 13.5px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .lang-cards {
    grid-template-columns: 1fr;
  }
  .frames {
    grid-template-columns: 1fr;
  }
  .actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
  .button,
  .button:hover,
  .button:active {
    transform: none;
    transition: none;
  }
}
