/* ===== Global ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Roboto",
    "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #2d2d2d;
  background-color: #f7f8fc;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(0, 0, 0, 0.03) 1px,
    transparent 0
  );
  background-size: 32px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #2563eb;
  transition: color 0.2s;
  text-decoration: none;
}
a:hover {
  color: #1d4ed8;
}
::selection {
  background: #c7d2fe;
  color: #1a1a2e;
}

main {
  flex: 1;
}

/* ===== Staggered fade-in ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main > *,
.project-grid > .project,
.section-centered > .card {
  animation: fadeUp 0.5s ease-out both;
}

main > *:nth-child(1) {
  animation-delay: 0s;
}
main > *:nth-child(2) {
  animation-delay: 0.1s;
}
main > *:nth-child(3) {
  animation-delay: 0.15s;
}
main > *:nth-child(4) {
  animation-delay: 0.2s;
}

.project-grid > .project:nth-child(1),
.section-centered > .card:nth-child(1) {
  animation-delay: 0.05s;
}
.project-grid > .project:nth-child(2),
.section-centered > .card:nth-child(2) {
  animation-delay: 0.12s;
}
.project-grid > .project:nth-child(3),
.section-centered > .card:nth-child(3) {
  animation-delay: 0.19s;
}
.project-grid > .project:nth-child(4),
.section-centered > .card:nth-child(4) {
  animation-delay: 0.26s;
}

/* ===== Header ===== */
header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  height: 64px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.35em;
  font-weight: 700;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2px;
}

nav ul li a {
  color: #666;
  font-size: 0.88em;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition:
    background-color 0.2s,
    color 0.2s;
  position: relative;
}

nav ul li a:hover {
  background: rgba(37, 99, 235, 0.06);
  color: #1a1a2e;
}

nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #0f3460);
  border-radius: 1px;
  transition:
    width 0.25s ease,
    left 0.25s ease;
}

nav ul li a:hover::after {
  width: 60%;
  left: 20%;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  transition:
    transform 0.3s,
    opacity 0.3s;
  border-radius: 1px;
}
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Footer ===== */
footer {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #a0a0b0;
  padding: 36px 20px 28px;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}

footer p {
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.social-icons {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.social-icons a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.3s;
}
.social-icons a:hover {
  color: #fff;
}

/* ===== Hero (Home) ===== */
.hero-banner {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  padding: 72px 32px;
  text-align: center;
  border-radius: 0 0 32px 32px;
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      ellipse at 30% 50%,
      rgba(37, 99, 235, 0.12) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 70% 50%,
      rgba(15, 52, 96, 0.15) 0%,
      transparent 60%
    );
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  from {
    transform: translate(-2%, -2%) rotate(0deg);
  }
  to {
    transform: translate(2%, 2%) rotate(3deg);
  }
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  position: relative;
  z-index: 1;
}

.hero-image {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.3),
    0 0 0 8px rgba(255, 255, 255, 0.05);
  transition: transform 0.4s ease;
}

.hero-image:hover {
  transform: scale(1.05);
}

.hero-text h1 {
  color: #fff;
  font-size: 2.4em;
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-tagline {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1em;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.about-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 32px;
}

.about-body h2 {
  font-size: 1.6em;
  color: #1a1a2e;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.about-body h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #0f3460);
  border-radius: 2px;
}

.about-body p {
  color: #555;
  font-size: 1.05em;
  line-height: 1.9;
  margin: 0 0 16px;
}

/* ===== Cards (shared) ===== */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 28px 32px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
  text-align: left;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, #2563eb, #0f3460) 1;
  border-image-slice: 1;
  border-top: none;
  border-right: none;
  border-bottom: none;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 12px 36px rgba(0, 0, 0, 0.08);
}

.card h3 {
  color: #1a1a2e;
  font-size: 1.2em;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.card p {
  color: #555;
  font-size: 0.95em;
  margin: 5px 0;
  line-height: 1.75;
}
.card ul {
  padding-left: 20px;
  color: #555;
  line-height: 1.75;
}
.card li {
  margin-bottom: 8px;
  font-size: 0.95em;
}

/* ===== Section containers ===== */
.section-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px;
}

.section-centered h2 {
  font-size: 1.7em;
  color: #1a1a2e;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.section-centered h2::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #0f3460);
  border-radius: 2px;
}

.section-centered .card {
  width: 100%;
  max-width: 800px;
}
.section-centered .card-narrow {
  max-width: 700px;
}

/* ===== Skills ===== */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  display: inline-block;
  background: linear-gradient(135deg, #eef2ff, #e8edff);
  color: #3b5998;
  padding: 7px 16px;
  border-radius: 24px;
  font-size: 0.85em;
  font-weight: 500;
  transition:
    transform 0.2s,
    background 0.3s,
    color 0.3s,
    box-shadow 0.3s;
  cursor: default;
}

.skill-tag:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #2563eb, #0f3460);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cert-list a {
  font-size: 0.92em;
  padding: 10px 12px;
  border-radius: 8px;
  border-bottom: none;
  transition:
    background 0.2s,
    color 0.2s;
}

