/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0a0a0a;
  color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: 100%;
  padding-left: 3vw;
  padding-right: 3vw;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(3vw, 24px, 6vw);
  z-index: 1000;
  position: fixed; /* 🔹 luôn cố định */
  top: 0;
  left: 0;
  right: 0;
}
.logo {
  width: clamp(
    80px,
    15vw,
    200px
  ); /* Scales from 80px to 200px based on viewport width */
  height: clamp(40px, 7vw, 100px); /* Adjust height proportionally */
  background-image: url("./assets/logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.contact-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #ffffff;
  color: #000;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.contact-button:hover {
  background-color: #ddd;
  transform: scale(1.05);
}

/* Hero */
.hero-wrapper {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 6vw;
  z-index: 1000;
  position: relative;
}

.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 10vw;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
  overflow: visible; /* ✅ allow image to overflow */
  z-index: 1;
}

/* ✅ Removed the pseudo-element to avoid duplication */
/* .hero::after { ... } — removed */

.hero.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-title {
  font-size: clamp(2rem, 6vw, 6rem);
  font-weight: 300;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2em;
  letter-spacing: -1px;
}

.hero-title .highlight {
  font-weight: 700;
  letter-spacing: 2px;
}

.hero-title .indent {
  margin-left: 5rem;
}

.hero-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-left: 30rem;
}

.header {
  position: absolute; /* Take it out of flow */
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 3vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none; /* Prevent accidental capture unless needed */
}

.header .logo,
.header .contact-button {
  pointer-events: all; /* Re-enable click for the button/logo */
}

/*  Decorative background image inside hero */
.hero-bg-img {
  position: absolute;
  right: -20vw; /* push outside the viewport */
  top: 50%; /* start from middle */
  transform: translateY(-50%); /* center it vertically */
  height: 100%;
  width: 70%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* View Project Button */
#viewProjectContainer {
  margin-top: 40px;
}
.project-description {
  margin-top: 10px;
  font-size: 1.2rem;
  color: #f4f1f1;
  line-height: 1.5;
}

.view-project {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  font-size: inherit;
  width: 14rem;
}

.view-project .circle {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: relative;
  display: block;
  width: 3rem;
  height: 3rem;
  background: #fff;
  border-radius: 40px;
  border: 2px solid black;
  padding: 5px;
}

.view-project .icon {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto;
}

.view-project .icon.arrow {
  left: 0.625rem;
  width: 1.125rem;
  height: 0.125rem;
  background: none;
}

.view-project .icon.arrow::before {
  content: "";
  position: absolute;
  top: -0.25rem;
  right: 0.0625rem;
  width: 0.625rem;
  height: 0.625rem;
  border-top: 2px solid #000;
  border-right: 2px solid #000;
  transform: rotate(45deg);
}

.view-project .button-text {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 0;
  margin-left: 1.85rem;
  color: #ffffff;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.6;
}

.view-project:hover .circle {
  width: 100%;
}

.view-project:hover .icon.arrow {
  background: #000;
  transform: translate(1rem, 0);
}

.view-project:hover .button-text {
  color: #000;
}
.hero-bubbles {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bubble {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #aaa;
  border-radius: 50%;
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  user-select: none;
  backdrop-filter: blur(4px);
  animation: floatUp 1.5s ease-in-out infinite alternate;
}

@keyframes floatUp {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-10px);
  }
}

.hero-bg-container {
  position: absolute;
  right: -10vw;
  top: 50%;
  transform: translateY(-50%);
  height: 100%;
  width: 70%;
  z-index: 0;
  pointer-events: auto; /* vẫn không cản trở tương tác */
}

.hero-bg-img {
  height: 100%;
  width: 100%;
  opacity: 0.15;
  object-fit: contain;
}

.hero-bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.hero-bubbles .bubble:nth-child(1) {
  animation-delay: 0s;
}

.hero-bubbles .bubble:nth-child(2) {
  animation-delay: 0.5s;
}

.hero-bubbles .bubble:nth-child(3) {
  animation-delay: 1s;
}

