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

:root {
  --bg: #ffffff;
  --text: #111111;
  --text-muted: #666666;
  --border: #dddddd;
  --link: #0057b8;
  --link-hover: #003d82;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --text: #efefef;
    --text-muted: #888888;
    --border: #2d2d2d;
    --link: #5da3fa;
    --link-hover: #82baff;
  }
}

[data-theme="dark"] {
  --bg: #111111;
  --text: #efefef;
  --text-muted: #888888;
  --border: #2d2d2d;
  --link: #5da3fa;
  --link-hover: #82baff;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

/* Theme toggle */

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, border-color 0.15s;
  z-index: 100;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Cat link */

.cat-link {
  position: fixed;
  bottom: 24px;
  right: 24px;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  line-height: 0;
  z-index: 100;
}

.cat-link:hover {
  opacity: 1;
  color: var(--text);
}

/* Header */

.site-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 32px;
}

nav {
  display: flex;
  gap: 24px;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

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

/* Sections */

section {
  margin-bottom: 48px;
}

section h2 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

section p {
  line-height: 1.7;
}

/* Experience */

.timeline {
  display: flex;
  flex-direction: column;
}

.job {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.job:first-child {
  border-top: 1px solid var(--border);
}

.job-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.company {
  font-weight: 600;
  font-size: 1rem;
}

.group {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.period {
  color: var(--text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.job-desc,
.achievements {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.achievements {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.achievements li::before {
  content: '— ';
}

/* Contacts */

.contacts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contacts li {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 72px;
}

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

.contacts a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Footer */

footer {
  margin-top: auto;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Mobile */

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .site-header {
    padding: 32px 0 24px;
  }

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

  .job-meta {
    flex-direction: column;
    gap: 4px;
  }

  .period {
    white-space: normal;
  }

  .achievements {
    padding-left: 0;
  }

  .contacts li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
