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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #ffffff;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* =========================================
   LAYOUT HELPERS
   ========================================= */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-alt {
  background: #f7f7f5;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #555;
  max-width: 700px;
  margin-bottom: 56px;
}

/* =========================================
   PLACEHOLDER BOXES
   (замінити на реальні зображення пізніше)
   ========================================= */
.placeholder-box {
  background: #e8e8e4;
  border: 2px dashed #c0c0b8;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.85rem;
  width: 100%;
  height: 100%;
}

.portrait-placeholder {
  width: 320px;
  height: 400px;
  border-radius: 12px;
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(40px, calc((100% - 1100px) / 2 + 24px));
  height: 60px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: #1a1a1a;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  color: #444;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #1a1a1a;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-content {
  max-width: 560px;
}

.hero-image-placeholder img {
  display: block;
  margin-left: auto;
  border-radius: 12px;
  max-height: 512px;
}

.hero-tag {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #767676;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-description {
  font-size: 1.1rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: #1a1a1a;
  color: #ffffff;
}

.btn-primary:hover {
  background: #333;
}

.btn-secondary {
  background: transparent;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
}

.btn-secondary:hover {
  background: #1a1a1a;
  color: #ffffff;
}

/* =========================================
   PROJECT CARDS
   ========================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.project-card {
  display: block;
  border: 1px solid #e8e8e4;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  background: #fff;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.project-card-image {
  height: 220px;
  overflow: hidden;
}

.project-card-image img,
.project-card-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.project-card:hover .project-card-image img,
.project-card:hover .project-card-image video {
  transform: scale(1.03);
}

.project-card-body {
  padding: 24px;
}

.project-card-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #767676;
  margin-bottom: 8px;
}

.project-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.project-card-body p {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 1px;
}

/* =========================================
   SKILLS
   ========================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.skill-group h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #767676;
  margin-bottom: 16px;
}

.skill-group ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-group li {
  font-size: 0.95rem;
  color: #333;
  padding-left: 12px;
  position: relative;
}

.skill-group li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: #bbb;
}

/* =========================================
   TIMELINE (Education)
   ========================================= */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 720px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 40px 0;
  border-bottom: 1px solid #eee;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-date {
  font-size: 0.85rem;
  color: #767676;
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

.timeline-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-place {
  font-size: 0.9rem;
  color: #767676;
  margin-bottom: 10px;
}

.timeline-body p {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.65;
}

/* =========================================
   EDUCATION HIGHLIGHTS
   ========================================= */
.education-highlights {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.highlight-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  align-items: baseline;
}

.highlight-number {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: -0.5px;
  line-height: 1;
}

.highlight-label {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.5;
}

/* =========================================
   CONTACT
   ========================================= */
.contact-container {
  text-align: center;
}

.contact-container .section-subtitle {
  margin: 0 auto 48px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 8px;
  padding: 14px 22px;
  font-size: 0.92rem;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
}

a.contact-item:hover {
  border-color: #1a1a1a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.contact-icon {
  font-size: 1rem;
  color: #888;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
  text-align: center;
  padding: 32px;
  font-size: 0.82rem;
  color: #bbb;
  border-top: 1px solid #eee;
}

/* =========================================
   PROJECT DETAIL PAGES
   ========================================= */
.project-detail-nav {
  height: 60px;
  padding: 0 max(20px, calc((100% - 900px) / 2 + 40px));
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-detail-nav a {
  font-size: 0.88rem;
  color: #555;
  transition: color 0.2s;
}

.project-detail-nav a:hover {
  color: #1a1a1a;
}

.project-detail-nav .nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.project-header {
  max-width: 900px;
  margin: 80px auto 64px;
  padding: 0 40px;
}

.project-header .project-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #888;
  margin-bottom: 16px;
}

.project-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.project-header .project-subtitle {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.7;
  max-width: 640px;
}

.project-hero {
  max-width: 900px;
  margin: 0 auto 80px;
  padding: 0 40px;
}

.project-hero .placeholder-box {
  height: 480px;
  border-radius: 12px;
}

.project-hero img,
.project-hero video {
  width: 100%;
  border-radius: 12px;
}

.project-hero video {
  max-height: 670px;
  object-fit: contain;
}

