:root {
  --nav-height: 78px;
  --primary: #ffb400;
  --secondary: #2c3e50;
  --text: #333;
  --bg: #f5f5f5;
  --card: #fff;
  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

  --dark-bg: #121212;
  --dark-card: #1e1e1e;
  --dark-text: #e0e0e0;
  --dark-secondary: #1a1a1a;

  --primary-blue: #0077b5;
  --subtext-color: #666;
  --bg-color: #f3f2ef;
  --card-bg-color: #fff;
  --scrollbar-color: #ccc;
  --scrollbar-track-color: #f3f2ef;
}

[data-theme="dark"] {
  --bg: var(--dark-bg);
  --card: var(--dark-card);
  --text: var(--dark-text);
  --secondary: var(--dark-secondary);

  --primary-blue: #0a66c2;
  --subtext-color: #bbb;
  --bg-color: #1d2226;
  --card-bg-color: #2b2b2b;
  --scrollbar-color: #555;
  --scrollbar-track-color: #1d2226;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.005em;
}

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

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

section {
  padding: 5rem 0;
}

h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--secondary);
  animation: slideIn 1s ease-in-out;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .overlay-content h3 {
  color: #fff;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  height: auto;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  color: #f7fbff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.14) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 10px 30px rgba(7, 14, 28, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

nav ul,
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
}

nav ul li,
.nav-links li {
  margin-left: 2rem;
}

nav a,
.nav-links a {
  color: #f7fbff;
  text-decoration: none;
  font-weight: 560;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

nav a:hover,
.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.active-nav,
nav a.active-nav {
  color: #ffd06a !important;
  font-weight: 700;
  border-bottom: 2px solid rgba(255, 208, 106, 0.95);
  transition: color 0.2s;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger div {
  width: 25px;
  height: 3px;
  background: #f7fbff;
  margin: 4px;
  transition: all 0.3s ease;
}

[data-theme='dark'] nav {
  background: linear-gradient(145deg, rgba(18, 32, 53, 0.56) 0%, rgba(14, 24, 44, 0.36) 100%);
  border-bottom-color: rgba(159, 202, 255, 0.28);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nav-active {
  transform: translateX(0);
}

.toggle .line1 {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
  opacity: 0;
}

.toggle .line3 {
  transform: rotate(45deg) translate(-5px, -6px);
}

.clock-container {
  position: relative;
  width: 30px;
  height: 27px;
}

.polygon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.polygon1 {
  width: 22px;
  height: 22px;
  animation: rotate-cw 6s linear infinite;
  z-index: 1;
}

.polygon2 {
  width: 18px;
  height: 18px;
  animation: rotate-ccw 8s linear infinite;
  z-index: 2;
}

.polygon3 {
  width: 14px;
  height: 14px;
  animation: rotate-cw 10s linear infinite;
  z-index: 3;
}

.polygon4 {
  width: 10px;
  height: 10px;
  animation: rotate-ccw 12s linear infinite;
  z-index: 4;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  overflow: hidden;
  animation: fadeIn 1.5s ease-in-out;
}

.hero-content {
  display: flex;
  width: 100%;
  max-width: 1200px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 40px 24px;
}

.hero-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 260px;
}

.hero-left h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 18px;
  text-align: left;
  line-height: 1.1;
  letter-spacing: -0.028em;
}

.hero-left h3 {
  font-size: 1.2rem;
  font-weight: 450;
  letter-spacing: 0.004em;
}

.hero-badge {
  background: #1a2e1a;
  color: #6cffb0;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 1rem;
  margin-bottom: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.hero-badge-dot {
  width: 10px;
  height: 10px;
  background: #6cffb0;
  border-radius: 50%;
  display: inline-block;
}

.hero-stack {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stack-icons {
  display: inline-flex;
  gap: 10px;
}

.stack-icons i {
  background: #222;
  border-radius: 50%;
  padding: 7px;
  font-size: 1.2rem;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.circular-img-container {
  width: 50vw;
  height: 50vw;
  max-width: 200px;
  max-height: 200px;
  overflow: hidden;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
}

.circular-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.container-home .btn {
  margin: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 0.63rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 620;
  border-radius: 30px;
  transition: background 0.3s ease, transform 0.3s ease;
  margin: 0.5rem;
  letter-spacing: 0.01em;
}

.btn:hover {
  background: #2980b9;
  transform: scale(1.05);
}

.about-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.card {
  background: var(--card);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 1s ease-in-out;
  text-align: justify;
  border-radius: 16px;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  text-align: center;
}

.skill-item {
  text-align: center;
}

.skill-item span {
  font-size: 1rem;
  color: var(--text);
}

.skill-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--percent), #e0e0e0 var(--percent));
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 0.5rem;
  position: relative;
}

.skill-circle::after {
  content: attr(data-percent);
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  position: absolute;
  z-index: 2;
  transition: opacity 0.3s ease;
  opacity: 0;
  text-align: center;
}

.skill-circle img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}

.skill-circle:hover::after {
  opacity: 1;
}

.skill-circle:hover img {
  filter: brightness(50%);
}

.resume-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.resume-widget {
  margin-bottom: 50px;
}

.resume-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
  padding: 20px;
  background-color: #2c3e50;
  color: #fff;
  border-radius: 8px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.resume-item .time {
  font-size: 1rem;
  font-weight: 600;
  color: #ffb403;
}

.resume-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 10px 0;
}

.institute {
  font-size: 1rem;
  color: #ccc;
}

.resume-item:hover {
  background-color: #ffb403;
  color: #2c3e50;
}

.resume-item:hover .time,
.resume-item:hover .institute {
  color: #2c3e50;
}

.certifications-section {
  background-color: var(--bg);
  padding: 2rem 0;
  font-family: var(--font-family);
  animation: fadeIn 1.5s ease-in-out;
}

.certifications-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.certification-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.certification-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--card);
  color: var(--text);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  text-decoration: none;
  overflow: hidden;
}

.certification-card:hover {
  box-shadow: 0 0 15px var(--primary);
}

.cert-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary);
}

.cert-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cert-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow: hidden;
  width: 100%;
}

.scroll-wrapper {
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.scroll-text {
  display: inline-block;
  white-space: nowrap;
  transition: transform 10s linear;
}

.scroll-wrapper:hover .scroll-text,
.scroll-enabled:hover {
  animation: scrollText 10s linear infinite;
}

.cert-date,
.cert-id {
  font-size: 0.85rem;
  color: var(--secondary);
}

[data-theme="dark"] .cert-date,
[data-theme="dark"] .cert-id {
  color: var(--dark-text);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  width: 100%;
}

.project-card {
  height: 260px;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.project-card.card-opening {
  animation: projectCardOpen 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes projectCardOpen {
  0% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
  45% {
    transform: scale(0.965);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  }
  100% {
    transform: scale(1.02);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.2);
  }
}

.project-card img {
  height: 160px;
  width: 100%;
  object-fit: cover;
}

.project-card .project-info {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-card .project-info p {
  display: none;
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: var(--text);
}

.project-card .icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-card .icon i {
  color: #000;
  font-size: 14px;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  margin: 0 auto;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  border: 0;
}

.recommendation-section {
  padding: 20px;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
}

.recommendation-wrapper {
  width: 90%;
  max-width: 1200px;
  overflow-x: auto;
}

.recommendation-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 20px;
  padding-bottom: 20px;
}

.recommendation-card {
  min-width: 300px;
  max-width: 300px;
  background-color: var(--card-bg-color);
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: transform 0.3s ease-in-out;
}

.recommendation-card:hover {
  transform: scale(1.05);
}

.profile-picture {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 2px solid var(--primary-blue);
}

.user-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 5px;
}

.user-profile {
  font-size: 1rem;
  color: var(--subtext-color);
  margin-bottom: 15px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  cursor: default;
  position: relative;
}

.user-profile:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: 100%;
  white-space: normal;
  background-color: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  z-index: 100;
  width: max-content;
  max-width: 300px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.recommendation-description {
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
  overflow-y: auto;
  max-height: 250px;
  padding-right: 10px;
  line-height: 1.5;
}

.recommendation-container::-webkit-scrollbar {
  height: 8px;
}

.recommendation-container::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-color);
  border-radius: 10px;
}

.recommendation-container::-webkit-scrollbar-track {
  background-color: var(--scrollbar-track-color);
}

