/* Spaceberries — shared dark-cosmic theme for section/listing pages.
   Same design language as the homepage (index.css). Link as /theme.css. */

:root {
  --bg: #f5f5f7;
  --bg-2: #ececf0;
  --surface: #ffffff;
  --hairline: rgba(0,0,0,0.10);
  --hairline-strong: rgba(0,0,0,0.16);

  --text: #1d1d1f;
  --text-mid: #6e6e73;
  --muted: #86868b;

  --berry: #b023d6;
  --violet: #6f17de;
  --lime: #b023d6;
  --cyan: #d92cc4;
  --gold: #ff3d9a;
  --tangerine: #c2410c;
  --ink-on-accent: #ffffff;

  --font-display: 'Geist', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, -apple-system, sans-serif;

  --shell: 1080px;
  --radius-card: 1.1rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(60rem 40rem at 88% -14%, rgba(0,113,227,0.06), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.5rem); }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem clamp(1.1rem, 4vw, 2.5rem);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px) saturate(1.8);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.03em; }
.brand-dot {
  width: 1.5rem; height: 1.4rem;
  background: url(/brand/mark.svg) no-repeat center / contain;
}
.back-link { color: var(--text-mid); font-weight: 500; font-size: 0.9rem; transition: color 0.15s; }
.back-link:hover { color: var(--lime); }

/* ---- Page header ---- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  padding: clamp(2.5rem, 7vw, 4.5rem) 0 1.5rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.page-head h1 { font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 800; }
.page-head .meta { text-align: right; max-width: 18rem; color: var(--text-mid); font-size: 0.92rem; line-height: 1.5; }
.page-head .count { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.8rem); color: var(--lime); line-height: 1; margin-bottom: 0.3rem; }

/* ---- Card grid ---- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem; padding-bottom: 2rem;
}
.tile {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.15rem; border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--hairline);
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), border-color 0.25s, box-shadow 0.25s;
}
.tile:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklch, var(--cat, var(--berry)) 55%, transparent);
  box-shadow: 0 18px 38px -20px oklch(0.1 0.05 300 / 0.9), 0 0 0 1px color-mix(in oklch, var(--cat, var(--berry)) 28%, transparent);
}
.tile .ico {
  flex-shrink: 0; width: 48px; height: 48px; display: grid; place-items: center;
  font-size: 1.55rem; line-height: 1; white-space: nowrap; overflow: hidden;
  border-radius: 0.75rem;
  background: rgba(0,0,0,0.04); border: 1px solid var(--hairline);
  box-shadow: inset 0 0 20px color-mix(in oklch, var(--cat, var(--berry)) 22%, transparent);
}
/* two-emoji icons: shrink so both fit inside the tile instead of spilling out */
.tile .ico.duo { font-size: 1.05rem; letter-spacing: -0.06em; }
.tile .body { min-width: 0; }
.tile .t-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.tile .t-desc { color: var(--text-mid); font-size: 0.85rem; margin-top: 0.1rem; }
.tile .t-tag {
  display: inline-block; margin-top: 0.45rem;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem; border-radius: 999px;
  color: var(--cat, var(--berry));
  background: color-mix(in oklch, var(--cat, var(--berry)) 16%, transparent);
  border: 1px solid color-mix(in oklch, var(--cat, var(--berry)) 35%, transparent);
}

/* category accent (set --cat on .tile via [data-cat]) */
[data-cat="klassiker"] { --cat: var(--gold); }
[data-cat="action"]    { --cat: var(--tangerine); }
[data-cat="puslespill"]{ --cat: var(--cyan); }
[data-cat="strategi"]  { --cat: var(--violet); }
[data-cat="sport"]     { --cat: var(--lime); }
[data-cat="kortspill"] { --cat: var(--berry); }

/* ---- Footer ---- */
.site-foot {
  border-top: 1px solid var(--hairline); margin-top: 2rem;
  padding: 2rem 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  color: var(--muted); font-size: 0.85rem;
}
.site-foot .brand { font-size: 0.95rem; }
.site-foot a:hover { color: var(--lime); }

/* ---- Reveals (network-free; never gets stuck hidden) ---- */
html.js [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
html.js [data-reveal].in { opacity: 1; transform: none; }

@media (max-width: 620px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head .meta { text-align: left; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; }
}
