/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:   #3b82f6;
  --accent2:  #38bdf8;
  --accent3:  #818cf8;
  --dark:     #0f172a;
  --dark2:    #1e293b;
  --sidebar:  #1a1f35;
  --sidebar2: #141828;
  --text:     #f1f5f9;
  --muted:    #94a3b8;
  --card:     #1e293b;
  --border:   rgba(148,163,184,.12);
  --tag-bg:   rgba(59,130,246,.2);
  --tag-col:  #bfdbfe;
  --radius:   12px;
  --font:     'Inter', sans-serif;
  --font2:    'Space Grotesk', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--dark);
  color: var(--text);
  display: grid;
  grid-template-columns: 295px 1fr;
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent2); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .75; }

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  background: linear-gradient(170deg, var(--sidebar) 0%, var(--sidebar2) 100%);
  border-right: 1px solid var(--border);
  padding: 2.5rem 1.75rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

/* Avatar */
.avatar-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 1.25rem;
}
.avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  background: var(--dark2);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent) 0%, var(--accent2) 40%, var(--accent3) 70%, transparent 80%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), white calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), white calc(100% - 2px));
  z-index: 1;
}

/* Name & tagline */
.name {
  font-family: var(--font2);
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  letter-spacing: -.3px;
  color: #fff;
}
.name span { color: var(--accent2); }
.tagline {
  font-size: .76rem;
  color: var(--muted);
  text-align: center;
  margin-top: .4rem;
  line-height: 1.5;
  letter-spacing: .3px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

/* Sidebar sections */
.sb-section { display: flex; flex-direction: column; gap: .6rem; }
.sb-title {
  font-family: var(--font2);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: .2rem;
}

/* Contact list */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
}
.contact-list .icon { font-size: .85rem; flex-shrink: 0; margin-top: .05rem; }

/* Skill bars */
.skill-bars { display: flex; flex-direction: column; gap: .65rem; }
.skill-item { display: flex; flex-direction: column; gap: .3rem; }
.skill-name { font-size: .73rem; color: var(--text); font-weight: 500; }
.bar-track {
  height: 5px;
  background: rgba(148,163,184,.12);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

/* Languages */
.lang-list { display: flex; flex-direction: column; gap: .5rem; }
.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lang-name { font-size: .8rem; color: var(--text); }
.lang-level {
  font-size: .63rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 99px;
  letter-spacing: .5px;
}
.lang-level.native { background: rgba(56,189,248,.2); color: var(--accent2); }
.lang-level.c1 { background: rgba(59,130,246,.25); color: #bfdbfe; }
.lang-level.b1 { background: rgba(148,163,184,.15); color: #94a3b8; }

/* Tech pills */
.pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.pill {
  font-size: .67rem;
  background: rgba(59,130,246,.12);
  color: #bfdbfe;
  border: 1px solid rgba(59,130,246,.22);
  padding: .2rem .55rem;
  border-radius: 99px;
  transition: background .2s, transform .15s;
  cursor: default;
}
.pill:hover {
  background: rgba(59,130,246,.28);
  transform: translateY(-1px);
}

/* ── Main ───────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Header */
.main-header {
  background: linear-gradient(110deg, #1e2a4a 0%, #141d35 55%, #0f172a 100%);
  padding: 2.5rem 2.75rem 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.main-header::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.15) 0%, transparent 70%);
  pointer-events: none;
}
.main-header::after {
  content: '';
  position: absolute;
  bottom: -50px; left: 25%;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,.08) 0%, transparent 70%);
  pointer-events: none;
}
.header-text { position: relative; z-index: 1; flex: 1; min-width: 0; }

.header-label {
  font-size: .68rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 600;
  margin-bottom: .45rem;
}
.header-title {
  font-family: var(--font2);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.05;
  color: #fff;
}
.header-title span { color: var(--accent2); }
.header-sub {
  font-size: .88rem;
  color: var(--muted);
  margin-top: .6rem;
  font-weight: 400;
}

/* Header contact strip */
.header-contact {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin-top: 1rem;
}
.hc-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--muted);
  transition: color .2s;
}
.hc-item:hover { color: var(--accent2); opacity: 1; }
.hc-item svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--accent2); }
.hc-location { cursor: default; }
.hc-location:hover { color: var(--muted); }

/* Header actions (lang switcher + download button) */
.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .6rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: .3rem;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .2rem;
}
.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: .2rem .25rem;
  border-radius: 6px;
  opacity: .45;
  transition: opacity .2s, background .2s, transform .15s;
  display: flex;
  align-items: center;
}
.lang-btn svg { width: 28px; height: 14px; border-radius: 2px; display: block; }
.lang-btn:hover { opacity: .8; transform: scale(1.08); }
.lang-btn.active {
  opacity: 1;
  background: rgba(59,130,246,.25);
}

/* Download button */
.btn-download {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  color: #fff;
  font-family: var(--font2);
  font-size: .8rem;
  font-weight: 600;
  padding: .65rem 1.3rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 20px rgba(59,130,246,.35);
  align-self: flex-start;
  flex-shrink: 0;
}
.btn-download:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59,130,246,.5);
}
.btn-download:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.btn-download svg { width: 15px; height: 15px; }