footer {
  text-align: center;
  background: var(--secondary);
  color: #fff;
  animation: fadeIn 1.5s ease-in-out;
  position: relative;
  overflow: hidden;
}

.scrolling-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(10, 18, 32, 0.72), rgba(16, 28, 48, 0.54));
}

.image-strip {
  display: flex;
  height: 100%;
  animation: scroll-left 60s linear infinite;
  width: max-content;
  --scroll-shift: 50%;
}

.image-strip img {
  height: 100%;
  width: auto;
  object-fit: cover;
  min-width: 300px;
  opacity: 0.5;
  filter: brightness(0.7);
}

.footer-overlay {
  position: relative;
  z-index: 10;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4));
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 20px 30px;
}

#contact {
  color: #fff;
  animation: fadeIn 1.5s ease-in-out;
  height: 100%;
}

form {
  display: grid;
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

input,
textarea {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: background 0.3s ease;
}

input:focus,
textarea:focus {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

input[type="submit"] {
  background: var(--primary);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.3s ease;
}

input[type="submit"]:hover {
  background: #2980b9;
  transform: scale(1.05);
}

#submit-btn.loading {
  pointer-events: none;
  opacity: 0.7;
  background-image: url('https://i.gifer.com/ZKZg.gif');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  color: transparent;
}

#scrollToTopBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  background-color: #333;
  color: #fff;
  padding: 10px;
  border-radius: 100%;
  font-size: 24px;
  text-align: center;
  cursor: pointer;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

#scrollToTopBtn:hover {
  background-color: #555;
}

#scrollToTopBtn i {
  margin: 0;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.overlay-content {
  background: var(--card);
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.overlay-content img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 auto 1rem;
}

.overlay-content h3 {
  margin-bottom: 1rem;
  color: var(--secondary);
  word-break: break-word;
}

.overlay-content p {
  margin-bottom: 1rem;
  word-break: break-word;
  white-space: normal;
}

.overlay-content a {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  word-break: break-word;
  white-space: normal;
  max-width: 100%;
}

.overlay-content .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 5px;
}

.project-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  font-family: var(--font-family);
}

.project-popup.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-popup .popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.project-popup .popup-content {
  position: relative;
  background: var(--card);
  color: #22364d;
  width: 90%;
  max-width: 760px;
  max-height: 80vh;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transform-origin: center center;
  animation: popupCardOpen 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-popup .popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 26px;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.project-popup .popup-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

.project-popup img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
  padding: 14px;
  box-sizing: border-box;
  border: 1px solid rgba(208, 217, 230, 0.9);
}

@keyframes popupCardOpen {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.project-popup h3 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #22364d;
}

.project-popup p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 12px;
  color: #2f465f;
}

.project-popup a {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 22px;
  border-radius: 30px;
  background: var(--primary);
  color: #000;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-popup a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 180, 0, 0.4);
}

[data-theme="dark"] .project-popup .popup-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .project-popup .popup-content {
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  color: #eef4ff;
}

[data-theme="dark"] .project-popup h3 {
  color: #fff;
}

[data-theme="dark"] .project-popup p {
  color: rgba(232, 241, 255, 0.92);
}

[data-theme="dark"] .project-popup img {
  background: #ffffff;
  border-color: rgba(208, 217, 230, 0.9);
}

.project-popup .popup-content strong,
.project-popup .popup-content span,
.project-popup .popup-content h4 {
  color: #22364d;
}

[data-theme="dark"] .project-popup .popup-content strong,
[data-theme="dark"] .project-popup .popup-content span,
[data-theme="dark"] .project-popup .popup-content h4 {
  color: #f1f6ff;
}

.project-popup .popup-content::-webkit-scrollbar {
  width: 8px;
}

.project-popup .popup-content::-webkit-scrollbar-thumb {
  background: rgba(255, 180, 0, 0.85);
  border-radius: 10px;
}

.project-popup .popup-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
}

#design-assets {
  overflow-y: auto;
  padding-right: 6px;
}

#design-assets::-webkit-scrollbar {
  width: 6px;
}

#design-assets::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.iframe-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-bottom: 1rem;
}

.iframe-container iframe,
.iframe-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.iframe-placeholder {
  cursor: pointer;
  display: block;
}

.fade-in {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.fade-in.visible {
  opacity: 1;
}

@media (min-width: 901px) {
  .hero-content {
    flex-direction: row;
    align-items: center;
  }

  .hero-left {
    align-items: flex-start;
    text-align: left;
  }

  .hero-left h1 {
    text-align: left;
  }
}

@media (max-width: 1024px) {
  .hero-left h1 {
    font-size: 3rem;
  }

  .certification-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .project-card {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

@media (max-width: 1200px) {
  .hamburger {
    display: flex;
  }

  .centered-link {
    display: block;
    text-align: center;
    font-family: var(--font-family);
    color: #000;
    padding: 10px;
    text-decoration: none;
    width: 100px;
    margin: 0 auto;
  }

  .nav-links {
    position: fixed;
    top: 65.4px;
    right: 0;
    width: 60vw;
    height: calc(100vh - 20px);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.16) 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: -12px 0 30px rgba(8, 14, 30, 0.22);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    flex-direction: column;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.3s ease-in;
    overflow-y: auto;
    z-index: 999;
    font-size: 1rem;
    max-height: 100vh;
  }

  .nav-links.nav-active {
    transform: translateX(0);
  }

  .nav-links li {
    margin: 0.25rem 0;
  }

  .nav-links::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
  }

  .nav-links::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
  }

  [data-theme='dark'] .nav-links {
    background: linear-gradient(155deg, rgba(17, 30, 50, 0.84) 0%, rgba(10, 19, 34, 0.72) 100%);
    border-left-color: rgba(144, 193, 255, 0.25);
  }
}

@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }

  .hero-left {
    align-items: center !important;
    text-align: center;
  }

  .hero-left h1 {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .hero-left h1 {
    font-size: 2.5rem;
  }

  .about-content,
  .resume-container {
    flex-direction: column;
    gap: 1rem;
  }

  .project-grid,
  .skill-grid,
  .certification-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .overlay-content {
    padding: 1rem;
    max-width: 95vw;
    max-height: 95vh;
  }

  .overlay-content img {
    width: 100%;
    height: auto;
  }

  .overlay-content h3,
  .overlay-content p {
    font-size: 1rem;
  }

  .video-container iframe {
    width: 100vw;
    height: 250px;
  }
}

@media (max-width: 600px) {
  .certification-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-left h1 {
    font-size: 2rem;
  }

  .overlay-content {
    padding: 0.5rem;
    max-width: 98vw;
    max-height: 98vh;
  }

  .overlay-content h3,
  .overlay-content p {
    font-size: 0.9rem;
  }

  .video-container iframe {
    width: 100vw;
    height: 180px;
  }
}

@keyframes rotate-cw {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes rotate-ccw {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  100% {
    transform: translateX(calc(-1 * var(--scroll-shift, 50%)));
  }
}

@media (max-width: 768px) {
  .image-strip {
    animation-duration: 75s;
  }

  .image-strip img {
    min-width: 220px;
  }
}

@keyframes scrollText {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-100%);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === Responsive Navbar Hardening (mobile + rotation safe) === */
@media (max-width: 1200px) {
  nav {
    padding: 0.85rem 1rem;
    height: auto;
  }

  .hamburger {
    z-index: 1101;
  }

  .nav-links {
    top: var(--nav-height) !important;
    right: 0;
    width: min(86vw, 360px);
    height: calc(100dvh - var(--nav-height)) !important;
    max-height: calc(100dvh - var(--nav-height));
    padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .nav-links li {
    width: 100%;
    margin: 0.15rem 0;
  }

  .nav-links a,
  .centered-link {
    display: block;
    width: 100% !important;
    max-width: none;
    padding: 0.7rem 0.5rem;
    text-align: center;
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  .nav-links {
    width: 100vw;
  }
}

@media (orientation: landscape) and (max-width: 1200px) {
  .nav-links {
    width: min(72vw, 420px);
  }
}

/* === Very Small Landscape Phones: Bottom-Sheet Mobile Nav === */
@media (orientation: landscape) and (max-width: 900px) and (max-height: 430px) {
  .nav-links {
    left: 0;
    right: 0;
    top: auto !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: min(72dvh, 320px) !important;
    max-height: min(72dvh, 320px) !important;
    border-radius: 14px 14px 0 0;
    padding: 0.7rem 0.8rem max(0.8rem, env(safe-area-inset-bottom));
    transform: translateY(105%) !important;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.28);
  }

  .nav-links.nav-active {
    transform: translateY(0) !important;
  }

  .nav-links li {
    margin: 0.1rem 0;
  }

  .nav-links a,
  .centered-link {
    font-size: 0.95rem;
    padding: 0.5rem 0.35rem;
  }
}

/* === Tablet/Nav Congestion Fixes === */
nav {
  gap: 0.65rem;
}

.clock-container {
  flex: 0 0 30px;
}

#logo {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

@media (max-width: 1200px) {
  nav {
    justify-content: flex-start;
  }

  #logo {
    max-width: calc(100% - 86px);
    font-size: clamp(1rem, 2.1vw, 1.2rem);
    margin-right: auto;
    padding-right: 0.5rem;
  }

  .hamburger {
    margin-left: auto;
    display: flex !important;
  }

  .nav-links {
    width: min(78vw, 380px);
  }

  .nav-links a,
  .centered-link {
    color: #fff !important;
    width: 100% !important;
  }
}

@media (max-width: 1024px) and (orientation: portrait) {
  #logo {
    max-width: calc(100% - 82px);
    font-size: 1.02rem;
  }
}

