* {
  box-sizing: border-box;
}

/* Responsive baseline: ensure media scale correctly */
img, picture, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

html {
  scroll-behavior: smooth;
  /* prevent accidental horizontal overflow */
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  color: #f8fafc;
  background: linear-gradient(135deg, #06172f 0%, #142e5d 100%);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* hide any small overflow while we ensure elements are responsive */
  overflow-x: hidden;
}

img,
button,
a {
  touch-action: manipulation;
}

a {
  color: #93c5fd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #bfdbfe;
}

header {
  background: rgba(3, 18, 40, 0.92);
  border-bottom: 1px solid rgba(96, 165, 250, 0.16);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.18);
}

nav a {
  color: #ffffff;
}

nav a:hover {
  color: #bfdbfe;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

nav h2 {
  margin: 0;
  font-size: 1.35rem;
}

nav ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}

nav li {
  margin: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(200px, 340px) 1fr;
  align-items: center;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
  background: rgba(8, 25, 58, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 44px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.24);
  width: calc(100% - 2rem);
}

.profile-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 36, 75, 0.85);
  border-radius: 36px;
  padding: 1rem;
}

.profile-container img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 32px;
  border: 5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 0;
  line-height: 1.02;
  color: #f8fafc;
}

.hero-content p {
  margin: 0;
  color: #dbeafe;
  max-width: 640px;
  font-size: 1.05rem;
}

.hero-quote {
  display: block;
  margin: 1.5rem 0 0;
  color: #eef4ff;
  font-style: italic;
  font-size: 1.08rem;
  max-width: 720px;
  padding: 1rem 1rem 1rem 1.1rem;
  border-left: 4px solid rgba(59, 130, 246, 0.95);
  background: rgba(16, 36, 68, 0.85);
  border-radius: 18px;
  opacity: 0.96;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  min-width: 64px;
  max-width: 180px;
  min-height: 44px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.12);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  border-left: 4px solid rgba(37, 99, 235, 0.35);
  background: rgba(6, 23, 55, 0.92);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
  width: calc(100% - 2rem);
}

section h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  color: #f8fafc;
  position: relative;
}

section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 3.5rem;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  border-radius: 999px;
}

section p,
section ul,
section li {
  color: #dbeafe;
  font-size: 1.05rem;
}

.contact-details p {
  margin: 0.35rem 0;
  color: #dbeafe;
}

.contact-details a {
  color: #93c5fd;
}

section ul {
  margin-left: 1.25rem;
}

section li {
  margin-bottom: 0.65rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* make card content consistently start at the same vertical position */
.cards > div,
.experience-card {
  background: rgba(10, 19, 47, 0.96);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 24px;
  padding: 1.75rem;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* ensure content aligns to top */
  gap: 1rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.24);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cards > div {
  border-top: 4px solid rgba(37, 99, 235, 0.75);
}

/* heading and list spacing made explicit so all cards match */
.cards > div h3 {
  margin: 0 0 0.75rem 0; /* consistent spacing under the title */
  font-size: 1.25rem;
}

.cards > div ul {
  margin: 0; /* remove unexpected top margins */
  padding-left: 1.25rem; /* keep bullet indent */
}

.cards > div ul li {
  margin-bottom: 0.65rem;
}

.experience-card {
  border-top: 4px solid rgba(29, 78, 216, 0.65);
}

.experience-card {
  margin-bottom: 1.5rem;
}

.cards > div:hover,
.experience-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.28);
}

.cards > div h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.cards > div a.btn {
  width: fit-content;
}

.experience-card h3,
.cards h3,
#coe h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.experience-card ul,
.cards ul {
  list-style: disc;
  margin: 1rem 0 0 1.25rem;
  padding: 0;
}

footer {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #94a3b8;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 2rem;
    gap: 1.5rem;
    width: calc(100% - 1.5rem);
  }

  .profile-container {
    max-width: 280px;
    margin: 0 auto;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  nav ul {
    flex-direction: column;
    width: 100%;
  }

  nav li {
    width: 100%;
  }

  nav a {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
  }

  .hero {
    padding: 2rem 1rem;
  }

  section {
    padding: 2rem 1rem;
  }

  .hero-content h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .hero-content p,
  section p,
  section ul,
  section li {
    font-size: 1rem;
    max-width: 100%;
  }

  .profile-container {
    padding: 0.75rem;
  }
}

/* Extra small phones adjustments */
@media (max-width: 420px) {
  nav {
    padding: 0.75rem 1rem;
  }

  nav h2 {
    font-size: 1.05rem;
  }

  .hero {
    padding: 1.25rem;
    border-radius: 22px;
    gap: 1rem;
    width: calc(100% - 1rem);
  }

  .profile-container {
    padding: 0.5rem;
  }

  .hero-content h1 {
    font-size: 1.6rem;
    line-height: 1.08;
  }

  .btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    min-width: 56px;
  }

  section h2 {
    font-size: 1.6rem;
  }
}
