/* Ivan Struchiner — homepage stylesheet. One file, no external resources. */

:root {
  --bg: #fdfcf9;
  --text: #1f2328;
  --muted: #5d6470;
  --rule: #e3e0d8;
  --accent: #1d4e89;        /* links, active menu item */
  --accent-soft: #e8eef6;
  --note-bg: #fff6cc;
  --note-border: #e0b400;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --text: #e6e4df;
    --muted: #a3a8b0;
    --rule: #33363c;
    --accent: #8db8ea;
    --accent-soft: #1f2a38;
    --note-bg: #3a3214;
    --note-border: #b38f00;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.6;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); padding: 1.6rem 0 0.9rem; }
.site-name {
  font-size: 1.55rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--text); text-decoration: none;
}
.site-role { margin: 0.1rem 0 0.8rem; color: var(--muted); font-family: var(--sans); font-size: 0.82rem; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.site-nav a {
  font-family: var(--sans); font-size: 0.88rem; text-decoration: none; color: var(--muted);
  padding: 0.2rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Main */
main.wrap { padding-top: 1.8rem; padding-bottom: 2.5rem; }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0 0 1rem; line-height: 1.25; }
h2 {
  font-size: 1.15rem; font-weight: 600; margin: 2.2rem 0 0.8rem; padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Home: intro with photo */
.intro { display: grid; grid-template-columns: 1fr; gap: 1.4rem; align-items: start; }
.intro img { width: 100%; max-width: 13rem; height: auto; border-radius: 4px; }
@media (min-width: 40rem) {
  .intro { grid-template-columns: 11rem 1fr; }
}

.board { margin: 0 0 1.6rem; }
.board img { max-width: 100%; height: auto; border-radius: 4px; display: block; }

/* Small facts table (contact) */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); font-family: var(--sans); font-size: 0.85rem; padding-top: 0.15rem; }
.facts dd { margin: 0; }

.profile-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; }
.profile-links a {
  display: inline-block; font-family: var(--sans); font-size: 0.82rem; text-decoration: none;
  padding: 0.2rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--text);
}
.profile-links a:hover { border-color: var(--accent); color: var(--accent); }

/* Publication and talk lists */
ol.pubs, ul.pubs { padding-left: 0; list-style: none; margin: 0; counter-reset: pub; }
.pubs > li { margin: 0 0 1.05rem; padding-left: 2.2rem; position: relative; }
ol.pubs > li::before {
  counter-increment: pub; content: counter(pub) ".";
  position: absolute; left: 0; width: 1.7rem; text-align: right;
  color: var(--muted); font-family: var(--sans); font-size: 0.8rem; top: 0.2rem;
}
ol.pubs.reversed > li::before { content: counter(pub) "."; }
.pubs .title { display: block; font-weight: 600; }
.pubs .authors, .pubs .venue { display: block; color: var(--muted); }
.pubs .links { display: block; font-family: var(--sans); font-size: 0.82rem; }

ul.talks { list-style: none; padding: 0; margin: 0; }
ul.talks li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.8rem; margin-bottom: 0.6rem; }
.date { color: var(--muted); font-family: var(--sans); font-size: 0.82rem; padding-top: 0.15rem; }

/* Course list */
table.courses { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.courses th, table.courses td { text-align: left; padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.courses th { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
table.courses td:first-child { white-space: nowrap; color: var(--muted); font-family: var(--sans); font-size: 0.85rem; }

.small { font-size: 0.85rem; color: var(--muted); }

/* Notices on course pages (dates, warnings) */
.notice { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 0.6rem 0.9rem 0.1rem; margin: 0 0 1rem; border-radius: 3px; }

/* Draft notes: placeholders waiting for information. publish.sh refuses pages that contain them. */
.draft-note {
  background: var(--note-bg); border-left: 4px solid var(--note-border);
  padding: 0.5rem 0.8rem; font-family: var(--sans); font-size: 0.85rem; border-radius: 3px;
}

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 1rem 0 2rem; font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }
.site-footer p { margin: 0.2rem 0; }

@media print {
  .site-nav, .draft-note { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}
