/* VladikGameStudio — спільні стилі: кольори з гри Name a Country (бежева суша, синій океан, жовтий акцент),
   шрифти Dela Gothic One (великі заголовки) + Onest (усе інше). Світла тема = суша, темна = океан. */
:root {
  --paper: #f6dcc3;
  --sheet: #fff8f0;
  --sheet-2: #fbeddd;
  --ink: #13284a;
  --ink-soft: #46506a;
  --line: rgba(19, 40, 74, .18);
  --rule: #e2c9b0;
  --ocean: #1e3a5f;
  --sun: #ffd166;
  --sun-ink: #13284a;
  --leaf: #1f8f4e;
  --amber: #a85400;
  --teal: #0b7068;
  --ok: #17733f;
  --ok-bg: #e2f2e7;
  --no: #b3261e;
  --no-bg: #fbe5e2;
  --shadow: 0 18px 40px -18px rgba(19, 40, 74, .45);

  --f-display: "Dela Gothic One", "Arial Black", "Segoe UI Black", system-ui, sans-serif;
  --f-body: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f2240; --sheet: #152b4d; --sheet-2: #1c3760; --ink: #f6dcc3; --ink-soft: #b8c2d6;
    --line: rgba(246, 220, 195, .18); --rule: #2c4670; --ocean: #1e3a5f; --sun: #ffd166; --sun-ink: #13284a;
    --leaf: #39d07f; --amber: #f3b45a; --teal: #5fd3c9; --ok: #6be39b; --ok-bg: #143523; --no: #ff9d94; --no-bg: #3d1d1d;
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f2240; --sheet: #152b4d; --sheet-2: #1c3760; --ink: #f6dcc3; --ink-soft: #b8c2d6;
  --line: rgba(246, 220, 195, .18); --rule: #2c4670; --ocean: #1e3a5f; --sun: #ffd166; --sun-ink: #13284a;
  --leaf: #39d07f; --amber: #f3b45a; --teal: #5fd3c9; --ok: #6be39b; --ok-bg: #143523; --no: #ff9d94; --no-bg: #3d1d1d;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: -1px -1px;
  color: var(--ink);
  font: 400 17px/1.55 var(--f-body);
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding-block: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; min-height: 44px; }
.brand__mark {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--ocean); color: var(--sun);
  display: grid; place-items: center;
  font: 16px/1 var(--f-display); letter-spacing: .02em;
  box-shadow: inset 0 0 0 2px var(--sun);
}
.nav { display: flex; gap: 6px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 16px;
  border: 1.5px solid transparent;
}
.nav a:hover { border-color: var(--ink); }
.nav a[aria-current="page"], .nav a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* ---------- хлібні крихти ---------- */
.crumbs { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 15px; color: var(--ink-soft); }
.crumbs li + li::before { content: "/"; margin: 0 10px; opacity: .6; }
.crumbs a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.crumbs a:hover { color: var(--ink); }

/* ---------- великий заголовок сторінки ---------- */
.hero { padding-block: 32px 44px; }
.hero__title {
  margin: 0;
  font: 400 clamp(30px, 7.6vw, 92px)/.98 var(--f-display);
  letter-spacing: -.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.hero__title span { display: block; }
.hero__lead { margin: 22px 0 0; max-width: 36em; font-size: clamp(17px, 2vw, 20px); color: var(--ink-soft); }
.hero__lead b { color: var(--ink); font-weight: 700; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 2px solid var(--ink); padding-top: 14px; }
.section-head h2 { margin: 0; font: 700 15px/1.3 var(--f-body); letter-spacing: .02em; }
.section-head p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 30px;
  border: 0; border-radius: 14px;
  background: var(--sun); color: var(--sun-ink);
  font: 400 19px/1 var(--f-display); text-decoration: none; letter-spacing: .01em;
  box-shadow: 0 0 0 2.5px var(--ink), 0 5px 0 0 var(--ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 2.5px var(--ink), 0 6px 0 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 2.5px var(--ink), 0 1px 0 0 var(--ink); }

/* ---------- плитки-посилання (дисципліни, уроки) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.tile {
  position: relative;
  display: grid; gap: 12px; align-content: start;
  padding: 24px 24px 26px;
  border-radius: 18px;
  background: var(--sheet);
  box-shadow: 0 0 0 2.5px var(--ink), var(--shadow);
  text-decoration: none;
  transition: transform .2s ease;
}
.tile:hover { transform: translateY(-3px); }
.tile__kicker { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.tile__title { margin: 0; font: 400 clamp(26px, 3.2vw, 34px)/1.05 var(--f-display); letter-spacing: -.01em; }
.tile__text { margin: 0; color: var(--ink-soft); }
.tile__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.tile__meta li { padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--ink); font-size: 14px; font-weight: 500; }
.tile__go {
  justify-self: start; margin-top: 6px;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border-radius: 12px; background: var(--sun); color: var(--sun-ink);
  font-weight: 700; box-shadow: 0 0 0 2px var(--ink);
}
.tile--soon { background: transparent; box-shadow: none; border: 2px dashed var(--line); color: var(--ink-soft); }
.tile--soon:hover { transform: none; }

/* ---------- підвал ---------- */
.foot { border-top: 2px solid var(--ink); margin-top: 72px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 22px 32px; font-size: 15px; color: var(--ink-soft); }
.foot b { color: var(--ink); }

@media (max-width: 820px) {
  body { background-size: 64px 64px; }
  .hero { padding-block: 20px 32px; }
}
@media (max-width: 480px) {
  .btn { width: 100%; }
  .brand__name { display: none; }
  .tile { padding: 20px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .tile:hover, .btn:hover { transform: none; }
}

[hidden] { display: none !important; }

/* ---------- кнопка тихої музики (assets/music.js) ---------- */
.vgs-music {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  width: 52px; height: 52px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--ocean); color: var(--sun);
  box-shadow: 0 0 0 2.5px var(--ink), 0 10px 24px -10px rgba(0, 0, 0, .55);
  cursor: pointer;
  transition: transform .15s ease, background .2s ease;
}
.vgs-music:hover { transform: translateY(-2px); }
.vgs-music__note { font: 700 24px/1 var(--f-body); }
.vgs-music__eq { display: none; gap: 3px; align-items: flex-end; height: 20px; }
.vgs-music__eq i { width: 4px; height: 40%; border-radius: 2px; background: currentColor; animation: vgs-eq 1.4s ease-in-out infinite; }
.vgs-music__eq i:nth-child(2) { animation-delay: -.45s; }
.vgs-music__eq i:nth-child(3) { animation-delay: -.9s; }
.vgs-music[aria-pressed="true"] { background: var(--sun); color: var(--sun-ink); }
.vgs-music.is-playing .vgs-music__note { display: none; }
.vgs-music.is-playing .vgs-music__eq { display: flex; }
@keyframes vgs-eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .vgs-music__eq i { animation: none; height: 70%; } }
.foot { padding-bottom: 64px; }
@media (max-width: 520px) {
  .vgs-music { width: 44px; height: 44px; right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .vgs-music__note { font-size: 20px; }
}
