* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

:root {
  --nav-h: 0px;
  --nav-offset: 4px;
  --underline-height: 2px;
  --underline-gap: 2px;
  --underline-speed: 400ms;
  --underline-ease: ease;
}

body {
  background-color: #0B4F6C;
  background-image: url("pattern.png");
  background-repeat: repeat;
  background-size: auto;
  background-position: top left;
  font-family: Arial, sans-serif;
  color: #F1EDEE;
  line-height: 1.6;
  padding-left: 32px;
  padding-right: 32px;
  overflow-x: hidden;
  padding-top: calc(var(--nav-h) + var(--nav-offset));
}

@supports (padding: max(0px)) {
  body {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

img, video { max-width: 100%; height: auto; display: block; }
pre, code { white-space: pre-wrap; word-break: break-word; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

header {
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #063549;
  text-align: left;
  justify-content: center;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

header::before {
  content: "";
  position: absolute;
  top: calc(-1 * (var(--nav-h) + var(--nav-offset)));
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + var(--nav-offset));
  background: #063549;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  z-index: 0;
}

header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.5rem);
}

header h2 {
  margin-top: 0.5rem;
  font-weight: normal;
  font-size: clamp(1rem, 1.2vw + 0.9rem, 1.25rem);
  color: #E2E8F0;
}

.header-text { padding: 16px 0; }

.profile-pic {
  width: 150px;
  height: auto;
  object-fit: contain;
  max-width: 100%;
}

section { padding: 32px 0; }

section h2, section h3 {
  text-align: center;
  margin: 2rem 0 1rem;
}

.subtitle { padding: 16px 0; }

.projects,
.work-experience,
.volunteering-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  grid-auto-rows: 1fr;
}

.volunteering {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

.card {
  background: #E2E8F0;
  color: #0B4F6C;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  opacity: 75%;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.card > .container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-button {
  background: #0B4F6C;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: auto;
  align-self: flex-start;
}

.project-button a {
  color: #F1EDEE;
  text-decoration: none;
}

.project-button:hover { background: #145A7A; }

.card .actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.contact-info a {
  color: #F1EDEE;
  text-decoration: none;
}

@media (min-width: 600px) {
  header { padding: 32px 0; }
  .header-text { padding: 24px 0; }
  .projects,
  .work-experience,
  .volunteering-cards {
    gap: 24px;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

@media (min-width: 768px) {
  body {
    padding-left: 32px;
    padding-right: 32px;
  }
  @supports (padding: max(0px)) {
    body {
      padding-left: max(32px, env(safe-area-inset-left));
      padding-right: max(32px, env(safe-area-inset-right));
    }
  }
}

@media (min-width: 900px) {
  .profile-pic { max-width: 160px; }
}

.skills {
  color: #F1EDEE;
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
}

.skills-scroll {
  display: flex;
  width: max-content;
  animation: scroll 25s linear infinite;
}

.scrolling-text {
  display: flex;
}

.scrolling-text span {
  padding: 0 40px;
  font-size: 1.2rem;
  white-space: nowrap;
}

@keyframes scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.menu-bar {
  position: fixed;
  top: var(--nav-offset);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px 18px 16px;
  height: var(--nav-h)+3;
  width: max-content;
  max-width: min(100% - 24px, 1100px);
  border-radius: 999px;
  background: rgba(6,53,73,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  transition: top .25s ease, background .25s ease, backdrop-filter .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.menu-bar.at-top {
  top: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-color: transparent;
}

a {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: #F1EDEE;
  padding: 6px 0;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: var(--underline-height);
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--underline-speed) var(--underline-ease);
  border-radius: 999px;
}

.menu-bar a::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: var(--underline-height);
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--underline-speed) var(--underline-ease);
  border-radius: 999px;
}

a:hover::after,
a:focus-visible::after,
a.active::after,
a[aria-current="page"]::after {
  transform: scaleX(1);
}

#backToTop {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background-color: #F1EDEE;
  color: #0B4F6C;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s ease;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  background-color: #10739e;
  color: #F1EDEE;
}

@media (max-width: 768px) {
  body {
    padding-left: 16px;
    padding-right: 16px;
  }
  @supports (padding: max(0px)) {
    body {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
    }
  }

  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    text-align: center;
  }

  .profile-pic {
    width: 108px;
    height: auto;
  }

  .header-text {
    flex: none;
    padding: 8px 0;
    text-align: center;
  }

  header h1 {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
    margin: 0;
    text-align: center;
  }

  header h2 {
    font-size: clamp(0.95rem, 4.2vw, 1.15rem);
    margin: 0;
    text-align: center;
  }

  section { padding: 24px 0; }

  .projects,
  .work-experience,
  .volunteering-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    width: 100% !important;
    max-width: 100%;
  }

  .menu-bar {
    gap: 12px 16px;
    padding: 8px 12px;
    height: auto;
    max-width: calc(100% - 16px);
  }

  a {
    padding: 6px 8px;
    white-space: normal;
    text-align: center;
  }

  header img { max-width: 100%; height: auto; }
}

.external-link { color:#063549; }

/* ===== PDF/Resume embed sizing (fixed) ===== */
.pdf-wrapper {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

.pdf-frame {
  width: 100%;
  max-width: 900px;
  border: none;
  overflow: show;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  background: transparent;
  height: 200vh;
}

#resume { padding: 32px 0; }

#resume-pdf {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: contain;
  border-radius: 12px;
}

/* Hamburger button (hidden on desktop) */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50px;
  background: rgba(6,53,73,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

@media (max-width: 800px) {
  .menu-bar {display:none;}
  .pdf-wrapper { padding: 0 8px; }
  .pdf-frame {
    height: clamp(65vh, 80vh, 950px);
    max-width: 800px;
  }
  .hamburger { display: inline-flex; position: fixed; top: 12px; right: 12px; z-index: 1300; }
.mobile-menu { padding-top: 72px; border-top-left-radius: 25px; border-bottom-left-radius: 25px;}

}

.pdfjs-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: center;
  border-radius: 12px;
}

#linux-cert { background-color: #F1EDEE; }

.pdfjs-view canvas {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
  border-radius: 8px;
  box-shadow: 10px 10px rgba(0,0,0,0.25);
}

.pdfjs-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.download-btn {
  display: inline-block;
  background: #0B4F6C;
  color: #F1EDEE;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
}

.download-btn:hover { background: #145A7A; }

#linux-cert,
#gen-ai-cert {
  max-width: 800px;
  margin: 0 auto;
  height: auto;
}

.hamburger span {
  display: flex;
  width: 22px;
  height: 2px;
  background: #F1EDEE;
  border-radius: 999px;
}

/* Mobile slide-in panel (off-canvas by default) */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(70vw, 270px);
  padding: 80px 20px 24px;
  background: rgba(6,53,73,0.9);
  box-shadow: -10px 0 30px rgba(0,0,0,0.35);
  transform: translateX(100%);
  transition: transform 200ms ease;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu a {
  color: #F1EDEE;
  text-decoration: none;
  font-size: 1.05rem;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.mobile-menu a:focus-visible,
.mobile-menu a:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}
