/* ==========================================================================
   mziarko.poznan.pl — dr hab. Michał Ziarko, prof. UAM
   ========================================================================== */

:root {
  --bg: #f6f4ef;
  --bg-alt: #eeebe3;
  --surface: #ffffff;
  --text: #1d2621;
  --muted: #5a665f;
  --line: #e2ddd2;
  --accent: #2c6b52;
  --accent-strong: #1f4f3c;
  --accent-soft: #e2eee7;
  --accent-contrast: #ffffff;
  --warm: #c98b5b;
  --shadow: 0 1px 2px rgba(29, 38, 33, .04), 0 8px 24px rgba(29, 38, 33, .06);
  --shadow-lg: 0 2px 4px rgba(29, 38, 33, .05), 0 24px 48px rgba(29, 38, 33, .10);
  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111613;
    --bg-alt: #161d19;
    --surface: #1a221e;
    --text: #e7ece9;
    --muted: #a0aba5;
    --line: #2a3530;
    --accent: #7cc5a1;
    --accent-strong: #a3dcbf;
    --accent-soft: #1d3329;
    --accent-contrast: #0f1a14;
    --warm: #e0a979;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 600; }
p { margin: 0 0 1.1em; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .6em;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; font-weight: 600; }

.container { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }
.narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }

.lead { font-size: 1.2rem; color: var(--muted); line-height: 1.65; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }
.brand:hover { color: var(--text); }
.brand-mark {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-contrast);
  font-family: var(--font-serif); font-size: 1.45rem; line-height: 1;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.08rem; white-space: nowrap; }
.brand-sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: .95rem; font-weight: 500;
  transition: background-color .2s, color .2s;
}
.nav-list a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.nav-list a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-list .nav-cta a { background: var(--accent); color: var(--accent-contrast); margin-left: 8px; }
.nav-list .nav-cta a:hover { background: var(--accent-strong); color: var(--accent-contrast); }
.nav-list .nav-cta a[aria-current="page"] { background: var(--accent-strong); color: var(--accent-contrast); }

.nav-toggle {
  display: none; flex: none;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 72px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px 20px;
    display: none;
  }
  .site-nav.is-open { display: block; animation: slideDown .2s ease-out; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list a { padding: 12px 16px; border-radius: 12px; font-size: 1.05rem; }
  .nav-list .nav-cta a { margin: 8px 0 0; text-align: center; }
}
@media (max-width: 400px) { .brand-sub { display: none; } }

