:root {
  --accent: #9c1f11;
  --muted: #f3f0ef;
  --text: #333;
  --sidebar: #f7f7f7;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  color: var(--text);
  background: var(--sidebar);
  font-size: 13px;
  line-height: 1.6;
}

/* Top Header Bar */
.top-header {
  background: var(--accent);
  color: white;
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.top-header h1 {
  margin: 0 0 8px 0;
  font-size: 36px;
  font-weight: normal;
}

.header-contact {
  display: flex;
  gap: 20px;
  font-size: 12px;
  flex-wrap: wrap;
}

.header-contact a {
  color: white;
  text-decoration: none;
}

.header-contact svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  background: transparent;
  position: relative;
}

/* Sidebar */
.left {
  width: 280px;
  background: var(--sidebar);
  padding: 30px 20px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  transition: transform 0.3s ease-in-out;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
}

.overlay.is-open {
  display: block;
}

.hamburger-menu {
  display: none;
}

/* Main Content */
.right {
  flex: 1;
  padding: 30px 40px;
  background: white;
}

.profile-pic-container {
  width: 100%;
  height: 280px;
  margin-bottom: 20px;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.profile-pic {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.8) translateX(-8%);
  transform-origin: center;
}

.section-title {
  background: var(--accent);
  color: #fff;
  padding: 6px 10px;
  margin: 20px -20px 15px -20px;
  font-weight: bold;
  font-size: 14px;
}

.left .section-title:first-of-type {
  margin-top: 0;
}

.right .section-title {
  margin: 25px 0 15px 0;
}

.right .section-title:first-child {
  margin-top: 0;
}

.right .section-title {
  cursor: pointer;
  user-select: none;
}

.toggle-indicator {
  float: right;
  font-size: 12px;
}

.section-content {
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 1;
  transform: scaleY(1);
  transform-origin: top;
}

.section-content.collapsed {
  opacity: 0;
  transform: scaleY(0);
  max-height: 0;
  margin: 0;
  padding: 0;
}

.box {
  background: #fff;
  padding: 0;
  border-radius: 0;
}

ul {
  margin: 0 0 10px 20px;
  padding: 0;
  font-size: 13px;
}

.left ul {
  font-size: 12px;
}

li {
  margin-bottom: 8px;
  line-height: 1.5;
}

p {
  margin: 10px 0;
  line-height: 1.6;
}

.small {
  font-size: 13px;
  color: #444;
}

.small p,
.small ul,
.small li {
  font-size: 13px;
}

.work-item {
  margin-bottom: 20px;
}

.role {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.role h3 {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  color: var(--accent);
}

.date {
  font-weight: bold;
  color: var(--accent);
  font-size: 14px;
}

.muted {
  color: #666;
  font-size: 13px;
  margin-bottom: 10px;
}

.achievements li {
  margin-bottom: 8px;
}

.content-section {
  margin-bottom: 20px;
}

.bullets {
  margin-left: 0;
  padding-left: 25px;
}

/* Work Experience Summary in Sidebar */
.work-summary {
  font-size: 12px;
  line-height: 1.5;
}

.work-summary strong {
  display: block;
  margin-top: 12px;
  font-weight: bold;
}

.work-summary em {
  display: block;
  color: var(--accent);
  margin: 3px 0;
  font-style: normal;
}

.work-summary .company {
  font-weight: bold;
  margin-top: 3px;
}

.work-summary .role-desc {
  color: #666;
  margin-top: 2px;
}

.work-summary hr {
  margin: 15px 0;
  border: none;
  border-top: 1px solid #ccc;
}

/* responsive */
@media(max-width:900px) {
  .container {
    flex-direction: column;
    padding-top: 0;
  }

  .left {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    z-index: 500;
    transform: translateX(-100%);
    overflow-y: auto;
    border-right: 1px solid #ccc;
    top: 0 !important;
  }

  .left.is-open {
    transform: translateX(0);
  }

  .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    z-index: 101;
  }

  .hamburger-menu span {
    width: 100%;
    height: 2px;
    background-color: white;
    border-radius: 2px;
  }

  .top-header {
    padding: 10px 12px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-inner {
    padding: 0 12px;
    margin: 0 auto;
  }

  /* Keep the contact list visible but compact on small screens: reduce
     gaps, shrink icons and text, and prevent items from taking extra vertical
     space. */
  .header-contact {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px; /* compact but spaced */
    font-size: 11px;
    align-items: center;
    /* Allow the contact area to grow naturally so links are never hidden.
       Removed `max-height`/clipping so items will wrap to additional lines.
       This keeps everything visible on narrow screens. */
    max-height: none;
    overflow: visible;
  }

  .header-contact span {
    display: inline-flex;
    align-items: center;
    gap: 6px; /* icon-to-label spacing */
    /* Allow wrapping within the header contact items so long labels
       don't get clipped; keep them compact using smaller font-size. */
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .header-contact svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
  
  .top-header h1 {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .profile-pic-container {
    height: 200px;
  }
  
  .profile-pic {
    transform: none;
    object-position: center 20%;
  }

  .left .section-title {
    margin-left: 0;
    margin-right: 0;
  }

  .right {
    padding: 20px;
  }

  .role {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .left,
  .section-content,
  .hamburger-menu {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
