/* ─────────────────────────────────────────────
   CSS RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* palette extracted from photo */
  /* 1 #191210  near-black warm dark   */
  /* 2 #1f3244  dark teal/slate        */
  /* 3 #7c3d1e  auburn rust (beard)    */
  /* 4 #c98b5e  warm amber (skin)      */
  /* 5 #ede1cc  cream ivory (shirt)    */

  --bg:          #0f1014;
  --bg-section:  #1a1f27;
  --accent:      #c98b5e;
  --text:        #c7cfda;
  --text-muted:  #909aab;
  --text-strong: #eef2f8;
  --border:      #303947;
  --tag-fintech:      #c98b5e;
  --tag-healthcare:   #2d6e7a;
  --tag-financial:    #a05030;
  --tag-manufacturing:#6a7a38;
  --tag-it:           #3a5a72;
  --tag-rental:       #8a6a42;
  --tag-telecom:      #a07a30;
  --ui-scale: 1.1;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size-base: calc(13px * var(--ui-scale));
  --gap: calc(24px * var(--ui-scale));
}

html {
  font-size: var(--font-size-base);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 32px 16px;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

.page--landing {
  max-width: 900px;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  margin-bottom: var(--gap);
}

.site-header--compact {
  padding-top: 0;
  padding-bottom: 0;
}

.site-title {
  color: var(--text-strong);
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.site-nav a {
  border-radius: 7px;
  padding: 6px 14px;
  color: var(--text-muted, #8a9ab0);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}

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

.site-nav a[aria-current="page"] {
  background: #2a3a4a;
  color: var(--accent);
}

.landing-card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: grid;
  gap: 12px;
}

.landing-card p {
  font-size: 0.95rem;
}

.about-page {
  display: grid;
  gap: 28px;
}

.about-hero {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.about-hero__name {
  color: var(--text-strong);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.about-hero__tagline {
  color: var(--text-muted, #8a9ab0);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
}

.about-hero__photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.about-contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.about-section {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.about-copy {
  display: grid;
  gap: 12px;
}

.about-copy p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
}

.section--narrow {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.contacts-list {
  display: grid;
  gap: 12px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  background: rgba(21, 27, 36, 0.72);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.card h2 {
  color: var(--text-strong);
  font-size: 0.95rem;
}

.card p {
  font-size: 0.82rem;
}

.card a {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

.cards-grid--latest-posts {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.blog-preview-card__title {
  color: var(--text-strong);
  font-size: 0.95rem;
  line-height: 1.35;
}

.blog-preview-card__meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.blog-preview-card__excerpt {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.55;
}

.blog-preview-card__link {
  margin-top: auto;
}

.markdown-body {
  display: grid;
  gap: 12px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--text-strong);
}

.markdown-body p,
.markdown-body li {
  font-size: 0.9rem;
}

.markdown-body pre {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  padding: 12px;
}

/* ─────────────────────────────────────────────
   PAGE WRAPPER (see .page above, merged with z-index block)
───────────────────────────────────────────── */

/* ─────────────────────────────────────────────
   HEADER
───────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  gap: calc(40px * var(--ui-scale));
  padding: calc(32px * var(--ui-scale)) calc(40px * var(--ui-scale));
  background: var(--bg-section);
  border-radius: 12px;
  margin-bottom: var(--gap);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.header__photo img {
  width: calc(120px * var(--ui-scale));
  height: calc(120px * var(--ui-scale));
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  display: block;
}

.header__name {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.header__contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 32px;
}

.contact {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
  transition: color 0.2s;
}

.contact:hover {
  color: var(--text-strong);
}

.contact__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-strong);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   TWO-COLUMN BODY
───────────────────────────────────────────── */
.body {
  display: grid;
  grid-template-columns: calc(380px * var(--ui-scale)) 1fr;
  gap: var(--gap);
  align-items: start;
}

/* ─────────────────────────────────────────────
   SECTION COMMON
───────────────────────────────────────────── */
.section {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: calc(20px * var(--ui-scale)) calc(24px * var(--ui-scale));
  margin-bottom: var(--gap);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

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

.section__title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-strong);
  border: 2px solid var(--text-strong);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 18px;
}

/* ─────────────────────────────────────────────
   SKILLS TABLE
───────────────────────────────────────────── */
.skills-table {
  width: 100%;
  border-collapse: collapse;
}

.skills-table tr {
  border-bottom: 1px solid var(--border);
}

.skills-table tr:last-child {
  border-bottom: none;
}

.skills-table th,
.skills-table td {
  padding: 7px 4px;
  vertical-align: top;
  text-align: left;
  font-weight: 400;
}

.skills-table th {
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  padding-right: 16px;
  font-size: 0.82rem;
  width: 110px;
}

.skills-table td {
  color: var(--text);
  font-size: 0.82rem;
}

/* ─────────────────────────────────────────────
   CHALLENGES LIST
───────────────────────────────────────────── */
.challenges-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.challenge {
  position: relative;
  padding-left: 28px;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
}

.challenge::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1e3530;
  color: #6aaa88;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.challenge--failed::before {
  content: '✗';
  background: #3a1a10;
  color: #c98b5e;
}

/* ─────────────────────────────────────────────
   EDUCATION
───────────────────────────────────────────── */
.edu-item {
  margin-bottom: 14px;
}

.edu-item:last-child {
  margin-bottom: 0;
}

.edu-item__school {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-strong);
}

.edu-item__degree {
  font-size: 0.82rem;
  color: var(--text);
}

.edu-item__years {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─────────────────────────────────────────────
   TIMELINE (PROJECTS)
───────────────────────────────────────────── */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: calc(65px * var(--ui-scale));
  top: calc(6px * var(--ui-scale));
  bottom: calc(6px * var(--ui-scale));
  width: 2px;
  background: var(--border);
}

.timeline__item {
  display: grid;
  grid-template-columns: calc(58px * var(--ui-scale)) 1fr;
  gap: calc(16px * var(--ui-scale));
  margin-bottom: calc(20px * var(--ui-scale));
  position: relative;
}

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

.timeline__date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  padding-top: 2px;
  white-space: nowrap;
}

.timeline__content {
  position: relative;
  padding-left: calc(18px * var(--ui-scale));
}

.timeline__content::before {
  content: '';
  position: absolute;
  left: calc(-13px * var(--ui-scale));
  top: calc(6px * var(--ui-scale));
  width: calc(10px * var(--ui-scale));
  height: calc(10px * var(--ui-scale));
  border-radius: 50%;
  background: var(--accent);
  border: calc(2px * var(--ui-scale)) solid var(--bg-section);
}

.timeline__desc {
  font-size: 0.85rem;
  color: var(--text-strong);
  margin-bottom: 4px;
  font-weight: 500;
}

.timeline__tech {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.timeline__tech strong {
  color: var(--text);
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   TAGS (industry labels)
───────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.tag--fintech       { background: var(--tag-fintech); }
.tag--healthcare    { background: var(--tag-healthcare); }
.tag--financial     { background: var(--tag-financial); }
.tag--manufacturing { background: var(--tag-manufacturing); }
.tag--it            { background: var(--tag-it); }
.tag--rental        { background: var(--tag-rental); }
.tag--telecom       { background: var(--tag-telecom); }

/* ─────────────────────────────────────────────
   LANGUAGES
───────────────────────────────────────────── */
.lang-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-item__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-strong);
  width: 80px;
  flex-shrink: 0;
}

.lang-item__level {
  font-size: 0.8rem;
  background: var(--accent);
  color: #fff;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.lang-item__level--muted {
  background: var(--border);
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   VALUES / INTERESTS
───────────────────────────────────────────── */
.plain-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 800px) {
  .body {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .header__contacts {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .about-contacts {
    grid-template-columns: 1fr;
  }

  .header__name {
    font-size: 1.8rem;
  }

  .timeline::before {
    left: calc(59px * var(--ui-scale));
  }

}

/* ─────────────────────────────────────────────
   PRINT
───────────────────────────────────────────── */
@page {
  size: A4 portrait;
  margin: 5mm;
}

@media print {
  :root {
    --print-scale: 0.53;
    --print-safe-margin: 4mm;
  }

  html,
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  body {
    background: var(--bg) !important;
    color: var(--text) !important;
    padding: 0;
    padding: var(--print-safe-margin);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
  }

  #bg-canvas {
    display: none !important;
  }

  .site-header {
    display: none !important;
  }

  .page {
    width: calc(1100px * var(--ui-scale));
    max-width: none;
    margin: 0 auto;
    zoom: var(--print-scale);
    transform: none;
    transform-origin: initial;
  }

  .header {
    flex-direction: row !important;
    text-align: left !important;
  }

  .header__contacts {
    grid-template-columns: 1fr 1fr !important;
    justify-items: stretch !important;
  }

  .body {
    display: grid !important;
    grid-template-columns: calc(380px * var(--ui-scale)) 1fr !important;
    gap: var(--gap) !important;
    align-items: start !important;
  }

  .header,
  .section {
    background: var(--bg-section) !important;
    border-color: var(--border) !important;
  }

  a,
  .tag,
  .contact,
  .timeline__desc,
  .timeline__tech strong {
    color: inherit;
  }
}