@media (max-width: 1180px) and (orientation: landscape) {
  #logo {
    max-width: calc(100% - 82px);
    font-size: 1.05rem;
  }

  .nav-links {
    width: min(76vw, 390px);
  }
}

@media (min-width: 1201px) and (max-width: 1368px) {
  nav {
    padding-left: 2.2%;
    padding-right: 2.2%;
  }

  .nav-links li {
    margin-left: 1.05rem;
  }

  .nav-links a {
    font-size: 0.96rem;
  }

  #logo {
    max-width: 170px;
    font-size: 1.05rem;
  }
}

/* === Blogs Section === */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.blog-card {
  display: block;
  padding: 1.1rem;
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  border-color: rgba(255, 180, 0, 0.45);
}

.blog-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.blog-meta {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 0.45rem;
  font-weight: 520;
}

[data-theme="dark"] .blog-card {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* === Blog Card Fixed Height + Scrollable Excerpt === */
.blog-card {
  height: 240px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.blog-card h3 {
  flex: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-meta {
  flex: 0 0 auto;
}

.blog-excerpt {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0;
  padding-right: 0.35rem;
  line-height: 1.45;
  font-weight: 430;
}

.blog-excerpt::-webkit-scrollbar {
  width: 6px;
}

.blog-excerpt::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.45);
  border-radius: 12px;
}

.blog-excerpt::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 640px) {
  .blog-card {
    height: 220px;
  }
}

[data-theme='dark'] body {
  color: #eef2f8;
}

[data-theme='dark'] .card,
[data-theme='dark'] .resume-item,
[data-theme='dark'] .certification-card,
[data-theme='dark'] .project-card,
[data-theme='dark'] .recommendation-card,
[data-theme='dark'] .blog-card,
[data-theme='dark'] .overlay-content,
[data-theme='dark'] .popup-content {
  color: #f2f6ff;
}

/* === Floating Document Symbols Background === */
section,
footer {
  position: relative;
  z-index: 2;
}

.doc-float-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

/* === Crystal Glass Design Layer (2026) === */
:root {
  --glass-bg: rgba(255, 255, 255, 0.22);
  --glass-bg-strong: rgba(255, 255, 255, 0.3);
  --glass-border: rgba(255, 255, 255, 0.42);
  --glass-highlight: rgba(255, 255, 255, 0.62);
  --glass-shadow: 0 14px 38px rgba(16, 22, 38, 0.18);
}

[data-theme="dark"] {
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-highlight: rgba(255, 255, 255, 0.28);
  --glass-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.card,
.resume-item,
.certification-card,
.project-card,
.recommendation-card,
.blog-card,
.overlay-content,
.popup-content {
  position: relative;
  background: linear-gradient(160deg, var(--glass-bg-strong) 0%, var(--glass-bg) 100%) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.card::before,
.resume-item::before,
.certification-card::before,
.project-card::before,
.recommendation-card::before,
.blog-card::before,
.overlay-content::before,
.popup-content::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, var(--glass-highlight) 0%, rgba(255, 255, 255, 0.04) 46%, rgba(255, 255, 255, 0) 100%);
}

.certification-card:hover,
.project-card:hover,
.blog-card:hover,
.recommendation-card:hover,
.card:hover {
  border-color: rgba(255, 255, 255, 0.66) !important;
  box-shadow: 0 18px 44px rgba(20, 32, 58, 0.22);
}

.btn,
#submit-btn,
.blog-page-btn,
.popup-content .btn,
#popup-link,
#overlay-url {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.16) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.52) !important;
  box-shadow:
    0 8px 22px rgba(12, 18, 36, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.btn:hover,
#submit-btn:hover,
.blog-page-btn:hover,
#popup-link:hover,
#overlay-url:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    0 12px 28px rgba(8, 14, 32, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.blog-page-btn.active {
  background: linear-gradient(150deg, rgba(255, 180, 0, 0.86) 0%, rgba(255, 140, 0, 0.76) 100%) !important;
  border-color: rgba(255, 212, 109, 0.92) !important;
  color: #fff;
}

.doc-float-item {
  position: absolute;
  bottom: -18vh;
  opacity: 0;
  filter: saturate(1.05) contrast(1.02);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  will-change: transform, opacity;
  animation-name: docs-float-up;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.doc-float-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.doc-float-fa {
  font-size: 100%;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(12, 22, 40, 0.22));
}

@keyframes docs-float-up {
  0% {
    transform: translate3d(var(--drift-start), 0, 0) rotate(var(--rot-start));
    opacity: 0;
  }

  10% {
    opacity: 0.08;
  }

  90% {
    opacity: 0.08;
  }

  100% {
    transform: translate3d(var(--drift-end), -135vh, 0) rotate(var(--rot-end));
    opacity: 0;
  }
}

/* === Hero Gear Cluster (click to animate) === */
.hero {
  isolation: isolate;
}

.hero-content {
  position: relative;
  z-index: 3;
}

.hero-gear-cluster {
  position: absolute;
  top: 7%;
  right: 4%;
  width: 170px;
  height: 130px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  z-index: 2;
  opacity: 0.22;
  pointer-events: auto;
  cursor: pointer;
}

.hero-gear {
  --size: 72px;
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      #111 0deg 14deg,
      #f2f2f2 14deg 28deg
    );
  box-shadow:
    inset 0 0 0 16px rgba(255, 255, 255, 0.9),
    inset 0 0 0 28px rgba(17, 17, 17, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.35);
  transform: rotate(0deg);
  animation-play-state: paused;
}

.hero-gear::after {
  content: '';
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 3px rgba(17, 17, 17, 0.7);
}

.gear-a {
  --size: 76px;
  top: 6px;
  right: 14px;
  animation: gear-cw 4.8s linear infinite;
}

.gear-b {
  --size: 60px;
  top: 50px;
  right: 68px;
  animation: gear-ccw 4.8s linear infinite;
}

.gear-c {
  --size: 54px;
  top: 58px;
  right: 8px;
  animation: gear-ccw 3.8s linear infinite;
}

.hero-gear-cluster.is-active .hero-gear {
  animation-play-state: running;
}

@keyframes gear-cw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes gear-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@media (max-width: 900px) {
  .hero-gear-cluster {
    top: 10%;
    right: 2%;
    transform: scale(0.82);
    opacity: 0.18;
  }
}

/* === WWDC Refinement Pass (single-profile hero + readability + fixed cards) === */

/* 1) Readability fixes in light/dark for glass cards */
.resume-item {
  color: #1d2b3d !important;
}

.resume-item .resume-title {
  color: #1d2b3d !important;
}

.resume-item .institute,
.resume-item p {
  color: #304255 !important;
}

.resume-item .time {
  color: #e3a11d !important;
}

[data-theme='dark'] .resume-item {
  color: #f2f7ff !important;
}

[data-theme='dark'] .resume-item .resume-title {
  color: #f6f9ff !important;
}

[data-theme='dark'] .resume-item .institute,
[data-theme='dark'] .resume-item p {
  color: rgba(227, 237, 252, 0.92) !important;
}

[data-theme='dark'] .resume-item .time {
  color: #ffc857 !important;
}

