/* nirsd.com: one page, no framework. Colors are tokens; dark mode swaps them. */
:root {
  --bg: #fbfaf7;
  --fg: #1f1f22;
  --muted: #62636a;
  --rule: #e6e3dc;
  --accent: #0f766e;
  --accent-strong: #0b5a54;
  --on-accent: #ffffff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, ui-serif, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --fg: #e7e5e0;
    --muted: #a2a3a9;
    --rule: #2a2c31;
    --accent: #5fd4c0;
    --accent-strong: #9be7da;
    --on-accent: #0c2622;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

main.wrap { padding-top: 72px; padding-bottom: 24px; }

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

/* Intro */
.intro {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
}

.avatar {
  flex: none;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--rule);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 1.05rem;
}

.social { display: flex; gap: 18px; }
.social a {
  display: inline-flex;
  color: var(--muted);
  padding: 2px;
}
.social a:hover { color: var(--fg); }
.social svg { width: 19px; height: 19px; fill: currentColor; }

.bio p { margin: 0 0 14px; }

/* Sections */
section { margin-top: 60px; }

h2 {
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}
h3 a { color: var(--fg); text-decoration: none; }
h3 a:hover { color: var(--accent); }

.lede { margin: 0 0 8px; }

/* Projects */
.project {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}
.project + .project { margin-top: 32px; }
.project p { margin: 0 0 10px; }

.thumb { display: block; }
.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--rule);
  transition: transform 0.2s ease;
}
.thumb:hover img { transform: translateY(-2px); }

.links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 600; font-size: 0.95rem; }
.links a { text-decoration: none; }
.links a:hover { text-decoration: underline; }

/* Writing */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.posts a { color: var(--fg); font-weight: 600; text-decoration: none; }
.posts a:hover { color: var(--accent); text-decoration: underline; }
.posts .sub { color: var(--muted); }
.posts .sub::before { content: " · "; }
.posts time {
  flex: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.button {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.button.ghost { background: transparent; color: var(--accent); }
.button.ghost:hover { background: transparent; color: var(--accent-strong); }

/* Papers */
.papers { list-style: none; margin: 0; padding: 0; }
.papers li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.papers li:last-child { border-bottom: none; }
.papers a { display: block; color: var(--fg); font-weight: 600; text-decoration: none; line-height: 1.45; }
.papers a:hover { color: var(--accent); text-decoration: underline; }
.papers .authors { display: block; margin-top: 4px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.papers .authors strong { color: var(--fg); font-weight: 600; }
.papers .venue { display: block; color: var(--muted); font-size: 0.9rem; font-style: italic; }

/* Project pages (e.g. /dorus/) */
.crumb { margin: 0 0 40px; font-size: 0.95rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--fg); }

.hero { margin-bottom: 24px; }
.hero h1 { font-size: 3rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 3px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 64px;
  padding-top: 24px;
  padding-bottom: 48px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  main.wrap { padding-top: 40px; }
  .intro { flex-direction: column; align-items: flex-start; gap: 18px; }
  .avatar { width: 96px; height: 96px; }
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.5rem; }
  section { margin-top: 48px; }
  .project { grid-template-columns: 1fr; gap: 14px; }
  .posts li { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  .thumb img { transition: none; }
  .thumb:hover img { transform: none; }
}
