@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #0a0a0a;
  --secondary: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --accent: #667eea;
  --accent-dark: #764ba2;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--secondary);
  color: var(--primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Navigation ------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--gray-200);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 1.2rem 0;
  z-index: 1500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar.scrolled {
  padding: 0.85rem 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
}
.nav-menu a {
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  letter-spacing: -0.2px;
  position: relative;
  transition: color 0.3s ease;
}
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}
.nav-menu a:hover,
.nav-menu a.active {
  color: var(--primary);
}
.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-logo img,
.footer-logo img {
  display: block;
  height: 40px;         /* adjust to taste */
  width: auto;
  object-fit: contain;
}

@media (max-width: 580px) {
  .nav-logo img,
  .footer-logo img {
    height: 32px;       /* slightly smaller on small screens */
  }
}

/* Hero ------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 8rem 2rem 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #eef1ff 0%, #e1e8ff 55%, #d6ddff 100%);
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(242, 245, 255, 0.92));
  z-index: 1;
  pointer-events: none;
}

/* Chess stage (background FX) ------------------------------------- */
.chess-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(1.05);
}

.stage-backdrop {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at center, rgba(188, 198, 255, 0.28), rgba(236, 240, 255, 0.88) 75%);
  filter: blur(38px);
  opacity: 0;
}

.stage-fog {
  position: absolute;
  width: 120%;
  height: 120%;
  filter: blur(40px);
  background: radial-gradient(circle, rgba(188, 204, 255, 0.35) 0%, transparent 60%);
  opacity: 0.35;
}
.fog-left {
  top: -10%;
  left: -25%;
  animation: fogDriftLeft 24s ease-in-out infinite;
}
.fog-right {
  bottom: -15%;
  right: -25%;
  animation: fogDriftRight 26s ease-in-out infinite;
}
@keyframes fogDriftLeft {
  0%, 100% { transform: translate3d(0,0,0) scale(1.2); }
  50%      { transform: translate3d(12%, 6%, 0) scale(1.45); }
}
@keyframes fogDriftRight {
  0%, 100% { transform: translate3d(0,0,0) scale(1.2); }
  50%      { transform: translate3d(-14%, -6%, 0) scale(1.4); }
}

.chess-camera {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  transform-style: preserve-3d;
}

/* Chess board ------------------------------------------------------ */
.chess-board {
  --board-size: min(80vmin, 620px);
  position: relative;
  width: var(--board-size);
  height: var(--board-size);
  border-radius: 26px;
  background: rgba(248, 250, 255, 0.95);
  border: 1px solid rgba(160, 175, 255, 0.3);
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow:
    0 36px 110px rgba(175, 188, 255, 0.35),
    0 0 70px rgba(190, 200, 255, 0.28);
}

/* Put this block directly beneath .chess-board */
.chess-board::before,
.chess-board::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.85;
}

.chess-board::before {
  background-image: repeating-linear-gradient(
    to right,
    transparent,
    transparent calc(12.5% - 1px),
    rgba(20, 38, 98, 0.85) calc(12.5% - 1px),
    rgba(20, 38, 98, 0.85) 12.5%
  );
}

.chess-board::after {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(12.5% - 1px),
    rgba(20, 38, 98, 0.85) calc(12.5% - 1px),
    rgba(20, 38, 98, 0.85) 12.5%
  );
}

.board-squares {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  transform: translateZ(0);
  z-index: 1;
}
.board-squares span {
  background: rgba(234, 239, 255, 0.82);
}
.board-squares span:nth-child(odd) {
  background: rgba(219, 226, 255, 0.82);
}
.board-squares span:nth-child(16n + 1),
.board-squares span:nth-child(16n + 3),
.board-squares span:nth-child(16n + 5),
.board-squares span:nth-child(16n + 7) {
  background: rgba(201, 213, 255, 0.85);
}

.board-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 65% 25%, rgba(255, 233, 165, 0.42), transparent 70%);
  filter: blur(45px);
  opacity: 0;
}
.board-flare {
  position: absolute;
  inset: -35%;
  background: conic-gradient(from 0deg, rgba(160, 190, 255, 0.45), transparent 50%);
  mix-blend-mode: screen;
  filter: blur(80px);
  opacity: 0.12;
  animation: flareSpin 16s linear infinite;
}
@keyframes flareSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.piece {
  --file: 0;
  --rank: 0;
  position: absolute;
  width: 14%;
  height: 14%;
  top: calc(var(--rank) * 12.5%);
  left: calc(var(--file) * 12.5%);
  transform: translate3d(0, 0, 18px);
  opacity: 0;
  filter: drop-shadow(0 14px 28px rgba(130, 150, 210, 0.35));
}
.piece--white {
  filter:
    drop-shadow(0 22px 38px rgba(140, 160, 255, 0.35))
    drop-shadow(0 10px 18px rgba(255, 255, 255, 0.28));
}
.piece--black {
  filter:
    drop-shadow(0 22px 34px rgba(90, 105, 185, 0.32))
    drop-shadow(0 10px 18px rgba(140, 150, 205, 0.3));
}