.project-card h3,
.blog-card h3,
.cert-name,
.cert-org,
.user-name,
.recommendation-description {
  color: #24364b;
}

[data-theme='dark'] .project-card h3,
[data-theme='dark'] .blog-card h3,
[data-theme='dark'] .cert-name,
[data-theme='dark'] .cert-org,
[data-theme='dark'] .user-name,
[data-theme='dark'] .recommendation-description {
  color: #eef4ff;
}

/* 2) Portfolio + Design fixed card size even on last page */
#projects-container.project-grid,
#design-container.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 280px));
  justify-content: center;
  gap: 24px;
}

#projects-container .project-card,
#design-container .project-card {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  height: 260px;
}

@media (max-width: 1024px) {
  #projects-container.project-grid,
  #design-container.project-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 240px));
    gap: 18px;
  }

  #projects-container .project-card,
  #design-container .project-card {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
  }
}

@media (max-width: 640px) {
  #projects-container.project-grid,
  #design-container.project-grid {
    grid-template-columns: 1fr;
  }

  #projects-container .project-card,
  #design-container .project-card {
    width: min(92vw, 340px);
    min-width: min(92vw, 340px);
    max-width: min(92vw, 340px);
    margin-left: auto;
    margin-right: auto;
  }
}

/* === Nav Readability Hardening (all sections, all modes) === */
nav {
  background: linear-gradient(145deg, rgba(20, 38, 62, 0.84) 0%, rgba(16, 30, 52, 0.74) 100%) !important;
  border-bottom: 1px solid rgba(203, 228, 255, 0.34) !important;
  box-shadow:
    0 10px 28px rgba(3, 8, 18, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(26px) saturate(170%) !important;
  -webkit-backdrop-filter: blur(26px) saturate(170%) !important;
}

[data-theme='dark'] nav {
  background: linear-gradient(145deg, rgba(9, 18, 33, 0.9) 0%, rgba(10, 20, 36, 0.82) 100%) !important;
  border-bottom-color: rgba(120, 165, 220, 0.3) !important;
}

nav a,
.nav-links a,
#logo,
.hamburger div {
  color: #f7fbff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

nav a:hover,
.nav-links a:hover {
  color: #ffd27b !important;
}

#dark-mode-toggle i {
  font-size: 1.08rem;
  line-height: 1;
  transition: transform 0.24s ease, opacity 0.24s ease, color 0.24s ease;
}

#dark-mode-toggle:hover i {
  transform: rotate(12deg) scale(1.05);
}

.nav-links a.active-nav,
nav a.active-nav {
  color: #ffd27b !important;
  border-bottom-color: rgba(255, 210, 123, 0.95) !important;
}

@media (max-width: 1200px) {
  .nav-links {
    background: linear-gradient(165deg, rgba(16, 31, 53, 0.95) 0%, rgba(13, 26, 45, 0.9) 100%) !important;
    border-left: 1px solid rgba(201, 226, 255, 0.28) !important;
    box-shadow: -18px 0 36px rgba(0, 0, 0, 0.34) !important;
    backdrop-filter: blur(24px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
  }

  [data-theme='dark'] .nav-links {
    background: linear-gradient(165deg, rgba(10, 19, 35, 0.96) 0%, rgba(8, 16, 29, 0.92) 100%) !important;
    border-left-color: rgba(112, 154, 206, 0.28) !important;
  }

  .nav-links a,
  .centered-link {
    color: #f4f8ff !important;
    font-weight: 620 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}

/* === Unified Responsive Rows (Certifications / Portfolio / Design / Blogs) === */
#certifications-container.certification-grid,
#projects-container.project-grid,
#design-container.project-grid,
#blogs-container.blog-grid,
#blog-container.blog-grid,
#blogs .blog-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 1199px) and (min-width: 900px) {
  #certifications-container.certification-grid,
  #projects-container.project-grid,
  #design-container.project-grid,
  #blogs-container.blog-grid,
  #blog-container.blog-grid,
  #blogs .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 899px) and (min-width: 640px) {
  #certifications-container.certification-grid,
  #projects-container.project-grid,
  #design-container.project-grid,
  #blogs-container.blog-grid,
  #blog-container.blog-grid,
  #blogs .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 639px) {
  #certifications-container.certification-grid,
  #projects-container.project-grid,
  #design-container.project-grid,
  #blogs-container.blog-grid,
  #blog-container.blog-grid,
  #blogs .blog-grid {
    grid-template-columns: 1fr !important;
  }
}

/* === Responsive Pagination + Grid Alignment Fix (Portfolio / Design) === */
#projects-pagination,
#design-pagination,
.section-pagination {
  width: 100%;
  box-sizing: border-box;
  padding: 0 12px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center !important;
}

#projects-container.project-grid,
#design-container.project-grid {
  justify-content: center !important;
  align-items: stretch;
  gap: 24px;
}

#projects-container .project-card,
#design-container .project-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

@media (min-width: 1200px) {
  #projects-container.project-grid,
  #design-container.project-grid {
    grid-template-columns: repeat(4, minmax(0, 280px)) !important;
  }
}

/* === Unified Pagination Pattern (Prev / Pages / Ellipsis / Next) === */
.blog-pagination,
.section-pagination {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 1.15rem;
  flex-wrap: wrap;
}

.blog-page-btn,
.section-page-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1;
}

.blog-page-btn i,
.section-page-btn i {
  font-size: 0.9rem;
}

.blog-page-btn.page-nav-btn:disabled,
.section-page-btn.page-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.blog-page-btn.page-ellipsis,
.section-page-btn.page-ellipsis {
  pointer-events: none;
  user-select: none;
}

@media (max-width: 640px) {
  .blog-page-btn,
  .section-page-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 999px;
    font-size: 0.98rem;
  }

  .blog-pagination,
  .section-pagination {
    gap: 8px;
  }
}

@media (max-width: 1199px) and (min-width: 900px) {
  #projects-container.project-grid,
  #design-container.project-grid {
    grid-template-columns: repeat(3, minmax(0, 250px)) !important;
  }
}

@media (max-width: 899px) and (min-width: 640px) {
  #projects-container.project-grid,
  #design-container.project-grid {
    grid-template-columns: repeat(2, minmax(0, 230px)) !important;
    gap: 18px;
  }
}

@media (max-width: 639px) {
  #projects-container.project-grid,
  #design-container.project-grid {
    grid-template-columns: minmax(0, 340px) !important;
    justify-content: center !important;
  }
}

/* === Section Loader === */
.section-loading {
  position: relative;
}

.section-loader {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.55) 0%, rgba(245, 250, 255, 0.42) 100%);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  border-radius: inherit;
  color: #29415a;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Hero/About should never get full overlay masking while revalidating cached data. */
#hero .section-loader,
#about .section-loader,
#about .about-content .section-loader {
  display: none !important;
}

.section-loader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(41, 65, 90, 0.2);
  border-top-color: rgba(41, 65, 90, 0.9);
  border-radius: 50%;
  animation: section-loader-spin 0.8s linear infinite;
}

.section-loader-text {
  font-size: 0.95rem;
}

@keyframes section-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

[data-theme='dark'] .section-loader {
  background: linear-gradient(145deg, rgba(14, 26, 44, 0.62) 0%, rgba(10, 20, 35, 0.52) 100%);
  color: #e8f1ff;
}

[data-theme='dark'] .section-loader-spinner {
  border-color: rgba(232, 241, 255, 0.22);
  border-top-color: rgba(232, 241, 255, 0.92);
}

/* Tiny global refresh badge (shown when cached hero is being revalidated) */
.top-refresh-loader {
  position: fixed;
  top: calc(var(--nav-height, 72px) + 10px);
  left: 12px;
  z-index: 1002;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0%, rgba(239, 247, 255, 0.36) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 22px rgba(8, 16, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  color: #29415a;
  font-weight: 600;
  font-size: 0.85rem;
}

.top-refresh-loader.active {
  display: inline-flex;
}

.top-refresh-loader .section-loader-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

[data-theme='dark'] .top-refresh-loader {
  background: linear-gradient(145deg, rgba(17, 30, 50, 0.78) 0%, rgba(12, 22, 38, 0.62) 100%);
  border-color: rgba(157, 202, 255, 0.32);
  color: #e9f2ff;
}

/* === 2026 polish pass: hierarchy, readability, rhythm, consistency === */

/* 1) Hero scale */
@media (min-width: 1200px) {
  #hero {
    min-height: 84vh;
  }

  #hero .hero-content {
    max-width: 1220px;
    margin-left: auto;
    margin-right: auto;
    padding: clamp(34px, 4.2vw, 52px);
  }

  #hero .hero-left h1 {
    font-size: clamp(3rem, 3.8vw, 4.35rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
  }

  #hero .hero-left h3 {
    font-size: clamp(1.15rem, 1.35vw, 1.4rem);
    line-height: 1.45;
  }
}

