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

:root {
  --bg:         #f1f5f9;
  --surface:    #ffffff;
  --surface2:   #e9eef5;
  --border:     rgba(15,23,42,.08);
  --border2:    rgba(15,23,42,.14);
  --accent:     #2563eb;
  --accent2:    #7c3aed;
  --accent-dim: rgba(37,99,235,.08);
  --green:      #16a34a;
  --amber:      #d97706;
  --text:       #0f172a;
  --text2:      #334155;
  --muted:      #64748b;
  --muted2:     #94a3b8;
  --grad:       linear-gradient(135deg, #2563eb, #7c3aed);
  --sidebar-w:  300px;
  --r:          10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: #cdd8e8;
  background-image:
    radial-gradient(circle, rgba(37,99,235,.13) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* ─── Layout ──────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 80px rgba(15,23,42,.12);
}

/* ─── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  padding: 3.5rem 2.25rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}

/* Profile block */
.profile-block {
  margin-bottom: 3.5rem;
}

.photo-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 2px;
  background: var(--grad);
  margin-bottom: 1.75rem;
  overflow: hidden;
  flex-shrink: 0;
}

.photo-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--surface2);
}

.avatar-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface2);
}

.sidebar-name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: .45rem;
  letter-spacing: -.01em;
}

.sidebar-role {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .6rem;
}

.sidebar-location {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--muted);
}

/* Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: auto;
}

.nav-item {
  display: block;
  font-size: .83rem;
  font-weight: 500;
  color: var(--muted);
  padding: .55rem .75rem;
  border-radius: var(--r);
  transition: color .2s, background .2s;
  letter-spacing: .01em;
}

.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--accent); background: var(--accent-dim); }

/* Contact links */
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.slink {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .75rem;
  color: var(--muted);
  transition: color .2s;
  overflow: hidden;
}
.slink svg { flex-shrink: 0; }
.slink span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slink:hover { color: var(--text2); }

/* ─── Main content ────────────────────────────────────────────────── */
.main {
  margin-left: 0;
  flex: 1;
  min-width: 0;
}

/* ─── Sections ────────────────────────────────────────────────────── */
.section {
  padding: 7rem 5rem 5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.section > * {
  width: 100%;
  max-width: 820px;
}

.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
}

.section-sublabel {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* ─── About ───────────────────────────────────────────────────────── */
.about-text {
  font-size: 1.15rem;
  line-height: 1.95;
  color: var(--text2);
  max-width: 700px;
  padding-left: 1.75rem;
  border-left: 3px solid var(--accent);
}

/* ─── Jobs ────────────────────────────────────────────────────────── */
.job {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border);
}
.job:last-child { border-bottom: none; }

.job-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.job-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .3rem;
}

.job-company {
  font-size: .85rem;
  color: var(--muted);
}

.job-note {
  display: block;
  font-size: .76rem;
  color: var(--muted2);
  margin-top: .15rem;
  font-style: italic;
}

.job-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
  flex-shrink: 0;
}

.badge-now {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(22,163,74,.08);
  border: 1px solid rgba(22,163,74,.2);
  padding: .15rem .55rem;
  border-radius: 99px;
}

.job-date {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}

.job-remote, .job-mode {
  font-size: .72rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  padding: .12rem .5rem;
  border-radius: 99px;
  white-space: nowrap;
}

.job-mode {
  color: var(--muted);
  background: var(--surface2);
}

.job-desc {
  font-size: .9rem;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

/* ─── Tags ────────────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tag {
  font-size: .73rem;
  font-weight: 500;
  padding: .3rem .75rem;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border2);
  transition: color .15s, border-color .15s;
}
.tag:hover { color: var(--accent); border-color: rgba(37,99,235,.3); }

/* ─── Skills ──────────────────────────────────────────────────────── */
.skill-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: flex-start;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.skill-row:last-child { border-bottom: none; }

.skill-cat {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text2);
  padding-top: .3rem;
}

/* ─── Education ───────────────────────────────────────────────────── */
.edu-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  align-items: flex-start;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}
.edu-row:last-child { border-bottom: none; }

.edu-year {
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  padding-top: .15rem;
  white-space: nowrap;
}

.edu-degree {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .2rem;
}

.edu-school {
  font-size: .8rem;
  color: var(--accent);
}

/* ─── Languages ───────────────────────────────────────────────────── */
.lang-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 400px;
}

.lang-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  gap: 1rem;
}

.lang-name {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
}

.lang-level {
  font-size: .75rem;
  color: var(--muted);
  text-align: right;
}

.lang-bar {
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}

.lang-fill {
  height: 100%;
  width: 0;
  background: var(--grad);
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

/* ─── Contact ─────────────────────────────────────────────────────── */
#contact {
  padding-bottom: 12rem;
}

.contact-intro {
  font-size: .95rem;
  color: var(--text2);
  max-width: 500px;
  margin-bottom: 2rem;
}

.contact-cta {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: var(--grad);
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  padding: .7rem 1.4rem;
  border-radius: var(--r);
  transition: opacity .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(37,99,235,.25);
}
.contact-cta:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.35); }

.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.contact-secondary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--muted);
  transition: color .2s;
}
.contact-secondary:hover { color: var(--text2); }

/* ─── Footer ──────────────────────────────────────────────────────── */
.footer {
  padding: 2rem 4rem;
  font-size: .75rem;
  color: var(--muted2);
}

/* ─── Mobile top bar ──────────────────────────────────────────────── */
.mobile-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
}

.mobile-identity {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.mobile-photo-ring {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 1.5px;
  background: var(--grad);
  overflow: hidden;
  flex-shrink: 0;
}

.mobile-photo-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.mobile-avatar-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: .5rem;
  font-weight: 700;
  background: var(--surface2);
  color: var(--accent);
}

.mobile-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: .2s;
}

/* ─── Reveal ──────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 260px; }
  .section { padding: 5.5rem 3.5rem 4rem; }
  .skill-row { grid-template-columns: 160px 1fr; }
}

@media (max-width: 768px) {
  .mobile-bar { display: flex; }

  .sidebar {
    position: fixed;
    top: 56px;
    left: -100%;
    bottom: 0;
    width: 280px;
    transition: left .3s ease;
    z-index: 150;
  }
  .sidebar.open { left: 0; }

  .main {
    margin-left: 0;
    padding-top: 56px;
  }

  .section { padding: 3.5rem 1.75rem 2.5rem; }
  .footer { padding: 1.5rem; }

  .skill-row { grid-template-columns: 1fr; gap: .5rem; }
  .edu-row { grid-template-columns: 90px 1fr; }
  .lang-row { grid-template-columns: 70px 1fr 70px; }

  .job-top { flex-direction: column; }
  .job-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .edu-row { grid-template-columns: 1fr; gap: .25rem; }
  .lang-row { grid-template-columns: 70px 1fr 70px; gap: .5rem; }
}
