@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
  --yellow: #ffb400;
  --dark: #333333;
  --sidebar-bg: #2b2b2b;
  --light-grey: #f0f0f0;
  --text-grey: #777777;
  --white: #ffffff;
  --cv-width: 210mm;
  --cv-height: 297mm;
  --sidebar-ratio: 32%;
  --track-x: 20px;
  --sidebar-pad: 38px;
  --main-track-x: 34px;
  --main-pad: 54px;
  --header-h: 200px;
  --header-bar-h: 96px;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #d5d5d5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
}

.cv-wrapper {
  width: var(--cv-width);
  min-height: var(--cv-height);
  max-width: 100%;
  background: var(--white);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  position: relative;
  overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-ratio);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.sidebar-top {
  --top-h: 200px;
  --photo-size: 112px;
  container-type: inline-size;
  position: relative;
  height: var(--top-h);
  flex-shrink: 0;
  overflow: visible;
}

.yellow-corner-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--yellow);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  z-index: 2;
}

.yellow-corner-top::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 42%,
    rgba(0, 0, 0, 0.07) 50%,
    transparent 58%
  );
  clip-path: polygon(0 0, 100% 0, 0 100%);
  pointer-events: none;
}

.profile-photo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: var(--photo-size);
  height: var(--photo-size);
  top: 48px;
  border-radius: 50% 50% 50% 0;
  border: 8px solid var(--white);
  overflow: hidden;
  z-index: 4;
  background: var(--white);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
}

.sidebar-timeline {
  position: absolute;
  top: 0;
  left: var(--track-x);
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.22);
  z-index: 1;
  transform: translateX(-50%);
}

.sidebar-content {
  padding: 6px 16px 20px var(--sidebar-pad);
  position: relative;
  z-index: 3;
  flex: 1;
}

.sidebar-section:first-child {
  margin-top: 4px;
}

.sidebar-section {
  position: relative;
  margin-bottom: 4px;
}

/* pill marker — section headers (on timeline only) */
.sidebar-section::before {
  content: '';
  position: absolute;
  left: calc(var(--track-x) - var(--sidebar-pad));
  top: 6px;
  transform: translateX(-50%);
  width: 8px;
  height: 26px;
  background: var(--yellow);
  border-radius: 4px;
  z-index: 5;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.contact-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.contact-item::before {
  content: '';
  position: absolute;
  left: calc(var(--track-x) - var(--sidebar-pad));
  top: 9px;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: var(--yellow);
  border-radius: 50%;
  z-index: 5;
}

.sidebar-icon {
  width: 28px;
  height: 28px;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-icon i {
  color: var(--dark);
  font-size: 13px;
}

.sidebar-section-header h3 {
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.contact-icon {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon i {
  color: var(--white);
  font-size: 11px;
}

.contact-item p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 300;
  word-break: break-word;
}

.sidebar-divider {
  border: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.28);
  margin: 12px 0 12px 8px;
}

.reference-block {
  position: relative;
  margin-bottom: 16px;
}

.reference-block::before {
  content: '';
  position: absolute;
  left: calc(var(--track-x) - var(--sidebar-pad));
  top: 4px;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: var(--yellow);
  border-radius: 50%;
  z-index: 5;
}

.reference-block:last-child {
  margin-bottom: 0;
}

.reference-block h4 {
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.reference-block p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.65;
  font-weight: 300;
}

.education-block {
  position: relative;
  margin-bottom: 10px;
}

.education-block::before {
  content: '';
  position: absolute;
  left: calc(var(--track-x) - var(--sidebar-pad));
  top: 3px;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: var(--yellow);
  border-radius: 50%;
  z-index: 5;
}

.education-block:last-child {
  margin-bottom: 0;
}

.education-block h4 {
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.education-block p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.6;
  font-weight: 300;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 28px;
  min-width: 0;
}

.main-timeline {
  position: absolute;
  top: 0;
  left: var(--main-track-x);
  width: 2px;
  height: 100%;
  background: #1a1a1a;
  z-index: 2;
  transform: translateX(-50%);
}

.header-section {
  position: relative;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 32px 0 54px;
  flex-shrink: 0;
}

.header-bar {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: var(--header-bar-h);
  transform: translateY(-50%);
  background: var(--light-grey);
  z-index: 0;
}

.header-name-block {
  position: relative;
  z-index: 3;
}

.yellow-name-bar {
  position: absolute;
  left: calc(var(--main-track-x) - var(--main-pad));
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 58px;
  background: var(--yellow);
  border-radius: 4px;
  z-index: 4;
}

.header-name {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.header-name .first,
.header-name .last {
  display: inline;
}

.header-name .first {
  color: var(--dark);
}

.header-name .last {
  color: var(--yellow);
}

.header-title {
  color: var(--dark);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.main-section {
  padding: 0 32px 0 54px;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}

.main-section::before {
  content: '';
  position: absolute;
  left: var(--main-track-x);
  top: 8px;
  transform: translateX(-50%);
  width: 8px;
  height: 26px;
  background: var(--yellow);
  border-radius: 4px;
  z-index: 3;
}

.main-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.main-icon {
  width: 32px;
  height: 32px;
  background: var(--yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main-icon i {
  color: var(--dark);
  font-size: 14px;
}

.main-section-header h3 {
  color: var(--dark);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.about-text {
  color: var(--text-grey);
  font-size: 11px;
  line-height: 1.55;
  font-weight: 400;
  text-align: justify;
}

.job-item {
  position: relative;
  margin-bottom: 12px;
}

.job-item::before {
  content: '';
  position: absolute;
  left: calc(var(--main-track-x) - var(--main-pad));
  top: 5px;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--yellow);
  border-radius: 50%;
  z-index: 3;
}

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

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.job-title {
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.job-date {
  color: var(--dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 10px;
}

.job-company {
  color: var(--text-grey);
  font-size: 12px;
  font-style: italic;
  margin-bottom: 7px;
}

.job-desc {
  color: var(--text-grey);
  font-size: 10.5px;
  line-height: 1.55;
  text-align: justify;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-name {
  color: var(--dark);
  font-size: 12px;
  font-weight: 500;
}

.skill-bar {
  width: 100%;
  height: 8px;
  background: var(--light-grey);
  position: relative;
}

.skill-bar-fill {
  height: 100%;
  background: var(--yellow);
  position: absolute;
  top: 0;
  left: 0;
}

.yellow-corner-bottom {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 70px;
  height: 70px;
  background: var(--yellow);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  z-index: 2;
}

.main-section:last-of-type {
  margin-bottom: 0;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: white;
    padding: 0;
  }

  .cv-wrapper {
    box-shadow: none;
    width: 210mm;
    height: 297mm;
    min-height: 0;
    max-height: 297mm;
    max-width: none;
    overflow: hidden;
  }

  .main-content {
    padding-bottom: 16px;
  }

  .main-section {
    margin-bottom: 10px;
  }

  .about-text,
  .job-desc {
    line-height: 1.45;
  }

  .skills-grid {
    gap: 6px 16px;
  }
}

@media (max-width: 820px) {
  :root {
    --cv-width: 100%;
  }

  body {
    padding: 12px 8px;
  }
}