/* 2) Readability tuning for text-heavy cards */
.resume-item .resume-title,
.recommendation-card .user-name {
  color: #f4f8ff;
}

.resume-item .institute,
.resume-item p,
.recommendation-card .user-profile,
.recommendation-card .recommendation-description {
  color: #d9e4f4;
}

[data-theme='dark'] .resume-item .resume-title,
[data-theme='dark'] .recommendation-card .user-name {
  color: #f6f9ff;
}

[data-theme='dark'] .resume-item .institute,
[data-theme='dark'] .resume-item p,
[data-theme='dark'] .recommendation-card .user-profile,
[data-theme='dark'] .recommendation-card .recommendation-description {
  color: #dee9f9;
}

/* 3) Vertical spacing rhythm */
#about,
#resume,
#certifications-section,
#projects,
#videos,
#design,
#blogs,
#testimonial {
  padding-top: clamp(72px, 8vh, 112px);
  padding-bottom: clamp(64px, 7vh, 96px);
}

/* 5) Pagination spacing refinement */
.blog-pagination,
.section-pagination {
  margin-top: 0.9rem;
}

/* Slightly soften floating background icons behind content */
.doc-float-item {
  opacity: 0.33 !important;
}

/* === Light-mode contrast fixes: Testimonials + Popups === */
body:not([data-theme='dark']) .recommendation-card .user-name {
  color: #2a3f57 !important;
}

body:not([data-theme='dark']) .recommendation-card .user-profile {
  color: #4a6078 !important;
}

body:not([data-theme='dark']) .recommendation-card .recommendation-description {
  color: #2f435a !important;
  background: transparent !important;
}

body:not([data-theme='dark']) .project-popup .popup-content {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.76) 0%, rgba(242, 248, 255, 0.66) 100%) !important;
  border: 1px solid rgba(122, 156, 196, 0.35) !important;
}

body:not([data-theme='dark']) .project-popup h3,
body:not([data-theme='dark']) .project-popup p,
body:not([data-theme='dark']) .project-popup .popup-content strong,
body:not([data-theme='dark']) .project-popup .popup-content span,
body:not([data-theme='dark']) .project-popup .popup-content h4 {
  color: #263a52 !important;
}

body:not([data-theme='dark']) .project-popup .popup-close {
  color: #2c4058 !important;
}

/* === Hide Blogger top admin bar safely (without affecting site layout/classes) === */
iframe#navbar-iframe {
  display: none !important;
}

/* === About Section Redesign (glass + two-column hero info + skill decks) === */
#about {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 520px at 12% 16%, rgba(72, 140, 255, 0.18) 0%, rgba(72, 140, 255, 0) 62%),
    radial-gradient(1000px 520px at 88% 84%, rgba(255, 186, 72, 0.16) 0%, rgba(255, 186, 72, 0) 64%),
    linear-gradient(180deg, rgba(8, 16, 31, 0.96) 0%, rgba(6, 12, 24, 0.98) 100%);
}

#about::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 40%, rgba(255, 255, 255, 0.08) 0 2px, transparent 3px) 0 0 / 180px 180px,
    radial-gradient(circle at 75% 70%, rgba(255, 255, 255, 0.06) 0 2px, transparent 3px) 0 0 / 220px 220px;
  opacity: 0.5;
}

#about > .container {
  position: relative;
  z-index: 2;
}

#about h2 {
  text-align: center;
  color: #f2f7ff;
  margin-bottom: clamp(24px, 3vw, 34px);
}

#about .about-content {
  display: block;
}

#about .about-text {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 20px;
}

#about .about-text > br {
  display: none;
}

#about #about-intro {
  grid-column: 1 / 2;
  margin: 0;
  color: #e6efff;
  font-size: clamp(1.08rem, 1.35vw, 1.34rem);
  line-height: 1.62;
  text-align: left;
}

#about .about-text > .card {
  border-radius: 26px;
  border: 1px solid rgba(174, 208, 255, 0.24);
  background: linear-gradient(145deg, rgba(20, 33, 58, 0.74) 0%, rgba(12, 24, 45, 0.62) 100%);
  box-shadow:
    0 16px 42px rgba(4, 10, 22, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  margin-bottom: 0;
  padding: 22px 24px;
}

#about .about-text > .card h3 {
  margin: 0 0 16px;
  color: #f3f8ff;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
}

/* Personal info card at top-right */
#about .about-text > .card:nth-of-type(1) {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

#about #personal-info-container p {
  margin: 12px 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(171, 203, 242, 0.2);
  color: #e6efff;
  font-size: 1.08rem;
  line-height: 1.45;
}

#about #personal-info-container p:last-child {
  border-bottom: 0;
}

/* Skill decks full-width */
#about .about-text > .card:nth-of-type(2),
#about .about-text > .card:nth-of-type(3) {
  grid-column: 1 / -1;
}

#about .skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 20px 16px;
  align-items: start;
  text-align: center;
}

#about .skill-item span {
  display: block;
  margin-top: 8px;
  font-size: 1.03rem;
  color: #ecf3ff;
  font-weight: 520;
}

#about .skill-circle {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(185, 214, 255, 0.42);
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.3), rgba(45, 95, 170, 0.45) 70%);
  box-shadow:
    0 10px 26px rgba(5, 11, 25, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

#about .skill-circle img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

#about .skill-circle::after {
  font-size: 13px;
}

@media (max-width: 1040px) {
  #about .about-text {
    grid-template-columns: 1fr;
  }

  #about #about-intro,
  #about .about-text > .card:nth-of-type(1),
  #about .about-text > .card:nth-of-type(2),
  #about .about-text > .card:nth-of-type(3) {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  #about .about-text > .card {
    padding: 18px 16px;
    border-radius: 20px;
  }

  #about .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

/* === About + Resume Reimagination (final) === */
#about,
#resume {
  position: relative;
  overflow: hidden;
}

#about::after,
#resume::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 30%, rgba(255, 255, 255, 0.08) 0 2px, transparent 3px) 0 0 / 200px 200px,
    radial-gradient(circle at 78% 68%, rgba(255, 195, 88, 0.14) 0 2px, transparent 3px) 0 0 / 260px 260px;
  opacity: 0.42;
}

#about > .container,
#resume > .container {
  position: relative;
  z-index: 2;
}

/* Dark mode base */
[data-theme='dark'] #about,
[data-theme='dark'] #resume,
body:not([data-theme]) #about,
body:not([data-theme]) #resume {
  background:
    radial-gradient(1200px 520px at 14% 18%, rgba(71, 139, 255, 0.18) 0%, rgba(71, 139, 255, 0) 62%),
    radial-gradient(1100px 580px at 84% 82%, rgba(255, 186, 72, 0.16) 0%, rgba(255, 186, 72, 0) 64%),
    linear-gradient(180deg, rgba(7, 15, 29, 0.98) 0%, rgba(5, 10, 22, 0.99) 100%);
}

/* Light mode base */
body[data-theme='light'] #about,
body[data-theme='light'] #resume,
body:not([data-theme='dark']) #about,
body:not([data-theme='dark']) #resume {
  background:
    radial-gradient(1000px 420px at 10% 14%, rgba(103, 165, 255, 0.15) 0%, rgba(103, 165, 255, 0) 62%),
    radial-gradient(900px 420px at 90% 88%, rgba(255, 201, 112, 0.15) 0%, rgba(255, 201, 112, 0) 60%),
    linear-gradient(180deg, rgba(237, 244, 255, 0.98) 0%, rgba(232, 240, 252, 0.99) 100%);
}

#about h2,
#resume .section-title {
  letter-spacing: -0.015em;
}

/* About layout */
#about .about-content {
  display: block;
}

#about .about-text {
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: 22px;
}

#about #about-intro {
  margin: 0;
  font-size: clamp(1.08rem, 1.25vw, 1.34rem);
  line-height: 1.64;
}

#about .about-text > .card {
  border-radius: 24px;
  margin-bottom: 0;
  padding: 20px 22px;
  border: 1px solid rgba(163, 199, 247, 0.28);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

