/* =========================================================
   CV / Resume — Style Sheet
   ========================================================= */

:root {
  --color-bg: #eef2f1;
  --color-surface: #ffffff;
  --color-primary: #8a9f9b;
  --color-primary-dark: #6b7d79;
  --color-accent: #10b981;
  --color-text: #1f2726;
  --color-text-muted: #5f6b6a;
  --color-border: #dbe3e2;
  --color-tag-bg: #e4eceb;
  --color-tag-text: #3f514e;
  /* Deeper sage shades for text links — #8a9f9b is too light for text */
  --color-primary-text: #4f615e;
  --color-primary-text-hover: #3a4a47;
  /* Header banner — dark text on sage keeps contrast readable */
  --header-bg: #8a9f9b;
  --color-header-text: #16201e;
  --shadow-sm: 0 1px 3px rgba(30, 45, 43, 0.10);
  --shadow-md: 0 10px 25px rgba(30, 45, 43, 0.14);
  --radius: 14px;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: 0.25s ease;
}

[data-theme="dark"] {
  --color-bg: #141a19;
  --color-surface: #1c2322;
  --color-primary: #8a9f9b;
  --color-primary-dark: #6b7d79;
  --color-accent: #34d399;
  --color-text: #e8eeed;
  --color-text-muted: #a3b0ae;
  --color-border: #333d3c;
  --color-tag-bg: #2a3332;
  --color-tag-text: #a8bdb9;
  --color-primary-text: #a8bdb9;
  --color-primary-text-hover: #c6d6d3;
  --header-bg: #8a9f9b;
  --color-header-text: #16201e;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), background var(--transition);
}
.theme-toggle:hover { transform: scale(1.08); }

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--header-bg);
  color: var(--color-header-text);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}

.header__photo img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: #fff;
}

.header__info { flex: 1; min-width: 220px; }

.header__name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
}

.header__title {
  margin: 4px 0 14px;
  font-size: 1.05rem;
  font-weight: 500;
  opacity: 0.9;
}

.header__contacts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.header__contacts li a {
  color: var(--color-header-text);
  text-decoration: none;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header__contacts li a:hover { opacity: 1; text-decoration: underline; }

.header__actions { align-self: flex-start; }

.btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform var(--transition), background var(--transition);
}

.btn--print {
  background: rgba(255, 255, 255, 0.55);
  color: var(--color-header-text);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
}
.btn--print:hover { background: rgba(255, 255, 255, 0.75); transform: translateY(-1px); }

/* ---------- Layout ---------- */
.content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 800px) {
  .content { grid-template-columns: 1fr; }
}

.sidebar, .main { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--color-text);
  position: relative;
  padding-left: 14px;
}
.card__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 4px;
  background: var(--color-primary);
}

.card__text {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.badge {
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Tags / Skills ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
}

/* ---------- Lists ---------- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}
.list li strong { color: var(--color-text); font-weight: 600; }

/* ---------- Education ---------- */
.education { display: flex; flex-direction: column; gap: 14px; }
.education-item h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}
.education-item p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---------- Certification ---------- */
.certification { display: flex; flex-direction: column; gap: 14px; }
.certification-item h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}
.certification-item h3 a {
  color: var(--color-primary-text);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}
.certification-item h3 a::after {
  content: " \2197";
  font-size: 0.7em;
  opacity: 0.7;
}
.certification-item h3 a:hover {
  color: var(--color-primary-text-hover);
  text-decoration: underline;
}

/* ---------- Work Experience ---------- */
.timeline-item {
  position: relative;
}

.timeline-item__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-item__role {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.timeline-item__org {
  color: var(--color-primary-text);
  font-weight: 600;
}

.timeline-item__period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-tag-bg);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.timeline-item__duration {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 2px 0 8px;
  font-style: italic;
}

.timeline-item__desc {
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.timeline-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.timeline-item__tags .tag {
  font-size: 0.75rem;
  padding: 4px 9px;
}

/* ---------- Nested projects (inside a job) ---------- */
.job-projects {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--color-border);
}
.project {
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 10px;
}
.project:last-child { margin-bottom: 0; }

.project__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.project__name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--color-text);
}
.project__period {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-tag-bg);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.project__role {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary-text);
}
.project__desc {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.project__resp {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project__resp li {
  position: relative;
  padding-left: 16px;
  font-size: 0.87rem;
  line-height: 1.5;
}
.project__resp li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}
.project__resp-label {
  font-weight: 600;
  color: var(--color-text);
  margin-right: 6px;
}
.project__resp-text {
  color: var(--color-text-muted);
}

.project__tech {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.project__tech-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-right: 2px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  margin-top: 32px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ---------- Print styles ---------- */
@media print {
  .theme-toggle, .btn--print { display: none !important; }
  body { background: #fff; }
  .card, .header { box-shadow: none; border: 1px solid #ddd; }
  .header { background: var(--header-bg) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page { padding: 0; max-width: 100%; }
}
