:root {
  --primary: #002b5c;
  --primary-soft: #004a99;
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text-main: #1f2933;
  --text-muted: #6b778c;
  --border-subtle: #e1e5ee;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
}

/* Header / Nav */

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(0, 43, 92, 0.96);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 14px 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.branding h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}

.branding p {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: #d0e3ff;
}

header h1.project-title {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.subtitle {
  font-size: 0.8rem;
  color: #d0e3ff;
  margin-top: 2px;
}

nav {
  font-size: 0.9rem;
  white-space: nowrap;
}

nav a {
  color: #e5f0ff;
  text-decoration: none;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

nav a:first-child {
  margin-left: 0;
}

nav a:hover {
  background: rgba(229, 240, 255, 0.18);
  color: #ffffff;
}

/* Layout */

main {
  max-width: 1040px;
  margin: 28px auto 40px;
  padding: 0 20px;
}

.home-main {
  margin-top: 32px;
}

h2 {
  color: var(--primary);
  margin-top: 0;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px 22px 18px;
  margin-bottom: 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  border: 1px solid var(--border-subtle);
}

section p {
  font-size: 0.96rem;
  line-height: 1.6;
}

ul, ol {
  padding-left: 20px;
  font-size: 0.95rem;
}

li {
  margin-bottom: 4px;
}

/* Home-specific */

.intro {
  margin-bottom: 32px;
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.projects-wrapper section {
  margin-bottom: 0;
  box-shadow: none;
  border: none;
  padding: 0;
  background: transparent;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 10px;
}

@media (min-width: 800px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.project-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 18px 18px 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.project-card p {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
}

a {
  color: var(--primary-soft);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

.project-card a {
  color: var(--primary);
}

/* Images */

img.responsive-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px 0 0;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  object-fit: cover;
}

/* Footer */

footer {
  border-top: 1px solid #d7dde8;
  background: #ffffff;
  text-align: center;
  padding: 16px 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer a {
  color: var(--primary-soft);
  font-weight: 500;
}

/* Error Page */

.error-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
}

.error-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  padding: 32px 26px 26px;
}

.error-code {
  font-size: 3rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 8px;
}

.error-message {
  font-size: 1rem;
  margin-bottom: 8px;
}

.error-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.btn-primary {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #0060cc;
  text-decoration: none;
}

/* Uniform sizing for membership & certificate images */
.badge-img {
  width: 180px;
  height: auto;
  margin: 10px auto 0 auto;
  display: block;
  border-radius: 8px;
}

/* Keep project images uniform in size */
.project-card img {
  max-width: 250px;
  height: auto;
  margin: 10px auto;
  display: block;
  border-radius: 8px;
}

/* Uniform sizing for all images on the homepage */
.home-page img {
  max-width: 250px;
  height: auto;
  margin: 10px auto;
  display: block;
  border-radius: 8px;
}

/* ---------------------------------------------------- */
/* About Me Section - Centered Header + Side-by-Side    */
/* ---------------------------------------------------- */

.intro h2 {
  text-align: center;
}

.about-me-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
}

.about-me-image {
  width: 260px;
  max-width: 260px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  margin: 0;
}

.about-me-text {
  max-width: 650px;
  line-height: 1.6;
  color: var(--text-main);
  text-align: left;
}

/* Side-by-side layout only on larger screens */
@media (min-width: 850px) {
  .about-me-container {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
  }

  .about-me-image {
    margin-right: 30px;
  }

  .about-me-text {
    flex: 1;
  }
}


/* --------------------------------------------- */
/* Project 1 Page - Image Size Reduction (10%)   */
/* --------------------------------------------- */
.project1-page img.responsive-img {
  transform: scale(0.9);
  transform-origin: center;
  display: block;
  margin: 10px auto;
}

/* Fix: keep nav on same row on large screens */
@media (min-width: 900px) {
  .header-inner {
    flex-wrap: nowrap;
  }

  nav {
    margin-left: auto;
    flex-shrink: 0;
  }

  .header-inner > div,
  .branding {
    min-width: 0;
  }
}