.capture-flash {
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 222, 102, 0.85), rgba(255, 140, 0, 0) 70%);
  opacity: 0;
  pointer-events: none;
}

.atmosphere-sparks {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  overflow: hidden;
}
.atmosphere-sparks span {
  position: absolute;
  width: 2px;
  height: 80px;
  background: linear-gradient(180deg, transparent, rgba(165, 182, 255, 0.6), transparent);
  opacity: 0.45;
  transform: rotate(12deg);
  animation: sparkFall 6s linear infinite;
}
.atmosphere-sparks span:nth-child(odd) { animation-delay: -3s; }
.atmosphere-sparks span:nth-child(2)   { left: 18%; }
.atmosphere-sparks span:nth-child(3)   { left: 40%; height: 60px; }
.atmosphere-sparks span:nth-child(4)   { left: 55%; height: 110px; }
.atmosphere-sparks span:nth-child(5)   { left: 72%; }
.atmosphere-sparks span:nth-child(6)   { left: 88%; height: 90px; }
@keyframes sparkFall {
  0%   { transform: translateY(-120%) rotate(12deg); opacity: 0; }
  20%  { opacity: 0.55; }
  80%  { opacity: 0.4; }
  100% { transform: translateY(220%) rotate(12deg); opacity: 0; }
}

/* Hero content ------------------------------------------------------ */
.hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  text-align: center;
}

.hero-card {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
  box-shadow: 0 22px 60px rgba(142, 158, 242, 0.18);
  border: 1px solid rgba(160, 170, 255, 0.18);
  backdrop-filter: blur(6px);
}
.hero-profile-wrapper {
  position: relative;
}
.hero-profile-ring {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
  opacity: 0.2;
  animation: pulse 3.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50%      { transform: scale(1.05); opacity: 0.28; }
}
.hero-image {
  width: clamp(220px, 28vw, 280px);
  height: clamp(220px, 28vw, 280px);
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(160, 170, 255, 0.18), 0 18px 50px rgba(150, 160, 240, 0.26);
}
.hero-text-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}
.hero-name {
  font-size: clamp(2.5rem, 4.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -2px;
  color: #1a1f3d;
}
.hero-socials {
  display: flex;
  gap: 1rem;
}
.social-link {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(160, 175, 255, 0.35);
  background: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.social-link:hover {
  transform: translateY(-4px);
  background: rgba(102, 126, 234, 0.92);
  color: var(--secondary);
  box-shadow: 0 12px 30px rgba(120, 140, 255, 0.28);
}

.hero-scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: rgba(70, 80, 140, 0.55);
  font-size: 0.9rem;
  animation: bounce 2.2s infinite;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

/* Sections ---------------------------------------------------------- */
.section {
  padding: 7rem 2rem;
  position: relative;
}
.section-header {
  max-width: 1100px;
  margin: 0 auto 4rem;
  text-align: center;
}
.section-number {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 0.75rem;
}
.section-subtitle {
  color: var(--gray-500);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

/* About ------------------------------------------------------------- */
.about-container {
  max-width: 1100px;
  margin: 0 auto;
}
.about-hero-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  padding: 3rem;
  border-radius: 26px;
  background: var(--secondary);
  border: 1px solid var(--gray-200);
  box-shadow: 0 22px 60px rgba(8, 10, 24, 0.08);
}
.about-hero-content h3 {
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.about-hero-content p {
  font-size: 1.05rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}
.about-hero-image {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(8, 10, 24, 0.12);
}
.about-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Experience -------------------------------------------------------- */
.experience-container {
  max-width: 1100px;
  margin: 0 auto;
}
.professional-experience {
  display: grid;
  gap: 1.5rem;
}
.exp-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.2rem;
  background: var(--secondary);
  border-radius: 18px;
  padding: 1.9rem 1.6rem;
  border: 1px solid var(--gray-200);
  box-shadow: 0 18px 45px rgba(8, 10, 24, 0.08);
}
.exp-role {
  font-size: 1.1rem;
  font-weight: 700;
}
.exp-company {
  font-size: 0.96rem;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
}
.exp-bullets {
  color: var(--gray-600);
}
.exp-bullets li {
  margin-bottom: 0.4rem;
}
.exp-dates {
  font-size: 0.9rem;
  color: var(--gray-500);
  white-space: nowrap;
}

/* Projects ---------------------------------------------------------- */
.projects-section {
  background: var(--gray-50);
}

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

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Fixed 3 columns */
  gap: 2rem;
  grid-auto-rows: 1fr;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr; /* 1 column on mobile */
  }
}

