/* =========================================
   CV Site — Iurie Cristea — Backend Dev
   ========================================= */

:root {
  --bg-primary:    #0d1117;
  --bg-secondary:  #161b22;
  --bg-card:       #1c2333;
  --accent:        #00d4aa;
  --accent-dim:    #00a884;
  --text-primary:  #e6edf3;
  --text-muted:    #8b949e;
  --border:        #30363d;
  --tag-bg:        #1f2d3d;
  --tag-text:      #58a6ff;
  --font-mono:     'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans:     'Inter', 'Segoe UI', sans-serif;
  --radius:        8px;
  --shadow:        0 4px 24px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── Topbar ── */
#topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 5vw, 48px);
  height: 56px;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.topbar-brand span { color: var(--text-muted); }

/* ── Print Button ── */
#print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

#print-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

#print-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-card);
}

/* ── Language Switcher ── */
.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4px;
}

.lang-btn {
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}

.lang-btn:hover { color: var(--text-primary); }

.lang-btn.active {
  background: var(--accent);
  color: #000;
}

/* ── Layout ── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 32px);
}

/* ── Hero ── */
#hero {
  padding: 64px 0 48px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}

.hero-name {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hero-name span {
  background: linear-gradient(135deg, var(--accent), #58a6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent);
}

.hero-title::before { content: '> '; color: var(--text-muted); }

.hero-location {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-location::before { content: '📍 '; }

.hero-summary {
  margin-top: 20px;
  color: var(--text-muted);
  max-width: 600px;
  font-size: 14.5px;
}

/* ── Avatar ── */
.avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.avatar-wrap img,
.avatar-wrap .avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  display: block;
}

.avatar-wrap .avatar-placeholder {
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed var(--accent);
  animation: spin 20s linear infinite;
  opacity: 0.4;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Contacts Bar ── */
.contacts-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.contact-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 212, 170, 0.05);
}

.contact-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Section ── */
.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.section-label::before { content: '// '; color: var(--text-muted); }

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}

.skill-card:hover { border-color: var(--accent); }

.skill-card-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(88, 166, 255, 0.2);
}

