/* =========================================================
   whyuxavier — портфоліо. Стилі.
   Кольори задано токенами; світла тема перевизначає їх.
   ========================================================= */

/* Палітра «Python з нуля»: світла тема за замовчуванням, темна — перемикачем у шапці */
:root {
  --bg: #f4f5fa;
  --bg-grad: #ecf1f8;          /* друга точка діагонального градієнта фону */
  --bg-2: #f7f8fc;             /* консоль / внутрішні поля */
  --surface: rgba(255, 255, 255, .74);   /* скло картки */
  --surface-2: #fbfcff;
  --border: rgba(60, 64, 100, .13);
  --border-strong: rgba(60, 64, 100, .24);
  --text: #23242e;
  --text-2: #43465a;
  --muted: #676a7d;
  --accent: #6f8ad6;
  --accent-strong: #5b77c7;
  --accent-ink: #ffffff;
  --accent-soft: rgba(111, 138, 214, .14);
  --blue: #4fae93;             /* другорядний акцент: м'ятний / успіх */
  --blue-soft: rgba(143, 209, 189, .22);
  --mint: #8fd1bd;
  --star: #d9aa3c;             /* золотий */
  --danger: #d0566a;

  --c-edu: #6f8ad6;
  --c-games: #d9aa3c;
  --c-tools: #4fae93;
  --c-other: #9a9caf;

  --radius: 16px;              /* картки */
  --radius-sm: 10px;           /* кнопки */
  --radius-pill: 20px;         /* чипи */
  --shadow: 0 4px 18px rgba(60, 64, 110, .08);
  --blur: blur(10px);
  --font: "Fixel Display", "Fixel Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1b1d23;
  --bg-grad: #1f2229;
  --bg-2: #181a1f;
  --surface: rgba(39, 42, 51, .76);
  --surface-2: #2a2d36;
  --border: rgba(255, 255, 255, .1);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #e6e7ef;
  --text-2: #c4c6d3;
  --muted: #9a9caf;
  --accent: #8fa6ee;
  --accent-strong: #a9bbf3;
  --accent-ink: #14161c;
  --accent-soft: rgba(143, 166, 238, .16);
  --blue: #6fcbb8;
  --blue-soft: rgba(111, 203, 184, .14);
  --mint: #6fcbb8;
  --star: #f0c96a;
  --danger: #ff8a9a;

  --c-edu: #8fa6ee;
  --c-games: #f0c96a;
  --c-tools: #6fcbb8;
  --c-other: #9a9caf;
  --shadow: 0 4px 18px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(135deg, var(--bg), var(--bg-grad)) fixed;
  background-color: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: 20px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.icon { width: 16px; height: 16px; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; }
.brand-mark rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.brand-mark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .brand-star { fill: var(--star); stroke: none; }

.header-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--text-2); font-size: .94rem;
  transition: background-color .15s, color .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-2); cursor: pointer; transition: border-color .15s, color .15s, background-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.info-btn { font: 700 15px/1 var(--mono); color: var(--accent); }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .88rem; border-radius: var(--radius-sm); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
/* Сітка на фоні всього сайту: зафіксована у вікні, «світло» йде за курсором */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
  /* --mx/--my: позиція курсора (script.js); сітка трохи зсувається, а «світло» йде за курсором */
  background-position: calc(-1px + var(--px, 0px)) calc(-1px + var(--py, 0px));
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at var(--mx, 62%) var(--my, 45%), #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 75% at var(--mx, 62%) var(--my, 45%), #000 20%, transparent 78%);
  opacity: .75;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: center; gap: 48px; padding-top: 28px; padding-bottom: 50px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font: 500 .82rem/1 var(--mono); color: var(--muted); letter-spacing: .02em;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.hero h1 {
  margin: 0 0 24px; font-size: clamp(1.7rem, 1.1rem + 2.1vw, 2.45rem); line-height: 1.18;
  letter-spacing: -.022em; font-weight: 700; text-wrap: balance;
}
.lead { margin: 0 0 26px; color: var(--text-2); font-size: 1.05rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-art { position: relative; padding: 0; width: 100%; max-width: 400px; justify-self: end; }

/* Порада дня / жарт над ілюстрацією */
.tip-card {
  position: relative; z-index: 2; margin: 0 0 16px 6px; max-width: 440px; width: fit-content;
  padding: 10px 12px 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.tip-head { display: flex; align-items: center; gap: 7px; font: 600 .72rem/1 var(--mono); color: var(--muted); letter-spacing: .03em; }
.tip-head .tip-ic { width: 15px; height: 15px; color: var(--star); flex: none; }
.tip-card.is-joke .tip-ic { color: var(--accent); }
.tip-next {
  margin-left: auto; display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: 7px; background: none; color: var(--muted); cursor: pointer;
}
.tip-next:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.tip-next svg { width: 14px; height: 14px; }
.tip-next[hidden] { display: none; }
.tip-card.is-loading .tip-head span, .tip-card.is-loading .tip-text { opacity: 0; }
.tip-text { margin: 6px 0 0; font-size: .9rem; line-height: 1.45; color: var(--text-2); }
/* «хвостик» бульбашки, що вказує на вікно */
.tip-card::after {
  content: ""; position: absolute; left: 30px; bottom: -7px; width: 12px; height: 12px;
  background: var(--surface); border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong);
  transform: rotate(45deg);
}
.hero-svg { display: block; width: 100%; height: auto; overflow: visible; }

.art-tag {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); box-shadow: var(--shadow);
  font-size: .76rem; color: var(--text-2); white-space: nowrap;
}
.art-tag--cats { right: 4%; bottom: 0; }
.art-tag i, .chip i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.art-tag i + i, .art-tag i { margin-left: 2px; }
.c-edu { background: var(--c-edu); } .c-games { background: var(--c-games); }
.c-tools { background: var(--c-tools); } .c-other { background: var(--c-other); }

