:root {
  --bg: #f7f6f2;
  --surface: #fcfbf8;
  --surface-raised: #ffffff;
  --text: #2d2b27;
  --muted: #746f67;
  --accent: #b85c3a;
  --accent-hover: #99482d;
  --accent-soft: rgba(184, 92, 58, 0.09);
  --border: rgba(50, 45, 40, 0.1);
  --border-strong: rgba(50, 45, 40, 0.17);
  --shadow: rgba(54, 45, 38, 0.09);
  --shadow-card: 0 1px 2px rgba(49, 43, 38, 0.04), 0 12px 32px rgba(49, 43, 38, 0.06);
}

[data-theme="dark"] {
  --bg: #191816;
  --surface: #211f1c;
  --surface-raised: #24221f;
  --text: #ebe7df;
  --muted: #aaa39a;
  --accent: #df8966;
  --accent-hover: #f0a07d;
  --accent-soft: rgba(223, 137, 102, 0.12);
  --border: rgba(235, 231, 223, 0.09);
  --border-strong: rgba(235, 231, 223, 0.16);
  --shadow: rgba(0, 0, 0, 0.28);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 14px 38px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.theme-luka {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.006em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.theme-luka a {
  color: var(--accent);
  text-decoration: none;
}

body.theme-luka a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.top-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: 60px;
  display: flex;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(130%);
}

.nav-container {
  width: min(1120px, 100%);
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left a {
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
}

.nav-left a:hover {
  color: var(--accent);
  text-decoration: none;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.wrapper {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-areas:
    "sidebar content"
    "sidebar footer";
}

.sidebar {
  grid-area: sidebar;
  position: fixed;
  top: 60px;
  width: 300px;
  height: calc(100vh - 60px);
  padding: 70px 24px 32px;
  display: flex;
  justify-content: center;
  text-align: center;
}

.profile-card {
  width: 100%;
}

.image.avatar {
  width: 184px;
  height: 184px;
  margin: 0 auto 28px;
  padding: 5px;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  background:
    linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box,
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--border)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 14px 42px var(--shadow);
}

.image.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.site-name {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.2;
}

.site-role {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.site-email {
  margin: 0 0 22px;
  color: var(--muted);
  font-family: "Ubuntu Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  word-break: break-word;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-icons a {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--muted);
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.social-icons a:hover {
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  transform: translateY(-3px);
}

.content {
  grid-area: content;
  min-width: 0;
  padding: 118px 40px 40px 64px;
}

.section {
  margin-bottom: 46px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.section.visible {
  opacity: 1;
  transform: none;
}

.section-title {
  position: relative;
  display: inline-flex;
  margin: 0 0 18px;
  padding-bottom: 10px;
  color: var(--text);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

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

.cv-link i {
  margin-right: 5px;
}

.card {
  margin: 0;
}

.experience-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.institution-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
}

.experience-content {
  min-width: 0;
  flex: 1;
}

.experience-content p {
  margin: 0 0 3px;
}

.exp-title {
  color: var(--text);
  font-size: 15.5px;
}

.exp-detail {
  color: var(--muted);
  font-size: 14px;
}

.exp-period,
.project-period {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.timeline-item {
  position: relative;
  margin-left: 19px;
  padding-left: 13px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -19px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-soft));
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: 21px;
  left: -24px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}

.detail-list {
  margin: 12px 0 0;
  padding-left: 19px;
  color: var(--text);
  font-size: 14px;
}

.detail-list li {
  margin-bottom: 6px;
}

.project-list {
  display: grid;
  gap: 16px;
}

.project-card {
  position: relative;
  overflow: hidden;
  padding: 23px 24px 21px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-raised) 96%, var(--accent)), var(--surface-raised));
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 40%, transparent), transparent);
  opacity: 0.7;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 2px 3px rgba(49, 43, 38, 0.05), 0 18px 42px var(--shadow);
}

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

.project-title {
  color: var(--text) !important;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.project-title:hover {
  color: var(--accent) !important;
}

.project-card p {
  margin: 10px 0 0;
  font-size: 14px;
}

.project-subtitle {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 13.5px !important;
  font-weight: 500;
}

.project-period {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 11.5px;
  white-space: nowrap;
}

.project-description {
  color: color-mix(in srgb, var(--text) 90%, var(--muted));
  line-height: 1.7;
}

.project-footer {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-stack span {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.github-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text) !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 2px var(--shadow);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.github-link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent) !important;
  text-decoration: none;
  transform: translateY(-1px);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.skill-item {
  padding: 15px 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  border-radius: 12px;
  box-shadow: 0 1px 2px var(--shadow);
}

.skill-item strong,
.skill-item span {
  display: block;
}

.skill-item strong {
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 600;
}

.skill-item span {
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  grid-area: footer;
  padding: 10px 40px 40px 64px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .wrapper {
    display: block;
    padding: 0 22px;
  }

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

  .image.avatar {
    width: 145px;
    height: 145px;
    margin-bottom: 22px;
  }

  .image.avatar img {
    width: 100%;
    height: 100%;
  }

  .content {
    padding: 28px 0 20px;
  }

  .site-footer {
    padding: 8px 0 34px;
  }
}

@media (max-width: 560px) {
  .nav-container {
    padding: 0 20px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .project-heading {
    display: block;
  }

  .project-period {
    display: inline-block;
    margin-top: 10px;
  }

  .project-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .github-link {
    width: 100%;
    justify-content: center;
  }

  .experience-item {
    gap: 12px;
  }

  .institution-logo {
    width: 44px;
    height: 44px;
  }
}

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

  .section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
