/* Page d'accueil de robote7701.com : thème sombre, mêmes cartes à contour arrondi que Pictou. */

@font-face {
  font-family: 'Nunito';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/Nunito-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Nunito';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/Nunito-Bold.ttf') format('truetype');
}

:root {
  color-scheme: dark;
  --bg: #17142a;
  --surface: #241f3d;
  --text: #f2eefb;
  --muted: #b9b1d3;
  --line: #4a4270;
  --accent: #a99fd6;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  background: radial-gradient(1200px 500px at 50% -120px, #2b2550 0%, var(--bg) 70%) no-repeat, var(--bg);
}

a {
  color: inherit;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-right: 16px;
  padding-left: 16px;
}

/* --- en-tête --- */

.hero {
  padding-top: 56px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0 0 16px;
}

/* Le logo, en tuile arrondie comme les images des cartes. */
.brand-logo {
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
}

.brand-text {
  display: block;
}

.brand-name {
  display: block;
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.05;
}

.brand-name span {
  color: var(--accent);
}

.brand-tagline {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--muted);
}

.lead {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
}

/* Le petit menu sous l'intro : une pastille par section. */
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.quick a {
  padding: 6px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.15s ease;
}

.quick a:hover,
.quick a:focus-visible {
  border-color: var(--accent);
  outline: none;
}

html {
  scroll-behavior: smooth;
}

h2[id],
.support[id] {
  scroll-margin-top: 16px;
}

/* --- les outils --- */

h2 {
  margin: 44px 0 16px;
  font-size: 1.3rem;
}

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.45);
  transform: translateY(-3px);
}

/* La couleur du bandeau de chaque outil. */
.card.pictou {
  --tint: #ffe7a8;
}

.card.tapivroum {
  --tint: #d4e8c7;
}

.card-art {
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--tint, #e3ddf7);
}

.card-art img {
  display: block;
  width: 120px;
  height: 120px;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}

.card h3 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.15;
}

/* Le lien du titre couvre toute la carte : on clique n'importe où. */
.card h3 a {
  text-decoration: none;
}

.card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.card h3 a:focus-visible {
  outline: none;
}

.card:has(h3 a:focus-visible) {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
}

.card-kicker {
  margin: 0;
  font-weight: 700;
}

.card-text {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
}

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

.chips li {
  padding: 2px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid var(--line);
  border-radius: 999px;
}

.open {
  align-self: flex-start;
  margin-top: 8px;
  padding: 8px 18px;
  font-weight: 700;
  color: var(--bg);
  background: var(--text);
  border-radius: 12px;
}

.card:hover .open {
  background: #fff;
}

.card.soon {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.card.soon:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.card.soon .card-art {
  background: transparent;
}

.card.soon .card-art span {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--muted);
  border: 3px dashed var(--line);
  border-radius: 24px;
}

/* --- cartes Home Assistant : une capture à la place de l'illustration --- */

.section-lead {
  max-width: 40rem;
  margin: -6px 0 18px;
  color: var(--muted);
}

.section-lead a {
  text-underline-offset: 3px;
}

.card-art.shot {
  padding: 0;
  background: #0e1013;
}

.card-art.shot img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center top;
}

/* --- derniers projets GitHub (liste réécrite chaque jour par scripts/depots.py) --- */

.repos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.repo {
  position: relative;
  padding: 14px 18px 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  transition: border-color 0.15s ease;
}

.repo:hover,
.repo:focus-within {
  border-color: var(--accent);
}

.repo h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Comme les cartes : le lien du nom couvre tout le bloc. */
.repo h3 a {
  text-decoration: none;
}

.repo h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.repo h3 a:focus-visible {
  outline: none;
}

.repo:has(h3 a:focus-visible) {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
}

.repo p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.repo .repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  font-size: 0.85rem;
}

/* Pastille de couleur du langage, comme sur GitHub. */
.lang::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: 0;
  background: var(--accent);
  border-radius: 50%;
}

.lang[data-lang='JavaScript']::before { background: #f1e05a; }
.lang[data-lang='TypeScript']::before { background: #3178c6; }
.lang[data-lang='HTML']::before { background: #e34c26; }
.lang[data-lang='CSS']::before { background: #663399; }
.lang[data-lang='Python']::before { background: #3572a5; }

.repo.empty {
  border-style: dashed;
}

.more {
  margin: 14px 0 0;
  font-weight: 700;
}

.more a {
  text-underline-offset: 3px;
}

.more a:hover {
  color: #fff;
}

/* --- bandeau « offrir un café » --- */

.support {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 44px;
  padding: 20px 24px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 22px;
}

.support-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  font-size: 2rem;
  background: #ffe7a8;
  border-radius: 50%;
}

.support-text {
  flex: 1;
}

.support-text h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.support-text p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
}

.coffee {
  flex: none;
  padding: 10px 20px;
  font-weight: 700;
  text-decoration: none;
  color: var(--bg);
  background: #ffe7a8;
  border-radius: 12px;
}

.coffee:hover {
  background: #fff;
}

.coffee:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
}

/* Discord et café : l'un sous l'autre sur téléphone, côte à côte sur ordinateur. */
.supports {
  display: grid;
  gap: 16px;
  margin-top: 44px;
}

.supports .support {
  margin-top: 0;
}

@media (min-width: 900px) {
  .supports {
    grid-template-columns: 1fr 1fr;
  }

  .supports .support {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .supports .support-text {
    flex: 1;
  }
}

.community .support-icon,
.community .coffee {
  background: var(--accent);
}

.community .coffee:hover {
  background: #fff;
}

@media (max-width: 720px) {
  .support {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* --- pied de page --- */

.site-footer {
  margin-top: 56px;
  padding-top: 18px;
  padding-bottom: 32px;
  font-size: 0.92rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer a {
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--text);
}

/* --- page de texte (mentions légales) --- */

.legal {
  max-width: 46rem;
  padding: 28px 16px 8px;
  margin: 0 auto;
}

.legal h1 {
  margin: 12px 0 4px;
  font-size: 2rem;
  line-height: 1.2;
}

.legal h2 {
  margin: 28px 0 8px;
  font-size: 1.15rem;
}

.legal p {
  margin: 0 0 12px;
  color: var(--muted);
}

.legal .updated {
  font-size: 0.92rem;
}

.back {
  font-weight: 700;
}

@media (max-width: 520px) {
  .hero {
    padding-top: 36px;
  }

  .brand {
    gap: 14px;
  }

  .brand-logo {
    width: 68px;
    height: 68px;
    border-radius: 15px;
  }

  .brand-name {
    font-size: 2.4rem;
  }

  .brand-tagline {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card {
    transition: none;
  }

  .card:hover,
  .card:focus-within {
    transform: none;
  }
}
