:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #292c2f;
  --muted: #697077;
  --line: #d9ddd9;
  --line-strong: #b9c0bb;
  --accent: #7a1737;
  --accent-soft: #f3e8ec;
  --link: #245f9f;
  --green: #2f725d;
  --placeholder: #8a6a28;
  --shadow: 0 12px 36px rgba(34, 40, 43, 0.09);
  --nav-bg: rgba(247, 247, 244, 0.94);
  --max-width: 1180px;
  --nav-height: 64px;
  font-family: "Inter", "Noto Sans SC", system-ui, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191a;
  --surface: #202325;
  --text: #eceeeb;
  --muted: #adb4b1;
  --line: #373d3b;
  --line-strong: #515a56;
  --accent: #d9829f;
  --accent-soft: #35242b;
  --link: #86b8ec;
  --green: #74b69e;
  --placeholder: #d5ad60;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  --nav-bg: rgba(23, 25, 26, 0.94);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
}

body.theme-luka {
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.72;
  transition: color 220ms ease, background-color 220ms ease;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

button {
  font: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  color: #ffffff;
  background: var(--accent);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--link) 48%, transparent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -64px;
  left: 16px;
  z-index: 1200;
  padding: 9px 13px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 4px;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 12px;
}

.top-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
}

.nav-container {
  width: min(var(--max-width), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.nav-right,
.section-links {
  display: flex;
  align-items: center;
}

.nav-right {
  gap: 22px;
}

.section-links {
  gap: 24px;
}

.section-links a {
  position: relative;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.section-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}

.section-links a:hover,
.section-links a.active {
  color: var(--text);
}

.section-links a:hover::after,
.section-links a.active::after {
  transform: scaleX(1);
}

.language-toggle {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 32px;
  padding: 0 9px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  font: 600 11px/1 "IBM Plex Mono", monospace;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.language-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.wrapper {
  width: min(var(--max-width), calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
}

.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: max(24px, calc(50% - 590px));
  width: 320px;
  height: calc(100vh - var(--nav-height));
  padding: 48px 18px 36px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.profile-card {
  width: 100%;
  text-align: center;
}

.avatar-frame {
  width: 196px;
  height: 196px;
  margin: 0 auto 24px;
  overflow: hidden;
  border: 5px solid var(--surface);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-kicker,
.entry-label,
.project-index,
.publication-index,
.section-title span {
  font-family: "IBM Plex Mono", monospace;
}

.profile-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
}

.profile-card h1 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.22;
}

.english-name {
  margin: 3px 0 10px;
  color: var(--accent);
  font: 500 13px/1.5 "IBM Plex Mono", monospace;
}

.affiliation {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 14px;
}

.profile-email {
  display: inline-block;
  max-width: 100%;
  color: var(--link);
  font: 500 11px/1.5 "IBM Plex Mono", monospace;
  overflow-wrap: anywhere;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 19px;
}

.social-icons a {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(35, 40, 43, 0.05);
}

.social-icons a {
  color: var(--text);
  border-color: var(--line-strong);
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.social-icons a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.social-icons svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.content {
  min-width: 0;
  margin-left: 340px;
  padding: 112px 24px 56px 52px;
}

.section {
  margin-bottom: 56px;
  scroll-margin-top: 88px;
}

html.reveal-ready .section {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 440ms ease, transform 440ms ease;
}

html.reveal-ready .section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 22px;
  padding-bottom: 8px;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  font-size: 22px;
  line-height: 1.3;
}

.section-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.section-body p {
  margin: 0 0 12px;
}

.prose {
  max-width: 760px;
}

.prose strong,
.institution-content h3,
.entry-heading h3,
.publication-item h3 {
  color: var(--text);
}

.section-note {
  color: var(--placeholder);
}

.section-note svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.institution-entry {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.institution-content h3,
.entry-heading h3,
.publication-item h3 {
  margin: 0;
  letter-spacing: 0;
}

.institution-content > p {
  margin: 3px 0 0;
  color: var(--muted);
}

.entry-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.entry-heading h3 {
  font-size: 17px;
  line-height: 1.48;
}

.entry-heading time {
  flex: 0 0 auto;
  padding-top: 2px;
  color: var(--accent);
  font: 500 11px/1.5 "IBM Plex Mono", monospace;
}

.detail-list {
  margin: 15px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}

.detail-list li {
  margin: 5px 0;
}

.timeline {
  margin-left: 12px;
  border-left: 2px solid var(--line);
}

.timeline-item {
  position: relative;
  padding: 0 0 36px 28px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 8px;
  left: -7px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.entry-label {
  margin: 0 0 5px !important;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
}

.timeline-item > p,
.experience-copy > p,
.project-item p {
  color: var(--muted);
  font-size: 14px;
}

.timeline-item > p:first-of-type {
  margin-top: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  font: 500 10px/1.3 "IBM Plex Mono", monospace;
}

.item-links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 13px;
}

.item-links a,
.link-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.item-links a svg,
.link-placeholder svg {
  width: 14px;
  height: 14px;
}

.link-placeholder {
  color: var(--placeholder);
}

.experience-entry {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
}

.experience-entry::before {
  display: none;
}

.experience-logo {
  width: 52px;
  height: 52px;
}

.placeholder-logo {
  display: grid;
  place-items: center;
  color: var(--placeholder);
  border: 1px dashed var(--placeholder);
  border-radius: 6px;
  background: color-mix(in srgb, var(--placeholder) 5%, var(--surface));
}

.placeholder-logo svg {
  width: 22px;
  height: 22px;
}

.project-list {
  border-top: 1px solid var(--line);
}

.project-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.project-index {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.publication-list {
  border-top: 1px solid var(--line);
}

.publication-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.publication-index {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.publication-content {
  min-width: 0;
}

.publication-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.publication-item h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.publication-status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line));
  border-radius: 3px;
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  font: 600 10px/1.3 "IBM Plex Mono", monospace;
  white-space: nowrap;
}

.publication-authors {
  margin-top: 10px !important;
  color: var(--text);
  font-size: 13px;
}

.publication-venue {
  color: var(--muted);
  font: 500 11px/1.6 "IBM Plex Mono", monospace;
  overflow-wrap: anywhere;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin-top: 13px;
}

.publication-links a,
.publication-doi {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
}

.publication-links a {
  color: var(--link);
}

.publication-doi {
  color: var(--muted);
}

.publication-links a svg,
.publication-doi svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.section-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 11px !important;
  font-size: 12px;
}

.awards-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.awards-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.awards-list li > span {
  color: var(--accent);
  font: 500 11px/1.6 "IBM Plex Mono", monospace;
}

.awards-list strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.site-footer {
  padding: 26px 0 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.site-footer .template-credit {
  margin-top: 5px;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .wrapper {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 108px 0 28px;
    overflow: visible;
  }

  .profile-card {
    max-width: 720px;
    margin: 0 auto;
  }

  .content {
    width: 100%;
    margin-left: 0;
    padding: 30px 0 52px;
  }
}

@media (max-width: 700px) {
  .nav-container,
  .wrapper {
    width: min(100% - 32px, var(--max-width));
  }

  .section-links {
    display: none;
  }

  .sidebar {
    padding-top: 94px;
  }

  .avatar-frame {
    width: 158px;
    height: 158px;
  }

  .profile-card h1 {
    font-size: 26px;
  }

  .content {
    padding-top: 20px;
  }

  .section {
    margin-bottom: 44px;
  }

  .section-title {
    font-size: 20px;
  }

  .entry-heading {
    flex-direction: column;
    gap: 6px;
  }

  .entry-heading time {
    padding-top: 0;
  }

  .timeline-item {
    padding-left: 23px;
  }

  .project-item {
    grid-template-columns: 32px 1fr;
    gap: 12px;
  }

  .publication-item {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
  }

  .publication-heading {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .publication-status {
    justify-self: start;
  }

}

@media (max-width: 420px) {
  .experience-entry {
    grid-template-columns: 42px 1fr;
    gap: 12px;
  }

  .experience-logo {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  html.reveal-ready .section {
    opacity: 1;
    transform: none;
  }
}