.caption {
  font-size: 0.82rem;
  color: #767676;
  margin-top: 12px;
  text-align: center;
}

.project-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 40px 32px;
}

.project-content section {
  margin-bottom: 48px;
}

.project-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.project-content p {
  font-size: 1rem;
  color: #444;
  line-height: 1.75;
  margin-bottom: 1em;
}

.project-content ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.project-content li {
  font-size: 1rem;
  color: #444;
  padding-left: 20px;
  position: relative;
  line-height: 1.75;
}

.project-content li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #bbb;
}

.project-content figure {
  margin: 40px 0;
}

.project-content figure .placeholder-box {
  height: 360px;
  border-radius: 8px;
}

.project-content figure img,
.project-content figure video {
  border-radius: 8px;
  width: 100%;
  /*max-height: 450px;
  object-fit: contain;*/
}

.project-content figure figcaption {
  font-size: 0.82rem;
  color: #767676;
  margin-top: 10px;
  text-align: center;
}

.figure-two-col {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.figure-two-col img {
  flex: 1 1 0;
  min-width: 0;
  object-fit: cover;
  border-radius: 8px;
}

@media (max-width: 560px) {
  .figure-two-col img {
    flex-basis: 100%;
  }
}

.figure-two-col figcaption {
  flex-basis: 100%;
}

/* Tab switcher figure */
.tab-figure .tab-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tab-figure .tab-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #e8e8e4;
  border-radius: 20px;
  background: none;
  cursor: pointer;
  color: #555;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tab-figure .tab-btn:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.tab-figure .tab-btn.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

.tab-figure .tab-panel {
  display: none;
  /* Soft edges (Weichkanten 20px) — uncomment to activate:
  -webkit-mask-image:
    linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent),
    linear-gradient(to bottom, transparent, black 20px, black calc(100% - 20px), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent),
    linear-gradient(to bottom, transparent, black 20px, black calc(100% - 20px), transparent);
  mask-composite: intersect;
  */
}

.tab-figure .tab-panel.active {
  display: block;
}

.figure-four-col {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.project-content .figure-four-col img {
  flex: 1 1 calc(25% - 9px);
  min-width: 0;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

@media (max-width: 600px) {
  .project-content .figure-four-col img {
    flex: 1 1 calc(50% - 6px);
  }
}

/* Tags (skills used) */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tags span {
  background: #f0f0ec;
  border: 1px solid #e0e0d8;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 0.82rem;
  color: #444;
}

/* Bottom navigation between projects */
.project-bottom-nav {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 40px 200px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  border-top: 1px solid #eee;
}

.project-bottom-nav a {
  display: flex;
  flex-direction: row;
  height: 170px;
  overflow: hidden;
  border: 1px solid #e8e8e4;
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-bottom-nav a:hover {
  border-color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.project-bottom-nav a:hover .nav-card-img {
  transform: scale(1.04);
}

.nav-card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 24px 28px;
}

.project-bottom-nav a.nav-next {
  order: -1;
}

.project-bottom-nav a.nav-next .nav-card-img {
  order: 1;
}

.project-bottom-nav a.nav-next .nav-card-text {
  text-align: left;
}

.nav-card-img {
  width: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  transition: transform 0.4s;
}

.nav-direction {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #767676;
}

.nav-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 60px 24px;
  }

  .hero-buttons {
    justify-content: center;
  }

  .portrait-placeholder {
    width: 240px;
    height: 300px;
  }

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

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0 20px;
  }

  .nav-links {
    gap: 20px;
  }

  .section {
    padding: 64px 0;
  }

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

  .project-header,
  .project-hero,
  .project-content,
  .project-bottom-nav {
    padding-left: 20px;
    padding-right: 20px;
  }

  .project-bottom-nav {
    grid-template-columns: 1fr;
  }

  .project-bottom-nav a {
    flex-direction: column;
    height: auto;
  }

  .project-bottom-nav a .nav-card-img,
  .project-bottom-nav a.nav-next .nav-card-img {
    order: -1;
    width: 100%;
    height: 160px;
  }

  .project-bottom-nav a.nav-next {
    order: -1;
  }

  .project-bottom-nav a.nav-next .nav-card-text {
    text-align: left;
  }
}