/* Portfolio – jeden plik CSS, bez frameworka. Najpierw telefon, potem szersze ekrany. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #16212e;
  --muted: #4a5868;
  --border: #d9e0e8;
  --hero: #0f2a43;
  --hero-text: #ffffff;
  --hero-muted: #c9d6e3;
  --primary: #0b5cad;
  --primary-hover: #084a8c;
  --tag-bg: #e8edf3;
  --tag-text: #26364a;
  --featured: #8a4b00;
  --featured-bg: #fff1dc;
  --hack: #5b2a86;
  --hack-bg: #f0e6fa;
  --focus: #f5a623;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 33 51 / 6%), 0 6px 20px rgb(16 33 51 / 6%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1520;
    --surface: #152131;
    --text: #e8eef5;
    --muted: #a9b7c6;
    --border: #2a3a4e;
    --hero: #0a1a2b;
    --primary: #4c9df0;
    --primary-hover: #74b4f5;
    --tag-bg: #22324a;
    --tag-text: #d6e2ee;
    --featured: #ffc77a;
    --featured-bg: #3a2a12;
    --hack: #d9b8ff;
    --hack-bg: #2e1f42;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--surface); color: var(--text);
  padding: 10px 14px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

.icon { flex: none; width: 18px; height: 18px; }

/* Nagłówek */
.hero { background: var(--hero); color: var(--hero-text); padding: 40px 0 32px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 6vw, 2.8rem); line-height: 1.15; letter-spacing: -0.01em; }
.tagline { margin: 0 0 22px; max-width: 46rem; font-size: clamp(1.05rem, 3.6vw, 1.25rem); color: var(--hero-muted); }

.contact { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 16px;
  border: 1px solid rgb(255 255 255 / 35%); border-radius: 999px;
  color: var(--hero-text); text-decoration: none; font-weight: 600;
  overflow-wrap: anywhere;
}
.chip:hover { background: rgb(255 255 255 / 12%); color: var(--hero-text); }

/* Siatka projektów */
main.wrap { padding-top: 28px; padding-bottom: 40px; outline: none; }
.section-title { margin: 0 0 16px; font-size: 1.35rem; }
.count { color: var(--muted); font-weight: 400; }

.grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 0; padding: 0; list-style: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
}
.card article { display: flex; flex-direction: column; width: 100%; }
.card--featured { border: 2px solid var(--featured); }

.thumb { display: block; aspect-ratio: 16 / 10; background: var(--tag-bg); border-bottom: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 16px 18px; }
.card h3 { margin: 0 0 6px; font-size: 1.25rem; line-height: 1.25; }
.problem { margin: 0 0 12px; color: var(--muted); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badges:empty { display: none; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.01em;
}
.badge .icon { width: 14px; height: 14px; }
.badge--featured { background: var(--featured-bg); color: var(--featured); }
.badge--hack { background: var(--hack-bg); color: var(--hack); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.tags li {
  padding: 2px 9px; border-radius: 6px;
  background: var(--tag-bg); color: var(--tag-text);
  font-size: 0.82rem; font-weight: 600;
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-weight: 650; text-decoration: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn--primary { flex: 1 1 100%; background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.actions .btn:not(.btn--primary) { flex: 1 1 0; }
@media (prefers-color-scheme: dark) {
  .btn--primary, .btn--primary:hover { color: #08111c; }
}

.note { margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }

/* Stopka */
.footer { border-top: 1px solid var(--border); padding: 24px 0 36px; color: var(--muted); font-size: 0.95rem; }
.footer p { margin: 0 0 6px; }
.footer strong { color: var(--text); }

.notfound { padding-top: 60px; }

/* Szersze ekrany */
@media (min-width: 640px) {
  .wrap { padding: 0 24px; }
  main.wrap { padding-top: 40px; padding-bottom: 56px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .card--featured { grid-column: span 2; }
  .card--featured article { flex-direction: row; }
  .card--featured .thumb { flex: 0 0 55%; border-bottom: 0; border-right: 1px solid var(--border); aspect-ratio: auto; }
  .card--featured .card-body { padding: 22px; }
  .card--featured .btn--primary { flex: 0 1 auto; }
  .card--featured .actions .btn:not(.btn--primary) { flex: 0 1 auto; }
  .hero { padding: 56px 0 44px; }
}

@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(6, 1fr); }
  .card { grid-column: span 2; }
  .card--featured { grid-column: span 3; }
  .card--featured article { flex-direction: column; }
  .card--featured .thumb { flex: none; border-right: 0; border-bottom: 1px solid var(--border); aspect-ratio: 16 / 10; }
  .card--featured h3 { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
}
