@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root{
  --bg: #f6f4ef;
  --ink: #0f172a;
  --muted: #5b6472;
  --card: #ffffff;
  --line: rgba(15,23,42,.10);
  --accent: #ff6b35;
  --accent2: #ff915f;
  --shadow: 0 18px 50px rgba(15,23,42,.10);
  --shadow2: 0 30px 80px rgba(15,23,42,.14);
  --radius: 18px;
  --danger: #d7263d;
}

*{ box-sizing:border-box; margin:0; padding:0 }
html{ scroll-behavior:smooth }
body{
  font-family:"Space Grotesk",system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

.wrap{ max-width:1180px; margin:0 auto; padding:0 22px; }

.reveal{ opacity:0; transform:translateY(18px); transition:opacity .7s ease, transform .7s ease; }
.reveal.is-in{ opacity:1; transform:none; }

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  background: rgba(246,244,239,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}
.topbar__inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 0; gap: 16px;
}
.brand{
  font-weight: 900;
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--ink);
}
.brand span{ color: var(--accent); }

.nav{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content:flex-end;
  align-items:center;
}
.nav__link{
  text-decoration:none;
  color: var(--muted);
  font-weight: 800;
  padding: 9px 12px;
  border-radius: 12px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
  display:inline-flex;
  align-items:center;
}
.nav__link:hover{ background: rgba(255,107,53,.10); color: var(--ink); transform: translateY(-1px); }
.nav__link.is-active{ background: rgba(15,23,42,.06); color: var(--ink); }

/* Dropdown (Aide -> Contact/Règles) */
.dropdown{ position: relative; }
.dropdown__btn{ display:inline-flex; align-items:center; gap:8px; }
.dropdown__menu{
  position:absolute;
  right:0;
  top: 46px;
  min-width: 210px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow2);
  padding: 8px;
  display:none;
  z-index: 40;
}
.dropdown__menu a{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration:none;
  font-weight: 900;
  color: var(--ink);
}
.dropdown__menu a:hover{ background: rgba(255,107,53,.12); }

/* Desktop hover */
@media (hover:hover){
  .dropdown:hover .dropdown__menu{ display:block; }
}

/* Mobile/touch: open via .is-open (JS) */
.dropdown.is-open .dropdown__menu{ display:block; }
@media (max-width: 520px){
  .dropdown__menu{ left:0; right:auto; top: 44px; }
}

