/*
  Sampo Paukkonen — personal website
  EDIT THEME: change the variables below.
  No font services, frameworks or build tools are required.
*/
:root {
  color-scheme: light;
  --background: #ffffff;
  --ink: #24292e;
  --muted: #59636e;
  --accent: #244e70;
  --accent-hover: #15334b;
  --line: #dce1e5;
  --soft: #f5f7f8;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --width: 1060px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
::selection { background: #dce8f1; color: var(--ink); }
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  overflow-wrap: anywhere;
}
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}
p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1, h2 { font-family: var(--font-heading); }
h1 { font-size: clamp(2.5rem, 5vw, 3.35rem); line-height: 1.13; letter-spacing: -.035em; }
h2 { font-size: 1.55rem; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-family: var(--font-body); font-size: 1.13rem; font-weight: 600; line-height: 1.5; margin-bottom: .45rem; }
sup { font-size: .72em; line-height: 0; }
.container { width: min(var(--width), calc(100% - 5rem)); margin-inline: auto; }
.skip-link {
  position: absolute;
  top: -10rem;
  left: 1rem;
  padding: .65rem 1rem;
  background: var(--background);
  z-index: 20;
}
.skip-link:focus { top: 1rem; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  min-height: 88px;
  padding-block: 1rem;
}
.wordmark { font-family: var(--font-heading); font-size: 1.25rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1.6rem; }
.site-nav a { font-size: .9375rem; color: var(--muted); text-decoration: none; padding-block: .4rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 5rem;
  align-items: start;
  padding-block: 4.7rem 4.2rem;
}
.eyebrow { color: var(--muted); font-size: .875rem; letter-spacing: .045em; margin-bottom: 1.1rem; }
.intro h1 { margin-bottom: 1.5rem; }
.lead { font-size: 1.21rem; line-height: 1.65; }
.intro-links { display: flex; flex-wrap: wrap; gap: 1.6rem; align-items: center; margin-top: 1.75rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .62rem 1.15rem;
  min-height: 44px;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 3px;
  font: inherit;
  font-size: .9375rem;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #ffffff; }
.profile-note { border-top: 2px solid var(--accent); margin-top: 2.65rem; padding-top: 1.35rem; font-size: .9375rem; }
.profile-note dl { margin: 0; }
.profile-note dl > div + div { margin-top: 1.35rem; }
.profile-note dt { font-size: .875rem; color: var(--muted); margin-bottom: .25rem; }
.profile-note dd { margin: 0; line-height: 1.6; }
.section-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3rem; padding-block: 2.6rem; border-top: 1px solid var(--line); }
.section-heading { padding-top: .15rem; }
.section-content { max-width: 720px; min-width: 0; }
.section-intro { font-size: 1.15rem; font-weight: 500; margin-bottom: .8rem; }
.topic-list { padding-left: 1.15rem; margin: 1.1rem 0 1.4rem; }
.topic-list li { padding-left: .2rem; margin-block: .3rem; }
.topic-list:first-child { margin-top: 0; }
.topic-list:last-child { margin-bottom: 0; }
.topic-list li::marker { color: var(--muted); }
.outlook { margin-top: 1.7rem; }
.entry-meta { font-size: .875rem; color: var(--muted); margin-bottom: .45rem; }
.publication + .publication { border-top: 1px solid var(--line); padding-top: 1.7rem; margin-top: 1.7rem; }
.publication h3 { font-size: 1.18rem; margin-bottom: .6rem; }
.publication h3 a { text-decoration: none; }
.publication h3 a:hover { text-decoration: underline; }
.authors { color: var(--muted); font-size: .9375rem; margin-bottom: .85rem; }
.math { white-space: nowrap; }
.entry-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .9375rem; }
.paper-details { margin-top: 1.35rem; font-size: .9375rem; }
.paper-details summary { width: fit-content; color: var(--accent); cursor: pointer; }
.paper-details[open] summary { margin-bottom: .75rem; }
.paper-details p { max-width: 65ch; }
.timeline-entry { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 1.5rem; }
.timeline-entry .entry-meta { padding-top: .18rem; }
.background-link { margin-top: 1.5rem; }
.contact-section { padding-bottom: 4rem; }
.contact-email { font-size: 1.2rem; margin-block: 1.3rem; }
.contact-affiliation { color: var(--muted); font-size: .9375rem; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; font-size: .8125rem; color: var(--muted); }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--muted); }
.cv-page { padding-top: 3.8rem; }
.cv-heading { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cv-heading h1 { font-size: clamp(2.25rem, 5vw, 3rem); margin-bottom: .85rem; }
.cv-subtitle { color: var(--muted); }
.cv-contact { font-size: .9375rem; margin-block: 1.6rem 2.4rem; }
.cv-page .section-row:last-of-type { padding-bottom: 4rem; }
.error-page { max-width: 800px; padding-block: 6rem; }
.error-page h1 { margin-bottom: 1.5rem; }
.error-page .button { margin-top: .7rem; }
/* Optional portrait: insert <img class="portrait" ...> in .profile-note. */
.portrait { width: 100%; max-width: 220px; height: auto; display: block; margin-bottom: 1.5rem; }

@media (max-width: 850px) {
  .container { width: calc(100% - 3rem); }
  .intro { gap: 2.5rem; grid-template-columns: minmax(0, 1fr) 195px; }
  .section-row { grid-template-columns: 175px minmax(0, 1fr); gap: 2rem; }
  .site-nav { gap: .35rem 1.1rem; }
}
@media (max-width: 650px) {
  body { font-size: 1rem; }
  .container { width: calc(100% - 2.5rem); }
  .header-inner { align-items: flex-start; flex-direction: column; gap: .35rem; padding-block: 1.1rem .7rem; }
  .site-nav { width: 100%; gap: .2rem 1.4rem; }
  .site-nav a { min-height: 44px; display: inline-flex; align-items: center; padding-block: .35rem; }
  .intro { display: block; padding-block: 2.8rem 2.5rem; }
  .lead { font-size: 1.1rem; }
  .intro h1 { margin-bottom: 1.25rem; }
  .profile-note { margin-top: 2.5rem; padding-top: 1.2rem; }
  .profile-note dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.4rem; }
  .profile-note dl > div + div { margin-top: 0; }
  .section-row { grid-template-columns: 1fr; gap: 1.2rem; padding-block: 2rem; }
  .desktop-break { display: none; }
  .timeline-entry { grid-template-columns: 1fr; gap: .2rem; }
  .contact-email { font-size: 1.07rem; }
  .contact-section { padding-bottom: 2.8rem; }
  .cv-page { padding-top: 2.5rem; }
  .cv-heading { align-items: flex-start; flex-direction: column; gap: 1.2rem; }
  .cv-contact { margin-top: 1.2rem; }
  .entry-links a { min-height: 44px; display: inline-flex; align-items: center; }
  .paper-details summary { min-height: 44px; padding-block: .45rem; }
  .footer-inner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  @page { margin: 18mm; size: A4; }
  body { color: #000000; background: #ffffff; font-size: 10.5pt; line-height: 1.5; }
  .container { width: 100%; max-width: none; }
  .site-header, .site-footer, .skip-link, .print-button { display: none !important; }
  .cv-page { padding-top: 0; }
  .cv-heading { display: block; }
  .cv-heading h1 { font-size: 25pt; }
  .cv-contact { margin-block: 1rem 1.5rem; }
  .section-row { grid-template-columns: 135px minmax(0, 1fr); gap: 1.4rem; padding-block: 1.1rem; break-inside: avoid; }
  .cv-page .section-row:last-of-type { padding-bottom: 0; }
  h2 { font-size: 13pt; }
  h3 { font-size: 11pt; }
  a { color: #000000; text-decoration: none; }
  .eyebrow, .entry-meta, .cv-contact { font-size: 10pt; }
  .topic-list { margin-block: .3rem; }
  .topic-list li { margin-block: .15rem; }
}
