/* Biences Gaming — page d'accueil. Charte Biences : fond crème, texte brun, accents orange. */

@font-face { font-family: "Lato"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/lato-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/lato-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-weight: 400 700; font-style: italic; font-display: swap; src: url("./fonts/playfair-display-italic-latin.woff2") format("woff2"); }

:root {
  --orange: #E87722;
  --orange-dark: #c65500;
  --brown: #43372C;
  --brown-light: #6A4B3C;
  --taupe: #7A6D64;
  --beige: #F1E8DE;
  --beige-dark: #e8ddd0;
  --bg: #FBF8F6;
  --white: #ffffff;
  --border: #DEDEDE;
  --border-hover: #c8bfb3;

  --sage: #3F5B45;
  --plum: #7A3B4F;
  --apricot: #D9822B;

  --shadow: 0 8px 28px rgba(67, 55, 44, .08);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --gutter: max(16px, calc(var(--safe-left) + 12px));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(232, 119, 34, .10), transparent 60%),
    radial-gradient(90% 50% at 0% 30%, rgba(63, 91, 69, .08), transparent 65%),
    var(--bg);
  color: var(--brown);
  font: 400 16px/1.6 "Lato", system-ui, -apple-system, sans-serif;
  letter-spacing: .05em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .26 0 0 0 0 .21 0 0 0 0 .17 0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- En-tête ---------- */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1060px; margin: 0 auto;
  padding: calc(var(--safe-top) + 18px) var(--gutter) 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--brown); text-decoration: none; min-height: 48px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: var(--orange); color: var(--white);
  font: italic 700 22px/1 "Playfair Display", Georgia, serif; letter-spacing: 0;
  box-shadow: 0 4px 14px rgba(232, 119, 34, .25);
}
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: .02em; }
.brand-tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .22em;
  color: var(--taupe); border-left: 1px solid var(--border); padding-left: 10px;
}
.top-count {
  font-size: 12px; color: var(--taupe); text-transform: uppercase; letter-spacing: .16em;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; background: rgba(255, 255, 255, .6);
}
.top-count b { color: var(--brown); }

/* ---------- Page ---------- */
.page { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; padding: 0 var(--gutter); padding-right: max(16px, calc(var(--safe-right) + 12px)); }

.hero { padding: 34px 0 26px; }
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--taupe);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); animation: pulse 2.4s ease-in-out infinite; }
h1 {
  margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.02;
  font-size: clamp(44px, 13vw, 84px); color: var(--brown);
}
h1 em {
  display: block; font: italic 500 1.06em/1 "Playfair Display", Georgia, serif; letter-spacing: -.015em;
  color: var(--plum);
}
.lede { margin: 16px 0 0; max-width: 34ch; font-size: 16px; font-weight: 400; color: var(--brown-light); }

/* ---------- Recherche ---------- */
.search { position: relative; margin-top: 24px; max-width: 520px; }
.search-icon {
  position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: var(--taupe); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.search input {
  width: 100%; min-height: 52px; appearance: none; -webkit-appearance: none;
  background: var(--white); border: 1px solid var(--border); border-radius: 999px;
  padding: 14px 20px 14px 48px;
  font: 400 16px/1.2 "Lato", sans-serif; letter-spacing: .05em; color: var(--brown);
  box-shadow: 0 2px 8px rgba(67, 55, 44, .04);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.search input::placeholder { color: var(--taupe); opacity: .8; }
.search input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 119, 34, .1), 0 4px 16px rgba(67, 55, 44, .06); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 5;
  margin: 0; padding: 6px; list-style: none;
  background: var(--white); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  animation: fadeIn .18s ease;
}
.suggestions li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 10px 14px; border-radius: 12px; cursor: pointer;
  font-weight: 700; color: var(--brown);
}
.suggestions li small { font-weight: 400; font-size: 12px; color: var(--taupe); letter-spacing: .08em; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--beige); }
.suggestions mark { background: none; color: var(--orange-dark); }