.bubble {
  /* remove this if using parallax: */
  /* animation: floatUp 1.5s ease-in-out infinite alternate; */
  transition: transform 120ms ease-out;
}
/* keep the overlay active; we control each bubble’s opacity instead */
.hero-bubbles {
  opacity: 1;
  pointer-events: none;
}

.bubble {
  opacity: 0; /* hidden by default */
  transition: opacity 0.18s ease, transform 120ms ease-out;
}

.hero-bubbles .bubble:nth-child(1) {
  top: 42%;
  left: 58%;
} /* Figma */
.hero-bubbles .bubble:nth-child(2) {
  top: 36%;
  left: 74%;
} /* JavaScript */
.hero-bubbles .bubble:nth-child(3) {
  top: 34%;
  left: 65%;
} /* Empathy */
/* overlays không chặn click */
.hero-bubbles {
  pointer-events: none;
  z-index: 1;
}
.cursor-glow {
  pointer-events: none;
  z-index: 9999;
}

/* nút và container của nút ở trên overlay */
.hero-nav,
.view-project {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

/* Generic Section Style */
section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 8vw;
  opacity: 0;
  transform: translateY(50px);
  transition: all 2s ease-out;
}

section.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.section-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  text-align: left;
}
/* About */
.about {
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: 0 3vw;
  box-sizing: border-box;
}

.about-inner {
  max-width: 1600px;
  margin: 0;
  padding: 0 8vw;

  gap: 2rem;
}

.about-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6vw;
}

.about-text {
  max-width: 600px;
  text-align: left;
}

.about-text h3 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.3;
}

.about-text p {
  font-size: clamp(1rem, 1.6vw, 1.6rem);
  color: #ccc;
  line-height: 1.8;
}

.about-text strong {
  color: #fff;
  font-weight: 700;
}

.profile-image {
  position: relative; /* Needed for ::after overlay */
  width: clamp(260px, 30vw, 420px);
  aspect-ratio: 1 / 1; /* Keep perfect square */
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  background-color: #ccc; /* Fallback background */
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Fill without stretching */
  border-radius: 14px;
  display: block;
}

.profile-image.is-muted img {
  filter: grayscale(100%) contrast(1.1) brightness(0.92);
}

.profile-image.is-muted::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0) 50%
    ),
    radial-gradient(
      60% 80% at 80% 20%,
      rgba(255, 235, 200, 0.06),
      transparent 60%
    );
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* base scroll-in already exists:
section { opacity:0; transform: translateY(50px); transition: all 0.8s ease-out; }
section.visible { opacity:1; transform: translateY(0); }
*/

/* extra flair for ABOUT’s children */
.about .section-title,
.about .about-text,
.about .profile-image {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* when section becomes visible, reveal in sequence */
.about.visible .section-title {
  opacity: 1;
  transform: none;
  transition-delay: 0.05s;
}

.about.visible .about-text {
  opacity: 1;
  transform: none;
  transition-delay: 0.18s;
}

.about.visible .profile-image {
  opacity: 1;
  transform: none;
  transition-delay: 0.32s;
}

/* optional: slide image from the right a bit */
.about .profile-image {
  transform: translate(20px, 20px);
}
.about.visible .profile-image {
  transform: translate(0, 0);
}

/* Skills */
/* Skills Section */
.skills {
  min-height: 100vh;
  padding: 6vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1600px;
  margin: 0 auto;
}

.skills-intro {
  font-size: clamp(1rem, 1.6vw, 1.6rem);
  color: #ccc;
  margin-bottom: 40px;
  text-align: left;
  max-width: 640px;
  padding-left: 0.2em;
  line-height: 1.6;
}

.skills-grid {
  display: flex;
  justify-content: flex-start;
  gap: clamp(40px, 6vw, 100px);
  flex-wrap: wrap;
  padding-left: 0.2em;
}

.skill-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 clamp(200px, 25%, 300px);
  min-width: 200px;
  margin-top: 10%;
}