@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: .98rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s, background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-contrast); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(48px, 8vw, 104px) 0 clamp(48px, 7vw, 88px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: auto -10% -40% auto; width: 620px; height: 620px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.35fr .65fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero h1 .title-pre { display: block; font-size: .5em; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-bottom: .3em; }
.hero .lead { max-width: 36em; margin-bottom: 2rem; }

.portrait { position: relative; justify-self: center; width: min(100%, 280px); }
.portrait::before {
  content: ""; position: absolute; inset: 18px -18px -18px 18px;
  border-radius: 28px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.portrait img {
  position: relative; width: 100%; aspect-ratio: 239 / 300; object-fit: cover;
  border-radius: 28px; box-shadow: var(--shadow-lg);
}
.portrait-badge {
  position: absolute; left: -22px; bottom: 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; box-shadow: var(--shadow);
  font-size: .8rem; line-height: 1.35;
}
.portrait-badge strong { display: block; color: var(--accent); font-size: .95rem; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(70%, 240px); margin-bottom: 8px; }
  .portrait-badge { left: auto; right: -30px; }
}

/* ---------- Page header (subpages) ---------- */
.page-head { padding: clamp(44px, 7vw, 88px) 0 clamp(28px, 4vw, 44px); }
.page-head h1 { margin-bottom: .3em; }
.page-head .lead { max-width: 40em; margin: 0; }

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head p { color: var(--muted); }

.prose p { font-size: 1.06rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .3em; }
.prose li::marker { color: var(--accent); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.two-col > .sticky { position: sticky; top: 100px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } .two-col > .sticky { position: static; } }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
a.card { color: var(--text); text-decoration: none; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .97rem; margin-bottom: 1em; }
.card .card-link { margin-top: auto; font-weight: 600; font-size: .92rem; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
a.card:hover .card-link svg { transform: translateX(3px); }
.card-link svg { width: 16px; height: 16px; transition: transform .2s; }

.icon-bubble {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 18px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.icon-bubble svg { width: 24px; height: 24px; }

/* ---------- Info lists (hours, contact, company) ---------- */
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.info-card h3 { display: flex; align-items: center; gap: 10px; }
.info-card h3 svg { width: 22px; height: 22px; color: var(--accent); flex: none; }

.hours { list-style: none; margin: 0 0 1rem; padding: 0; }
.hours li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.hours li:last-child { border-bottom: 0; }
.hours span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); color: var(--accent-strong);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .95rem; font-weight: 500; margin: 0;
}
.note svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list .icon-bubble { margin: 0; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.contact-list .icon-bubble svg { width: 20px; height: 20px; }
.contact-list small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.contact-list a, .contact-list .value { font-weight: 600; font-size: 1.08rem; color: var(--text); text-decoration: none; }
.contact-list a:hover { color: var(--accent); }

.data-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: .97rem; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .data-list { grid-template-columns: 1fr; gap: 2px; }
  .data-list dd { margin-bottom: 10px; }
}

/* ---------- Highlight / certificate banner ---------- */
.highlight {
  display: flex; gap: 24px; align-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--accent-contrast);
  border-radius: var(--radius); padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-lg);
}
.highlight h2, .highlight h3 { color: inherit; margin-bottom: .3em; }
.highlight p { margin: 0; opacity: .9; }
.highlight .btn { background: var(--accent-contrast); color: var(--accent-strong); margin-left: auto; flex: none; }
.highlight .btn:hover { transform: translateY(-1px); }
.highlight-icon {
  flex: none; width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent-contrast) 16%, transparent);
}
.highlight-icon svg { width: 32px; height: 32px; }
@media (max-width: 720px) {
  .highlight { flex-direction: column; align-items: flex-start; }
  .highlight .btn { margin-left: 0; }
}

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.chips li {
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 500; font-size: .95rem;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline > li { position: relative; padding: 0 0 36px 48px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: 4px; top: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.section-alt .timeline > li::before { background: var(--bg-alt); }
.timeline .year { display: inline-block; font-weight: 700; color: var(--accent); font-size: .9rem; letter-spacing: .06em; margin-bottom: 6px; }
.timeline h3 { margin-bottom: .45em; }
.timeline p { color: var(--muted); }
.timeline .card { padding: 24px 26px; }

.reviewers { margin-top: 4px; }
.reviewers small { display: block; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: .75rem; color: var(--muted); margin-bottom: 6px; }
.reviewers ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.reviewers li { background: var(--accent-soft); color: var(--accent-strong); border-radius: 8px; padding: 4px 10px; font-size: .9rem; }

/* Course list */
.year-group { display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.year-group:first-child { border-top: 0; padding-top: 0; }
.year-group > h3 {
  font-family: var(--font-serif); font-size: 2rem; font-weight: 500; color: var(--accent);
  margin: 0; line-height: 1; position: sticky; top: 96px; align-self: start;
}
.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.course {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 22px;
}
.course .when { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--warm); }
.course .what { font-weight: 600; margin: 4px 0 6px; line-height: 1.5; }
.course .who { font-size: .92rem; color: var(--muted); margin: 0; }
@media (max-width: 640px) {
  .year-group { grid-template-columns: 1fr; gap: 12px; }
  .year-group > h3 { position: static; font-size: 1.6rem; }
}

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .lead { max-width: 34em; margin: 0 auto 1.6rem; }
.cta-band .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 56px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-grid h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 14px; font-weight: 600; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-grid p { color: var(--muted); margin: 12px 0 0; max-width: 30em; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  border-top: 1px solid var(--line); padding-top: 20px;
  font-size: .82rem; color: var(--muted);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

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

@media print {
  .site-header, .site-footer, .btn, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
}