/* ---------- Cartes de jeu ---------- */
.games { list-style: none; margin: 0; padding: 0 0 8px; display: grid; gap: 18px; }
.game { --accent: var(--sage); animation: fadeUp .6s var(--ease) both; }
.game:nth-child(2) { animation-delay: .08s; }
.game:nth-child(3) { animation-delay: .16s; }
.game[data-accent="plum"] { --accent: var(--plum); }
.game[data-accent="apricot"] { --accent: var(--apricot); }
.game[hidden] { display: none; }

.game-link {
  position: relative; display: grid; grid-template-columns: minmax(112px, 38%) 1fr; gap: 16px;
  padding: 12px; color: inherit; text-decoration: none;
  background: var(--white); border: 1px solid var(--border); border-radius: 22px;
  transition: transform .3s var(--ease), box-shadow .3s ease, border-color .3s ease;
  overflow: hidden;
}
.game-link::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); opacity: .9;
}
.game-link:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.game-link:active { transform: scale(.985); }
.game-link:focus-visible { outline: 3px solid rgba(232, 119, 34, .45); outline-offset: 3px; }

.shot {
  position: relative; margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 390 / 560;
  background: var(--beige); box-shadow: inset 0 0 0 1px rgba(67, 55, 44, .06);
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: transform .6s var(--ease); }
.game-link:hover .shot img { transform: scale(1.04); }

.game-body { display: flex; flex-direction: column; min-width: 0; padding: 4px 4px 2px 0; }
.game-meta { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; }
.num { font: italic 600 26px/1 "Playfair Display", Georgia, serif; color: var(--accent); letter-spacing: 0; }
.genre { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--taupe); }
.game-title { margin: 0; font-size: 21px; line-height: 1.15; font-weight: 700; letter-spacing: .01em; }
.game-pitch { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--brown-light); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.chips li {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--brown-light);
  background: var(--beige); border-radius: 999px; padding: 4px 10px;
}

.cta {
  margin-top: auto; align-self: stretch;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; margin-block-start: 14px; padding: 0 20px;
  background: var(--orange); color: var(--white); border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(232, 119, 34, .25);
  transition: background .3s ease, box-shadow .3s ease, transform .3s var(--ease);
}
.cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.game-link:hover .cta { background: var(--orange-dark); box-shadow: 0 6px 20px rgba(232, 119, 34, .35); }
.game-link:hover .cta svg { transform: translateX(3px); }

.empty { margin: 8px 0 0; padding: 22px; text-align: center; color: var(--taupe); background: var(--white); border: 1px dashed var(--border); border-radius: 18px; }

/* ---------- Conseils + pied ---------- */
.tips {
  margin: 26px 0 0; padding: 20px 22px; border-radius: 22px; background: var(--beige);
  animation: fadeUp .6s var(--ease) .24s both;
}
.tips h2 { margin: 0 0 8px; font: italic 600 22px/1.2 "Playfair Display", Georgia, serif; letter-spacing: 0; color: var(--brown); }
.tips ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tips li { font-size: 14px; line-height: 1.5; color: var(--brown-light); }
.tips b { color: var(--brown); }

.foot {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1060px; margin: 0 auto;
  padding: 28px var(--gutter) calc(var(--safe-bottom) + 28px);
  font-size: 11px; text-transform: uppercase; letter-spacing: .2em; color: var(--taupe);
}

/* ---------- Petits écrans ---------- */
@media (max-width: 360px) {
  .game-link { grid-template-columns: 1fr; }
  .shot { aspect-ratio: 16 / 10; }
  .brand-tag { display: none; }
}

/* ---------- Tablette / bureau ---------- */
@media (min-width: 900px) {
  .hero { padding: 64px 0 40px; }
  .games { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .game-link { grid-template-columns: 1fr; padding: 14px; }
  .game-link::before { inset: 0 0 auto 0; width: auto; height: 4px; }
  .shot { aspect-ratio: 4 / 5; }
  .game-body { padding: 6px 6px 4px; }
  .tips { display: grid; grid-template-columns: 200px 1fr; align-items: start; gap: 20px; }
}

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
