/* =========================================
   ТЕМИ / ЗМІННІ (узгоджено з головною)
   ========================================= */
:root{
  --bg: #f5f9ff;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5e7eb;
  --brand: #0ea5e9;
  --brand-ink: #083344;
  --ring: rgba(14,165,233,.35);
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-1: 0 10px 30px rgba(2, 8, 23, .06);
  --shadow-2: 0 18px 50px rgba(2, 8, 23, .08);
}

html[data-theme="dark"]{
  --bg: #0b1220;
  --panel: #0f172a;
  --ink: #e5e7eb;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --line: #1f2937;
  --brand: #38bdf8;
  --brand-ink: #05202a;
  --shadow-1: none;
  --shadow-2: none;
}

/* =========================================
   БАЗА
   ========================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body{
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.9)), var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans";
}

img{ max-width: 100%; height: auto; display: block; }
a{ color: inherit; text-decoration: none; }
:focus-visible{ outline: 2px solid var(--brand); outline-offset: 2px; }

.container{ max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main.content{ padding: 20px 0 40px; }

/* =========================================
   РОЗДІЛ-КАРТКА
   ========================================= */
.section-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 18px 16px;
  margin: 18px 0;
}
.section-header{
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.section-header .badge{
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
}
.section-header h2, .section-header h3{
  margin: 0; line-height: 1.25;
  font-size: clamp(1.25rem, 1rem + .9vw, 1.6rem);
}
.section-body{ color: var(--ink-2); line-height: 1.65; }

/* =========================================
   ОСОБИСТА ІНФОРМАЦІЯ (біографія + фото + дисципліни)
   ========================================= */
.biography{
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr); /* ліворуч фото, праворуч текст */
  grid-auto-rows: min-content;
  gap: 18px 24px;
  align-items: center; /* вирівнюємо текст по центру відносно фото */
}

/* Фото – в лівому стовпчику */
.biography > img{
  grid-column: 1;
  width: 100%;
  max-width: 260px;
  height: auto;              /* зберігаємо природні пропорції портрету */
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(2,8,23,.1);
  border: 1px solid var(--line);
  justify-self: start;
}

/* Текст (ім’я, спеціальність, освіта) – у правому стовпчику */
.biography .bio-text{
  grid-column: 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;  /* вертикальне центрування тексту */
  gap: 4px;
}

/* Заголовок "Дисципліни..." на всю ширину і по центру */
.biography > h4{
  grid-column: 1 / -1;
  margin: 8px 0 0;
  text-align: center;
  color: var(--ink);
}

/* Чіпи дисциплін — по центру, на всю ширину */
.biography > .chips{
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

/* Чіпи */
.chip{
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 700;
  white-space: nowrap;
}

/* Адаптив для вузьких екранів */
@media (max-width: 900px){
  .biography{
    grid-template-columns: 1fr; /* все у стовпчик */
    text-align: left;
  }

  .biography > img{
    grid-column: 1;
    justify-self: center;
    max-width: 220px;
    margin-top: 4px;
  }

  .biography .bio-text{
    grid-column: 1;
    text-align: left;
  }
}


/* =========================================
   СІТКИ / КАРТКИ / ДОДАТКОВІ ЕЛЕМЕНТИ
   ========================================= */
.grid.two{ display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px){ .grid.two{ grid-template-columns: 1fr; } }

.note, .quote{
  background: #fff;
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--ink-2);
}

.list-check, .list-dot{ padding-left: 18px; margin: 8px 0 0; }
.list-check li{ margin: 6px 0; list-style: "✔  "; }
.list-dot li{ margin: 6px 0; list-style: "•  "; }

/* =========================================
   СЕРТИФІКАТИ (сітка карток)
   ========================================= */
.cert-grid{
  display: grid; gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}
.cert-card{
  grid-column: span 4;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cert-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}
.cert-figure{ aspect-ratio: 16/9; overflow: hidden; }
.cert-thumb{ width: 100%; height: 100%; object-fit: cover; }
.cert-meta{ padding: 12px; }
.cert-title{ margin: 0 0 6px; font-size: 1rem; color: var(--ink); }
.cert-note{ margin: 0 0 10px; color: var(--muted); }
.cert-actions{ display: flex; gap: 8px; }

@media (max-width: 1024px){
  .cert-card{ grid-column: span 6; }
}
@media (max-width: 600px){
  .cert-card{ grid-column: span 12; }
}

/* =========================================
   КНОПКИ
   ========================================= */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 14px; border-radius: 12px; font-weight: 700;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  text-decoration: none; cursor: pointer;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 8px 20px var(--ring); }
.btn:active{ transform: translateY(0); box-shadow: none; }
.btn.soft{ background: color-mix(in srgb, var(--brand) 10%, #fff); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.btn.ghost{ background: transparent; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }

/* =========================================
   LIGHTBOX (якщо використовується)
   ========================================= */
.lightbox{ position: fixed; inset: 0; display: none; }
.lightbox[aria-hidden="false"]{ display: block; }
.lightbox-backdrop{ position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.lightbox-dialog{
  position: relative; z-index: 2; max-width: 1000px; margin: 4vh auto; background: var(--panel);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2); border: 1px solid var(--line);
  padding: 12px;
}
.lightbox-close{
  position: absolute; top: 8px; right: 12px; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.lightbox img{ width: 100%; height: auto; border-radius: 10px; }
.lightbox-caption{
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--ink-2);
}
.lb-title{ font-weight: 700; }

/* =========================================
   ТАЙМЛАЙН / ЛІНІЯ ЧАСУ
   ========================================= */
.timeline{
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li{
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  position: relative;
}

/* Вертикальна лінія */
.timeline li::before{
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 2px;
}

/* Точка */
.tl-point{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 6px;
  z-index: 1;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, #fff);
}

/* Контент */
.tl-content{
  border-left: 2px dashed color-mix(in srgb, var(--brand) 35%, var(--line));
  padding-left: 12px;
}

.tl-date{
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

.tl-title{
  font-weight: 600;
  color: var(--ink);
  margin: 2px 0 4px;
}

.tl-desc{
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* адаптив — менше відступів */
@media (max-width: 600px){
  .timeline li{
    grid-template-columns: 18px 1fr;
    gap: 8px;
  }
  .timeline li::before{
    left: 8px;
  }
  .tl-content{ padding-left: 10px; }
}


/* =========================================
   REVEAL-АНІМАЦІЯ (IntersectionObserver додає .is-visible)
   ========================================= */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
  will-change: opacity, transform;
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* безпека для користувачів, що не люблять анімації */
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* =========================================
   ФУТЕР
   ========================================= */
footer{
  margin-top: 28px; padding: 20px; text-align: center; color: var(--muted);
}
footer .banner{ margin: 12px auto 0; max-width: 320px; border-radius: 8px; }
