/* ---------- Header: slim, translucent ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 245, 247, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--ink); }
.brand__mark { display: block; width: 30px; height: 30px; border-radius: 8px; }
.brand__name { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.02em; }
.site-nav { display: flex; gap: 0.15rem; }
.site-nav a {
  padding: 0.35rem 0.8rem; border-radius: 999px; text-decoration: none;
  color: var(--ink); font-size: 0.88rem; opacity: 0.8;
}
.site-nav a:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }
.site-nav a[aria-current="page"] { opacity: 1; font-weight: 600; }
.nav-toggle {
  display: none; border: 0; background: transparent;
  border-radius: 8px; padding: 0.4rem 0.7rem; font-size: 1.1rem; cursor: pointer; color: var(--ink);
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; padding: 0.5rem 1.25rem 1rem;
    background: rgba(245, 245, 247, 0.96); border-bottom: 1px solid var(--line);
  }
  .site-header.is-open .site-nav { display: flex; }
  .site-nav a { padding: 0.7rem 0.5rem; font-size: 1rem; }
}

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-block; padding: 0.7rem 1.35rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  text-decoration: none; border: 0; cursor: pointer; font-size: 1rem;
}
.btn:hover { filter: brightness(1.1); }
.btn--ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

.chip {
  display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px;
  background: rgba(0, 0, 0, 0.06); color: var(--ink-soft); font-size: 0.78rem; font-weight: 500;
}
.chip--type { background: var(--ink); color: #fff; }
.chip--soon { background: #fff3e0; color: #8a4b00; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; }
.filter {
  border: 0; background: rgba(0, 0, 0, 0.06); color: var(--ink);
  border-radius: 999px; padding: 0.4rem 1rem; font: inherit; font-size: 0.9rem;
  cursor: pointer;
}
.filter:hover { background: rgba(0, 0, 0, 0.1); }
.filter[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section--tint { background: #fff; }
.section__head { max-width: 40rem; margin-bottom: 2.5rem; }
.section__head p { color: var(--ink-soft); margin: 0; font-size: 1.15rem; }

.breadcrumb { font-size: 0.9rem; color: var(--ink-soft); margin: 1.5rem 0 0.5rem; }
.breadcrumb a { color: var(--ink-soft); }
.lede { font-size: 1.25rem; color: var(--ink-soft); max-width: 60ch; }
.empty { color: var(--ink-soft); padding: 1.5rem; border: 1.5px dashed var(--line); border-radius: var(--radius); }

/* ---------- Topic tiles (periodic-table style) ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.tile {
  --tile-color: var(--g-foundations);
  display: flex; flex-direction: column; justify-content: space-between; gap: 0.6rem;
  min-height: 150px; padding: 0.9rem 1rem;
  background: var(--card); border-radius: 18px;
  color: var(--ink); text-decoration: none;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), background 0.2s ease, color 0.2s ease;
}
.tile[data-group="physical"] { --tile-color: var(--g-physical); }
.tile[data-group="inorganic"] { --tile-color: var(--g-inorganic); }
.tile__sym { font-size: 2.7rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1; color: var(--tile-color); }
.tile__name { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.tile__count { font-size: 0.78rem; color: var(--ink-soft); }
.tile:hover, .tile:focus-visible { transform: scale(1.03); background: var(--tile-color); color: #fff; }
.tile:hover .tile__sym, .tile:hover .tile__count,
.tile:focus-visible .tile__sym, .tile:focus-visible .tile__count { color: #fff; }

/* ---------- Level cards ---------- */
.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.75rem; }
.level {
  display: flex; flex-direction: column; gap: 0.35rem; padding: 1.4rem 1.4rem 1.6rem;
  background: #fff; border-radius: 18px;
  color: var(--ink); text-decoration: none; transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
}
.level:hover { transform: scale(1.02); }
.level__short { font-size: 2.4rem; font-weight: 650; letter-spacing: -0.04em; color: var(--accent); line-height: 1; margin-bottom: 0.5rem; }
.level__name { font-weight: 600; }
.level__blurb { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Activity cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; background: var(--card);
  border-radius: 24px; overflow: hidden;
  color: var(--ink); text-decoration: none; transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
}
a.card:hover { transform: scale(1.015); }
.section--tint .card { background: var(--paper); }
.card__thumb {
  --tile-color: var(--g-foundations);
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--stage-bg);
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card--soon .card__thumb { filter: saturate(0.4); }
.card__body { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.2rem 1.4rem 1.5rem; flex: 1; }
.card__title { font-size: 1.2rem; margin: 0; line-height: 1.2; }
.card__summary { font-size: 0.95rem; color: var(--ink-soft); margin: 0; flex: 1; }
.card__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ---------- Ad slots (reserved space = no layout shift) ---------- */
.ad-slot { margin: 2rem auto; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.ad-slot--leaderboard { width: min(100%, 970px); min-height: 100px; }
.ad-slot--rectangle { width: min(100%, 336px); min-height: 280px; }
.ad-slot--debug {
  border: 1.5px dashed #b0b0b8; border-radius: 12px; color: #8a8a92;
  font-size: 0.8rem; letter-spacing: 0.04em; background: rgba(0, 0, 0, 0.02);
}

/* ---------- Activity page shell ---------- */
.activity { padding-bottom: 3rem; }
.game-shell {
  min-height: 420px; background: var(--card);
  border-radius: var(--radius); margin: 1.25rem 0;
}
.game-shell__placeholder { display: grid; place-items: center; min-height: 420px; margin: 0; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper); color: var(--ink-soft); padding: 3rem 0 2rem; margin-top: 2rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer strong { color: var(--ink); }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: 0.75rem; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.site-footer__fine { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.8rem; }
@media (max-width: 720px) { .site-footer__grid { grid-template-columns: 1fr; } }