/* Sections */
.section {
  padding: 2.5rem 2.75rem;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.section.visible { opacity: 1; transform: translateY(0); }

/* Section title — collapsible trigger */
.section-title {
  font-family: var(--font2);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.collapsible-trigger {
  cursor: pointer;
  user-select: none;
}
.collapsible-trigger:hover { color: var(--accent2); }
.collapsible-trigger .chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--muted);
  transition: transform .3s ease, color .2s;
  flex-shrink: 0;
}
.collapsible-trigger:hover .chevron { color: var(--accent2); }
.section.collapsed .chevron { transform: rotate(-90deg); }

/* Collapsible section body */
.section-body {
  overflow: hidden;
  transition: max-height .35s ease, opacity .3s ease;
  max-height: 9999px;
  opacity: 1;
}
.section.collapsed .section-body {
  max-height: 0;
  opacity: 0;
}
.section.collapsed .section-title { margin-bottom: 0; }

.section-icon { color: var(--accent2); font-size: .7rem; }

/* About */
.about-text {
  font-size: .92rem;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.8;
}
.about-text strong { color: var(--text); }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent2) 60%, rgba(59,130,246,.1) 100%);
  border-radius: 2px;
}

.tl-item {
  position: relative;
  margin-bottom: 1.75rem;
}
.tl-item:last-child { margin-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -1.5rem;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--dark);
  box-shadow: 0 0 0 3px rgba(59,130,246,.25);
  z-index: 1;
}
.tl-dot.small {
  width: 10px;
  height: 10px;
  background: var(--muted);
  box-shadow: none;
  top: 8px;
  left: calc(-1.5rem + 2px);
}
.tl-minor .tl-content { opacity: .65; }

.tl-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.tl-content:hover {
  border-color: rgba(59,130,246,.4);
  transform: translateX(4px);
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}

/* Timeline item collapsible */
.tl-trigger {
  cursor: pointer;
  user-select: none;
}
.tl-header-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.tl-chevron {
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform .3s ease, color .2s;
  flex-shrink: 0;
}
.tl-trigger:hover .tl-chevron { color: var(--accent2); }
.tl-item.collapsed .tl-chevron { transform: rotate(-90deg); }

.tl-body {
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
  transition: max-height .3s ease, opacity .25s ease;
}
.tl-item.collapsed .tl-body {
  max-height: 0;
  opacity: 0;
}
.tl-item.collapsed .tl-header { margin-bottom: 0; }
.tl-item.collapsed .tl-tags { margin-top: .6rem; }

.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .55rem;
  flex-wrap: wrap;
}
.tl-role {
  font-size: .93rem;
  font-weight: 600;
  color: #fff;
  font-family: var(--font2);
}
.tl-company {
  font-size: .78rem;
  color: var(--accent2);
  margin-top: .15rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.tl-company-logo {
  height: 14px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
  opacity: 0.85;
  flex-shrink: 0;
}
.tl-date {
  font-size: .71rem;
  color: var(--muted);
  white-space: nowrap;
  background: rgba(148,163,184,.08);
  padding: .2rem .65rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  height: fit-content;
}
.tl-desc {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.72;
  margin-bottom: .7rem;
}
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .32rem;
}
.tl-tags span {
  font-size: .67rem;
  background: var(--tag-bg);
  color: var(--tag-col);
  padding: .14rem .58rem;
  border-radius: 99px;
  border: 1px solid rgba(59,130,246,.2);
}

/* Education */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.edu-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: border-color .25s, box-shadow .25s;
}
.edu-card:hover {
  border-color: rgba(59,130,246,.4);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.edu-year {
  font-size: .72rem;
  color: var(--accent2);
  font-weight: 600;
  letter-spacing: .5px;
  display: block;
  margin-bottom: .6rem;
}
.edu-card h4 {
  font-family: var(--font2);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: .5rem;
}
.edu-card p { font-size: .82rem; color: var(--muted); line-height: 1.6; }

.cert-subtitle {
  font-family: var(--font2);
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: .85rem;
}
.cert-list { display: flex; flex-direction: column; gap: .55rem; }
.cert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .7rem 1rem;
  transition: border-color .2s;
}
.cert-item:hover { border-color: rgba(59,130,246,.35); }
.cert-item.featured {
  border-color: rgba(59,130,246,.45);
  background: rgba(59,130,246,.08);
}
.cert-year {
  font-size: .68rem;
  font-weight: 700;
  color: var(--accent2);
  min-width: 34px;
}
.cert-item strong {
  font-size: .82rem;
  color: var(--text);
  display: block;
}
.cert-issuer {
  font-size: .71rem;
  color: var(--muted);
  margin-top: .1rem;
  display: block;
}

/* Footer */
.main-footer {
  padding: 1.5rem 2.75rem;
  font-size: .77rem;
  color: var(--muted);
  margin-top: auto;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
  }

  .main-header {
    padding: 2rem 1.5rem;
    flex-direction: column;
  }
  .header-actions { flex-direction: row; align-self: stretch; justify-content: space-between; align-items: center; }
  .btn-download { align-self: auto; justify-content: center; }
  .header-title { font-size: 1.9rem; }
  .section { padding: 2rem 1.5rem; }
  .main-footer { padding: 1.5rem; }
  .edu-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar { position: static; height: auto; }
  .section { opacity: 1; transform: none; }
  .btn-download { display: none; }
}
