/* ------------------------------------------------------------
   Michal Jex — personal site
   Static CSS, no build step. Accent colour taken from the
   CTU Game Lab logo (#0065BD).
   ------------------------------------------------------------ */

:root {
  --blue: #0065bd;
  --blue-dark: #004d91;
  --blue-soft: #e8f1fb;
  --ink: #1d2733;
  --ink-soft: #4b5563;
  --muted: #7b8794;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --card: #ffffff;
  --accent: #f0a500;      /* warm highlight used sparingly (games) */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --max: 1080px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #5aa9f0;
    --blue-dark: #8cc4f7;
    --blue-soft: #10263d;
    --ink: #e6edf5;
    --ink-soft: #b7c2cf;
    --muted: #8a97a6;
    --line: #243140;
    --bg: #0f1620;
    --bg-alt: #141d29;
    --card: #182230;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .6em;
}

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 64px;
}
.brand { font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-size: 1.05rem; }
.brand span { color: var(--blue); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.nav li a {
  display: inline-block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-soft); font-weight: 500; font-size: .95rem;
}
.nav li a:hover, .nav li a[aria-current="page"] {
  background: var(--blue-soft); color: var(--blue); text-decoration: none;
}
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--ink); font: inherit; cursor: pointer;
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav ul {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }
  .nav ul.open { display: flex; }
}

/* ---------- hero ---------- */
.hero {
  padding: 56px 0 48px;
  background:
    radial-gradient(900px 400px at 110% -10%, var(--blue-soft), transparent 60%),
    var(--bg);
}
.hero-grid {
  display: grid; grid-template-columns: 1.3fr .9fr; gap: 48px; align-items: center;
}
.hero h1 { margin-bottom: .25em; }
.hero .tagline { font-size: 1.25rem; color: var(--ink-soft); max-width: 36ch; }
.hero .lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 60ch; }
.hero-photo {
  width: 100%; max-width: 360px; justify-self: end;
  border-radius: 24px; overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 3 / 4; object-fit: cover;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--line); color: var(--ink); background: var(--card);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { justify-self: start; max-width: 260px; }
}

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 28px; }
.section-head p { color: var(--ink-soft); }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue); margin-bottom: 14px; font-size: 1.2rem;
}

/* ---------- soufflé aside ---------- */
.souffle {
  display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: center;
  margin-top: 36px; padding: 20px 24px; border-radius: var(--radius);
  background: var(--bg-alt); border: 1px solid var(--line);
}
.souffle img { width: 150px; }
.souffle .quote { font-family: var(--serif); font-size: 1.1rem; line-height: 1.5; color: var(--ink); margin-bottom: 8px; }
@media (max-width: 600px) { .souffle { grid-template-columns: 1fr; } .souffle img { width: 120px; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; }
.stat { padding: 16px 18px; border-left: 3px solid var(--blue); background: var(--bg-alt); border-radius: 0 10px 10px 0; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .85rem; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- timeline (CV) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 28px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--blue);
}
.timeline time { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.timeline .where { font-weight: 600; }
.timeline .what { color: var(--ink-soft); }
.timeline .thesis { font-style: italic; color: var(--ink-soft); font-size: .95rem; }

.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 820px) { .cv-grid { grid-template-columns: 1fr; } }

/* ---------- publications ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.pub-list li {
  display: grid; grid-template-columns: 52px 1fr; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.pub-list .num { font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.pub-list .title { font-weight: 600; }
.pub-list .venue { color: var(--ink-soft); }
.pub-list .meta { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.pub-list .meta a { margin-right: 10px; }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); margin-left: 6px; vertical-align: middle;
}
.tag.warn { background: #fff4d6; color: #8a5a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.warn { background: #3a2a05; color: #f3c35b; } }

/* ---------- games ---------- */
.game-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; padding: 0; }
.game-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.game-card .body { padding: 20px; }
@media (max-width: 760px) { .game-card[style*="grid-column"] { grid-template-columns: 1fr !important; } }
.game-card .facts { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 0; padding: 0; list-style: none; font-size: .85rem; color: var(--muted); }
.game-card .facts li::before { content: attr(data-icon) " "; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; width: 100%; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

.covers { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 28px; }
.covers img { height: 220px; width: auto; display: block; box-shadow: var(--shadow); }
@media (max-width: 760px) { .covers img { height: 130px; } }

.logos { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.logos img { height: 56px; width: auto; border-radius: 6px; background: #fff; padding: 6px; }

.banner-logo { max-width: 520px; width: 100%; }

/* ---------- misc ---------- */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: 6px 0; display: flex; gap: 12px; }
.contact-list li b { min-width: 90px; color: var(--muted); font-weight: 600; }

.callout {
  border-left: 4px solid var(--accent); background: var(--bg-alt);
  padding: 16px 20px; border-radius: 0 10px 10px 0;
}

.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .9rem; }
.site-footer .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.page-title { padding: 48px 0 24px; }
.page-title h1 { margin-bottom: .2em; }
