/* The homepage's own styles, shared by its translations (web/<lang>/index.html).
   Everything article-shaped lives in site.css; the header and footer in nav.css. */
/* Palette = the app's default "wood" skin (src/theme.js). The page runs
   dark-to-light: an espresso hero and closing band (the app icon's ground,
   scripts/gen-icons.mjs) around the cream the app itself is drawn on. */
:root {
  --screen: #f4ebd9;
  --panel: #ece0c6;
  --chip: #e3d3b0;
  --cell: #c99a5c;
  --ink: #4a3419;
  --sub: #725733;
  --accent: #9f5819;
  --copper: #d07a2b;
  --on-accent: #f4ebd9;
  --gold: #ecc37c;
  --night: #241505;
  --night-2: #3a2410;
  --dark-piece: #43290f;
  --dark-edge: #241505;
  --light-piece: #f0d8ac;
  --light-edge: #7d6440;
  --edge-line: #d9c9ae;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--screen);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
h1, h2, h3, p { margin: 0; }
/* Titles and headings are set in Outfit Black (@font-face in nav.css). */
h1, h2, h3 { font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 900; }
img { max-width: 100%; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--screen);
  background:
    radial-gradient(60rem 34rem at 78% 30%, rgba(208, 122, 43, .30), transparent 60%),
    radial-gradient(40rem 30rem at 0% 100%, rgba(201, 150, 47, .14), transparent 65%),
    linear-gradient(160deg, var(--night-2), var(--night) 62%);
}
/* The board's own grid, faint, behind everything. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 235, 217, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 235, 217, .045) 1px, transparent 1px);
  background-size: 4.5rem 4.5rem;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 40%, #000 10%, transparent 70%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 2rem;
  padding-top: 4.5rem;
  padding-bottom: 5rem;
}
.hero h1 {
  font-size: clamp(2.8rem, 7.6vw, 4.9rem);
  letter-spacing: -.02em;
  line-height: .96;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--copper); }
.tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: rgba(244, 235, 217, .78);
  margin: 1.3rem 0 2rem;
  max-width: 30rem;
}
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.1rem; }
.play-cta {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 1.6rem;
  border-radius: 1rem;
  text-decoration: none;
  font-weight: 750;
  font-size: 1.0625rem;
  background: #e8721c;
  color: #fffaf0;
  border: 2px solid #fffaf0;
  transition: transform .15s ease, background-color .15s ease;
}
.play-cta:hover { transform: translateY(-2px); background: #f58430; }
.play-cta svg { width: 1.1em; height: 1.1em; }
.cta-note { font-size: .875rem; color: rgba(244, 235, 217, .62); }

/* Store badges — official Apple/Google artwork (web/app-store-badge.svg,
   web/google-play-badge.png), used as-is per each platform's brand
   guidelines: no recoloring, no added background, no altered proportions.
   Clear space around each badge (guidelines require at least 1/4 of the
   badge's height) comes from the flex gap. */
.badges { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-top: 1.75rem; }
.badge-link { display: inline-block; line-height: 0; transition: opacity .15s ease; }
.badge-link:hover { opacity: .82; }
.badge-link img { display: block; height: 48px; width: auto; }

/* The hero board: the app's own board and pieces (src/components/Board.js,
   Piece.js) drawn in CSS, tipped back so it reads as an object on a table.
   */
.heroboard-stage { perspective: 70rem; display: grid; place-items: center; padding: 1rem 0 2.5rem; }
.heroboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* Explicit rows: left to auto, a row holding only a small piece comes out
     shorter than its neighbours. */
  grid-template-rows: repeat(4, 1fr);
  gap: 2.2%;
  padding: 2.6%;
  width: min(100%, 27rem);
  aspect-ratio: 1;
  background: #7a4f27;
  border-radius: 7%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(22deg) rotateZ(-9deg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset;
}
/* The slab: copies of the board's outline pushed back along its own Z, so
   the edge is the same thickness all the way round. (A box-shadow offset
   lives in the board's rotated plane and comes out as a wedge.) */
