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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #222;
  background: #fff;
}

a { color: #0070f3; text-decoration: none; }
a:hover { text-decoration: underline; }

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2rem 0;
}

/* Layout: sidebar fixed flush to the left edge, never scrolls or bounces + content */
.layout {
  display: block;
  width: 100%;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  --bg-shift: 0px;
  background-image:
    linear-gradient(180deg, rgba(15, 17, 20, .6), rgba(15, 17, 20, .82)),
    url('assets/sidebar-bg-web2.jpg');
  background-position: center, center calc(20% - var(--bg-shift));
  background-size: cover, auto 260%;
  background-repeat: no-repeat, no-repeat;
  background-color: #14161a;
  border-radius: 0;
  padding: 2.5rem 1.75rem;
  color: #f2f2f2;
}
.avatar {
  position: absolute;
  top: 7rem;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .85);
  display: block;
}
.sidebar-name {
  position: absolute;
  top: 17rem;
  left: 0;
  right: 0;
  text-align: center;
}
.sidebar h1 {
  font-family: "Source Sans Pro", Helvetica, Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: #fff;
}
.tagline {
  font-family: "Courier New", Courier, monospace;
  color: #fff;
  font-size: .8rem;
  line-height: 1.4;
}

.sidebar-bottom {
  position: absolute;
  top: clamp(25rem, 82vh, 42rem);
  left: 0;
  right: 0;
  text-align: center;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: .4rem;
}
.social-row a {
  color: rgba(255, 255, 255, .4);
  transition: color .2s ease-in-out;
}
.social-row a:hover { color: #fff; }

.sidebar-copy {
  font-family: "Source Sans Pro", Helvetica, Arial, sans-serif;
  font-size: 10.7px;
  color: rgba(255, 255, 255, .4);
}

/* Content */
.content {
  margin-left: 380px;
  max-width: 680px;
  padding: 3rem 2rem 4rem 3rem;
}
.content section p { margin-bottom: .75rem; color: #333; }
.content section p:last-child { margin-bottom: 0; }

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #111;
}

/* Timeline (Experience) */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  top: .3rem;
  bottom: .3rem;
  left: 0;
  border-left: 2px dotted #ccc;
}
.timeline .entry { position: relative; }
.timeline .entry::before {
  content: '';
  position: absolute;
  top: .3rem;
  left: -1.5rem;
  transform: translateX(-4px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #999;
}

/* Experience & Education entries */
.entry { margin-bottom: 1.5rem; }
.entry:last-child { margin-bottom: 0; }
.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: .4rem;
}
.entry-meta {
  font-size: .85rem;
  color: #777;
}

/* Skills table */
.skills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}
.skills-table td {
  padding: .4rem .5rem;
  vertical-align: top;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}
.skills-table td:first-child {
  font-weight: 600;
  color: #111;
  padding-right: 1.5rem;
  width: 38%;
}
.skills-table tr:last-child td { border-bottom: none; }

/* Mobile — sidebar stays vertical, just moves above the content */
@media (max-width: 800px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-radius: 0;
    padding: 2.5rem 1.5rem;
    /* the tall-sidebar sizing (auto 260% + parallax shift) needs slack that
       a short, wide mobile box doesn't have — revert to a plain full cover,
       same fix khorrams.github.io applies at its own header breakpoint */
    background-position: center, center;
    background-size: cover, cover;
  }
  .sidebar-bottom {
    position: static;
    margin-top: 1.5rem;
  }
  .avatar {
    position: static;
    transform: none;
    margin: 0 auto 1.1rem;
  }
  .sidebar-name {
    position: static;
    margin-bottom: 1rem;
  }
  .content {
    max-width: 100%;
    margin-left: 0;
    padding: 2.5rem 1.5rem 4rem;
  }
  .entry-header { flex-direction: column; }
  .skills-table td:first-child { width: auto; }
}

@media (max-width: 420px) {
  .avatar { width: 110px; height: 110px; }
}
