/*
 * The home page, index.html, on top of style.css: its title, the nickname, the two ways to play
 * and the board that shows a game won. From the screen 07 of docs/design/.
 */

/* The text and the actions, then the board, side by side on a wide screen. */
.home {
  flex: 1;
  width: 100%;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 16px 24px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 64px;
}

.home-intro {
  flex: 999 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-badge {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.home-badge-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-online);
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-online) 70%, transparent);
}

.home-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.home-title-line {
  display: block;
}

.home-lead {
  max-width: 520px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.home-nickname {
  max-width: 360px;
}

/* The two ways to play: the online one stands out. */
.mode-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.mode-card {
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-card-online {
  border-color: color-mix(in srgb, var(--color-text) 28%, transparent);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-card-lift);
}

.mode-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-surface-control);
  display: grid;
  place-items: center;
  color: var(--color-text);
}

.mode-card-online .mode-icon {
  background: var(--color-border);
}

.mode-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.mode-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.mode-button {
  margin-top: 4px;
  min-height: 48px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
}

.home-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.home-link:hover {
  text-decoration: underline;
}

/* « Première fois ? Voir comment jouer », a button that opens the rules, drawn as a link. */
.home-link-secondary {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-secondary);
  font-family: inherit;
  cursor: pointer;
}

.home-link-secondary:hover {
  color: var(--color-text);
}

/*
 * A board of a game won by yellow, on a diagonal, which says what the game is. It is drawn by the
 * classes of the board of the game, at its own width.
 */
.home-visual {
  container-type: inline-size;
  flex: 1 1 420px;
  min-width: 0;
  display: none;
  justify-content: center;
}

.board-preview {
  --board-width: min(480px, 100cqi);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--strip-gap);
}

.board-preview-strip {
  width: var(--board-width);
  height: var(--strip-height);
  padding: 0 var(--board-inset);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.board-preview-slot {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 50%;
  border: 2px dashed var(--color-board-line);
}

.board-preview [data-win-index="1"] {
  --win-index: 1;
}

.board-preview [data-win-index="2"] {
  --win-index: 2;
}

.board-preview [data-win-index="3"] {
  --win-index: 3;
}

/* Medium and wide screens: the two ways side by side, a larger title, and the board. */
@media (min-width: 600px) {
  .home {
    padding: 40px 32px 48px;
  }

  .home-title {
    font-size: 52px;
  }

  .home-lead {
    font-size: 18px;
  }

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

  .home-visual {
    display: flex;
  }
}

@media (min-width: 960px) {
  .home-title {
    font-size: 64px;
    line-height: 1.02;
    letter-spacing: -0.035em;
  }
}
