/* ============================================================
   Site-02 — Règlement SCP:SL
   Thème sombre "Fondation", accent rouge (cohérent DarkHud)
   ============================================================ */

/* ---------- Polices locales (offline-first) ---------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0b0e;
  --bg-2: #101218;
  --surface: #14171f;
  --surface-2: #1a1e28;
  --border: #262b36;
  --border-soft: #1d222c;
  --text: #e7e9ee;
  --text-soft: #aab0bd;
  --text-mute: #6c7484;

  --red: #b71c1c;
  --red-2: #8c0000;
  --red-glow: rgba(183, 28, 28, 0.35);
  --amber: #e0a73a;
  --green: #4caf72;

  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1100px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(
      900px 500px at 80% -10%,
      rgba(183, 28, 28, 0.08),
      transparent
    ),
    radial-gradient(700px 500px at 0% 0%, rgba(224, 167, 58, 0.05), transparent);
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
svg {
  display: block;
}
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Lecture progress bar ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--red-2), var(--red), var(--amber));
  z-index: 100;
  transition: width 0.1s linear;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 14, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand .logo {
  width: 34px;
  height: 34px;
  color: var(--red);
}
.brand b {
  font-size: 1.05rem;
}
.brand span {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-mute);
  letter-spacing: 1px;
}
.nav-links {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.92rem;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-links a:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-links a.active {
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-2));
  box-shadow: 0 4px 14px var(--red-glow);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.section-pad {
  padding: 56px 0;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.12s,
    box-shadow 0.15s,
    background 0.15s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background: linear-gradient(180deg, var(--red), var(--red-2));
  color: #fff;
  box-shadow: 0 6px 20px var(--red-glow);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--red);
}

/* ---------- HERO (accueil) ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 90px 24px 70px;
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(224, 167, 58, 0.35);
  background: rgba(224, 167, 58, 0.06);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.hero h1 .accent {
  color: var(--red);
}
.hero p {
  max-width: 560px;
  margin: 0 auto 30px;
  color: var(--text-soft);
  font-size: 1.08rem;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Cards / stats ---------- */
.grid {
  display: grid;
  gap: 18px;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
}
.card .card-ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(183, 28, 28, 0.12);
  color: var(--red);
  margin-bottom: 14px;
}
.card h3 {
  font-size: 1.1rem;
  margin-bottom: 7px;
}
.card p {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.connect {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 18px 22px;
  flex-wrap: wrap;
}
.connect .label {
  font-size: 0.78rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.connect code {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--text);
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.5px;
}
.section-title p {
  color: var(--text-soft);
  margin-top: 8px;
}

/* ============================================================
   PAGE RÈGLEMENT
   ============================================================ */
.rules-head {
  text-align: center;
  padding: 60px 24px 30px;
  border-bottom: 1px solid var(--border-soft);
}
.rules-head .badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--amber);
  margin-bottom: 16px;
}
.rules-head h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -1px;
}
.rules-head .meta {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--text-mute);
  font-size: 0.85rem;
  font-family: var(--mono);
}
.rules-head .meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.rules-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 40px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 80px;
  align-items: start;
}

/* Sommaire latéral */
.toc {
  position: sticky;
  top: 90px;
}
.toc .search {
  position: relative;
  margin-bottom: 16px;
}
.toc .search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 10px 12px 10px 36px;
  outline: none;
}
.toc .search input:focus {
  border-color: var(--red);
}
.toc .search .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-mute);
}
.toc-title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-mute);
  margin: 6px 0 10px 4px;
}
.toc ul {
  list-style: none;
  border-left: 1px solid var(--border);
}
.toc li a {
  display: block;
  padding: 7px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-soft);
  font-size: 0.9rem;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.toc li a:hover {
  color: var(--text);
}
.toc li a.active {
  color: #fff;
  border-left-color: var(--red);
  font-weight: 600;
}

/* Contenu règlement */
.rules-content {
  min-width: 0;
}
.tldr {
  background: linear-gradient(180deg, rgba(183, 28, 28, 0.1), var(--surface));
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 40px;
}
.tldr h2 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.tldr ol {
  list-style: none;
  counter-reset: tldr;
  display: grid;
  gap: 10px;
}
.tldr li {
  counter-increment: tldr;
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--text-soft);
}
.tldr li::before {
  content: counter(tldr);
  font-family: var(--mono);
  font-weight: 700;
  color: var(--red);
  background: rgba(183, 28, 28, 0.14);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 0.8rem;
  flex: none;
  align-self: center;
}
.tldr li b {
  color: var(--text);
}

.rule-section {
  margin-bottom: 38px;
  scroll-margin-top: 90px;
}
.rule-section > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  letter-spacing: -0.3px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}
.rule-section > h2 .num {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--red);
  background: rgba(183, 28, 28, 0.12);
  padding: 4px 9px;
  border-radius: 6px;
}
.rule-section > h2 .ico {
  color: var(--red);
}
.rule-list {
  list-style: none;
  display: grid;
  gap: 12px;
}
.rule-list li {
  position: relative;
  padding: 14px 16px 14px 44px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  transition: border-color 0.15s;
}
.rule-list li:hover {
  border-color: var(--border);
}
.rule-list li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.12);
}
.rule-list li b {
  color: var(--text);
}
.rule-list li.ok::before {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(76, 175, 114, 0.12);
}
.rule-list li.warn::before {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(224, 167, 58, 0.14);
}

.callout {
  display: flex;
  gap: 12px;
  background: rgba(224, 167, 58, 0.07);
  border: 1px solid rgba(224, 167, 58, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
  color: var(--text-soft);
  font-size: 0.93rem;
}
.callout .icon {
  color: var(--amber);
  margin-top: 2px;
}

/* Échelle des sanctions */
.sanctions {
  display: grid;
  gap: 10px;
}
.sanction {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.sanction .step {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  padding: 6px 8px;
  border-radius: 6px;
}
.sanction.s1 .step {
  color: var(--amber);
  background: rgba(224, 167, 58, 0.12);
}
.sanction.s2 .step {
  color: #ff8f4d;
  background: rgba(255, 143, 77, 0.12);
}
.sanction.s3 .step {
  color: var(--red);
  background: rgba(183, 28, 28, 0.14);
}
.sanction.s4 .step {
  color: #fff;
  background: var(--red-2);
}
.sanction span {
  color: var(--text-soft);
  font-size: 0.94rem;
}

/* No-results */
.no-results {
  display: none;
  text-align: center;
  color: var(--text-mute);
  padding: 40px;
  font-style: italic;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-2);
  padding: 36px 24px;
  text-align: center;
  color: var(--text-mute);
  font-size: 0.88rem;
}
.site-footer .foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 10px;
}
.site-footer .foot-brand .logo {
  width: 22px;
  height: 22px;
  color: var(--red);
}
.site-footer .links {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 10px 0;
  flex-wrap: wrap;
}
.site-footer .links a:hover {
  color: var(--text);
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s,
    border-color 0.15s;
  z-index: 40;
}
.to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.to-top:hover {
  border-color: var(--red);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .rules-layout {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
  }
  .toc ul {
    display: none;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .nav-links {
    position: absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .sanction {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .sanction .step {
    justify-self: start;
  }
}
