* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: #fff;
  background-image: url("Building002.jpg");
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

.site-header,
body > header {
  background-color: rgba(0, 0, 0, 0.55);
  padding: clamp(12px, 2vw, 22px);
  text-align: center;
  color: white;
}

.site-header h2,
body > header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.page-layout,
body > section {
  flex: 1;
  min-height: 0;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
  display: flex;
  align-items: stretch;
  gap: 24px;
}

.sidebar,
body > section > nav {
  flex: 0 0 230px;
  overflow: hidden;
  border-radius: 14px;
  background-color: rgba(0, 0, 0, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.profile-photo,
body > section > nav > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 285px;
  object-fit: cover;
}

.main-menu,
body > section > nav ul {
  list-style-type: none;
  margin: 0;
  padding: 14px;
  width: auto;
  height: auto;
  background-color: rgba(0, 0, 0, 0.25);
}

.main-menu li,
body > section > nav li {
  margin: 0;
}

.main-menu a,
body > section > nav li a {
  display: block;
  color: white;
  padding: 11px 13px;
  border-radius: 10px;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-menu a:hover,
.main-menu a.active,
body > section > nav li a:hover {
  color: yellow;
  background-color: rgba(255, 255, 255, 0.12);
}

.content-panel,
body > section > div.scroll {
  flex: 1;
  min-width: 0;
  width: auto;
  min-height: 0;
  overflow: hidden;
}

.content-card,
body > section article {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: break-word;
  color: white;
  background-color: rgba(0, 0, 0, 0.43);
  border-radius: 14px;
  padding: clamp(24px, 4vw, 46px);
  line-height: 1.65;
  font-size: clamp(0.96rem, 1.1vw, 1.05rem);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.content-card h1,
body > section article h1 {
  margin: 0 0 20px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.2;
}

.content-card h2,
.resume-section-title,
body > section article h2 {
  margin: 30px 0 12px;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.25;
}

.content-card h2:first-child,
.resume-section-title:first-child,
body > section article h2:first-child {
  margin-top: 0;
}

.content-card p,
body > section article p {
  margin: 0 0 18px;
}

.content-card a,
body > section article a {
  color: #ffed75;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.content-card a:hover,
body > section article a:hover {
  text-decoration: underline;
}

.resume-entry {
  margin-bottom: 18px;
}

.resume-entry p {
  margin-bottom: 8px;
}

.resume-list,
body > section article ul:not(.main-menu) {
  margin: 0 0 18px 22px;
  padding-left: 18px;
}

.resume-list li,
body > section article ul:not(.main-menu) li {
  margin-bottom: 8px;
}

.contact-details {
  margin-top: 26px;
}

.site-footer,
body > footer {
  background-color: rgba(0, 0, 0, 0.55);
  padding: 12px 10px;
  text-align: center;
  color: white;
}

.site-footer p,
body > footer p,
body > footer pre {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  white-space: normal;
}

@media (max-width: 900px) {
  .page-layout,
  body > section {
    width: min(100% - 24px, 900px);
    gap: 18px;
  }

  .sidebar,
  body > section > nav {
    flex-basis: 210px;
  }

  .content-card,
  body > section article {
    min-height: 0;
  }
}

@media (max-width: 700px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    background-position: center top;
    background-attachment: scroll;
  }

  .page-layout,
  body > section {
    width: calc(100% - 20px);
    margin: 14px auto;
    flex-direction: column;
  }

  .sidebar,
  body > section > nav {
    width: 100%;
    flex: none;
    display: grid;
    grid-template-columns: 128px 1fr;
  }

  .profile-photo,
  body > section > nav > img {
    width: 128px;
    height: auto;
    min-height: 0;
    max-height: none;
    object-fit: contain;
  }

  .main-menu,
  body > section > nav ul {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 6px;
    padding: 10px;
    width: 100% !important;
    height: auto !important;
    margin: 0;
  }

  .main-menu a,
  body > section > nav li a {
    padding: 10px;
    font-size: 0.94rem;
  }

  .content-panel,
  body > section > div.scroll {
    width: 100%;
    overflow: visible;
  }

  .content-card,
  body > section article {
    height: auto;
    overflow: visible;
  }

  .content-card,
  body > section article {
    padding: 22px;
    line-height: 1.58;
  }

  .resume-list,
  body > section article ul:not(.main-menu) {
    margin-left: 18px;
    padding-left: 14px;
  }
}

@media (max-width: 430px) {
  .site-header,
  body > header {
    padding: 12px 10px;
  }

  .page-layout,
  body > section {
    width: calc(100% - 14px);
    margin: 10px auto;
  }

  .sidebar,
  body > section > nav {
    width: 100%;
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: start;
    background-color: rgba(0, 0, 0, 0.78);
  }

  .profile-photo,
  body > section > nav > img {
    width: 96px;
    height: auto;
    max-height: none;
    object-fit: contain;
    align-self: start;
    justify-self: start;
    background-color: transparent;
  }

  .main-menu,
  body > section > nav ul {
    display: grid !important;
    grid-template-columns: 1fr;
    align-content: start;
    width: 100% !important;
    height: auto !important;
    gap: 4px;
    padding: 8px;
    background-color: transparent;
  }

  .main-menu a,
  body > section > nav li a {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .content-card,
  body > section article {
    padding: 18px;
  }

  .site-footer p,
  body > footer p,
  body > footer pre {
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  .sidebar,
  body > section > nav {
    grid-template-columns: 84px 1fr;
  }

  .profile-photo,
  body > section > nav > img {
    width: 84px;
  }

  .content-card,
  body > section article {
    font-size: 0.92rem;
  }

  .main-menu a,
  body > section > nav li a {
    padding: 7px 9px;
    font-size: 0.86rem;
  }
}

/* Phone landscape fix: keep the compact mobile menu visible on short screens */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 950px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    background-position: center top;
    background-attachment: scroll;
  }

  .page-layout,
  body > section {
    width: calc(100% - 18px);
    margin: 10px auto;
    flex-direction: column;
    gap: 10px;
  }

  .sidebar,
  body > section > nav {
    width: 100%;
    flex: none;
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: start;
    background-color: rgba(0, 0, 0, 0.78);
  }

  .profile-photo,
  body > section > nav > img {
    width: 90px;
    height: auto;
    max-height: none;
    object-fit: contain;
    align-self: start;
    justify-self: start;
    background-color: transparent;
  }

  .main-menu,
  body > section > nav ul {
    display: grid !important;
    grid-template-columns: 1fr;
    align-content: start;
    width: 100% !important;
    height: auto !important;
    gap: 4px;
    padding: 8px;
    background-color: transparent;
  }

  .main-menu a,
  body > section > nav li a {
    padding: 7px 8px;
    font-size: 0.84rem;
  }

  .content-panel,
  body > section > div.scroll {
    width: 100%;
    overflow: visible;
  }

  .content-card,
  body > section article {
    height: auto;
    overflow: visible;
    padding: 16px;
    line-height: 1.5;
  }

  .site-footer,
  body > footer {
    padding: 8px;
  }
}
