:root {
  --background: #292a2d;
  --background-secondary: #3b3d42;
  --header: #252627;
  --color: #a9a9b3;
  --color-secondary: #73747b;
  --border: #4a4b50;
  --white: #e8e8e8;
  --max-width: 860px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--color);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color);
  text-decoration: underline;
  text-decoration-color: var(--color-secondary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--white);
  text-decoration-color: var(--white);
}

header {
  background: var(--header);
  border-bottom: 1px solid var(--border);
}

.header-inner,
main,
footer {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-name {
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

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

.lang-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.lang-toggle:hover {
  background: var(--background-secondary);
  border-color: var(--color-secondary);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

main {
  padding: 56px 0 72px;
}

.intro {
  padding: 0 12px 34px;
}

h1 {
  color: var(--white);
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.headline {
  margin: 0 0 14px;
  color: var(--color-secondary);
  font-size: 17px;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
  color: var(--color-secondary);
}

.contact-line a {
  color: var(--color-secondary);
}

.contact-line a:hover {
  color: var(--white);
}

.cv-section {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 12px;
  border-top: 1px solid var(--border);
  border-radius: 6px;
  transition: background-color 140ms ease;
}

.cv-section:last-of-type {
  border-bottom: 1px solid var(--border);
}

.cv-section:hover {
  background: var(--background-secondary);
}

.cv-section h2 {
  margin: 0;
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
}

.cv-section > div {
  min-width: 0;
}

p {
  margin: 0 0 12px;
}

.entry {
  margin-bottom: 25px;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 6px;
}

.entry-name,
.skill-title {
  color: var(--white);
  font-weight: 650;
}

.entry-role {
  color: var(--color-secondary);
  margin-top: 1px;
  font-size: 14px;
}

.entry-date {
  color: var(--color-secondary);
  font-size: 14px;
  white-space: nowrap;
}

ul {
  margin: 8px 0 0;
  padding-left: 19px;
}

li {
  margin: 5px 0;
}

.tech {
  margin-top: 9px;
  color: var(--color-secondary);
  font-size: 14px;
}

.tech strong {
  color: var(--color);
  font-weight: 500;
}

.project-intro {
  margin-top: 10px;
}

.skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 30px;
}

.skill-title {
  margin-bottom: 3px;
}

.muted {
  color: var(--color-secondary);
}

footer {
  padding: 0 0 42px;
  color: var(--color-secondary);
  font-size: 13px;
}

@media (max-width: 680px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
    gap: 10px;
  }

  nav {
    flex-wrap: wrap;
  }

  main {
    padding-top: 38px;
  }

  .intro {
    padding-left: 8px;
    padding-right: 8px;
  }

  .cv-section {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 22px 8px;
  }

  .entry-head {
    display: block;
  }

  .entry-date {
    margin-top: 3px;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