.skill-icon {
  width: clamp(80px, 12vw, 150px);
  height: clamp(80px, 12vw, 150px);
  padding: clamp(6px, 1.5vw, 20px);
  margin-bottom: clamp(12px, 2vw, 20px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.design-icon::before {
  content: "🎨";
}
.code-icon::before {
  content: "💻";
}
.soft-icon::before {
  content: "🤝";
}

.skill-icon::before {
  font-size: clamp(30px, 4vw, 40px);
}

.skill-item h4 {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 600;
  margin-bottom: 16px;
}

.skill-item ul {
  list-style: none;
  padding: 0;
  text-align: center;
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.6rem);
}

.skill-item li {
  font-size: clamp(0.9rem, 1.6vw, 1rem);

  margin-bottom: 8px;
  font-size: clamp(1rem, 1.6vw, 1.6rem);
}

/* Workflow Section */
.workflow {
  min-height: 100vh;
  padding: 6vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1600px;
  margin: 0 auto;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 45vw), 1fr));
  grid-auto-rows: minmax(250px, auto);
  gap: clamp(24px, 5vw, 48px);
  width: 100%;
  margin-top: 2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.workflow-step {
  text-align: center;
}

.workflow-icon {
  width: clamp(100px, 15vw, 250px);
  height: auto;
  /*background-color: #333;*/
  margin: 0 auto 20px;
}

.workflow-step p {
  font-size: clamp(1rem, 1.6vw, 1.6rem);
  color: #ccc;
  font-weight: 500;
}

/* Contact Section */
.contact {
  min-height: 100vh;
  padding: 6vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1600px;
  margin: 0 auto;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
  width: 100%;
  max-width: 1200px;
}

.contact-text p {
  font-size: clamp(1rem, 1.6vw, 1.6rem);
  color: rgb(204, 204, 204);
  margin-bottom: 40px;
  text-align: left;
  line-height: 1.6;
}

.email {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(1rem, 1.6vw, 1.6rem);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.email:hover {
  border-color: #fff;
}

.contact-message {
  text-align: right;
}

.contact-message p {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: #fff;
  font-weight: 600;
  margin-bottom: 8px;
}

.contact-message small {
  font-size: clamp(1.5rem, 1.4vw, 1.3rem);
  color: #666;
}
/*
.social-dots {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 40px;
}

.dot {
  width: clamp(1.6rem, 3vw, 2.4rem);
  height: clamp(1.6rem, 3vw, 2.4rem);
  background-color: #333;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dot:hover {
  background-color: #555;
}
*/
/* Responsive */
@media (max-width: 1024px) {
  .container {
    padding: 30px 40px;
  }

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

  .workflow-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px 30px;
  }

  .hero-title {
    font-size: 42px;
  }

  .about-content {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .contact-content {
    flex-direction: column;
    text-align: center;
  }

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

@media (max-width: 480px) {
  .container {
    padding: 15px 20px;
  }

  .hero-title {
    font-size: 32px;
  }

  .section-title {
    font-size: 24px;
  }

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

@keyframes blink {
  0%,
  100% {
    background-color: #666;
  }
  50% {
    background-color: #fff;
  }
}

.cursor-glow {
  position: fixed;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(254, 250, 219, 0.593) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  z-index: 9999;
}

/* ===================== PROJECTS ===================== */
.projects {
  min-height: 100vh;
  padding: 6vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1600px;
  margin: 0 auto;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 45vw), 1fr));
  grid-auto-rows: minmax(250px, auto);
  gap: clamp(24px, 5vw, 48px);
  width: 100%;
  margin: 2rem auto 0;
  max-width: 1400px;
}

/* Card */
.project-card {
  position: relative;
  background: #111;
  border: 3px solid #525151;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
  min-height: clamp(320px, 35vw, 420px);
}
.project-card:hover {
  border-color: #d2d0d0;
  transform: translateY(-10px);
}
.project-card.large {
  grid-column: span 2;
}
.project-card.wide {
  grid-column: span 2;
}

/* Front / Back panes (slide) */
.card-front,
.card-back {
  position: absolute;
  inset: 0;
  padding: 20px;
  transition: transform 0.5s ease;
  backface-visibility: hidden;
}

/* FRONT */
.card-front {
  z-index: 2;
  background: #111;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-front h4 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 600;
}

/* KHUNG ẢNH VUÔNG, KHÔNG CROP */
.card-front .thumb {
  flex: 1 1 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #1a1a1a53;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 24px;
}
.card-front .thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* vừa khung, không bị cắt */
  display: block;
}

