/* Mirabolo: the umbrella site of the public games and apps. Colours as tokens, light and dark. */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --bg: #0b0a1a;
  --glow-1: rgba(139, 92, 246, 0.32);
  --glow-2: rgba(34, 211, 238, 0.2);
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f3ff;
  --text-muted: #a9a5cc;
  --link: #67e8f9;
  --accent: #8b5cf6;
  --gradient: linear-gradient(120deg, #8b5cf6 0%, #6366f1 35%, #22d3ee 70%, #f472b6 100%);
  /* Darker stops than --gradient: white text keeps a 4.5:1 contrast along the whole button. */
  --button-gradient: linear-gradient(120deg, #7c3aed 0%, #4f46e5 55%, #0e7490 100%);
  --on-accent: #ffffff;
  --radius: 20px;

  --gutter-left: max(20px, env(safe-area-inset-left));
  --gutter-right: max(20px, env(safe-area-inset-right));
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f4ff;
    --glow-1: rgba(139, 92, 246, 0.2);
    --glow-2: rgba(34, 211, 238, 0.16);
    --surface: rgba(255, 255, 255, 0.75);
    --surface-strong: rgba(255, 255, 255, 0.95);
    --border: rgba(22, 20, 43, 0.1);
    --text: #16142b;
    --text-muted: #5b5880;
    --link: #0e7490;
  }
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60vmax 40vmax at 10% -10%, var(--glow-1), transparent 70%),
    radial-gradient(50vmax 40vmax at 100% 0%, var(--glow-2), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 var(--gutter-right) 0 var(--gutter-left);
}

/* ---- Header and footer */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand img {
  width: 34px;
  height: 34px;
}

.lang {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

main {
  flex: 1;
}

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.site-footer a {
  color: var(--text-muted);
}

/* ---- Home */

.hero {
  padding: 48px 0 32px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
}

.hero h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0;
  max-width: 36em;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 20px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.app h2 {
  margin: 0;
  font-size: 1.5rem;
}

.app p {
  margin: 0;
  color: var(--text-muted);
}

.app ul {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-muted);
}

.badge {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.button {
  align-self: flex-start;
  margin-top: 4px;
  padding: 12px 22px;
  border-radius: 14px;
  background: var(--button-gradient);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}

/* ---- Legal pages */

.legal {
  max-width: 44em;
  padding-top: 24px;
}

.legal h1 {
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  margin: 16px 0 8px;
}

.legal h2 {
  font-size: 1.35rem;
  margin: 40px 0 12px;
}

.legal h3 {
  font-size: 1.1rem;
  margin: 28px 0 8px;
}

.legal .updated {
  color: var(--text-muted);
  margin: 0 0 24px;
}

.legal address {
  font-style: normal;
}

.legal dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0;
}

.legal dt {
  font-weight: 600;
}

.legal dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Wide tables scroll inside themselves: the page never gets wider than the screen. */
.table {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--surface-strong);
}

code {
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* A phone: each row becomes a card, every value under the name of its column. */
@media (max-width: 600px) {
  .table {
    overflow: visible;
  }

  .table table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
  }

  .table thead {
    display: none;
  }

  .table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }

  .table tr:last-child {
    border-bottom: 0;
  }

  .table td {
    padding: 4px 0;
    border: 0;
  }

  .table td:first-child {
    font-weight: 700;
  }

  .table td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
  }
}

@media (max-width: 520px) {
  .legal dl {
    grid-template-columns: 1fr;
  }

  .legal dd {
    margin-bottom: 8px;
  }
}