.project-card {
  background: var(--secondary);
  border-radius: 22px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 18px 45px rgba(8, 10, 24, 0.08);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 26px 65px rgba(8, 10, 24, 0.16);
}

.project-card.featured {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .project-card.featured {
    grid-column: span 1;
  }
}

.project-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.project-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-badge {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 18px 45px rgba(8, 10, 24, 0.2);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 100%);
}

.project-content {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.project-tags {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.project-tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
}

.project-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.project-content p {
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.7;
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 0.7rem;
}

.project-link {
  flex: 1;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-link.primary {
  background: var(--primary);
  color: var(--secondary);
  box-shadow: 0 12px 30px rgba(8, 10, 24, 0.18);
}

.project-link.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 45px rgba(8, 10, 24, 0.22);
}

.project-link.secondary {
  background: var(--gray-100);
  color: var(--primary);
  border: 1px solid var(--gray-200);
}

.project-link.secondary:hover {
  transform: translateY(-3px);
  background: var(--gray-200);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  grid-auto-rows: 1fr; /* every card gets the same row height */
}

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

.project-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* consistent 16:9 preview window */
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.12));
}

.project-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 2rem;
}

.project-links {
  margin-top: auto; /* pins the buttons to the bottom across cards */
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Contact ----------------------------------------------------------- */
.contact-container {
  max-width: 800px;
  margin: 0 auto;
}

.contact-info-card {
  padding: 3.5rem 3rem;
  border-radius: 28px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  box-shadow: 0 20px 55px rgba(8, 10, 24, 0.1);
}

.contact-info-card h3 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.contact-info-card > p {
  color: var(--gray-600);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.4rem;
  background: var(--secondary);
  border-radius: 18px;
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-method:hover {
  transform: translateX(8px);
  box-shadow: 0 18px 45px rgba(8, 10, 24, 0.12);
}

.method-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--gray-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.method-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.method-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gray-500);
}

.method-value {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.contact-cta {
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 2.8rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: -0.2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--primary);
  color: var(--secondary);
  box-shadow: 0 16px 36px rgba(8, 10, 24, 0.2);
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 46px rgba(8, 10, 24, 0.24);
}

/* Footer ----------------------------------------------------------- */
.footer {
  background: var(--primary);
  color: var(--secondary);
  padding: 4rem 2rem 2.5rem;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-logo {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--gray-400);
  max-width: 360px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 2.5rem;
}

.footer-column h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 1rem;
}

