html { overflow-y: scroll; }
body {
  max-width: 1200px;
  margin: auto;
  padding: 1em;
  line-height: 1.5;
}

/* header and footer areas */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: 0 auto;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background: #333;
  margin: 4px 0;
  border-radius: 2px;
}
.menu {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  list-style: none;
}
.menu li { display: block; }
.article-meta, .menu a {
  text-decoration: none;
  background: #eee;
  padding: 5px;
  border-radius: 5px;
}
.menu a.active {
  background: #333;
  color: #fff;
}
.menu, .article-meta, footer { text-align: center; }

@media (max-width: 480px) {
  .hamburger { display: block; }
  .menu {
    display: none;
    flex-direction: column;
    gap: 0;
  }
  .menu.open { display: flex; }
  .menu li { margin: 0; }
  .menu a {
    display: block;
    padding: 10px;
    border-radius: 0;
  }
  .menu li:first-child a { border-radius: 5px 5px 0 0; }
  .menu li:last-child a { border-radius: 0 0 5px 5px; }
}
.title { font-size: 1.1em; }
footer a { text-decoration: none; }
hr {
  border-style: dashed;
  color: #ddd;
}

/* code */
pre {
  border: 1px solid #ddd;
  box-shadow: 5px 5px 5px #eee;
  padding: 1em;
  overflow-x: auto;
}
code { background: #f9f9f9; }
pre code { background: none; }

/* misc elements */
img, iframe, video { max-width: 100%; }
main { hyphens: auto; }
blockquote {
  background: #f9f9f9;
  border-left: 5px solid #ccc;
  padding: 3px 1em 3px;
}

table {
  margin: auto;
  border-top: 1px solid #666;
  border-bottom: 1px solid #666;
}
table thead th { border-bottom: 1px solid #ddd; }
th, td { padding: 5px; }
thead, tfoot, tr:nth-child(even) { background: #eee; }

/* projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5em;
  margin-top: 1em;
}
.project-card {
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #f9f9f9;
  overflow: hidden;
}
.project-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.project-card-body {
  padding: 0.8em 1em;
}
.project-card-body h3 { margin-top: 0; }

/* terms badges */
.terms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 1em;
}
.term-badge {
  display: inline-block;
  background: #eee;
  padding: 5px 10px;
  border-radius: 5px;
  text-decoration: none;
  color: inherit;
}
.term-badge:hover {
  background: #ddd;
}

/* timeline */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 2em auto;
  padding: 1em 0;
}
.timeline::after {
  content: '';
  position: absolute;
  width: 3px;
  background: #ddd;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1.5px;
}
.timeline-entry {
  position: relative;
  width: 50%;
  padding: 0 2.5em 2em;
  box-sizing: border-box;
}
.timeline-entry:nth-child(odd) {
  left: 0;
  text-align: center;
}
.timeline-entry:nth-child(even) {
  left: 50%;
  text-align: center;
}
.timeline-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #333;
  border: 2px solid #ddd;
  border-radius: 50%;
  top: 0.3em;
  z-index: 1;
}
.timeline-entry:nth-child(odd) .timeline-dot {
  right: -7px;
}
.timeline-entry:nth-child(even) .timeline-dot {
  left: -7px;
}
.timeline-date {
  display: inline-block;
  background: #333;
  color: #fff;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.85em;
  margin-bottom: 0.4em;
}
.timeline-content h3 {
  margin: 0.4em 0 0.1em;
}
.timeline-content h4 {
  margin: 0 0 0.4em;
  font-weight: normal;
  color: #666;
}
.timeline-content p {
  margin: 0 0 0.5em;
}
.timeline-content ul {
  margin: 0;
  padding-left: 1.2em;
}
.timeline-entry:nth-child(odd) .timeline-content ul {
  list-style-position: inside;
  padding-left: 0;
}
.timeline-content li {
  margin-bottom: 0.3em;
  font-size: 0.92em;
}
.timeline-education .timeline-date {
  background: #666;
}

@media (max-width: 480px) {
  .timeline::after {
    left: 1em;
  }
  .timeline-entry {
    width: 100%;
    left: 0 !important;
    text-align: left !important;
    padding-left: 3em;
    padding-right: 0;
  }
  .timeline-dot {
    left: calc(1em - 6px) !important;
    right: auto !important;
  }
  .timeline-entry:nth-child(odd) .timeline-content ul {
    list-style-position: outside;
    padding-left: 1.2em;
  }
}
