/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
  --bg:             #f4f2ed;
  --surface:        #faf9f6;
  --surface-raised: #ffffff;
  --sidebar-bg:     #16150f;
  --sidebar-text:   #e8e4d8;
  --sidebar-muted:  #7a7668;
  --sidebar-border: #2a2920;
  --text-primary:   #18170f;
  --text-secondary: #57544a;
  --text-muted:     #9a9688;
  --accent:         #b8873a;
  --accent-light:   #f0e0c0;
  --border:         #e2dfd5;
  --border-strong:  #ccc9bc;
  --tag-bg:         #edeade;
  --tag-text:       #5a5746;
  --font-serif:     "Cormorant Garamond", serif;
  --font-sans:      "Outfit", sans-serif;
  --sidebar-w:      280px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
}

body.dark-mode {
  --bg:             #0e0d09;
  --surface:        #13120d;
  --surface-raised: #1c1a13;
  --text-primary:   #e8e4d8;
  --text-secondary: #9a9688;
  --text-muted:     #5a5746;
  --accent:         #d4a055;
  --accent-light:   #2c2010;
  --border:         #252318;
  --border-strong:  #35331f;
  --tag-bg:         #1e1c12;
  --tag-text:       #9a9688;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-inner {
  padding: 2.5rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  height: 100%;
}

/* Avatar & Name */
.profile-block {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  margin-bottom: 0.3rem;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.name {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--sidebar-text);
  letter-spacing: 0.01em;
}

.name span {
  color: var(--accent);
}

.role {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  line-height: 1.5;
}

/* Nav */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s, background 0.2s;
}

.nav-link::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--sidebar-text);
  background: rgba(255,255,255,0.05);
}

.nav-link:hover::before,
.nav-link.active::before {
  opacity: 1;
  background: var(--accent);
}

/* Contact */
.contact-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 1.5rem;
}

.contact-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  margin-bottom: 0.2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--sidebar-muted);
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.2s;
}

.contact-item:hover {
  color: var(--sidebar-text);
}

.contact-icon {
  font-size: 0.7rem;
  margin-top: 0.15rem;
  opacity: 0.7;
  flex-shrink: 0;
}

/* Social */
.social-block {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.social-btn {
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(184,135,58,0.08);
}

/* Theme button */
.theme-btn {
  margin-top: auto;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border);
  background: transparent;
  color: var(--sidebar-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  width: 100%;
}

.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(184,135,58,0.06);
}

/* ============================================================
   MAIN CONTENT
============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HERO STRIP
============================================================ */
.hero-strip {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  padding: 2.8rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 480px;
  font-style: italic;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  flex-shrink: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================
   SECTIONS
============================================================ */
.section {
  padding: 3rem 3rem 0;
}

.section:last-of-type {
  padding-bottom: 3rem;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-num {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--accent);
  font-style: italic;
}

/* ============================================================
   TIMELINE (EXPERIENCE)
============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 1.2rem;
  border-left: 1.5px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 2rem 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -0.45rem;
  top: 0.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  transition: background 0.35s;
}

.timeline-body {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.timeline-body:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.tl-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.tl-org {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.2rem;
  letter-spacing: 0.01em;
}

.tl-date {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding: 0.22rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.tl-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ============================================================
   TAGS
============================================================ */
.tl-tags,
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border);
}

/* ============================================================
   PROJECT CARDS
============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: default;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-index {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.project-arrow {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.project-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.project-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-desc {
  font-size: 0.845rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.65;
  flex: 1;
}

/* ============================================================
   SKILLS
============================================================ */
.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-tag {
  font-size: 0.83rem;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  transition: border-color 0.2s, color 0.2s;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   EDUCATION
============================================================ */
.edu-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  gap: 1.8rem;
  align-items: flex-start;
  transition: border-color 0.2s;
}

.edu-card:hover {
  border-color: var(--border-strong);
}

.edu-year-badge {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-style: italic;
}

.edu-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.edu-school {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.7rem;
  letter-spacing: 0.01em;
}

.edu-desc {
  font-size: 0.855rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.7;
}

/* ============================================================
   FOOTER
============================================================ */
.main-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 1.5rem 3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.03em;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
    flex-direction: row;
    padding: 0;
  }

  .sidebar-inner {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 1.2rem 1.5rem;
    gap: 1rem;
  }

  .profile-block { width: 100%; }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .nav-link { padding: 0.35rem 0.6rem; }

  .contact-block { border-top: none; padding-top: 0; }

  .main-content {
    margin-left: 0;
  }

  .hero-strip {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.5rem;
  }

  .section {
    padding: 2rem 1.5rem 0;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .edu-card {
    flex-direction: column;
    gap: 1rem;
  }

  .main-footer {
    padding: 1.5rem;
  }
}