/* RRR public site — mobile-first dark theme */
:root {
  --bg: #0f1117;
  --bg-raise: #151923;
  --surface: #1a1f2c;
  --surface-2: #222839;
  --line: #2a3145;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --green: #22c55e;
  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.02em; }
.brand img { height: 34px; width: auto; }
.nav-toggle {
  margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 1.1rem; cursor: pointer;
}
nav.site-nav { display: none; }
nav.site-nav.open {
  display: block; position: absolute; top: 60px; left: 0; right: 0;
  background: var(--bg-raise); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
}
nav.site-nav a {
  display: block; padding: 10px 8px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
nav.site-nav a.active, nav.site-nav a:hover { color: var(--text); background: var(--surface); }
.btn {
  display: inline-block; background: var(--accent); color: #14100a; font-weight: 700;
  padding: 10px 18px; border-radius: 999px; border: none; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 6px 14px; font-size: 0.9rem; }

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  nav.site-nav { display: flex !important; position: static; margin-left: auto; gap: 4px;
    background: none; border: 0; padding: 0; }
  nav.site-nav a { padding: 8px 12px; }
}

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero .art { position: absolute; inset: 0; }
.hero .art img, .hero .art svg { width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.hero .art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,17,23,0.2), var(--bg) 92%); }
.hero .inner { position: relative; padding: 72px 0 64px; text-align: center; }
.hero img.mark { width: min(300px, 64vw); margin: 0 auto 18px; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1.15; }
.hero .tagline { color: var(--accent); font-weight: 700; font-size: clamp(1rem, 3vw, 1.3rem); margin-top: 10px; }
.hero p.sub { color: var(--muted); max-width: 34rem; margin: 14px auto 0; }
.hero .cta { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Sections */
section.block { padding: 52px 0; }
section.block.alt { background: var(--bg-raise); }
.kicker { color: var(--accent); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 0.8rem; }
h2.title { font-size: clamp(1.5rem, 4.5vw, 2.1rem); margin: 6px 0 8px; }
p.lead { color: var(--muted); max-width: 42rem; }

/* Cards & grids */
.grid { display: grid; gap: 16px; margin-top: 26px; }
.grid.cols-3 { grid-template-columns: 1fr; }
.grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) {
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.card .body { padding: 16px; }
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .thumb { aspect-ratio: 3 / 2; background: var(--surface-2); }
.card .thumb.square { aspect-ratio: 1; }
.card .thumb img, .card .thumb svg { width: 100%; height: 100%; object-fit: cover; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 26px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery .shot { aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2); }
.gallery .shot img, .gallery .shot svg { width: 100%; height: 100%; object-fit: cover; }

/* Team */
.person { text-align: center; padding: 20px 14px; }
.person .avatar {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--surface-2); border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.6rem; color: var(--accent); overflow: hidden;
}
.person .avatar img { width: 100%; height: 100%; object-fit: cover; }
.person .role { color: var(--accent); font-size: 0.85rem; font-weight: 600; }

/* Leaderboard */
.board-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  color: var(--muted); font-size: 0.9rem; margin-top: 10px; }
.board-meta .stamp { background: var(--surface); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 999px; }
.board-meta .stamp.stale { color: #fca5a5; border-color: #7f1d1d; }
.searchbar { margin: 22px 0 6px; }
.searchbar input {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 10px 14px; font-size: 1rem;
}
.board { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.95rem; }
.board th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 8px;
  border-bottom: 1px solid var(--line); }
.board td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
.board tr.out { opacity: 0.45; }
.board .rank { width: 2.4rem; font-weight: 800; color: var(--muted); }
.board .rank.m1 { color: #fbbf24; } .board .rank.m2 { color: #cbd5e1; } .board .rank.m3 { color: #d97706; }
.board .runner { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.board .runner .avatar { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800; color: var(--accent); overflow: hidden; }
.board .runner .avatar img { width: 100%; height: 100%; object-fit: cover; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.rules { margin-top: 30px; }
.rules ul { margin: 10px 0 0 1.2rem; color: var(--muted); }
.notice { background: var(--accent-soft); border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius); padding: 14px 16px; color: var(--text); margin-top: 20px; }

/* Archive */
.challenge-card { margin-bottom: 14px; }
.challenge-card summary {
  list-style: none; cursor: pointer; padding: 16px; display: flex; flex-wrap: wrap;
  gap: 6px 14px; align-items: baseline;
}
.challenge-card summary::-webkit-details-marker { display: none; }
.challenge-card summary h3 { font-size: 1.1rem; }
.challenge-card summary .dates { color: var(--muted); font-size: 0.85rem; }
.challenge-card summary .type { margin-left: auto; background: var(--accent-soft);
  color: var(--accent); font-size: 0.75rem; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.challenge-card .detail { padding: 0 16px 16px; color: var(--muted); }
.challenge-card .detail ul { margin: 8px 0 0 1.2rem; }
.podium { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.podium .medal { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 14px; font-size: 0.9rem; }
.podium .medal b { color: var(--text); }

/* Heatmap strips + tier pills (engine boards) */
.heatstrip { display: flex; gap: 2px; margin-top: 6px; flex-wrap: wrap; max-width: 460px; }
.heatstrip .hs { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.hs-on { background: var(--green); }
.hs-off { background: var(--surface-2); border: 1px solid var(--line); }
.hs-pending { background: transparent; border: 1px dashed var(--accent); }
.hs-out { background: #ef4444; }
.tierpill { background: var(--accent-soft); color: var(--accent); font-size: 0.72rem;
  font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0 40px; margin-top: 40px;
  color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.site-footer .links { margin-left: auto; display: flex; gap: 16px; }
.site-footer a:hover { color: var(--text); }