/* BACK */
.card-back {
  background: #222;
  color: #ccc;
  font-size: 1rem;
  line-height: 1.5;
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 80px; /* chừa chỗ cho nút */
  border: 2px solid #555;
  border-radius: 12px;
}

/* Active state: lật sang mặt sau */
.project-card.active .card-front {
  transform: translateX(-100%);
}
.project-card.active .card-back {
  transform: translateX(0);
}

/* View Live button */

.view-live-container {
  margin-top: 20px;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 40px;
  position: absolute;
  bottom: 20px;
  right: 20px;
}
.view-project {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  font-size: inherit;
  width: 14rem;
}
.view-project .circle {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: relative;
  display: block;
  width: 3rem;
  height: 3rem;
  background: #fff;
  border-radius: 40px;
  border: 2px solid #000;
  padding: 5px;
}
.view-project .icon {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto;
}
.view-project .icon.arrow {
  left: 0.625rem;
  width: 1.125rem;
  height: 0.125rem;
  background: none;
}
.view-project .icon.arrow::before {
  content: "";
  position: absolute;
  top: -0.25rem;
  right: 0.0625rem;
  width: 0.625rem;
  height: 0.625rem;
  border-top: 2px solid #000;
  border-right: 2px solid #000;
  transform: rotate(45deg);
}
.view-project .button-text {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: absolute;
  inset: 0;
  padding: 0.75rem 0;
  margin-left: 2.5rem;
  color: #fff;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.6;
}
.view-project:hover .circle {
  width: 100%;
}
.view-project:hover .icon.arrow {
  background: #000;
  transform: translate(1rem, 0);
}
.view-project:hover .button-text {
  color: #000;
}

/* Pagination dots */
.pagination-dots {
  position: absolute;

  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 20;
}
.pagination-dots .dot {
  width: 10px;
  height: 10px;
  background: #666;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.pagination-dots .dot.active {
  background: #fff;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card.large,
  .project-card.wide {
    grid-column: span 2;
  }
}
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card {
    min-height: 360px;
  }
}
@media (max-width: 480px) {
  .project-card {
    min-height: 340px;
  }
}
/* ===================== RESPONSIVE TỪNG PHẦN (ADD-ON) ===================== */

/* ---------- 1280px: desktop hẹp / laptop ---------- */
@media (max-width: 1280px) {
  /* Header */
  .header {
    padding: 16px 4vw;
  }
  .contact-button {
    padding: 8px 16px;
  }

  /* Hero */
  .hero {
    padding: 0 8vw;
  }
  .hero-title {
    gap: 0.15em;
  }

  /* About */
  .about {
    padding: 4vh 4vw;
  }
  .about-content {
    gap: 4vw;
  }

  /* Skills */
  .skills {
    padding: 5vh 6vw;
  }

  /* Projects */
  .projects {
    padding: 5vh 6vw;
  }
  .projects-grid {
    gap: clamp(20px, 4vw, 40px);
  }
}