.cert-list a:hover {
  background: rgba(37, 99, 235, 0.06);
}

/* ===== Projects ===== */
.projects-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  padding: 56px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.toc {
  width: 200px;
  position: sticky;
  top: 84px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 18px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.toc-title {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a1a2e;
  padding: 0 10px 10px;
  border-bottom: 2px solid rgba(37, 99, 235, 0.15);
  margin-bottom: 10px;
}

.toc ul {
  list-style: none;
  margin-bottom: 0;
}

.toc a {
  display: block;
  font-size: 0.86em;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 8px;
  color: #888;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.25s ease;
}

.toc a:hover {
  background: rgba(37, 99, 235, 0.06);
  color: #1a1a2e;
  border-left-color: #2563eb;
}

.project-grid {
  flex: 1;
  min-width: 0;
}

.project {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 32px;
  border-radius: 14px;
  margin-bottom: 24px;
  text-align: left;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.project::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #0f3460, #1a1a2e);
}

.project:hover {
  transform: translateY(-3px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 12px 36px rgba(0, 0, 0, 0.08);
}

.project h3 {
  color: #1a1a2e;
  font-size: 1.3em;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.project h4 {
  color: #1a1a2e;
  margin: 24px 0 10px;
  font-size: 1.05em;
}

.project p,
.project li {
  color: #555;
  line-height: 1.75;
}
.project ul {
  padding-left: 20px;
}
.project li {
  margin-bottom: 8px;
}

.training-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border-radius: 8px;
  overflow: hidden;
}
.training-table th,
.training-table td {
  border: 1px solid #e8e8ee;
  padding: 10px;
  text-align: center;
}
.training-table img {
  width: 100%;
  max-width: 128px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.label-cell {
  font-weight: 600;
  text-align: left;
  padding-left: 12px;
  font-size: 0.85em;
  white-space: nowrap;
  color: #1a1a2e;
}

/* ===== Gallery ===== */
.gallery-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

.gallery-header {
  text-align: center;
  margin-bottom: 32px;
}

.gallery-header h2 {
  font-size: 1.6em;
  color: #1a1a2e;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

.gallery-header h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #0f3460);
  border-radius: 2px;
}

.gallery-header p {
  color: #888;
  font-size: 0.95em;
  margin-top: 12px;
  font-style: italic;
}

.gallery-bento {
  display: grid;
  grid-template-columns: 60% 1fr;
  grid-template-rows: 240px 240px;
  grid-template-areas: "malta portrait" "mountain portrait";
  gap: 14px;
}

.bento-item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  background: #1a1a2e;
}

.bento-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    transform 0.6s ease,
    filter 0.4s ease;
}

.bento-item:hover img {
  transform: scale(1.05);
  filter: brightness(0.85);
}

.bento-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 18px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.bento-item:hover .bento-caption {
  opacity: 1;
  transform: translateY(0);
}

.bento-location {
  color: #fff;
  font-weight: 600;
  font-size: 1em;
  letter-spacing: 0.01em;
}

.bento-desc {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82em;
}

.bento-item:nth-child(1) {
  grid-area: malta;
}
.bento-item:nth-child(2) {
  grid-area: portrait;
}
.bento-item:nth-child(3) {
  grid-area: mountain;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  header {
    padding: 0 20px;
  }
  .hamburger {
    display: flex;
  }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 8px 0;
  }
  nav.open {
    display: block;
  }
  nav ul {
    flex-direction: column;
    gap: 0;
  }
  nav ul li a {
    display: block;
    padding: 14px 24px;
    border-radius: 0;
    font-size: 1em;
  }
  nav ul li a::after {
    display: none;
  }

  .hero-banner {
    padding: 48px 20px;
    border-radius: 0 0 20px 20px;
  }
  .hero-content {
    flex-direction: column;
    gap: 20px;
  }
  .hero-image {
    width: 130px;
    height: 130px;
  }
  .hero-text h1 {
    font-size: 1.7em;
  }
  .hero-tagline {
    font-size: 0.95em;
  }
  .about-body {
    padding: 36px 20px;
  }

  .section-centered {
    padding: 36px 16px;
  }
  .card {
    padding: 22px;
  }

  .projects-container {
    flex-direction: column;
    padding: 36px 16px;
  }
  .toc {
    width: 100%;
    position: static;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px;
  }
  .toc ul {
    margin-bottom: 0;
  }
  .project {
    padding: 22px 18px;
  }

  .training-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .training-table tbody {
    display: table;
    min-width: 500px;
  }
  .training-table img {
    max-width: 80px;
  }
  .label-cell {
    font-size: 0.75em;
    white-space: normal;
  }

  .gallery-section {
    padding: 0 16px 36px;
  }
  .gallery-bento {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 320px 220px;
    grid-template-areas: "malta" "portrait" "mountain";
  }
  .bento-caption {
    opacity: 1;
    transform: translateY(0);
  }
}