.tag.go    { color: #79c0ff; border-color: rgba(121,192,255,0.25); }
.tag.py    { color: #ffa657; border-color: rgba(255,166,87,0.25); }
.tag.js    { color: #f0db4f; border-color: rgba(240,219,79,0.25); }
.tag.php   { color: #b39ddb; border-color: rgba(179,157,219,0.25); }
.tag.db    { color: #d2a8ff; border-color: rgba(210,168,255,0.25); }
.tag.infra { color: #56d364; border-color: rgba(86,211,100,0.25); }
.tag.api   { color: var(--accent); border-color: rgba(0,212,170,0.25); }

/* ── Timeline / Experience ── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.tl-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0 20px;
  padding-bottom: 32px;
}

.tl-line {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
  box-shadow: 0 0 8px rgba(0,212,170,0.5);
}

.tl-track {
  width: 1px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
}

.tl-item:last-child .tl-track { background: transparent; }

.tl-body { min-width: 0; }

.tl-role {
  font-weight: 600;
  font-size: 16px;
}

.tl-company {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-top: 2px;
}

.tl-period {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 10px;
}

.tl-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.tl-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-bullets li {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}

.tl-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
  top: 3px;
}

.sub-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 10px;
  margin-bottom: 4px;
}

/* ── Languages ── */
.lang-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
}

.lang-row { display: flex; flex-direction: column; gap: 4px; }

.lang-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.lang-row-head span:last-child {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.lang-bar-track {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}

.lang-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #58a6ff);
  border-radius: 2px;
}

/* ── Education ── */
.edu-list { display: flex; flex-direction: column; gap: 16px; }

.edu-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.edu-degree { font-weight: 600; font-size: 15px; }
.edu-school { font-family: var(--font-mono); font-size: 13px; color: var(--accent); margin-top: 2px; }
.edu-year   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

footer span { color: var(--accent); }

/* ── Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero-inner { grid-template-columns: 1fr; }
  .avatar-wrap { order: -1; width: 88px; height: 88px; }
  .avatar-wrap img,
  .avatar-wrap .avatar-placeholder { width: 88px; height: 88px; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════ */
@media print {
  /* Reset to white paper */
  :root {
    --bg-primary:   #fff;
    --bg-secondary: #fff;
    --bg-card:      #f7f7f7;
    --accent:       #007a62;
    --accent-dim:   #007a62;
    --text-primary: #111;
    --text-muted:   #555;
    --border:       #d0d0d0;
    --tag-bg:       #eef2f7;
    --tag-text:     #1a5fa8;
  }

  @page {
    size: A4 portrait;
    margin: 14mm 16mm 14mm 16mm;
  }

  /* Remove screen-only chrome */
  #topbar,
  #print-btn,
  .avatar-ring,
  .fade-in { display: revert; opacity: 1; transform: none; }

  #topbar { display: none; }

  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
    line-height: 1.5;
  }

  /* Full width, no padding */
  .container { max-width: 100%; padding: 0; }

  /* ── Hero ── */
  #hero { padding: 0 0 18pt; }

  .hero-inner {
    display: grid;
    grid-template-columns: 1fr 88pt;
    gap: 20pt;
    align-items: start;
  }

  .hero-name { font-size: 22pt; }
  .hero-name span { -webkit-text-fill-color: var(--accent); color: var(--accent); }

  .hero-title  { font-size: 11pt; color: var(--accent); }
  .hero-summary { font-size: 10pt; color: var(--text-muted); max-width: 100%; margin-top: 8pt; }

  /* Avatar */
  .avatar-wrap { width: 80pt; height: 80pt; }
  .avatar-wrap img,
  .avatar-wrap .avatar-placeholder { width: 80pt; height: 80pt; border: 1.5pt solid var(--accent); }
  .avatar-ring { display: none; }

  /* Contacts */
  .contacts-bar { gap: 6pt; margin-top: 10pt; }
  .contact-link {
    border: 1pt solid var(--border);
    color: var(--text-muted);
    font-size: 9pt;
    padding: 2pt 6pt;
    text-decoration: none;
  }
  .contact-link::after { content: none; }

  /* ── Sections ── */
  .section { padding: 14pt 0; border-top: 1pt solid var(--border); }

  .section-label {
    font-size: 8pt;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 10pt;
  }

  /* Avoid orphan headings */
  .section { page-break-inside: avoid; }
  .tl-item { page-break-inside: avoid; }
  .edu-item { page-break-inside: avoid; }
  .skill-card { page-break-inside: avoid; }

  /* ── Skills grid ── */
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8pt;
  }

  .skill-card {
    background: var(--bg-card);
    border: 1pt solid var(--border);
    padding: 8pt 10pt;
  }

  .skill-card-title { font-size: 8pt; color: var(--text-muted); margin-bottom: 6pt; }

  .tag {
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 8pt;
    padding: 1pt 5pt;
    border: 1pt solid #c8d8ee;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .tag.go    { color: #1a5fa8; }
  .tag.py    { color: #b85c00; }
  .tag.js    { color: #7a6800; }
  .tag.php   { color: #5b3fa0; }
  .tag.db    { color: #6a3fa0; }
  .tag.infra { color: #1a7a30; }
  .tag.api   { color: var(--accent); }

  /* ── Timeline ── */
  .tl-dot {
    background: var(--accent);
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .tl-track { background: var(--border); }

  .tl-role    { font-size: 12pt; }
  .tl-company { font-size: 10pt; color: var(--accent); }
  .tl-period  { font-size: 9pt; color: var(--text-muted); }

  .tl-bullets li { font-size: 10pt; color: var(--text-muted); }
  .tl-bullets li::before { color: var(--accent); }
  .sub-title { font-size: 10pt; }

  /* ── Language bars ── */
  .lang-bar-track { background: #e0e0e0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .lang-bar-fill  { background: var(--accent); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .lang-row-head  { font-size: 10pt; }

  /* ── Education ── */
  .edu-item {
    background: var(--bg-card);
    border: 1pt solid var(--border);
    border-left: 3pt solid var(--accent);
    padding: 8pt 12pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .edu-degree { font-size: 11pt; }
  .edu-school { font-size: 10pt; color: var(--accent); }
  .edu-year   { font-size: 9pt; }

  /* ── Footer ── */
  footer { border-top: 1pt solid var(--border); padding: 10pt 0 0; font-size: 9pt; }
}