.heroboard::before, .heroboard::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #4d3016;
  transform: translateZ(-16px);
}
.heroboard::after {
  background: #3a230f;
  transform: translateZ(-32px);
  box-shadow: 0 40px 70px rgba(8, 4, 0, .65), 0 0 120px rgba(208, 122, 43, .22);
}
.heroboard .cellbox {
  min-height: 0;
  background: var(--cell);
  border-radius: 16%;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 rgba(36, 21, 5, .25) inset;
}
.heroboard .cellbox.next { background: transparent; box-shadow: none; outline: 2px dashed rgba(236, 195, 124, .75); outline-offset: -3px; }
.heroboard .pc { width: 76%; height: auto; aspect-ratio: 1; border-width: 2px; box-shadow: 0 5px 0 rgba(36, 21, 5, .28), 0 10px 14px rgba(36, 21, 5, .3); }
.heroboard .pc.s { width: 46%; height: auto; }
.heroboard .pc.o::after { background: var(--cell); }
@media (prefers-reduced-motion: no-preference) {
  .heroboard { animation: hover 8s ease-in-out infinite; }
  @keyframes hover { 50% { transform: rotateX(19deg) rotateZ(-7deg) translateY(-10px); } }
}

/* ---------------- Traits strip ---------------- */
.traits { background: var(--panel); border-bottom: 1px solid var(--edge-line); }
.traits .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding-top: 1.4rem; padding-bottom: 1.4rem; }
.trait { display: flex; align-items: center; gap: .8rem; font-size: .9375rem; color: var(--sub); }
.trait b { display: block; color: var(--ink); font-weight: 750; }
.pair { display: flex; align-items: center; gap: .3rem; flex: none; }
/* Pieces as the app draws them (src/components/Piece.js), after the two in
   the app icon: a thick ring, a soft-cornered square, lit from above. */
.pc {
  display: block;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background-color: var(--light-piece);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 64%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, .1));
  border: 1.5px solid var(--light-edge);
  position: relative;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .2);
}
.pc.s { width: 1.05rem; height: 1.05rem; }
.pc.d { background-color: var(--dark-piece); background-image: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 64%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, .22)); border-color: var(--dark-edge); }
.pc.q { border-radius: 24%; }
.pc.o::after { content: ''; position: absolute; inset: 27%; border-radius: inherit; background: var(--panel); border: 1px solid; border-color: inherit; }

/* ---------------- Sections ---------------- */
section { padding: 4.5rem 0; }
section + section { border-top: 1px solid var(--edge-line); }
.kicker {
  display: block;
  text-align: center;
  font-size: .8125rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}
h2 {
  font-size: clamp(1.9rem, 4.6vw, 2.7rem);
  letter-spacing: -.015em;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
}
.lede { text-align: center; color: var(--sub); font-size: 1.0625rem; max-width: 36rem; margin: .9rem auto 2.75rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; counter-reset: step; }
.step {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--edge-line);
  border-radius: 1.25rem;
  padding: 1.6rem 1.4rem 1.5rem;
  overflow: hidden;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  right: .6rem;
  top: -1.6rem;
  font-family: 'Outfit', sans-serif;
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
  color: var(--chip);
}
.step > * { position: relative; }
.step .glyph { display: flex; align-items: center; gap: .4rem; height: 2.4rem; margin-bottom: 1rem; color: var(--accent); }
.step .glyph svg { width: 1.5rem; height: 1.5rem; }
.step .glyph .slot { width: 2.1rem; height: 2.1rem; border-radius: 22%; background: var(--cell); display: grid; place-items: center; }
.step .glyph .slot .pc.o::after { background: var(--cell); }
.step .glyph .pc.o::after { background: var(--panel); }
.step h3 { font-size: 1.25rem; margin-bottom: .35rem; }
.step p { font-size: .9375rem; color: var(--sub); }

/* ---------------- How to win ----------------
   Three small boards drawn the same way as the hero board, each with one
   winning shape lit. Winning cells take the app's cellHi + accent ring
   (src/components/Board.js). */