/* Global red disclaimer bar */
.notice{
  background: rgba(215, 38, 61, 0.10);
  border-bottom: 1px solid rgba(215, 38, 61, 0.20);
}
.notice__inner{
  padding: 10px 0;
  display:flex;
  gap: 10px;
  align-items: flex-start;
  color: #7a0b1a;
  font-weight: 800;
  font-size: .95rem;
}
.notice__inner strong{ color: #a31227; }
.notice__inner a{ color: #a31227; text-decoration: underline; }

/* Hero */
.hero{ position:relative; min-height:70vh; display:flex; align-items:center; overflow:hidden; }
.hero__inner{ position:relative; z-index:2; padding:68px 0; }
.badge{
  display:inline-flex;
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  font-size:.92rem;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.20);
  backdrop-filter: blur(10px);
}
.hero__title{
  margin-top:14px;
  font-size: clamp(2.6rem, 5.5vw, 4.1rem);
  line-height:1.03;
  color:#fff;
  letter-spacing: -0.02em;
}
.hero__text{ margin-top:14px; max-width:72ch; color: rgba(255,255,255,.84); }
.hero__cta{ display:flex; gap:12px; flex-wrap:wrap; margin-top:22px; }

.hero__bg{
  position:absolute; inset:0; z-index:1;
  background:
    linear-gradient(120deg, rgba(15,23,42,.78), rgba(15,23,42,.24)),
    var(--hero-img, url("https://images.unsplash.com/photo-1523413455343-ea8b3d5a42f7?auto=format&fit=crop&w=2200&q=60")) center/cover no-repeat;
  transform: scale(1.03);
}

.hero__grain{
  position:absolute; inset:-40px; z-index:1;
  opacity:.12; pointer-events:none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration:none;
  font-weight: 900;
  border: 1px solid transparent;
  cursor:pointer;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn--primary{ background: var(--accent); color:#fff; box-shadow:0 14px 30px rgba(255,107,53,.25); }
.btn--primary:hover{ filter:brightness(.97); transform:translateY(-2px); box-shadow:0 18px 40px rgba(255,107,53,.28); }
.btn--ghost{ background: rgba(255,255,255,.10); color:#fff; border-color:rgba(255,255,255,.22); }
.btn--ghost:hover{ background: rgba(255,255,255,.14); transform:translateY(-2px); }
.btn--soft{ background: rgba(15,23,42,.05); color: var(--ink); border-color: var(--line); }
.btn--soft:hover{ background: rgba(15,23,42,.07); transform:translateY(-1px); }
.btn--danger{ background: var(--danger); color:#fff; }
.btn--danger:hover{ filter:brightness(.98); transform:translateY(-1px); }

/* Sections & cards */
.section{ padding: 52px 0; }
.section--top{ padding-top: 26px; }
.section-title{ font-size: clamp(2rem, 3.5vw, 2.6rem); margin: 10px 0 18px; letter-spacing: -0.02em; }

.pagehead h1{ font-size: clamp(2rem, 3.8vw, 2.8rem); letter-spacing: -0.02em; }
.pagehead p{ color: var(--muted); margin-top:10px; max-width:78ch; }

.grid3{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin-top:18px; }
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover{ transform: translateY(-2px); box-shadow: var(--shadow2); }
.card h3, .card h2{ margin-bottom:10px; }
.card p{ color: var(--muted); }
.link{ display:inline-block; margin-top:10px; color: var(--accent); font-weight: 900; text-decoration:none; }

.list{ margin-top:10px; padding-left: 18px; color: var(--muted); }
.list li{ margin: 6px 0; }

/* Tabs */
.tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 18px 0;
}
.tabbtn{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.04);
  cursor: pointer;
  font-weight: 900;
}
.tabbtn.is-active{
  background: rgba(255,107,53,.14);
  border-color: rgba(255,107,53,.22);
}
.tabpanel{ display:none; }
.tabpanel.is-active{ display:block; }

/* Forms */
.form{ display:grid; gap:10px; }
.form__row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.input{
  width:100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 12px;
  font: inherit;
  background:#fff;
}
.input:focus{ outline:2px solid rgba(255,107,53,.22); border-color: rgba(255,107,53,.34); }
.hint{ color: var(--muted); font-size:.95rem; }

.kbd{
  border: 1px solid var(--line);
  background: rgba(15,23,42,.03);
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 900;
}

/* Carte collaborative layout */
.mapwrap{ display:grid; grid-template-columns:1.3fr .7fr; gap:18px; margin-top:18px; align-items:start; }
.map{
  height: 600px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow2);
  overflow:hidden;
  background: #e9e4d8;
}
.sidepanel{
  position: sticky;
  top: 110px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.divider{ height:1px; background: var(--line); margin:16px 0; }

/* Chips scroller */
.chips{
  display:flex;
  gap:10px;
  overflow:auto;
  padding: 10px 6px;
  margin: 10px 0 0;
  scrollbar-width: thin;
}
.chip{
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
}
.chip.is-active{
  border-color: rgba(255,107,53,.35);
  background: rgba(255,107,53,.12);
}

/* Modals */
.modal{
  position: fixed; inset: 0;
  display: none; place-items:center;
  padding: 18px;
  background: rgba(15,23,42,.35);
  backdrop-filter: blur(10px);
  z-index: 60;
}
.modal.is-open{ display:grid; }
.modal__card{
  width: min(600px, 96vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow2);
  padding: 16px;
}
.modal__top{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 12px; gap: 10px; }
.iconbtn{
  width:38px; height:38px;
  border-radius:12px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.04);
  cursor:pointer;
}
.iconbtn:hover{ background: rgba(15,23,42,.06); }

/* Explorations posts */
.posts{ display:grid; gap:18px; margin-top:18px; }
.post{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:grid;
  grid-template-columns: 1.2fr 1fr;
}
.post__media img{ width:100%; height:100%; min-height:280px; object-fit:cover; display:block; }
.post__body{ padding: 18px; }
.meta{ color: var(--muted); font-size:.95rem; margin:6px 0 10px; }
.embed{ margin-top:12px; border-radius:14px; overflow:hidden; border:1px solid var(--line); }
.embed iframe{ width:100%; height:260px; border:0; display:block; }

/* Drag & Drop zone */
.dropzone{
  border: 2px dashed rgba(15,23,42,.18);
  background: rgba(15,23,42,.03);
  border-radius: 16px;
  padding: 14px;
  transition: background .2s ease, border-color .2s ease;
}
.dropzone.is-dragover{
  background: rgba(255,107,53,.10);
  border-color: rgba(255,107,53,.45);
}
.previewgrid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.previewgrid img{
  width:100%;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* Responsive */
@media (max-width: 980px){
  .grid3{ grid-template-columns:1fr; }
  .mapwrap{ grid-template-columns:1fr; }
  .sidepanel{ position: static; top: auto; }
  .post{ grid-template-columns:1fr; }
  .map{ height: 420px; }
  .previewgrid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px){
  .topbar__inner{ flex-direction:column; align-items:flex-start; }
  .nav{ justify-content:flex-start; }
  .map{ height: 360px; }
  .previewgrid{ grid-template-columns: repeat(2, 1fr); }
}
