@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,600;1,9..144,600&family=Space+Mono:wght@400;700&display=swap');

:root {
  --paper: #EADFC2;
  --paper-2: #DED1AC;
  --paper-shadow: #C3B28A;
  --ink: #2A2115;
  --ink-soft: #4A3C28;
  --brass: #A97A2E;
  --brass-light: #D9A94F;
  --brass-dark: #6E4D1C;
  --rust: #9C3B26;
  --rust-light: #C1573B;
  --forest: #2F4A3A;
  --forest-light: #4C6E56;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --mono: 'Space Mono', 'SF Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ------------------------------------------------------------------ */
/* Texture de fond : papier vieilli + grain, jamais un aplat uni       */
/* ------------------------------------------------------------------ */

.chart-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 80% at 15% -10%, rgba(217, 169, 79, 0.22), transparent 55%),
    radial-gradient(ellipse 100% 70% at 105% 15%, rgba(156, 59, 38, 0.10), transparent 50%),
    radial-gradient(ellipse 90% 60% at 50% 115%, rgba(47, 74, 58, 0.10), transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}

.chart-bg::before {
  /* Grain fin, répétable, léger */
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.16  0 0 0 0 0.13  0 0 0 0 0.08  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.chart-bg::after {
  /* Lignes de longitude/latitude, très discrètes */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(74, 60, 40, 0.055) 0, rgba(74, 60, 40, 0.055) 1px, transparent 1px, transparent 88px),
    repeating-linear-gradient(90deg, rgba(74, 60, 40, 0.055) 0, rgba(74, 60, 40, 0.055) 1px, transparent 1px, transparent 88px);
}

/* Vignette bord de carte */
.chart-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  box-shadow: inset 0 0 min(18vw, 220px) rgba(42, 33, 21, 0.35);
}

/* ------------------------------------------------------------------ */
/* Typo générique                                                      */
/* ------------------------------------------------------------------ */

.label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-dark);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

a {
  color: inherit;
}

.italic {
  font-style: italic;
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

section {
  position: relative;
  padding: 108px 0;
}

/* Séparateur "trait de règle de navigation" avec rose des vents miniature */
.divider {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-dark), transparent);
  opacity: 0.5;
}

.divider .mark {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--brass-dark);
  transform: rotate(45deg);
  opacity: 0.7;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Header                                                               */
/* ------------------------------------------------------------------ */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 20px 0;
  background: linear-gradient(180deg, rgba(234, 223, 194, 0.96), rgba(234, 223, 194, 0.86));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(110, 77, 28, 0.25);
}

header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand .rose {
  width: 26px;
  height: 26px;
}