/* ---------- 1024px: tablet ngang ---------- */
@media (max-width: 1024px) {
  /* Header */
  .header {
    padding: 16px 3vw;
  }
  .hero-nav {
    margin-left: 0;
    gap: 12px;
  }

  /* Hero */
  .hero-title {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
  }
  .hero {
    padding: 0 6vw;
  }

  /* About */
  .about-content {
    gap: 32px;
  }
  .profile-image {
    width: 420px;
    height: 420px;
  }

  /* Skills */
  .skills-grid {
    gap: clamp(24px, 4vw, 40px);
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card.large,
  .project-card.wide {
    grid-column: span 2;
  }
  .card-front .thumb {
    margin-bottom: 24px;
  }

  /* Workflow */
  .workflow-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Contact */
  .contact-content {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* ---------- 900px: tablet dọc lớn ---------- */
@media (max-width: 900px) {
  /* Hero: giảm khoảng trống dọc */
  .hero-wrapper {
    height: auto;
  }
  .hero {
    padding: 8vh 6vw;
  }

  /* About: chuyển layout cột */
  .about-content {
    flex-direction: column;
    text-align: center;
  }
  .about-text {
    max-width: 700px;
    margin: 0 auto;
  }
  .profile-image {
    width: 360px;
    height: 360px;
  }

  /* Skills: căn giữa */
  .skills {
    padding: 6vh 6vw;
  }
  .skills-grid {
    justify-content: center;
  }

  /* Projects: giãn dot với ảnh hơn */
  .projects-grid {
    gap: clamp(20px, 5vw, 36px);
  }
  .pagination-dots {
    bottom: 8px;
  }
}

/* ---------- 768px: mobile lớn / tablet nhỏ ---------- */
@media (max-width: 768px) {
  /* Container padding nhẹ hơn */
  .container {
    padding: 0 6vw;
  }

  /* Header: tránh đè hero */
  .header {
    position: relative;
  }

  /* Hero */
  .hero {
    padding: 10vh 6vw;
  }
  .hero-title {
    font-size: clamp(1.6rem, 6vw, 3rem);
  }
  .hero-bg-container,
  .hero-bg-img {
    display: none;
  } /* bớt rối trên mobile */

  /* About */
  .about {
    padding: 6vh 6vw;
  }
  .about-text p {
    font-size: clamp(1rem, 1.4vw, 1.1rem);
  }
  .profile-image {
    width: 300px;
    height: 300px;
  }

  /* Skills */
  .skill-item {
    margin-top: 6%;
    min-width: 180px;
  }
  .skill-icon::before {
    font-size: clamp(26px, 5vw, 34px);
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card {
    min-height: 360px;
  }
  .card-front {
    gap: 10px;
  }
  .card-front h4 {
    font-size: 1.1rem;
  }
  .card-front .thumb {
    aspect-ratio: 1/1;
    margin-bottom: 20px;
  }
  .pagination-dots {
    bottom: 6px;
  }

  /* Workflow */
  .workflow {
    padding: 6vh 6vw;
  }
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .workflow-step p {
    font-size: 1rem;
  }

  /* Contact */
  .contact-content {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .contact-message {
    text-align: center;
  }
  .contact-message p {
    font-size: clamp(1.4rem, 4.5vw, 2rem);
  }
}

/* ---------- 600px: mobile phổ biến ---------- */
@media (max-width: 600px) {
  /* Typography chung */
  .section-title {
    font-size: clamp(1.8rem, 7vw, 2.2rem);
  }

  /* Hero */
  .hero {
    padding: 8vh 5vw;
  }
  .hero-title {
    letter-spacing: -0.5px;
  }

  /* About */
  .about {
    padding: 5vh 5vw;
  }
  .profile-image {
    width: 260px;
    height: 260px;
  }

  /* Skills */
  .skills-intro {
    margin-bottom: 28px;
  }

  /* Projects */
  .project-card {
    min-height: 340px;
  }
  .view-live-container {
    right: 16px;
    bottom: 16px;
  }
  .view-project {
    width: 12rem;
  }
  .view-project .button-text {
    font-size: 0.9rem;
  }

  /* Workflow */
  .workflow-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

/* ---------- 480px: mobile nhỏ ---------- */
@media (max-width: 480px) {
  /* Header */
  .contact-button {
    padding: 8px 14px;
    font-size: 0.95rem;
  }

  /* Hero */
  .hero {
    padding: 7vh 5vw;
  }
  .hero-title {
    font-size: clamp(1.4rem, 7vw, 2rem);
  }

  /* About */
  .about {
    padding: 5vh 5vw;
  }
  .profile-image {
    width: 220px;
    height: 220px;
  }

  /* Skills */
  .skills {
    padding: 5vh 5vw;
  }
  .skill-item {
    min-width: 160px;
  }

  /* Projects */
  .projects {
    padding: 5vh 5vw;
  }
  .projects-grid {
    gap: 18px;
  }
  .card-front .thumb {
    margin-bottom: 16px;
  }
  .pagination-dots {
    bottom: 4px;
  }
  .view-project {
    width: 11rem;
  }
  .view-project .circle {
    width: 2.6rem;
    height: 2.6rem;
  }

  /* Workflow */
  .workflow-grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact {
    padding: 5vh 5vw;
  }
  .contact-text p {
    font-size: 1rem;
  }
}

/* ---------- Tối ưu trải nghiệm cảm ứng & giảm chuyển động ---------- */
@media (hover: none) {
  /* bỏ hover mạnh trên thiết bị cảm ứng */
  .project-card:hover {
    transform: none;
    border-color: #525151;
  }
  .view-project:hover .circle,
  .view-project:hover .icon.arrow,
  .view-project:hover .button-text {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .hero,
  section,
  .card-front,
  .card-back {
    transition: none !important;
  }
}
/* ================= HEADER – RESPONSIVE ONLY (NO DESKTOP CHANGE) ================ */

/* Tablet ngang ≤1024px */
@media (max-width: 1024px) {
  /* header luôn cố định, sát mép trên */
  .header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: 72px; /* cao gọn cho tablet */
    padding: 0 4vw !important; /* chỉ padding ngang */
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10000;

    pointer-events: auto; /* vô hiệu rule cũ pointer-events:none */
    width: 100%;
  }

  /* bù khoảng cho nội dung, tránh bị che bởi header */
  body {
    padding-top: 72px;
  }

  /* logo/nút gọn lại một chút */
  .logo {
    width: 140px;
    height: 56px;
    background-position: left center;
  }
  .contact-button {
    padding: 8px 16px;
    font-size: 0.95rem;
  }
}

/* Mobile lớn/nhỏ ≤768px & ≤480px */
@media (max-width: 768px) {
  .header {
    height: 60px;
    padding: 0 5vw !important;
    background: rgba(10, 10, 10, 0.8);
  }
  body {
    padding-top: 60px;
  }

  .logo {
    width: 120px; /* co tiếp trên mobile */
    height: 48px;
  }
  .contact-button {
    padding: 8px 14px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .header {
    height: 56px;
    padding: 0 5vw !important;
  }
  body {
    padding-top: 56px;
  }

  .logo {
    width: 104px;
    height: 44px;
  }
  .contact-button {
    padding: 7px 12px;
    font-size: 0.88rem;
  }
}

/* Chốt hạ: nếu có rule cũ set .header { position: relative/absolute } ở media cũ,
   khối dưới đảm bảo “fixed” thắng ở mọi breakpoint nhỏ */
@media (max-width: 1024px) {
  .header {
    position: fixed !important;
  }
}
@media (max-width: 768px) {
  .header {
    position: fixed !important;
  }
}

/* 1) Only the hero is full-height */
.hero-wrapper,
.hero {
  min-height: 100vh;
}

section {
  min-height: auto;
} /* reset the global rule */
.about,
.skills,
.workflow,
.projects,
.contact {
  min-height: auto;
}

/* 2) Unify vertical spacing with a variable */
:root {
  --section-y: clamp(64px, 10vh, 120px);
}

/* Base padding for all sections */
section {
  padding: var(--section-y) 8vw;
}

/* If you want About to use narrower left/right padding, keep it but add top/bottom */
.about {
  padding: var(--section-y) 3vw;
}

/* Make Skills match the base exactly (or keep as-is if you prefer) */
.skills {
  padding: var(--section-y) 8vw;
}

/* Optional: keep all section max widths consistent */
.about-inner,
.skills,
.workflow,
.projects,
.contact {
  max-width: 1600px;
  margin: 0 auto;
}
/* 1) Only the hero is full-height */
.hero-wrapper,
.hero {
  min-height: 100vh;
}

section {
  min-height: auto;
} /* reset the global rule */
.about,
.skills,
.workflow,
.projects,
.contact {
  min-height: auto;
}

/* 2) Unify vertical spacing with a variable */
:root {
  --section-y: clamp(64px, 10vh, 120px);
}

/* Base padding for all sections */
section {
  padding: var(--section-y) 8vw;
}

/* If you want About to use narrower left/right padding, keep it but add top/bottom */
.about {
  padding: var(--section-y) 3vw;
}

/* Make Skills match the base exactly (or keep as-is if you prefer) */
.skills {
  padding: var(--section-y) 8vw;
}

/* Optional: keep all section max widths consistent */
.about-inner,
.skills,
.workflow,
.projects,
.contact {
  max-width: 1600px;
  margin: 0 auto;
}
/* About */
.about {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 8vw; /* ← match other sections */
  box-sizing: border-box;
}

.about-inner {
  max-width: 1600px; /* ← centered, consistent width cap */
  margin: 0 auto;
  padding: 0; /* ← remove inner padding to avoid double-indentation */
}

.about-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6vw;
}

.about-text {
  max-width: 600px;
  text-align: left;
}

.about-text h3 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.3;
}

.about-text p {
  font-size: clamp(1rem, 1.6vw, 1.6rem);
  color: #ccc;
  line-height: 1.8;
}

.about-text strong {
  color: #fff;
  font-weight: 700;
}

.profile-image {
  position: relative;
  width: clamp(260px, 30vw, 420px);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  background-color: #ccc;
}
.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

/* reveal animation stays the same */
.about .section-title,
.about .about-text,
.about .profile-image {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Ensure every card is a single-column item on small screens */
@media (max-width: 1024px) {
  .project-card.large,
  .project-card.wide {
    grid-column: auto !important;
  }
}
@media (max-width: 768px) {
  .project-card.large,
  .project-card.wide {
    grid-column: auto !important;
  }
}

/* --- MOBILE CARD FIX: no absolute panes, no clipping --- */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    overflow: visible; /* avoid clipping */
    min-height: auto; /* grow with content */
  }

  /* put both faces in normal flow; show only one at a time */
  .card-front,
  .card-back {
    position: relative;
    inset: auto;
    transform: none !important;
    padding: 16px;
    backface-visibility: visible;
  }

  /* when card is active, hide the front and show the back */
  .project-card:not(.active) .card-back {
    display: none;
  }
  .project-card.active .card-front {
    display: none;
  }
  .project-card.active .card-back {
    display: flex;
    flex-direction: column;
  }

  /* button sits after the text */
  .view-live-container {
    position: static !important;
    justify-content: flex-start;
    margin-top: 12px;
  }

  /* dots not needed on mobile */
  .pagination-dots {
    display: none;
  }
}
/* Hide arrow button on mobile */
@media (max-width: 768px) {
  .view-project .circle {
    display: none !important;
  }
  /* Optional: adjust text to be centered or full width */
  .view-project .button-text {
    margin-left: 0;
    text-align: right; /* hoặc center nếu bạn muốn */
  }
}
@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(2.4rem, 10vw, 4rem); /* tăng min lên 2rem và vw cao hơn */
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(2rem, 10vw, 3.5rem); /* tăng min lên 1.8rem */
  }
}

@media (max-width: 768px) {
  /* Ẩn icon tròn */
  .view-project .circle {
    display: none !important;
  }

  /* Nút dạng border chỉ bao chữ */
  .view-project {
    display: inline-block;
    border: 2px solid #fff;
    border-radius: 25px;
    padding: 6px 16px;
    background: transparent;
    width: auto; /* để co theo chữ */
    text-align: center;
  }

  /* Căn lại chữ */
  .view-project .button-text {
    margin-left: 0;
    position: static;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
  }
}
/* --- MOBILE (<=900px): nút nằm sau text, canh phải, không overlay --- */
@media (max-width: 900px) {
  .project-card {
    overflow: visible;
    min-height: auto;
  }

  .card-back {
    position: relative;
    inset: auto;
    transform: none !important;
    overflow: visible;
    padding: 16px;
  }
  .card-back p {
    margin-bottom: 12px;
  } /* chừa khoảng dưới cho nút */

  .view-live-container {
    position: static !important; /* không absolute nữa */
    display: flex;
    justify-content: flex-end; /* đẩy nút sang phải */
    margin-top: 12px;
  }

  /* Nút có border, bỏ circle trên mobile */
  .view-project {
    border: 2px solid #fff;
    border-radius: 24px;
    padding: 6px 14px;
    background: transparent;
    width: auto;
  }
  .view-project .circle {
    display: none !important;
  }
  .view-project .button-text {
    position: static;
    margin: 0;
    line-height: 1.2;
    text-align: center;
  }

  /* Không cần dots trên mobile */
  .pagination-dots {
    display: none;
  }
}