#about .about-text > .card:nth-of-type(1) {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

#about .about-text > .card:nth-of-type(2),
#about .about-text > .card:nth-of-type(3) {
  grid-column: 1 / -1;
}

#about .skill-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 18px 14px;
}

#about .skill-circle {
  width: 86px;
  height: 86px;
}

#about .skill-circle img {
  width: 62px;
  height: 62px;
}

/* About card tones by mode */
[data-theme='dark'] #about .about-text > .card,
body:not([data-theme]) #about .about-text > .card {
  background: linear-gradient(145deg, rgba(20, 33, 58, 0.76) 0%, rgba(12, 24, 45, 0.64) 100%);
  box-shadow: 0 16px 40px rgba(3, 9, 20, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme='dark'] #about #about-intro,
[data-theme='dark'] #about .about-text > .card h3,
[data-theme='dark'] #about #personal-info-container p,
[data-theme='dark'] #about .skill-item span,
body:not([data-theme]) #about #about-intro,
body:not([data-theme]) #about .about-text > .card h3,
body:not([data-theme]) #about #personal-info-container p,
body:not([data-theme]) #about .skill-item span {
  color: #eaf2ff;
}

body:not([data-theme='dark']) #about .about-text > .card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.62) 0%, rgba(243, 249, 255, 0.54) 100%);
  box-shadow: 0 14px 34px rgba(74, 98, 132, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

body:not([data-theme='dark']) #about #about-intro,
body:not([data-theme='dark']) #about .about-text > .card h3,
body:not([data-theme='dark']) #about #personal-info-container p,
body:not([data-theme='dark']) #about .skill-item span {
  color: #253a52;
}

/* Resume redesign: twin timelines */
#resume .resume-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

#resume .experience-section,
#resume .education-section {
  position: relative;
  padding-left: 22px;
}

#resume .experience-section::before,
#resume .education-section::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 82px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 195, 85, 0.94) 0%, rgba(255, 166, 64, 0.55) 100%);
  box-shadow: 0 0 14px rgba(255, 187, 78, 0.48);
}

#resume .resume-widget {
  margin-bottom: 0;
}

#resume .resume-item {
  position: relative;
  border-radius: 20px;
  margin-bottom: 18px;
  padding: 22px 20px 20px;
  border: 1px solid rgba(162, 198, 245, 0.28);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#resume .resume-item::after {
  content: '';
  position: absolute;
  left: -30px;
  top: 32px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffd07a;
  box-shadow: 0 0 12px rgba(255, 190, 78, 0.86);
}

#resume .resume-item:hover {
  transform: translateY(-3px);
}

#resume .resume-item .time {
  font-size: clamp(1rem, 1.2vw, 1.16rem);
  font-weight: 700;
  color: #f7c46f;
  margin-bottom: 8px;
}

#resume .resume-item .resume-title {
  font-size: clamp(1.5rem, 2.1vw, 1.95rem);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

#resume .resume-item .institute {
  font-size: clamp(1rem, 1.12vw, 1.1rem);
  margin-bottom: 4px;
}

#resume .resume-item p {
  font-size: clamp(0.98rem, 1.08vw, 1.06rem);
  line-height: 1.55;
}

/* Resume tones by mode */
[data-theme='dark'] #resume .resume-item,
body:not([data-theme]) #resume .resume-item {
  background: linear-gradient(145deg, rgba(20, 33, 58, 0.78) 0%, rgba(12, 24, 45, 0.66) 100%);
  box-shadow: 0 16px 38px rgba(3, 9, 20, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme='dark'] #resume .resume-item .resume-title,
[data-theme='dark'] #resume .resume-item .institute,
[data-theme='dark'] #resume .resume-item p,
body:not([data-theme]) #resume .resume-item .resume-title,
body:not([data-theme]) #resume .resume-item .institute,
body:not([data-theme]) #resume .resume-item p {
  color: #e8f1ff;
}

body:not([data-theme='dark']) #resume .resume-item {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.68) 0%, rgba(243, 249, 255, 0.58) 100%);
  box-shadow: 0 14px 30px rgba(74, 98, 132, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body:not([data-theme='dark']) #resume .resume-item .resume-title {
  color: #23374e;
}

body:not([data-theme='dark']) #resume .resume-item .institute,
body:not([data-theme='dark']) #resume .resume-item p {
  color: #3b536b;
}

/* Responsiveness */
@media (max-width: 1080px) {
  #about .about-text {
    grid-template-columns: 1fr;
  }

  #about #about-intro,
  #about .about-text > .card:nth-of-type(1),
  #about .about-text > .card:nth-of-type(2),
  #about .about-text > .card:nth-of-type(3) {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  #resume .resume-container {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 768px) {
  #about .about-text > .card {
    border-radius: 18px;
    padding: 16px 14px;
  }

  #about .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  #resume .experience-section,
  #resume .education-section {
    padding-left: 16px;
  }

  #resume .resume-item {
    border-radius: 16px;
    padding: 16px 14px 14px;
    margin-bottom: 14px;
  }

  #resume .resume-item::after {
    left: -22px;
    top: 24px;
    width: 10px;
    height: 10px;
  }

  #resume .experience-section::before,
  #resume .education-section::before {
    left: 0;
    top: 74px;
  }
}

/* === Fix pass: About/Resume background + heading + independent column scroll === */

/* 1) Keep original section background (emoji layer stays visible behind) */
#about,
#resume {
  background: transparent !important;
}

#about::after,
#resume::after {
  display: none !important;
}

/* 2) About heading visibility in light mode */
body:not([data-theme='dark']) #about h2 {
  color: #2c435c !important;
}

[data-theme='dark'] #about h2,
body:not([data-theme]) #about h2 {
  color: #f2f7ff !important;
}

/* 3) Experience/Education independent vertical scroll with bottom fade */
#resume .experience-section .resume-widget,
#resume .education-section .resume-widget {
  max-height: 760px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
  mask-image: linear-gradient(to bottom, #000 0%, #000 84%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 84%, transparent 100%);
}

#resume .experience-section .resume-widget::-webkit-scrollbar,
#resume .education-section .resume-widget::-webkit-scrollbar {
  width: 8px;
}

#resume .experience-section .resume-widget::-webkit-scrollbar-thumb,
#resume .education-section .resume-widget::-webkit-scrollbar-thumb {
  background: rgba(255, 187, 78, 0.75);
  border-radius: 999px;
}

#resume .experience-section .resume-widget::-webkit-scrollbar-track,
#resume .education-section .resume-widget::-webkit-scrollbar-track {
  background: rgba(112, 139, 172, 0.14);
}

/* Disable inner-column scroll on smaller screens for better UX */
@media (max-width: 1080px) {
  #resume .experience-section .resume-widget,
  #resume .education-section .resume-widget {
    max-height: none;
    overflow: visible;
    padding-right: 0;
    mask-image: none;
    -webkit-mask-image: none;
  }
}

/* 4) Quick pixel polish: consistent glass finish across core cards */
.card,
.resume-item,
.certification-card,
.project-card,
.blog-card,
.recommendation-card,
.overlay-content,
.popup-content {
  border: 1px solid rgba(170, 202, 243, 0.26);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(8, 18, 34, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body:not([data-theme='dark']) .card,
body:not([data-theme='dark']) .resume-item,
body:not([data-theme='dark']) .certification-card,
body:not([data-theme='dark']) .project-card,
body:not([data-theme='dark']) .blog-card,
body:not([data-theme='dark']) .recommendation-card,
body:not([data-theme='dark']) .overlay-content,
body:not([data-theme='dark']) .popup-content {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72) 0%, rgba(245, 250, 255, 0.62) 100%);
}

[data-theme='dark'] .card,
[data-theme='dark'] .resume-item,
[data-theme='dark'] .certification-card,
[data-theme='dark'] .project-card,
[data-theme='dark'] .blog-card,
[data-theme='dark'] .recommendation-card,
[data-theme='dark'] .overlay-content,
[data-theme='dark'] .popup-content,
body:not([data-theme]) .card,
body:not([data-theme]) .resume-item,
body:not([data-theme]) .certification-card,
body:not([data-theme]) .project-card,
body:not([data-theme]) .blog-card,
body:not([data-theme]) .recommendation-card,
body:not([data-theme]) .overlay-content,
body:not([data-theme]) .popup-content {
  background: linear-gradient(145deg, rgba(20, 33, 58, 0.72) 0%, rgba(12, 24, 45, 0.6) 100%);
}

