:root {
  color-scheme: light dark;

  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #1b1a1f;
  --muted: #6d6870;
  --line: #e7e2da;
  --glow: #7d5fe0;
  --shadow-rest: 0 1px 2px rgba(27, 26, 31, .04), 0 10px 24px -16px rgba(27, 26, 31, .18);
  --shadow-lift: 0 2px 4px rgba(27, 26, 31, .05), 0 22px 40px -18px rgba(27, 26, 31, .28);

  --wine: #7d1d3f;
  --quiz: #5b3fd6;
  --dixit: #a8680a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121116;
    --surface: #1b1a21;
    --ink: #f3f0ea;
    --muted: #9d98a2;
    --line: #2b2931;
    --glow: #6a50d0;
    --shadow-rest: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -16px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 24px 44px -18px rgba(0, 0, 0, .75);

    --wine: #e8859c;
    --quiz: #a392ff;
    --dixit: #f2c26b;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 var(--sans);
  color: var(--ink);
  background:
    radial-gradient(60rem 28rem at 50% -12rem, color-mix(in srgb, var(--glow) 9%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}

a { color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic .dot, .sprite .dot { fill: currentColor; stroke: none; }

.wrap {
  width: min(100% - 32px, 1040px);
  min-height: 100vh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 1.25rem/1 var(--serif);
  letter-spacing: -.01em;
  text-decoration: none;
  border-radius: 8px;
}
.brand-mark { width: 1.7rem; height: 1.7rem; stroke-width: 1.5; }

.lang {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang button {
  appearance: none;
  min-width: 42px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 .78rem/1 var(--sans);
  letter-spacing: .08em;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.lang button:focus-visible { outline-offset: 1px; }

/* Hero */

.hero {
  padding: clamp(40px, 9vw, 88px) 0 clamp(36px, 7vw, 64px);
  text-align: center;
}
.hero h1 {
  margin: 0 auto;
  max-width: 14ch;
  font: 500 clamp(2.5rem, 7.2vw, 4.4rem)/1.04 var(--serif);
  letter-spacing: -.025em;
  text-wrap: balance;
}
.lede {
  margin: 20px auto 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  text-wrap: balance;
}

/* Cards */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-bottom: 72px;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  /* an odd card out takes the whole row instead of sitting alone */
  .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 940px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .card:last-child:nth-child(odd) { grid-column: auto; }
}

.card {
  --c: var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--c) 9%, transparent), transparent 62%),
    var(--surface);
  box-shadow: var(--shadow-rest);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, border-color .25s;
  animation: rise .6s cubic-bezier(.2, .7, .2, 1) both;
}
.card--wine { --c: var(--wine); }
.card--quiz { --c: var(--quiz); }
.card--dixit { --c: var(--dixit); }
.card:nth-child(2) { animation-delay: 70ms; }
.card:nth-child(3) { animation-delay: 140ms; }

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--c) 40%, var(--line));
}
.card:has(.card-link:focus-visible) { outline: 2px solid var(--c); outline-offset: 3px; }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.tile {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, var(--surface));
}
.tile .ic { width: 1.7rem; height: 1.7rem; }

.chip {
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 11%, transparent);
  font: 600 .7rem/1.4 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.card-title {
  margin: 6px 0 0;
  font: 500 1.7rem/1.15 var(--serif);
  letter-spacing: -.015em;
}
.card-link { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.card-desc { margin: 0; color: var(--muted); font-size: .97rem; }

.card-end { margin-top: auto; padding-top: 10px; display: grid; gap: 4px; }

.card-host {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.host { font-size: .86rem; font-weight: 500; letter-spacing: .01em; overflow-wrap: anywhere; }

.go {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 11%, transparent);
  transition: background-color .25s, color .25s;
}
.go .ic { width: 1.1rem; height: 1.1rem; transition: transform .25s; }
.card:hover .go { background: var(--c); color: var(--surface); }
.card:hover .go .ic { transform: translateX(2px); }

.admin {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  font-size: .86rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.admin .ic { width: 1.05rem; height: 1.05rem; }
.admin-path { margin-left: auto; font-size: .8rem; opacity: .75; }
.admin:hover { color: var(--c); background: color-mix(in srgb, var(--c) 11%, transparent); }
.admin:focus-visible { outline-color: var(--c); outline-offset: 2px; }

/* Footer */

.foot { padding: 0 0 32px; color: var(--muted); font-size: .85rem; text-align: center; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover { transform: none; }
}
