/* ===========================
   CSS VARIABLES & RESET
   =========================== */
:root {
  --bg:           #0e0e0e;
  --sidebar-bg:   #141414;
  --accent:       #c8a96e;
  --accent-light: #e2c99a;
  --text:         #f0ece4;
  --text-muted:   #8a8478;
  --text-dim:     #5a5650;
  --border:       #2a2826;
  --card-bg:      #1a1917;
  --tag-bg:       #242220;
  --topbar-h:     64px;
  --sidebar-w:    280px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

/* ===========================
   MOBILE TOPBAR (hidden on desktop)
   =========================== */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.topbar-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--accent);
  flex-shrink: 0;
}

.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.topbar-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

.topbar-role {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Hamburger button */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.menu-toggle:hover { background: rgba(200,169,110,.1); }

.burger-line {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, background 0.2s;
}

.menu-toggle[aria-expanded="true"] .burger-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
  background: var(--accent);
}
.menu-toggle[aria-expanded="true"] .burger-line:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .burger-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
  background: var(--accent);
}

/* ===========================
   OVERLAY
   =========================== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s;
}

.overlay.show {
  opacity: 1;
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 48px 32px;
  z-index: 160;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Close button — hidden on desktop */
.sidebar-close {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
}

.sidebar-close:hover {
  color: var(--text);
  background: rgba(200,169,110,.08);
}

.sidebar-top { margin-bottom: 48px; }

/* Avatar */
.avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b6a3a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--sidebar-bg);
  letter-spacing: 1px;
  overflow: hidden;
  border: 2px solid var(--accent);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}

.status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #4caf7d;
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.25); opacity: 0.6; }
}

/* Name & Role */
.name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 8px;
}

.name em { color: var(--accent); font-style: italic; }

.role {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.5;
}

/* Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 40px;
}

.nav-link {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.25s, background 0.25s, padding-left 0.25s;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(200,169,110,.06);
  padding-left: 16px;
}

.nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(200,169,110,.08);
  padding-left: 16px;
}

/* Contacts */
.sidebar-contacts {
  margin-bottom: auto;
  padding-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.contact-icon {
  color: var(--accent);
  font-size: 8px;
  margin-top: 4px;
  flex-shrink: 0;
}

/* Download Button */
.download-btn {
  display: block;
  text-align: center;
  margin-top: 24px;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s, color 0.25s;
}

.download-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ===========================
   MAIN CONTENT
   =========================== */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 0;
  max-width: 900px;
  min-width: 0;
}

.section {
  padding: 80px 64px;
  border-bottom: 1px solid var(--border);
}

.section-last {
  border-bottom: none;
  padding-bottom: 120px;
}

/* Section Label */
.section-label {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-weight: 400;
}

/* Section Title */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 300;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 36px;
  letter-spacing: -1px;
}

.section-title em { color: var(--accent); font-style: italic; }

/* Bio */
.bio {
  font-size: 15.5px;
  color: #bab5ae;
  line-height: 1.8;
  margin-bottom: 16px;
  max-width: 600px;
}

.bio strong { color: var(--text); font-weight: 500; }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 48px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.stat {
  background: var(--card-bg);
  padding: 28px 16px;
  text-align: center;
  transition: background 0.2s;
}

.stat:hover { background: #1e1d1b; }

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ===========================
   TIMELINE
   =========================== */
.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-meta {
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-year {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.timeline-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(76,175,125,.12);
  color: #4caf7d;
  border: 1px solid rgba(76,175,125,.25);
  width: fit-content;
}

.job-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
}

.company {
  font-size: 12.5px;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.job-desc {
  font-size: 14.5px;
  color: #a8a49d;
  line-height: 1.75;
  margin-bottom: 16px;
}

/* ===========================
   TAGS
   =========================== */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  padding: 4px 12px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}

.tag:hover {
  color: var(--accent);
  border-color: rgba(200,169,110,.3);
}

/* ===========================
   EDUCATION
   =========================== */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  transition: border-color 0.25s, transform 0.25s;
}

.edu-card:first-child { grid-column: 1 / -1; }

.edu-card:hover {
  border-color: rgba(200,169,110,.3);
  transform: translateY(-2px);
}

.edu-year {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.edu-card h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 6px;
}

.edu-place {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.edu-note { font-size: 12px; color: var(--text-dim); }

/* ===========================
   SKILLS
   =========================== */
.skills-block { display: flex; flex-direction: column; gap: 40px; }

.skill-group-title {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
}

.skill-bars { display: flex; flex-direction: column; gap: 14px; }

.skill-bar-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: center;
}