/* === Final About fixes: heading contrast + personal info height balance === */
body:not([data-theme='dark']) #about h2,
body[data-theme='light'] #about h2,
body:not([data-theme]) #about h2 {
  color: #2a425c !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

[data-theme='dark'] #about h2 {
  color: #f2f7ff !important;
  text-shadow: none;
}

/* === Image visibility fix: white backplate for key card sections === */
#certifications-container .cert-image {
  background: #ffffff;
}

#certifications-container .cert-image img {
  background: #ffffff;
  object-fit: contain;
  padding: 4px;
}

#projects-container .project-card img,
#design-container .project-card img {
  background: #ffffff;
}

#about .about-text {
  align-items: start;
}

#about .about-text > .card:nth-of-type(1) {
  align-self: start;
  height: fit-content;
  padding: 12px 16px;
  border-radius: 18px;
}

#about #personal-info-container p {
  margin: 4px 0;
  padding: 8px 0;
  font-size: 0.98rem;
  line-height: 1.3;
}

/* === Final Normalize Pass: Hero/About/Resume === */

/* -----------------------------
   ABOUT: heading + balance
------------------------------ */
body:not([data-theme='dark']) #about h2 {
  color: #2a425c !important;
}

#about .about-text {
  align-items: start !important;
}

#about .about-text > .card:nth-of-type(1) {
  align-self: start !important;
  height: fit-content !important;
}

/* -----------------------------
   RESUME: keep independent scrolls
------------------------------ */
#resume .experience-section .resume-widget,
#resume .education-section .resume-widget {
  max-height: 760px;
  overflow-y: auto;
}

@media (max-width: 1080px) {
  #resume .experience-section .resume-widget,
  #resume .education-section .resume-widget {
    max-height: none;
    overflow: visible;
  }
}

/* === HERO 2026 PREMIUM GLOSSY GLASS REDESIGN (final override) === */
#hero.hero {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: calc(var(--nav-height) + 14px) 0 16px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(1100px 620px at 12% 6%, rgba(72, 138, 255, 0.24) 0%, rgba(72, 138, 255, 0) 64%),
    radial-gradient(920px 560px at 88% 84%, rgba(255, 189, 92, 0.2) 0%, rgba(255, 189, 92, 0) 68%),
    linear-gradient(146deg, #050d1f 0%, #081a3d 44%, #0a1c3f 68%, #192333 100%) !important;
}

#hero {
  scroll-margin-top: calc(var(--nav-height) + 14px);
}

#hero.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 220px at 65% 22%, rgba(132, 192, 255, 0.3) 0%, rgba(132, 192, 255, 0) 70%),
    radial-gradient(620px 180px at 74% 68%, rgba(255, 197, 122, 0.24) 0%, rgba(255, 197, 122, 0) 72%);
  filter: blur(10px);
  animation: hero-aurora-shift 14s ease-in-out infinite alternate;
}

#hero.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.28;
  background-image: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.28) 0 1px, transparent 2px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
}

#hero .hero-content {
  position: relative;
  z-index: 3;
  width: min(1280px, calc(100% - 52px));
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: 1.35fr 0.95fr;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(28px, 4vw, 52px);
  border-radius: 30px;
  border: 1px solid rgba(182, 214, 255, 0.36);
  background:
    linear-gradient(150deg, rgba(51, 87, 145, 0.42) 0%, rgba(24, 43, 84, 0.34) 40%, rgba(18, 33, 70, 0.28) 100%);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  box-shadow:
    0 36px 90px rgba(4, 10, 24, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -1px 0 rgba(120, 165, 230, 0.24);
  overflow: hidden;
}

#hero .hero-content::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(620px 260px at 12% -10%, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(420px 180px at 85% 10%, rgba(130, 182, 255, 0.26) 0%, rgba(130, 182, 255, 0) 70%);
}

#hero .hero-content::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid transparent;
  background:
    radial-gradient(220px 120px at 0% 100%, rgba(255, 206, 120, 0.34), transparent 75%),
    radial-gradient(280px 140px at 100% 0%, rgba(138, 198, 255, 0.34), transparent 75%);
  mix-blend-mode: screen;
}

#hero .hero-left {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#hero .hero-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid rgba(215, 232, 255, 0.52);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.1) 100%);
  color: #edf6ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 10px 26px rgba(8, 18, 38, 0.22);
}

#hero .hero-badge-dot {
  width: 10px;
  height: 10px;
  background: #2fd47d;
  box-shadow: 0 0 0 4px rgba(47, 212, 125, 0.24), 0 0 14px rgba(47, 212, 125, 0.66);
}

#hero #hero-headline {
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.65rem);
  line-height: 1.1;
  font-weight: 780;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: #f4f8ff;
  text-shadow: 0 4px 20px rgba(81, 139, 255, 0.22);
  display: inline-block;
  padding-bottom: 0.08em;
  overflow: visible;
}

#hero #hero-headline::first-line {
  font-weight: 640;
}

#hero #hero-headline {
  background: linear-gradient(100deg, #f6f8ff 12%, #99cdff 52%, #ffdcb0 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#hero #hero-subheadline {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(1.02rem, 1.58vw, 1.34rem);
  line-height: 1.6;
  color: rgba(231, 240, 255, 0.92);
}

#hero .hero-stack {
  margin-top: 2px;
}

#hero .stack-icons {
  display: flex;
  gap: 10px;
}

#hero .stack-icons a {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(214, 232, 255, 0.52);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.11));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 10px 22px rgba(6, 14, 30, 0.2);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  text-decoration: none !important;
  border-bottom: 0 !important;
}

#hero .stack-icons a:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(172, 218, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66), 0 14px 28px rgba(4, 11, 26, 0.28);
  text-decoration: none !important;
  border-bottom: 0 !important;
}

#hero .stack-icons a:focus,
#hero .stack-icons a:active,
#hero .stack-icons a:visited {
  text-decoration: none !important;
  border-bottom: 0 !important;
}

#hero .stack-icons i {
  font-size: 1.02rem;
  color: #f5f9ff;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: inline-block;
  line-height: 1;
}

/* Right side composition */
#hero .container-home {
  position: relative;
  z-index: 3;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

#hero .container-home .row,
#hero .container-home .home-details-container,
#hero .container-home .home-details,
#hero .container-home .text-sm-center.text-lg-start {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 14px;
  margin: 0 !important;
  text-align: center !important;
}

#hero .main-img-mobile {
  display: block !important;
  margin: 0 auto 8px;
}

#hero .main-img-mobile .circular-img-container {
  position: relative;
  width: clamp(180px, 24vw, 300px);
  height: clamp(180px, 24vw, 300px);
  border-radius: 50%;
  overflow: visible;
  background: transparent;
  border: 1px solid rgba(187, 221, 255, 0.74);
  box-shadow:
    0 24px 56px rgba(7, 15, 32, 0.42),
    0 0 0 10px rgba(88, 149, 255, 0.15),
    0 0 0 20px rgba(255, 197, 120, 0.11);
  animation: hero-profile-float 8s ease-in-out infinite;
}

#hero .main-img-mobile .circular-img-container::before {
  content: '';
  position: absolute;
  inset: -13px;
  border-radius: 50%;
  background: conic-gradient(
    from 30deg,
    rgba(102, 201, 255, 0.85),
    rgba(108, 141, 255, 0.45),
    rgba(255, 195, 112, 0.7),
    rgba(102, 201, 255, 0.85)
  );
  filter: blur(1px);
  animation: hero-ring-spin 14s linear infinite;
  z-index: 0;
}

#hero .main-img-mobile .circular-img-container::after {
  content: '';
  position: absolute;
  inset: -42px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 180, 255, 0.24) 0%, rgba(108, 180, 255, 0) 68%);
  z-index: -1;
}

#hero #hero-profile-image {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(240, 248, 255, 0.84);
}

#hero .main-img-mobile .circular-img-container:hover {
  transform: translateY(-4px);
  box-shadow:
    0 30px 70px rgba(7, 15, 32, 0.5),
    0 0 0 11px rgba(95, 161, 255, 0.2),
    0 0 0 22px rgba(255, 203, 128, 0.16);
}