.footer-column a {
  display: block;
  color: var(--gray-400);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.footer-column a:hover {
  color: var(--secondary);
}

.footer-bottom {
  text-align: center;
  margin-top: 2.5rem;
}

.footer-bottom p {
  color: var(--gray-500);
  font-size: 0.88rem;
}

.footer-tagline {
  color: var(--gray-600);
  font-size: 0.82rem;
}

.footer-logo img {
  filter: invert(1) brightness(1.8);
}

/* Responsive ------------------------------------------------------- */
@media (max-width: 1024px) {
  .about-hero-card {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    gap: 1.6rem;
  }
  .footer-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .hero {
    padding-top: 7rem;
  }
  .hero-card {
    flex-direction: column;
  }
  .hero-text-content {
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 1.5rem;
  }
  .nav-menu {
    display: none;
  }
  .hero {
    padding: 7rem 1.4rem 4rem;
  }
  .hero-card {
    padding: 2.2rem;
  }
  .hero-scroll-indicator {
    display: none;
  }
  .section {
    padding: 5.5rem 1.4rem;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card.featured {
    grid-column: span 1;
  }
  .contact-info-card {
    padding: 2.8rem 2.2rem;
  }
}

@media (max-width: 580px) {
  .hero-name {
    font-size: 2.4rem;
  }
  .hero-image {
    width: 200px;
    height: 200px;
  }
  .about-hero-card {
    padding: 2.2rem 1.8rem;
  }
  .exp-card {
    grid-template-columns: 1fr;
  }
  .project-content {
    padding: 1.8rem;
  }
  .project-links {
    flex-direction: column;
  }
  .contact-method {
    padding: 1.2rem;
  }
}

/* Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .chess-stage,
  .stage-backdrop,
  .stage-fog,
  .board-flare,
  .atmosphere-sparks {
    display: none !important;
  }
}

/* Hero reveal utility ---------------------------------------------- */
.hero-content {
  position: relative;
  z-index: 5;
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
}
.hero-content.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Intro overlay ---------------------------------------------------- */
.hero-intro {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  background: radial-gradient(circle at center, rgba(242, 246, 255, 0.95), rgba(226, 233, 255, 0.9));
  overflow: hidden;
}
.hero-intro.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.intro-board {
  position: relative;
  width: min(82vmin, 680px);
  height: min(82vmin, 680px);
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid rgba(180, 195, 255, 0.42);
  box-shadow:
    0 36px 100px rgba(160, 175, 255, 0.32),
    0 0 60px rgba(200, 210, 255, 0.45);
  background: rgba(251, 253, 255, 0.94);
}

.intro-board::before,
.intro-board::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  pointer-events: none;
  z-index: 5;                 /* sits above intro squares, below pieces */
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-repeat: no-repeat;
}

.intro-board::before {
  background-image:
    linear-gradient(to right, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to right, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to right, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to right, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to right, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to right, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to right, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38));
  background-size:
    1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%;
  background-position:
    calc(100% / 8)         0,
    calc(100% / 4)         0,
    calc(3 * 100% / 8)     0,
    calc(100% / 2)         0,
    calc(5 * 100% / 8)     0,
    calc(3 * 100% / 4)     0,
    calc(7 * 100% / 8)     0;
}

.intro-board::after {
  background-image:
    linear-gradient(to bottom, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to bottom, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to bottom, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to bottom, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to bottom, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to bottom, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38)),
    linear-gradient(to bottom, rgba(82, 102, 210, 0.38), rgba(82, 102, 210, 0.38));
  background-size:
    100% 1px, 100% 1px, 100% 1px, 100% 1px, 100% 1px, 100% 1px, 100% 1px;
  background-position:
     0 calc(100% / 8),
     0 calc(100% / 4),
     0 calc(3 * 100% / 8),
     0 calc(100% / 2),
     0 calc(5 * 100% / 8),
     0 calc(3 * 100% / 4),
     0 calc(7 * 100% / 8);
}

.intro-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(170, 180, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 180, 255, 0.22) 1px, transparent 1px);
  background-size: calc(100% / 8) calc(100% / 8);
  mix-blend-mode: screen;
  opacity: 0.45;
}
.intro-outline {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(175, 185, 255, 0.35);
  border-radius: 16px;
  mix-blend-mode: screen;
  opacity: 0;
}

.intro-piece {
  --file: 0;
  --rank: 0;
  --file-offset: 0;
  --rank-offset: 0;
  position: absolute;
  width: 14%;
  top:  calc((var(--rank) + 0.5 + var(--rank-offset)) * 12.5%);
  left: calc((var(--file) + 0.5 + var(--file-offset)) * 12.5%);
  transform: translate(-50%, -50%);
  opacity: 0;
  filter: drop-shadow(0 14px 28px rgba(130, 150, 210, 0.35));
}

.intro-piece--white {
  filter:
    drop-shadow(0 22px 34px rgba(150, 165, 255, 0.34))
    drop-shadow(0 10px 18px rgba(255, 255, 255, 0.28))
    brightness(1.08);
}

.intro-piece--black {
  filter:
    drop-shadow(0 22px 34px rgba(98, 115, 190, 0.35))
    drop-shadow(0 10px 18px rgba(140, 150, 205, 0.3))
    brightness(1.12);
}

.intro-flash {
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 140, 0.8), rgba(255, 170, 60, 0) 70%);
  opacity: 0;
  pointer-events: none;
}

.intro-highlight {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  border-radius: 10px;
  pointer-events: none;
}

.intro-fog {
  position: absolute;
  width: 120%;
  height: 120%;
  filter: blur(40px);
  background: radial-gradient(circle, rgba(190, 205, 255, 0.35) 0%, transparent 60%);
  opacity: 0.4;
  transform: scale(1.2);
}
.intro-fog.fog-left  { top: -20%; left: -30%; }
.intro-fog.fog-right { bottom: -20%; right: -30%; }