.skill-bar-item span { font-size: 13.5px; color: #c0bbb4; }

.bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

.bar-fill.animated { width: var(--w); }

/* ===========================
   PORTFOLIO
   =========================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.portfolio-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.25s, transform 0.25s;
  cursor: pointer;
}

.portfolio-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: flex-start;
  background: linear-gradient(135deg,#1c1a17 0%,#1a1917 100%);
  border-color: rgba(200,169,110,.2);
}

.portfolio-card:hover {
  border-color: rgba(200,169,110,.4);
  transform: translateY(-3px);
}

.port-num {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  flex-shrink: 0;
  min-width: 64px;
}

.portfolio-card.featured .port-num {
  font-size: 72px;
  color: rgba(200,169,110,.15);
}

.port-info h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}

.port-info p {
  font-size: 13.5px;
  color: #9e9990;
  line-height: 1.65;
  margin-bottom: 12px;
}

/* ===========================
   CONTACT GRID
   =========================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.cc-icon {
  font-size: 22px;
  color: var(--accent);
  font-family: var(--font-display);
  line-height: 1;
}

.cc-label {
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 8px;
}

.cc-value { font-size: 14px; color: var(--text); }

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===========================
   RESPONSIVE — TABLET (≤1024px)
   =========================== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 250px; }

  .section { padding: 64px 48px; }

  .skill-bar-item { grid-template-columns: 130px 1fr; }
}

/* ===========================
   RESPONSIVE — MOBILE (≤899px)
   Sidebar becomes a slide-in drawer
   =========================== */
@media (max-width: 899px) {

  /* Show topbar */
  .topbar { display: flex; }

  /* Show overlay */
  .overlay { display: block; }

  /* Show close button */
  .sidebar-close { display: block; }

  /* Sidebar: off-screen by default */
  .sidebar {
    transform: translateX(-100%);
    top: 0;
    padding: 56px 28px 40px;
    width: min(var(--sidebar-w), 80vw);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 32px rgba(0,0,0,.5);
  }

  /* Sidebar open state */
  .sidebar.open {
    transform: translateX(0);
  }

  /* Content: full width, push down below topbar */
  .content {
    margin-left: 0;
    max-width: 100%;
    padding-top: var(--topbar-h);
  }

  .section { padding: 48px 24px; }
  .section-last { padding-bottom: 80px; }

  .section-title { font-size: clamp(32px, 8vw, 48px); letter-spacing: -0.5px; }

  .bio { font-size: 14.5px; }

  /* Stats: 2 cols */
  .stats-row { grid-template-columns: repeat(2, 1fr); }

  .stat { padding: 20px 12px; }
  .stat-num { font-size: 28px; }

  /* Timeline: stacked */
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 24px 0;
  }

  .timeline-meta { flex-direction: row; align-items: center; gap: 12px; }

  .job-title { font-size: 20px; }

  /* Education: single column */
  .edu-grid { grid-template-columns: 1fr; }
  .edu-card:first-child { grid-column: 1; }
  .edu-card { padding: 20px 18px; }

  /* Skills */
  .skill-bar-item { grid-template-columns: 110px 1fr; gap: 12px; }
  .skill-bar-item span { font-size: 12.5px; }

  /* Portfolio: single column */
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-card.featured { flex-direction: column; }
  .portfolio-card.featured .port-num { font-size: 48px; }

  /* Contact: single column */
  .contact-grid { grid-template-columns: 1fr; }
}

/* ===========================
   RESPONSIVE — SMALL MOBILE (≤480px)
   =========================== */
@media (max-width: 480px) {
  .section { padding: 36px 16px; }
  .section-last { padding-bottom: 60px; }

  .section-title { font-size: clamp(28px, 9vw, 40px); }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 16px 8px; }
  .stat-num { font-size: 24px; }
  .stat-label { font-size: 9px; }

  .bio { font-size: 14px; }

  .job-title { font-size: 18px; }
  .job-desc { font-size: 13.5px; }

  .timeline-meta { flex-direction: column; align-items: flex-start; gap: 4px; }

  .skill-bar-item { grid-template-columns: 96px 1fr; gap: 10px; }

  .edu-card h3 { font-size: 17px; }

  .port-info h3 { font-size: 18px; }
  .port-info p  { font-size: 13px; }

  .contact-grid { grid-template-columns: 1fr; gap: 10px; }
  .contact-card { padding: 18px 16px; }

  .tag { font-size: 10.5px; padding: 3px 10px; }

  .topbar { padding: 0 14px; }
  .topbar-name { font-size: 12px; }
}