nav.top-links {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

nav.top-links a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

nav.top-links a:hover {
  color: var(--rust);
  border-color: var(--rust);
}

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

.hero {
  padding-top: 84px;
  padding-bottom: 40px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  background: var(--rust);
  border-radius: 50%;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: italic;
  color: var(--rust);
  position: relative;
  white-space: nowrap;
}

.hero h1 em svg {
  position: absolute;
  left: -2%;
  bottom: -0.16em;
  width: 104%;
  height: 0.3em;
}

.hero .lede {
  margin-top: 26px;
  max-width: 46ch;
  font-size: 1.14rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 20px;
  border: 1.5px solid var(--brass-dark);
  border-radius: 4px;
  background: rgba(234, 223, 194, 0.5);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.store-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(42, 33, 21, 0.4);
}

.store-badge svg {
  width: 24px;
  height: 24px;
  color: var(--brass-dark);
  flex-shrink: 0;
}

.store-badge .txt {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.store-badge .txt .small {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.store-badge .txt .big {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.02rem;
}

.hero-note {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
  opacity: 0.75;
}

/* ------------------------------------------------------------------ */
/* Compas / plateau de jeu (mockup CSS+SVG)                             */
/* ------------------------------------------------------------------ */

.compass-stage {
  position: relative;
  aspect-ratio: 1;
  max-width: 460px;
  margin: 0 auto;
}

.compass-stage svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-outer {
  fill: none;
  stroke: var(--brass-dark);
  stroke-width: 1;
  opacity: 0.35;
}

.ring-tick {
  stroke: var(--brass-dark);
  stroke-width: 1;
  opacity: 0.4;
}

.ring-tick.major {
  opacity: 0.75;
  stroke-width: 1.5;
}

.rhumb {
  stroke: var(--rust);
  stroke-width: 1;
  stroke-dasharray: 2 5;
  opacity: 0;
  transform-origin: center;
  animation: rhumb-in 1s ease forwards;
}

@keyframes rhumb-in {
  from { opacity: 0; stroke-dashoffset: 40; }
  to { opacity: 0.55; stroke-dashoffset: 0; }
}

.mystery-core {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.mystery-glyph {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  fill: var(--ink);
  text-anchor: middle;
}

.mystery-sub {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--ink-soft);
  text-anchor: middle;
  opacity: 0.7;
}

.arrow-group {
  opacity: 0;
  animation: arrow-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.arrow-shaft {
  stroke: var(--brass-dark);
  stroke-width: 2;
  stroke-linecap: round;
}

.arrow-head {
  fill: var(--brass-dark);
}

.arrow-flag {
  fill: var(--rust);
  stroke: var(--ink);
  stroke-width: 0.75;
}

.arrow-flag.forest {
  fill: var(--forest);
}

.arrow-flag.brass {
  fill: var(--brass);
}

.arrow-label {
  font-family: var(--mono);
  font-size: 7.5px;
  fill: var(--paper);
  text-anchor: middle;
  font-weight: 700;
}

@keyframes arrow-in {
  from { opacity: 0; transform: scale(0.55); }
  to { opacity: 1; transform: scale(1); }
}

.score-plate {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 9px 22px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 28px -14px rgba(42, 33, 21, 0.55);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-plate .num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--brass-light);
}

.score-plate .num span {
  animation: score-tick 4.5s steps(1) infinite;
}

@keyframes score-tick {
  0%   { content: ''; }
}

/* ------------------------------------------------------------------ */
/* Comment jouer                                                       */
/* ------------------------------------------------------------------ */

.how {
  padding-top: 92px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 64px;
}

.section-head .label {
  margin-bottom: 16px;
  display: block;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.15;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--paper-shadow);
  border: 1px solid var(--paper-shadow);
}

.how-card {
  background: var(--paper);
  padding: 40px 38px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}

.how-card:hover {
  background: var(--paper-2);
  transform: translateY(-4px);
  box-shadow:
    0 14px 28px -12px rgba(42, 33, 21, 0.28),
    inset 3px 0 0 var(--rust);
}

.how-card .idx {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--brass-dark);
  letter-spacing: 0.14em;
  display: block;
  margin-bottom: 20px;
}

.how-card .icon {
  width: 40px;
  height: 40px;
  margin-bottom: 22px;
  color: var(--rust);
}

.how-card h3 {
  font-size: 1.28rem;
  margin-bottom: 12px;
}

.how-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.62;
  font-size: 0.98rem;
}

/* ------------------------------------------------------------------ */
/* Barème de score                                                     */
/* ------------------------------------------------------------------ */

.score-ledger {
  margin-top: 72px;
  border: 1px solid var(--brass-dark);
  background: rgba(234, 223, 194, 0.4);
}

.score-ledger .ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 26px;
  border-bottom: 1px dashed var(--brass-dark);
}

.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 16px 26px;
  font-family: var(--mono);
  font-size: 0.88rem;
  border-bottom: 1px dotted rgba(110, 77, 28, 0.35);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ledger-row:hover {
  background: rgba(169, 122, 46, 0.07);
  box-shadow: inset 3px 0 0 var(--brass);
}

.ledger-row:last-child {
  border-bottom: none;
}

.ledger-row .desc {
  color: var(--ink-soft);
}

.ledger-row .amt {
  font-weight: 700;
  white-space: nowrap;
}

.amt.neg { color: var(--rust); }
.amt.pos { color: var(--forest); }

/* ------------------------------------------------------------------ */
/* Langues                                                              */
/* ------------------------------------------------------------------ */

.langs {
  padding-top: 84px;
  padding-bottom: 96px;
}

.lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 44px;
}

.lang-plate {
  flex: 1;
  min-width: 190px;
  border: 1px solid var(--brass-dark);
  padding: 26px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(234, 223, 194, 0.35);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.lang-plate:hover {
  transform: translateY(-3px);
  background: var(--paper-2);
  box-shadow: 0 10px 24px -10px rgba(42, 33, 21, 0.3);
}

.lang-plate .flag {
  font-size: 1.9rem;
  line-height: 1;
}

.lang-plate .lname {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
}

.lang-plate .lcode {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-top: 2px;
}

/* ------------------------------------------------------------------ */
/* CTA final                                                            */
/* ------------------------------------------------------------------ */

.cta {
  padding: 100px 0 120px;
  text-align: center;
}

.cta h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 18ch;
  margin: 0 auto 22px;
  line-height: 1.1;
}

.cta p {
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 auto;
  line-height: 1.6;
}

.cta .badges {
  justify-content: center;
  margin-top: 40px;
}

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