#hero .container-home .btn {
  position: relative;
  overflow: hidden;
  min-width: clamp(172px, 16vw, 230px);
  height: 52px;
  border-radius: 999px;
  font-size: clamp(1rem, 1.18vw, 1.25rem);
  font-weight: 560;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

#hero .container-home .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 42%;
  height: 100%;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  transform: skewX(-24deg);
  transition: left 0.36s ease;
}

#hero .container-home .btn:hover::before {
  left: 110%;
}

#hero .container-home .btn:first-of-type {
  color: #f6fbff !important;
  border: 1px solid rgba(149, 211, 255, 0.92) !important;
  background: linear-gradient(145deg, rgba(78, 188, 255, 0.9) 0%, rgba(58, 130, 255, 0.78) 100%) !important;
  box-shadow: 0 16px 34px rgba(28, 98, 218, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

#hero #hero-resume.btn {
  color: #eff6ff !important;
  border: 1px solid rgba(235, 243, 255, 0.74) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1)) !important;
  box-shadow: 0 12px 28px rgba(8, 18, 36, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

#hero .container-home .btn:hover {
  transform: translateY(-2px);
}

/* Mobile and tablet */
@media (max-width: 1080px) {
  #hero.hero {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding-top: calc(var(--nav-height) + 12px);
    padding-bottom: 14px;
  }

  #hero .hero-content {
    grid-template-columns: 1fr;
    gap: 20px;
    width: calc(100% - 26px);
    border-radius: 24px;
    padding: 20px 14px 18px;
  }

  #hero .hero-left,
  #hero #hero-subheadline {
    text-align: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
  }

  #hero #hero-subheadline {
    max-width: 95%;
  }

  #hero .stack-icons {
    justify-content: center;
  }

  #hero .container-home .text-sm-center.text-lg-start {
    gap: 10px;
  }
}

@media (max-width: 640px) {
  #hero .hero-content {
    border-radius: 20px;
    padding: 16px 12px;
  }

  #hero .hero-badge {
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  #hero .stack-icons a {
    width: 40px;
    height: 40px;
  }

  #hero .main-img-mobile .circular-img-container {
    width: min(62vw, 240px);
    height: min(62vw, 240px);
  }

  #hero .container-home .btn {
    min-width: min(86vw, 280px);
    width: min(86vw, 280px);
    height: 48px;
    font-size: 1rem;
  }

  #hero.hero {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding-top: calc(var(--nav-height) + 10px);
    padding-bottom: 12px;
  }
}

/* Remove top-right gear cluster from hero */
.hero-gear-cluster {
  display: none !important;
}

@keyframes hero-aurora-shift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-1.2%, 1.2%, 0) scale(1.03); }
  100% { transform: translate3d(1.6%, -1.5%, 0) scale(1.05); }
}

@keyframes hero-panel-in {
  0% { opacity: 0; transform: translateY(18px) scale(0.992); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hero-profile-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -8px, 0); }
}

@keyframes hero-ring-spin {
  to { transform: rotate(360deg); }
}

/* === Hero Ambient Background v2 (no glossy hover sweep) === */

/* Base gradient (dark + light variants) */
[data-theme='dark'] #hero.hero {
  background:
    linear-gradient(138deg, #030b1d 0%, #071a3d 46%, #0a2046 76%, #1a2737 100%) !important;
}

body:not([data-theme='dark']) #hero.hero {
  background:
    linear-gradient(138deg, #7f97c0 0%, #6f89b5 44%, #647ea8 76%, #6e86ae 100%) !important;
}

/* Layer 2 + 3: aurora waves + blurred blobs */
#hero.hero::before {
  content: '';
  position: absolute;
  inset: -8% -6%;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
  background:
    radial-gradient(55% 35% at 18% 18%, rgba(74, 146, 255, 0.34) 0%, rgba(74, 146, 255, 0) 72%),
    radial-gradient(48% 32% at 84% 76%, rgba(248, 189, 104, 0.28) 0%, rgba(248, 189, 104, 0) 74%),
    radial-gradient(42% 28% at 68% 32%, rgba(105, 194, 255, 0.22) 0%, rgba(105, 194, 255, 0) 70%),
    radial-gradient(38% 28% at 32% 82%, rgba(110, 151, 255, 0.18) 0%, rgba(110, 151, 255, 0) 72%);
  filter: blur(2px);
  opacity: 0.9;
  animation: hero-ambient-drift-v2 34s ease-in-out infinite alternate;
}

/* Layer 4: subtle particles */
#hero.hero::after {
  content: '';
  position: absolute;
  inset: -10% -8%;
  z-index: 1;
  pointer-events: none;
  will-change: transform, opacity;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.34) 0 1.2px, transparent 2px),
    radial-gradient(circle, rgba(255, 214, 146, 0.24) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(184, 220, 255, 0.28) 0 1px, transparent 2px);
  background-size: 180px 180px, 240px 240px, 300px 300px;
  background-position: 0 0, 40px 70px, 120px 30px;
  opacity: 0.25;
  mix-blend-mode: screen;
  animation: hero-particles-float-v2 36s linear infinite;
}

/* Layer 5: radial glow behind profile image */
#hero .container-home {
  position: relative;
}

#hero .container-home::before {
  content: '';
  position: absolute;
  inset: 8% 12% 12% 12%;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(104, 179, 255, 0.26) 0%, rgba(104, 179, 255, 0.06) 34%, rgba(104, 179, 255, 0) 68%);
  filter: blur(18px);
  animation: hero-profile-glow-v2 10s ease-in-out infinite;
}

/* Keep panel in front of ambient layers */
#hero .hero-content,
#hero .hero-left,
#hero .container-home {
  position: relative;
  z-index: 3;
}

/* Light mode readability balancing (less faded than before) */
body:not([data-theme='dark']) #hero #hero-subheadline {
  color: rgba(28, 46, 69, 0.9) !important;
}

body:not([data-theme='dark']) #hero .stack-icons a {
  border-color: rgba(98, 132, 178, 0.68);
  background: linear-gradient(165deg, rgba(244, 249, 255, 0.72), rgba(217, 230, 248, 0.56));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 22px rgba(34, 57, 90, 0.2);
}

body:not([data-theme='dark']) #hero .stack-icons a:hover {
  border-color: rgba(80, 118, 170, 0.86);
  background: linear-gradient(165deg, rgba(250, 253, 255, 0.82), rgba(225, 236, 251, 0.62));
}

body:not([data-theme='dark']) #hero .stack-icons i {
  color: #1d3653 !important;
}

/* Mobile: reduce ambient intensity for clarity/perf */
@media (max-width: 768px) {
  #hero.hero::before {
    opacity: 0.72;
    animation-duration: 40s;
  }

  #hero.hero::after {
    opacity: 0.16;
    animation-duration: 44s;
  }

  #hero .container-home::before {
    opacity: 0.72;
  }
}

/* Keep certifications section surface consistent with other sections */
#certifications-section,
#certifications-section .certifications-section {
  background: transparent !important;
}

/* Final navbar layout guards for resize/rotation stability */
@media (max-width: 1200px) {
  .nav-links {
    left: auto !important;
    right: 0 !important;
    bottom: auto !important;
    width: min(84vw, 360px) !important;
    height: calc(100dvh - var(--nav-height)) !important;
    max-height: calc(100dvh - var(--nav-height)) !important;
    transform: translateX(110%) !important;
  }

  .nav-links.nav-active {
    transform: translateX(0) !important;
  }
}

@media (min-width: 1201px) {
  .nav-links {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    transform: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }
}

@keyframes hero-ambient-drift-v2 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.86;
  }
  50% {
    transform: translate3d(-1.4%, 1.2%, 0) scale(1.03);
    opacity: 0.95;
  }
  100% {
    transform: translate3d(1.6%, -1.5%, 0) scale(1.04);
    opacity: 0.88;
  }
}

@keyframes hero-particles-float-v2 {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, -28px, 0);
  }
}

@keyframes hero-profile-glow-v2 {
  0%, 100% {
    transform: scale(0.98);
    opacity: 0.78;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

/* Hero-only: keep main glass card static on hover */
#hero .hero-content {
  animation: none !important;
  transition: none !important;
}

#hero .hero-content::before,
#hero .hero-content::after {
  transition: none !important;
}

#hero .hero-content:hover,
#hero .hero-content:hover::before,
#hero .hero-content:hover::after {
  transform: none !important;
  animation: none !important;
  box-shadow: inherit !important;
  filter: none !important;
}