/* SVG-ілюстрація: кольори з палітри сайту */
.w-frame { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.w-bar { fill: var(--surface-2); }
.w-dot1 { fill: #f28b82; opacity: .8; } .w-dot2 { fill: #f5c66b; opacity: .8; } .w-dot3 { fill: #81d4a3; opacity: .8; }
.w-url { fill: var(--bg); stroke: var(--border); }
.w-url-t { font: 500 10.5px var(--mono); fill: var(--muted); }
.code-bg { fill: var(--bg-2); stroke: var(--border); }
.code text { font: 11.5px var(--mono); fill: var(--text-2); }
.code .k { fill: var(--accent); } .code .f { fill: var(--blue); } .code .m { fill: var(--muted); font-style: italic; }
.code .caret { fill: var(--accent); }
.card-bg { fill: var(--surface-2); stroke: var(--border); }
.ln-strong { fill: var(--text-2); opacity: .55; }
.ln { fill: var(--muted); opacity: .35; }
.c-edu-f { fill: var(--c-edu); } .c-games-f { fill: var(--c-games); } .c-tools-f { fill: var(--c-tools); }
.pill-demo { fill: var(--blue-soft); stroke: var(--blue); stroke-opacity: .5; }
.pill-t { font: 600 9.5px var(--font); fill: var(--blue); }
.star-f { fill: var(--star); }
.code-ic { fill: none; stroke: var(--c-tools); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lbl { font: 10.5px var(--mono); fill: var(--muted); }
.contrib rect { fill: var(--accent); }
.contrib rect.l0 { fill: var(--border); opacity: .9; }

/* Одна коротка анімація при завантаженні: «дані приходять з API → картки з’являються → графік заповнюється» */
@media (prefers-reduced-motion: no-preference) {
  .a-code  { animation: rise .5s var(--ease) .05s backwards; }
  .a-card1 { animation: slideIn .5s var(--ease) .35s backwards; }
  .a-card2 { animation: slideIn .5s var(--ease) .5s backwards; }
  .a-card3 { animation: slideIn .5s var(--ease) .65s backwards; }
  .contrib rect { animation: pop .35s var(--ease) backwards; animation-delay: calc(.8s + var(--d, 0s)); }
  .art-tag, .tip-card { animation: rise .45s var(--ease) 1.1s backwards; }
  .tip-text.is-swapping { animation: fadeIn .3s var(--ease); }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } }
@keyframes pop { from { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } }

/* ---------- Projects ---------- */
.projects { padding-top: 24px; padding-bottom: 72px; outline: none; scroll-margin-top: 70px; }
.projects-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.projects-head h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.01em; }
.status { flex: none; margin: 0; font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-stars { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.status-stars svg { width: 14px; height: 14px; color: var(--star); }
.refresh-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.refresh-btn:hover { color: var(--text); border-color: var(--border-strong); }
.refresh-btn:disabled { cursor: default; opacity: .6; }
.refresh-btn .icon { width: 14px; height: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .refresh-btn.is-loading .icon { animation: spin .9s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Підказка «гортайте вниз» унизу hero: одна коротка анімація при завантаженні */
.scroll-cue {
  position: absolute; left: 50%; bottom: 12px; z-index: 2; translate: -50% 0;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  box-shadow: var(--shadow); transition: color .15s, border-color .15s;
}
.scroll-cue:hover { color: var(--text); border-color: var(--accent); }
.scroll-cue svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue { animation: cueBounce 1.2s var(--ease) 1.3s 2 both; }
}
@keyframes cueBounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(6px); } 70% { transform: translateY(-2px); } }

.link-btn {
  border: 0; background: none; padding: 2px 4px; color: var(--accent); cursor: pointer;
  font-size: inherit; font-weight: 600; border-radius: 6px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--radius-pill); background: transparent; color: var(--text-2);
  font-size: .9rem; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); }
.chip .count { font: 600 .75rem/1 var(--mono); color: var(--muted); }
.chip.is-active .count { color: var(--accent); }

