html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

:root {
    --page: #FFFFFF;
    --soft: #d1dff6;
    --line: #c2d6f6;
    --light: #b2cbf2;
    --bright: #a0bff0;
    --mid: #92b6f0;
    --dark: #2B4C7E;
    --text: var(--dark);
    --muted: rgba(43, 76, 126, 0.74);
    --faint: rgba(43, 76, 126, 0.55);
    --soft-fill: rgba(209, 223, 246, 0.34);
    --soft-fill-strong: rgba(209, 223, 246, 0.5);
    --line-soft: rgba(194, 214, 246, 0.62);
    --light-soft: rgba(178, 203, 242, 0.58);
    --shadow: rgba(43, 76, 126, 0.12);
    --shadow-soft: rgba(43, 76, 126, 0.07);
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    min-height: 100vh;
    background-color: var(--page);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 50px;
    padding-bottom: 58px;
    line-height: 1.5;
}
nav{
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
    width: 100%;
    background-color: var(--page);
    padding: 0 2rem;
    border-bottom: 1px solid var(--line-soft);
}
nav ul{
    width: 100%;
    list-style: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
nav li{
    height: 50px;
}
nav a{
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.95rem;
}
nav a:hover{
    background-color: var(--soft-fill);
}

nav a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--dark);
    outline-offset: 3px;
}

nav a.active{
    background-color: var(--soft-fill);
    border-bottom: 2px solid var(--bright);
    color: var(--dark);
}
.site-brand{
    margin-right: auto;
}
.sidebar{
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 250px;
    z-index: 1200;
    background-color: var(--page);
    box-shadow: -5px 0 16px var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.22s ease, visibility 0.22s ease;
    visibility: hidden;
}
.sidebar.is-open{
    pointer-events: auto;
    transform: translateX(0);
    visibility: visible;
}
.sidebar-open-state{
    overflow: hidden;
}
.sidebar li{
    width: 100%;
}
.sidebar a{
    width: 100%;
}
.sidebar a.active {
    border-bottom: none;
    border-left: 3px solid var(--bright);
    background-color: var(--soft-fill);
    font-weight: 600;
}
.sidebar li:first-child{
    align-self: flex-end;
}
.menu-button{
    display: none;
}
.nav-icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 50px;
    border: 0;
    background: none;
    cursor: pointer;
}

.nav-icon-button:hover {
    background-color: var(--soft-fill);
}
@media(max-width: 800px){
    .hideOnMobile{
        display: none;
    }
    .menu-button{
        display: block;
    }
}
@media(max-width: 400px){
    .sidebar{
        width: 100%;
    }
}
.surname {
  font-weight: 700;
}
.about-page {
  padding: 42px 4% 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 700px) minmax(220px, 320px);
  gap: 56px;
  align-items: start;
  max-width: 1060px;
  margin: 0 auto;
}

.hero-copy {
  max-width: 720px;
}

.hero h1 {
  margin: 0;
  color: var(--dark);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.15;
}

.about,
.about-secondary {
  margin: 0;
  max-width: 680px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}

.about-secondary {
  margin-top: 16px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--dark);
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--page);
  color: var(--dark);
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--page);
}

.meta {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.portrait-panel {
  width: 100%;
}

.portrait-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
}

.portrait-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line-soft);
  padding: 22px;
  background: var(--soft-fill);
  color: var(--muted);
}

.portrait-placeholder span {
  color: var(--dark);
  font-size: 1rem;
  font-weight: 600;
}

.portrait-placeholder small {
  margin-top: 6px;
  color: var(--faint);
  font-size: 0.82rem;
}

.contact-page {
  padding: 42px 4% 0;
}

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

.contact h1 {
  margin-bottom: 12px;
  color: var(--dark);
  font-size: 2rem;
  font-weight: 400;
}

.contact-intro {
  max-width: 560px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

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

.contact-row {
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  color: var(--text);
  text-decoration: none;
  transition: padding-left 0.2s ease, border-color 0.2s ease;
}

.contact-row:hover {
  border-color: var(--bright);
  padding-left: 8px;
}

.icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: currentColor;
}

.contact-row span {
  display: grid;
  gap: 4px;
}

.contact-row strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.contact-row small {
  color: var(--faint);
  font-size: 0.9rem;
}
.cv-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 42px 4% 0;
}

.cv-page a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cv-page a:hover {
  color: var(--dark);
  text-decoration-color: var(--mid);
}

.cv-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 42px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.cv-header h1 {
  margin-bottom: 6px;
  color: var(--dark);
  font-size: 2rem;
  font-weight: 400;
}

.cv-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.cv-updated {
  text-align: right;
  white-space: nowrap;
}

.cv-section {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.cv-section h2 {
  color: var(--dark);
  font-size: 0.95rem;
  font-weight: 600;
}

.cv-section > :not(h2) {
  grid-column: 2;
}

.cv-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 28px;
}

.cv-entry + .cv-entry {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.cv-entry h3,
.cv-skill-grid h3 {
  margin-bottom: 5px;
  color: var(--dark);
  font-size: 1rem;
  font-weight: 600;
}

.cv-entry p,
.cv-skill-grid p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.cv-entry ul,
.cv-list {
  margin-top: 10px;
  padding-left: 18px;
}

.cv-entry li,
.cv-list li {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.cv-meta {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--faint);
  font-size: 0.86rem;
  text-align: right;
}

.cv-skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.simple-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 42px 4% 0;
}

