:root {
  --paper: #ffffff;
  --surface: #f8fafc;
  --ink: #111827;
  --body: #374151;
  --muted: #4b5563;
  --subtle: #6b7280;
  --border: #e5e7eb;
  --accent: #0f766e;
  --accent-hover: #0d625b;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--body);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

a,
button {
  cursor: pointer;
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
}

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

.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  flex-wrap: wrap;
  padding-top: 6px;
  padding-bottom: 6px;
}

.section-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
}

.section-nav a:hover {
  color: var(--ink);
  background: var(--surface);
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
}

.seg-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.seg-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.seg-btn.is-active {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--surface);
}

/* Main paper sheet */
.sheet {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 28px;
  margin-bottom: 20px;
  padding: 44px 48px;
}

.state-box {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
}

.state-error {
  color: #991b1b;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-text h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  color: var(--ink);
  font-weight: 700;
}

.role {
  margin: 6px 0 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
}

.contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
  color: var(--muted);
}

.contacts a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.contacts a:hover {
  text-decoration: underline;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Sections */
.section {
  scroll-margin-top: 76px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.section-head .section-title {
  margin-bottom: 0;
}

.variant-group {
  display: inline-flex;
  gap: 6px;
}

.var-btn {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.var-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.var-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

.profile-copy {
  margin: 0;
  color: var(--body);
}

/* Timeline (Experience & Education) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: start;
}

.period {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--subtle);
  padding-top: 2px;
}

.entry-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.entry-sub {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.entry-links {
  margin: 4px 0 0;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.entry-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.entry-links a:hover {
  text-decoration: underline;
}

.bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14.5px;
}

/* Skills */
.skills-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
}

.skill-row dt {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

.skill-row dd {
  margin: 0;
  font-size: 14.5px;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.project-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}

.project-tag {
  margin: 3px 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
}

.project-tag a {
  color: var(--accent);
  text-decoration: none;
}

.project-tag a:hover {
  text-decoration: underline;
}

.project-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.project-stack {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 36px;
  font-size: 13px;
  color: var(--subtle);
}

.link-btn {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

.link-btn:hover {
  text-decoration: underline;
}

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

  .sheet {
    padding: 24px 18px;
    margin-top: 14px;
  }

  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .timeline-row,
  .skill-row,
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .projects-grid {
    gap: 12px;
  }
}

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

@media print {
  body {
    background: #ffffff;
  }

  .topbar,
  .variant-group,
  .site-footer {
    display: none;
  }

  .sheet {
    border: 0;
    margin: 0;
    padding: 0;
  }
}

