/* skolag · výukové aplikace — sdílené styly mozaiky.
   Designový jazyk navazuje na kapaliny.html (Fyzika/Emu) — Fraunces+Geist, paleta amethyst/mint/peach. */

:root {
  --bg-base: #f7f4fb;
  --bg-card: #fff;
  --ink: #1e1a2e;
  --ink-soft: #2d2647;
  --muted: #6b6280;
  --muted-soft: #908a9e;

  --amethyst: #9d8ac9;
  --amethyst-deep: #5d4f8c;
  --amethyst-ink: #3d2c5c;
  --mint: #a4d4c2;
  --mint-deep: #3d7460;
  --mint-ink: #1f4d3a;
  --peach: #f5c9a8;
  --peach-deep: #c8895c;
  --peach-ink: #7a4a23;

  --tile-inactive: #e8e4ec;
  --tile-inactive-stroke: #d9d4dd;

  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--ink);
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.topbar__logo {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--amethyst) 0%, var(--mint) 50%, var(--peach) 100%);
  border-radius: 10px;
  color: white;
  font-weight: 700;
}
.topbar__brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.topbar__tagline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 4px;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.intro {
  text-align: center;
  max-width: 620px;
  margin-bottom: 40px;
}
.intro h1 {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.intro h1 .accent {
  font-style: italic;
  background: linear-gradient(135deg, var(--amethyst-deep) 0%, var(--mint-deep) 50%, var(--peach-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro p {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0;
}

/* ── Mozaika ────────────────────────────────────────────────────────────── */

.mosaic {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.5vw, 18px);
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .mosaic { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, filter 0.18s ease;
}
.tile svg.tile__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.tile__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12% 8% 8%;
  pointer-events: none;
}
.tile__icon {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1;
  margin-bottom: 2px;
}
.tile__name {
  font-weight: 700;
  font-size: clamp(0.78rem, 1.2vw, 0.98rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.tile__subtitle {
  font-size: clamp(0.58rem, 0.9vw, 0.72rem);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  line-height: 1.15;
  margin-top: 2px;
}

/* Inactive (decorative) tile */
.tile--inactive svg.tile__shape {
  fill: var(--tile-inactive);
  stroke: var(--tile-inactive-stroke);
  stroke-width: 1;
}

/* Active tiles — colored outline + colored content */
.tile--active {
  cursor: pointer;
}
.tile--active:hover { transform: translateY(-3px); filter: brightness(1.02); }
.tile--active:focus-visible {
  outline: 3px solid var(--ink-soft);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.tile--fyzika svg.tile__shape {
  fill: white;
  stroke: var(--amethyst);
  stroke-width: 2;
}
.tile--fyzika .tile__icon { color: var(--amethyst-deep); }
.tile--fyzika .tile__name { color: var(--amethyst-ink); }
.tile--fyzika .tile__subtitle { color: var(--amethyst-deep); }

.tile--matematika svg.tile__shape {
  fill: white;
  stroke: var(--mint-deep);
  stroke-width: 2;
}
.tile--matematika .tile__icon { color: var(--mint-deep); }
.tile--matematika .tile__name { color: var(--mint-ink); }
.tile--matematika .tile__subtitle { color: var(--mint-deep); }

.tile--informatika svg.tile__shape {
  fill: white;
  stroke: var(--peach-deep);
  stroke-width: 2;
}
.tile--informatika .tile__icon { color: var(--peach-deep); }
.tile--informatika .tile__name { color: var(--peach-ink); }
.tile--informatika .tile__subtitle { color: var(--peach-deep); }

/* Back link on sub-pages */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--ink-soft); }