.simple-page h1 {
  margin-bottom: 12px;
  color: var(--dark);
  font-size: 2rem;
  font-weight: 400;
}

.simple-page p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.simple-page a {
  color: var(--dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 850;
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 4%;
  background: var(--page);
  border-top: 1px solid var(--light);
  color: var(--text);
  font-size: 0.78rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-links a {
  color: var(--text);
  font-size: 0.78rem;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page section {
  margin-top: 28px;
}

.page-note {
  margin-bottom: 24px;
  color: var(--faint);
  font-size: 0.9rem;
}

.legal-page p + p {
  margin-top: 12px;
}

.legal-page h2 {
  margin-bottom: 10px;
  color: var(--dark);
  font-size: 1rem;
  font-weight: 600;
}

.legal-page a {
  color: var(--dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.projects-section {
  padding: 40px 4%;
}

.projects-section h1 {
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 28px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.filter-btn {
  background: var(--page);
  border: 1px solid var(--line);
  padding: 5px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  border-radius: 20px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.filter-btn:hover {
  border-color: var(--bright);
  color: var(--dark);
}

.filter-btn.active {
  background-color: var(--soft-fill-strong);
  border-color: var(--bright);
  color: var(--dark);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 150px;
  padding: 22px 24px 20px;
  background: var(--page);
  box-shadow: 0 1px 4px var(--shadow-soft);
  cursor: pointer;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  box-shadow: 0 6px 20px var(--shadow);
  transform: translateY(-3px);
  border-color: var(--bright);
}

.card-header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  pointer-events: none;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card-main-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 6px;
}

.card-main-link:focus-visible {
  outline: 2px solid var(--dark);
  outline-offset: 4px;
}

.category-tag {
  border: 1px solid var(--line);
  background: var(--page);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 3px 10px;
  border-radius: 20px;
}

.card-link {
  position: relative;
  z-index: 3;
  color: var(--mid);
  text-decoration: none;
  display: flex;
  align-items: center;
  pointer-events: auto;
  transition: color 0.2s;
}

.card-link:hover {
  color: var(--dark);
}

.card-status {
  position: relative;
  z-index: 2;
  color: var(--dark);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--light-soft);
  border-radius: 20px;
  padding: 3px 10px;
  background: var(--soft-fill);
  pointer-events: none;
}

.card-title {
  position: relative;
  z-index: 2;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
  pointer-events: none;
}

.project-detail-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 42px 4% 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--faint);
  font-size: 0.9rem;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.back-link:hover {
  color: var(--dark);
  text-decoration-color: var(--bright);
}

.project-detail-hero {
  max-width: 760px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.project-detail-hero h1 {
  margin: 14px 0 12px;
  color: var(--dark);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.project-status {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--light-soft);
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--soft-fill);
  color: var(--dark);
  font-size: 0.9rem;
}

.top-button {
  position: fixed;
  right: 22px;
  bottom: 58px;
  z-index: 860;
  border: 1px solid var(--dark);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--page);
  color: var(--dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.top-button:hover {
  background: var(--soft-fill);
}

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

@media (max-width: 850px) {
  .about-page {
    padding: 46px 5% 0;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .portrait-panel {
    max-width: 360px;
  }

  .cv-header,
  .cv-section,
  .cv-entry,
  .cv-skill-grid {
    grid-template-columns: 1fr;
  }

  .cv-header {
    flex-direction: column;
  }

  .cv-section > :not(h2) {
    grid-column: 1;
  }

  .cv-meta,
  .cv-updated {
    text-align: left;
  }

}

@media (max-width: 1050px) {
  nav a {
    padding: 0 14px;
    font-size: 0.9rem;
  }

  .nav-icon-button {
    width: 52px;
  }
}

@media (max-width: 520px) {
  body {
    padding-bottom: 74px;
  }

  nav {
    padding: 0 1rem;
  }

  nav a {
    padding: 0 14px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .footer {
    gap: 8px 14px;
    padding: 8px 5%;
  }

  .top-button {
    right: 14px;
    bottom: 78px;
  }
}

@media (min-width: 851px) {
  html {
    font-size: 16px;
  }

  nav {
    padding-left: 0;
    padding-right: 0;
  }

  nav > ul:not(.sidebar) {
    width: min(1280px, calc(100% - 64px));
    margin-left: auto;
    margin-right: auto;
  }

  .hero {
    max-width: 1280px;
    grid-template-columns: minmax(0, 760px) minmax(260px, 340px);
  }

  .hero-copy {
    max-width: 760px;
  }

  .about,
  .about-secondary {
    max-width: 740px;
  }

  .contact,
  .simple-page {
    max-width: 820px;
  }

  .projects-section {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  nav,
  .footer,
  .top-button {
    display: none;
  }

  body {
    color: var(--dark);
    background: var(--page);
    font-size: 11pt;
    padding: 0;
  }

  .cv-page {
    max-width: none;
    padding: 0;
  }

  .cv-header,
  .cv-section {
    break-inside: avoid;
  }

  .cv-section {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    padding: 16px 0;
  }

  .cv-entry {
    grid-template-columns: minmax(0, 1fr) 150px;
  }
}

.site-status {
  max-width: 680px;
  margin-top: 30px;
  padding: 11px 14px;
  border-left: 2px solid var(--dark);
  background: var(--soft-fill);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}
