/* Colors: light by default, dark only via the toggle. */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --surface: #ffffff;
  --ink: #1b1f24;
  --ink-muted: #4a535c;
  --line: #dde2e8;
  --accent: #005f86;
  --accent-soft: #e6f3fa;
  --accent-underline: rgba(0, 95, 134, 0.4);
  --ink-underline: rgba(27, 31, 36, 0.35);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1319;
  --bg-soft: #17212a;
  --surface: #121a22;
  --ink: #f1f5f8;
  --ink-muted: #b0bcc8;
  --line: #293642;
  --accent: #78cdec;
  --accent-soft: rgba(120, 205, 236, 0.14);
  --accent-underline: rgba(120, 205, 236, 0.5);
  --ink-underline: rgba(241, 245, 248, 0.38);
  color-scheme: dark;
}


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: 3rem;
  margin-top: 0.25rem;
}

h2 {
  font-size: 1.85rem;
  margin-bottom: 1rem;
}

a {
  color: var(--ink);
  text-decoration-color: var(--ink-underline);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  text-decoration-color: currentColor;
}

p {
  margin: 0;
}

.container {
  margin: 0 auto;
  max-width: 1000px;
  padding: 0 1.25rem;
}

.section {
  padding: 1.6rem 0;
}

/* Tighter gaps between the paper sections (Working Papers, Work in Progress, Data) */
#work-in-progress,
#data {
  padding-top: 0.9rem;
}

#working-papers,
#work-in-progress {
  padding-bottom: 1.3rem;
}

/* Intro: portrait on the left, bio on the right */
.intro {
  padding-top: 3.5rem;
}

.intro-grid {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 235px minmax(0, 1fr);
}

.portrait {
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.portrait-placeholder {
  align-items: center;
  color: var(--ink-muted);
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  font-size: 3.5rem;
  justify-content: center;
}

.lead {
  color: var(--ink-muted);
  font-size: 1.05rem;
  margin-top: 1rem;
  max-width: 68ch;
}

.lead a {
  color: var(--ink);
}

.compact-lead {
  margin-top: 0.55rem;
}

/* Round icon buttons */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.profile-links a,
.theme-toggle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  height: 2.45rem;
  justify-content: center;
  padding: 0;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  width: 2.45rem;
}

.theme-toggle {
  cursor: pointer;
  font: inherit;
}

.profile-links a:hover,
.profile-links a:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  outline: none;
  transform: translateY(-1px);
}

.profile-links svg,
.theme-toggle svg {
  fill: none;
  height: 1.32rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 1.32rem;
}

/* Brand logos drawn as filled shapes (e.g. X) */
.profile-links svg.icon-fill {
  fill: currentColor;
  height: 1.1rem;
  stroke: none;
  width: 1.1rem;
}

.theme-icon-sun,
.theme-toggle.is-dark .theme-icon-moon {
  display: none;
}

.theme-toggle.is-dark .theme-icon-sun {
  display: block;
}

/* Paper lists */
.paper-list {
  border-top: 1px solid var(--line);
}

.paper-entry {
  border-bottom: 1px solid var(--line);
  padding: 1.05rem 0;
  position: relative;
}

.paper-entry-plain {
  padding-left: 0;
}

.paper-main h3 {
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

.paper-main h3 a {
  text-decoration: none;
}

.paper-main h3 a:hover,
.paper-main h3 a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--accent-underline);
}

.paper-main p {
  color: var(--ink-muted);
}

.paper-main p a,
.paper-main p em {
  color: var(--ink);
}

.paper-main p + p {
  margin-top: 0.25rem;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  font-size: 1rem;
  gap: 0.45rem 0.8rem;
  margin-top: 0.55rem;
}

.paper-links a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.paper-links a:hover,
.paper-links a:focus-visible {
  text-decoration: underline;
}

/* Expandable abstract: magnifier button in the left gutter */
.paper-details {
  margin-top: 0.8rem;
}

.paper-details summary {
  align-items: center;
  border-radius: 999px;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  height: 2rem;
  justify-content: center;
  left: 0;
  list-style: none;
  position: absolute;
  top: 1.05rem;
  transition: background 160ms ease, color 160ms ease;
  width: 2rem;
}

.paper-details summary::-webkit-details-marker {
  display: none;
}

.paper-details summary::before {
  border: 2px solid currentColor;
  border-radius: 999px;
  content: "";
  height: 0.72rem;
  transform: translate(-0.08rem, -0.08rem);
  width: 0.72rem;
}

.paper-details summary::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  position: absolute;
  transform: translate(0.42rem, 0.42rem) rotate(45deg);
  width: 0.5rem;
}

.paper-details summary:hover,
.paper-details summary:focus-visible,
.paper-details[open] summary {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.details-body {
  border-left: 2px solid var(--accent-soft);
  color: var(--ink-muted);
  padding: 0.15rem 0 0.15rem 1rem;
}

.details-body strong {
  color: var(--ink);
  font-weight: 500;
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  margin-top: 2rem;
  padding: 1.6rem 0;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  justify-content: space-between;
}

/* Sections fade in on scroll (only when JS enables it) */
.reveal-motion .reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal-motion .reveal.in {
  animation: rise-in 550ms ease-out forwards;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .portrait {
    max-width: 180px;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-motion .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-motion .reveal.in {
    animation: none;
  }
}


.details-body p + p {
  margin-top: 0.55rem;
}

.links-label {
  color: var(--ink-muted);
  margin-left: 0.4rem;
}

/* Text button that opens the entry's abstract dropdown */
.link-button {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  padding: 0;
}

.link-button:hover,
.link-button:focus-visible {
  text-decoration: underline;
}

/* Abstracts open only via the "Abstract" text buttons; no magnifier icon */
.paper-details summary {
  display: none;
}

.paper-details:not([open]) {
  margin-top: 0;
}

main {
  padding-bottom: 2.5rem;
}

/* match lukasalthoff.com: system font, light body text (300), medium headings (500), white background */
body { font-weight: 300; }
h1, h2, h3, h4, strong, b { font-weight: 500; }

/* sizes like lukasalthoff.com (name 2rem, section titles 1.4rem, paper titles at body size), square photo */
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
.paper-main h3 { font-size: 1rem; }
.portrait { border-radius: 0; }

/* Always reserve the scrollbar's space, so opening an abstract (page grows taller) doesn't shift the page sideways */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }

/* no horizontal divider lines between papers */
.paper-list,
.paper-entry { border-top: none; border-bottom: none; }