footer {
  border-top: 1px solid rgba(110, 77, 28, 0.3);
  padding: 40px 0;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
}

footer a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--brass-dark);
  padding-bottom: 1px;
}

footer a:hover {
  color: var(--rust);
  border-color: var(--rust);
}

footer .foot-links {
  display: flex;
  gap: 24px;
}

/* ------------------------------------------------------------------ */
/* Page politique de confidentialité                                   */
/* ------------------------------------------------------------------ */

.legal {
  padding: 76px 0 100px;
}

.legal .back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-dark);
  text-decoration: none;
  margin-bottom: 36px;
}

.legal .back:hover {
  color: var(--rust);
}

.legal h1 {
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  max-width: 20ch;
}

.legal .updated {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.legal .content {
  margin-top: 52px;
  max-width: 700px;
}

.legal .content h2 {
  font-size: 1.4rem;
  margin-top: 52px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(110, 77, 28, 0.35);
}

.legal .content h2:first-child {
  margin-top: 0;
}

.legal .content p,
.legal .content li {
  line-height: 1.72;
  color: var(--ink-soft);
  font-size: 1rem;
}

.legal .content ul {
  padding-left: 22px;
}

.legal .content li + li {
  margin-top: 8px;
}

.legal .content strong {
  color: var(--ink);
}

.legal .content a {
  color: var(--rust);
  border-bottom: 1px solid var(--rust-light);
  text-decoration: none;
}

.legal .contact-plate {
  margin-top: 52px;
  border: 1px solid var(--brass-dark);
  padding: 26px 28px;
  background: rgba(234, 223, 194, 0.4);
}

.legal .contact-plate .label {
  display: block;
  margin-bottom: 10px;
}

.legal .contact-plate a {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  border-bottom: 1.5px solid var(--rust);
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 880px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .compass-stage {
    max-width: 340px;
  }

  .how-grid {
    grid-template-columns: 1fr;
  }

  nav.top-links {
    display: none;
  }

  section {
    padding: 76px 0;
  }
}

@media (max-width: 520px) {
  .badges {
    flex-direction: column;
  }

  .store-badge {
    width: 100%;
  }

  .ledger-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ------------------------------------------------------------------ */
/* Stagger reveal : grilles .how-grid, .gallery-grid, .faq-list       */
/* Utilise translate (propriété individuelle) pour ne pas gêner les   */
/* transitions transform des hovers                                    */
/* ------------------------------------------------------------------ */

@keyframes reveal-up {
  from { opacity: 0; translate: 0 16px; }
  to   { opacity: 1; translate: 0 0; }
}

.how-card {
  animation: reveal-up 0.5s ease both;
}
.how-card:nth-child(1) { animation-delay: 0.05s; }
.how-card:nth-child(2) { animation-delay: 0.18s; }
.how-card:nth-child(3) { animation-delay: 0.31s; }
.how-card:nth-child(4) { animation-delay: 0.44s; }

.gallery-shot {
  animation: reveal-up 0.5s ease both;
}
.gallery-shot:nth-child(1) { animation-delay: 0.08s; }
.gallery-shot:nth-child(2) { animation-delay: 0.22s; }
.gallery-shot:nth-child(3) { animation-delay: 0.36s; }

.faq-item {
  animation: reveal-up 0.45s ease both;
}
.faq-item:nth-child(1) { animation-delay: 0.04s; }
.faq-item:nth-child(2) { animation-delay: 0.12s; }
.faq-item:nth-child(3) { animation-delay: 0.20s; }
.faq-item:nth-child(4) { animation-delay: 0.28s; }
.faq-item:nth-child(5) { animation-delay: 0.36s; }
.faq-item:nth-child(6) { animation-delay: 0.44s; }

/* Galerie de captures d'écran */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.gallery-shot {
  margin: 0;
  text-align: center;
}

.gallery-shot img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--paper-shadow);
  box-shadow: 0 12px 28px rgba(42, 33, 21, 0.18);
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-shot:hover img {
  transform: translateY(-5px);
  box-shadow: 0 22px 44px -14px rgba(42, 33, 21, 0.32);
}

.gallery-shot figcaption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

@media (max-width: 780px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
  }
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--paper-shadow);
  border: 1px solid var(--paper-shadow);
}

.faq-item {
  background: var(--paper);
  padding: 28px 32px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  background: var(--paper-2);
  box-shadow: inset 3px 0 0 var(--brass-dark);
}

.faq-item h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--ink);
}

.faq-item p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}

/* ------------------------------------------------------------------ */
/* Accessibilité : respect de prefers-reduced-motion                  */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
