* {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-weight: 300;
  box-sizing: border-box;
  font-display: swap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  margin: 0;
  padding: 0;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
}

strong {
  font-weight: 700;
}

a {
  color: #434248;
  font-weight: 400;
  transition: all 0.3s ease-out;
  position: relative;
}

a:hover {
  transform: translateY(-1px);
}

dl {
  margin: 0 0 -0.5rem 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  padding: 0;
}

.layout {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.icon {
  width: 1em;
  height: 1em;
}

.sidebar {
  background-color: #434248;
  color: #ffffff;
  padding: 1rem;

  flex: 1 0 auto;

  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.sidebar-header {
  font-weight: 400;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.sidebar a {
  color: #c4dcf7;
  text-decoration: none;
  font-weight: 100;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.sidebar a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidebar a:hover {
  background: rgba(196,220,247,0.15);
  color: #ffffff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 20px rgba(196,220,247,0.3);
  text-decoration: none;
}

.sidebar a:hover::before {
  left: 100%;
}

.main {
  flex: 0 1 65vw;

  display: flex;
  flex-direction: column;
  overflow: auto;
}

.header {
  flex: 0 0 auto;
  display: flex;
  gap: 1ch;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  background-color: #eee;
  padding: 0.5rem;
}

.header-name-and-title {
  flex: 1;
}

.header-summary {
  text-align: right;
  font-style: italic;
}

.header-summary p {
  margin: 0;
}

.header-contact {
  display: none;
  font-size: 0.9rem;
}

.header-contact .icon {
  color: #000;
}

.header-contact-list {
  padding: 0;
}

.header-contact-list li {
  margin-bottom: 0.25em;
  white-space: nowrap;
}

.header-contact-list li,
.header-contact-list li a {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-height: 44px;
  padding: 4px 8px;
  margin: -4px -8px;
}

.header-contact-list li:last-of-type {
  margin-bottom: 0;
}

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

.header-contact a:hover {
  text-decoration: underline;
}

.profile-image {
  height: 5rem;
  width: 5rem;
  border-radius: 2.5rem;
  transition: all 0.4s ease-out;
  animation: fadeInUp 0.8s ease-out;
}

.profile-image:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.header-name {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-grow: 1;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
  white-space: nowrap;
}

.header-title {
  font-size: 1.25rem;
  margin-top: 0;
  white-space: nowrap;
}

.header-location-mobile {
  display: none;
}

.experience {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.experience-list {
  flex: 1 0 auto;
}

.sidebar-contact {
  flex: 0 0 auto;
}

.technical-skills,
.key-projects {
  flex: 0 0 auto;
}

.technical-skills dd,
.key-projects dd {
  font-size: 0.875rem;
  margin-left: 1rem;
  margin-bottom: 0.5rem;
}

.sidebar-contact .icon {
  color: #fff;
}

.sidebar-contact-list {
  background-color: #53515c;
  padding: 0.5rem;
  border-radius: 0.25rem;
}

.sidebar-contact-list li {
  margin-bottom: 0.25rem;
  white-space: nowrap;
}

.sidebar-contact-list li,
.sidebar-contact-list li a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 4px 8px;
  margin: -4px -8px;
}

.sidebar-contact-list li:last-of-type {
  margin-bottom: 0;
}

.experience-position {
  margin-bottom: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-bottom: 1px solid #eee;
}

.experience-position:last-of-type {
  border-bottom: none;
}

.experience-header {
  display: flex;
  width: 100%;
  align-items: center;
}

.experience-company {
  font-weight: 400;
  font-size: 1.25rem;
  margin-right: 0.5rem;
}

.experience-company a {
  text-decoration: none;
}

.experience-company a:hover {
  text-decoration: underline;
}

.experience-title {
  flex: 1;
}

.sub-list {
  list-style: circle;
  padding-left: 1rem;
  margin: 0.5rem 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.15rem;
}

.education {
  flex: 0 0 auto;
  background-color: #eee;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.education-title {
  font-weight: 400;
  font-size: 1.25rem;
  margin: 0 0.5rem 0.5rem 0;
}

.education-degree {
  font-size: 1rem;
}

.education .education-list {
  margin: 0 0 0 1rem;
  padding: 0 0 0 1rem;
  list-style: circle;
}

@media (max-width: 925px) {
  .header-summary {
    text-align: left;
    margin-top: 0.2rem;
  }
}

@media (max-width: 725px) {
  html {
    font-size: 18px;
  }

  .layout {
    flex-direction: column;
    height: auto;
  }

  .main,
  .experience,
  .sidebar {
    height: auto;
    flex: 0 0 auto;
  }

  .header-contact {
    display: block;
  }

  .download-link,
  .sidebar-contact {
    display: none;
  }

  .profile-image {
    height: 3.5rem;
    width: 3.5rem;
  }

  .header-name {
    font-size: 1.35rem;
  }

  .header-title {
    font-size: 1.1rem;
    margin-bottom: 0;
  }

  .header {
    justify-content: flex-start;
  }

  .header-contact {
    width: 100%;
  }

  /* Reorder header blocks: name/title -> contact -> summary */
  .header-name-and-title { order: 1; }
  .header-contact { order: 2; }
  .header-summary { order: 3; width: 100%; }
  /* Hide summary on mobile */
  .header-summary { display: none; }

  .header-contact-list li,
  .header-contact-list li a {
    justify-content: flex-start;
    text-align: left;
  }

  .header-contact-list {
    text-align: left;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.75rem;
    row-gap: 0.4rem;
  }

  /* Hide location from the grid on mobile; it will appear under the title */
  .header-contact-list [data-test-name="contact-location"] {
    display: none;
  }

  .header-contact-list li {
    white-space: normal;
    margin: 0;
  }

  .header-contact-list li,
  .header-contact-list li a {
    display: inline-flex;
    min-height: auto;
    padding: 0.25rem 0.25rem;
    margin: 0;
  }

  .header-location-mobile {
    display: block;
    font-size: 0.9rem;
    color: #000;
    margin-top: 0.1rem;
  }

  .experience-header {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
  }

  .experience-title {
    margin-top: 0;
    flex-basis: 100%;
    order: 3;
  }

  .experience-company {
    margin: 0 0.25rem 0 0;
    order: 1;
  }

  .experience-header time {
    order: 2;
    margin-left: auto;
    font-size: 0.9rem;
  }

  .experience {
    margin-top: 0.75rem;
  }

  .education {
    margin: 0;
    padding: 1rem 0.5rem;
  }

  /* Mobile spacing for Education & Certifications */
  .education-title {
    margin-bottom: 0.75rem;
  }

  .education .education-list li {
    margin-bottom: 0.6rem;
    line-height: 1.35rem;
  }

  .technical-skills {
    margin-top: 0;
  }

  /* Make Technical Skills title bold on mobile */
  .technical-skills .sidebar-header {
    font-weight: 400;
  }

  /* Make nested technical skills headings bold on mobile */
  .technical-skills dt {
    font-weight: 700;
  }

  .experience-position {
    margin-bottom: 0.75rem;
  }

  /* Add more space before job description under title */
  .experience-position .sub-list {
    margin-top: 1rem;
  }
}

.loading-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2.5s linear infinite;
  border-radius: 4px;
  color: transparent;
  min-height: 1.2em;
  will-change: background-position;
}

@keyframes shimmer {
  0% { 
    background-position: -200% 0; 
  }
  100% { 
    background-position: 200% 0; 
  }
}

.content-loaded .loading-placeholder {
  display: none;
}

/* Run non-essential animations only after main content is ready */
.content-loaded .header {
  animation: fadeIn 0.6s ease-out;
}

.content-loaded .main {
  animation: fadeIn 0.8s ease-out 0.1s both;
}

.content-loaded .sidebar {
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.content-loaded .experience-list,
.content-loaded .education-list,
.content-loaded .technical-skills dl,
.content-loaded .key-projects dl,
.content-loaded .header-summary p {
  animation: fadeIn 0.4s ease-out;
}

.content-loaded .experience-position {
  animation: fadeInUp 0.5s ease-out both;
}

.experience-position:nth-child(1) { animation-delay: 0.1s; }
.experience-position:nth-child(2) { animation-delay: 0.2s; }
.experience-position:nth-child(3) { animation-delay: 0.3s; }
.experience-position:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-summary .loading-placeholder {
  width: 80%;
  height: 1.5em;
}

.experience-list .loading-placeholder {
  width: 100%;
  height: 4em;
  margin-bottom: 1rem;
}

.education-list .loading-placeholder {
  width: 90%;
  height: 1.5em;
}

.technical-skills .loading-placeholder {
  width: 70%;
  height: 1.2em;
}

.key-projects .loading-placeholder {
  width: 85%;
  height: 1.2em;
}

@media (prefers-reduced-motion: reduce) {
  .loading-placeholder {
    animation: none;
    background: #e8e8e8;
  }
  
  .content-loaded .experience-list,
  .content-loaded .education-list,
  .content-loaded .technical-skills dl,
  .content-loaded .key-projects dl,
  .content-loaded .header-summary p,
  .header,
  .main,
  .sidebar,
  .experience-position,
  .profile-image {
    animation: none;
  }
  
  a:hover,
  .sidebar a:hover,
  .profile-image:hover {
    transform: none;
    animation: none;
    box-shadow: none;
  }
  
  .sidebar a::before {
    transition: none;
  }
}