.controls { display: flex; gap: 8px; flex: 1 1 320px; justify-content: flex-end; min-width: 0; }
.search {
  position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 320px; min-width: 0;
}
.search .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input, .sort select {
  width: 100%; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text); font-size: .9rem;
}
.search input { padding: 0 10px 0 34px; }
.search input::placeholder { color: var(--muted); }
.search input:focus, .sort select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sort { flex: 0 0 auto; }
.sort select {
  padding: 0 32px 0 10px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%238d93ab' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}

.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  font-size: .9rem; color: var(--text-2);
}
.notice[hidden] { display: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }

/* ---------- Card ---------- */
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow); overflow: hidden;
  transition: border-color .18s, transform .18s var(--ease), background-color .18s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card:focus-within { border-color: var(--accent); }
.card.is-featured { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
.card.is-featured::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--mint));
}
.card-media { aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; flex: 1; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { margin: 0; font-size: 1.04rem; line-height: 1.3; font-weight: 650; letter-spacing: -.005em; overflow-wrap: anywhere; }
.card-title a { text-decoration: none; }
.card-title a:focus-visible { outline: none; }
/* «Розтягнуте» посилання: уся картка клікабельна, без вкладених <a> */
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-title a:focus-visible::after { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: var(--radius); }
.featured-mark { flex: none; font: 600 .7rem/1 var(--mono); color: var(--accent); padding: 5px 7px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 6px; letter-spacing: .02em; }
.card-desc { margin: 0; color: var(--text-2); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc.is-missing { color: var(--muted); font-style: italic; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg-2);
  font-size: .76rem; color: var(--text-2); white-space: nowrap;
}
.tag i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.tag-demo { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); background: var(--blue-soft); }
.tag-lang .lang-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }

.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: auto; padding-top: 6px; font-size: .82rem; color: var(--muted); }
.card-meta .stars {
  position: relative; z-index: 2; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px;
  font-variant-numeric: tabular-nums; text-decoration: none; border-radius: 6px; padding: 2px 4px; margin: -2px -4px;
}
.card-meta .stars:hover { color: var(--text); background: var(--surface-2); }
.card-meta .stars svg { width: 14px; height: 14px; color: var(--star); }

.card-actions {
  position: relative; z-index: 2; /* вище за розтягнуте посилання */
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg-2);
}
.card-actions .primary-hint { flex: 1; min-width: 0; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.card-actions .primary-hint b { color: var(--text-2); font-weight: 600; }
.card-actions a { position: relative; z-index: 2; }

/* ---------- Skeleton / Empty ---------- */
.skeleton { pointer-events: none; }
.skeleton .sk { background: var(--surface-2); border-radius: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton .sk { animation: skPulse 1.4s ease-in-out infinite; }
}
@keyframes skPulse { 50% { opacity: .5; } }

.empty {
  text-align: center; padding: 48px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--text-2);
}
.empty[hidden] { display: none; }
.empty h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--text); }
.empty p { margin: 0 0 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .86rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding-top: 22px; padding-bottom: 28px; }
.footer-inner p { margin: 0; }
.site-footer a { color: var(--text-2); }

/* ---------- Dialog ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.dialog::backdrop { background: rgba(5, 6, 12, .62); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: 1.1rem; }
.dialog-body { padding: 16px 20px 20px; color: var(--text-2); font-size: .94rem; }
.dialog-body p { margin: 0 0 14px; }
.dialog-body h3 { margin: 0 0 8px; font-size: .95rem; color: var(--text); }
.dialog-body ul { margin: 0 0 18px; padding-left: 20px; }
.dialog-body .ai-note { margin: 14px 0 0; font-size: .8rem; color: var(--muted); }
.dialog-body li { margin-bottom: 6px; }
.dialog-body li::marker { color: var(--accent); }
.gh-star svg { color: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; padding-bottom: 36px; }
  .hero-text { max-width: none; }
  .hero-art { max-width: 420px; margin: 0 auto; justify-self: center; }
}
@media (max-width: 720px) {
  .toolbar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .toolbar > * { min-width: 0; max-width: 100%; }
  .controls { flex: none; justify-content: stretch; }
  .search { max-width: none; }
  .hide-sm { display: none; }
  .scroll-cue { display: none; } /* на телефоні зайва: кнопка «Дивитися проєкти» вже є */
}
@media (max-width: 520px) {
  .container { padding-inline: 16px; }
  .controls { flex-wrap: wrap; }
  .search { flex: 1 1 100%; }
  .sort { flex: 1 1 0; }
  .hero-inner { padding-top: 24px; padding-bottom: 28px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-art { max-width: 340px; }
  .tip-card { max-width: none; width: auto; margin-left: 0; }
  .tip-text { font-size: .86rem; }
  .art-tag { font-size: .7rem; padding: 5px 8px; }
  .art-tag--cats { right: 0; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .chip { flex: none; }
  .card-body { padding: 16px 16px 14px; }
  .card-actions { padding: 12px 16px; }
}
@media (max-width: 400px) {

}

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