.wins { background: linear-gradient(180deg, var(--screen), var(--panel)); }
.win-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; max-width: 56rem; margin: 0 auto; }
.win { margin: 0; text-align: center; }
.miniboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2.4%;
  padding: 2.8%;
  aspect-ratio: 1;
  background: #7a4f27;
  border-radius: 8%;
  box-shadow: 0 10px 0 #4d3016, 0 26px 40px rgba(36, 21, 5, .22);
}
.miniboard > div { min-height: 0; background: var(--cell); border-radius: 16%; display: grid; place-items: center; }
.miniboard > div.hit { background: #ecc37c; box-shadow: inset 0 0 0 3px var(--accent); }
.miniboard .pc { width: 74%; height: auto; aspect-ratio: 1; }
.miniboard .pc.s { width: 44%; height: auto; }
.miniboard .pc.o::after { background: var(--cell); }
.miniboard .hit .pc.o::after { background: #ecc37c; }
.win figcaption { margin-top: 1.9rem; font-size: .9375rem; color: var(--sub); }
.win figcaption b { display: block; font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 1.2rem; color: var(--ink); margin-bottom: .15rem; }
.more { text-align: center; margin-top: 2.5rem; }
.more a { color: var(--accent); font-weight: 700; text-underline-offset: 3px; }

/* ---------------- Features ---------------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.feature {
  background: var(--screen);
  border: 1px solid var(--edge-line);
  border-radius: 1.25rem;
  padding: 1.4rem;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.feature:hover { border-color: var(--cell); transform: translateY(-3px); box-shadow: 0 12px 24px rgba(36, 21, 5, .08); }
.feature .ico {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .85rem;
  background: var(--night);
  margin-bottom: 1rem;
}
.feature svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.2rem; margin-bottom: .25rem; }
.feature p { font-size: .9375rem; color: var(--sub); }

/* ---------------- FAQ ----------------
   An open list on hairlines, heading in a column of its own. The toggle is
   a ring holding a plus that fills and turns to a minus when open. */
.faq-section .wrap { display: grid; grid-template-columns: 1fr 1.7fr; gap: 3.5rem; align-items: start; }
.faq-section .kicker, .faq-section h2 { text-align: left; }
.faq { border-top: 2px solid var(--ink); }
.faq-item { border-bottom: 1px solid var(--edge-line); }
.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.3rem 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.2;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '';
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background:
    linear-gradient(var(--ink), var(--ink)) center / .8rem 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px .8rem no-repeat;
  transition: background-color .15s ease;
}
.faq-item summary:hover::after { background-color: var(--chip); }
.faq-item[open] summary::after { background: linear-gradient(var(--screen), var(--screen)) center / .8rem 2px no-repeat, var(--ink); }
.faq-item summary:focus-visible { outline: 3px solid var(--copper); outline-offset: 4px; border-radius: .25rem; }
.faq-item p { margin: -.2rem 3.5rem 1.4rem 0; font-size: 1rem; color: var(--sub); }

/* ---------------- Closing band ---------------- */
.closer {
  border-top: 0;
  color: var(--screen);
  text-align: center;
  background:
    radial-gradient(40rem 20rem at 50% 0%, rgba(208, 122, 43, .28), transparent 70%),
    linear-gradient(180deg, var(--night-2), var(--night));
}
.closer img.mark { width: 5rem; height: 5rem; border-radius: 22%; box-shadow: 0 14px 30px rgba(10, 5, 0, .5), 0 0 0 1px rgba(244, 235, 217, .14); margin-bottom: 1.5rem; }
.closer p { color: rgba(244, 235, 217, .75); margin: .9rem auto 2rem; max-width: 30rem; font-size: 1.0625rem; }
.closer .cta-row { justify-content: center; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 3rem; padding-bottom: 3.5rem; gap: 3rem; }
  .heroboard { width: min(86%, 21rem); }
  .traits .wrap { grid-template-columns: repeat(2, 1fr); gap: 1rem .5rem; }
  .steps, .features { grid-template-columns: 1fr; }
  section { padding: 3.25rem 0; }
  .win-grid { grid-template-columns: 1fr; max-width: 20rem; gap: 2.75rem; }
  .faq-section .wrap { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (min-width: 861px) and (max-width: 1000px) { .features { grid-template-columns: repeat(2, 1fr); } }
