
body {
  background-image: url("images/Portfolio/Web background image.jpg");
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.5);
  background-blend-mode: overlay;
  color: black;
  transition: background-color 0.5s ease, color 0.5s ease;
  text-align: center;
  padding: 20px;
}

/* Dark Mode */
.dark-mode {
  background-image: url("images/Portfolio/Web background image.jpg"); 
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
}

#theme-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 50px; 
  height: 50px;
  background-color: #000000;
  color: white;
  border: none;
  border-radius: 50%; /* Circular shape */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#theme-toggle img {
  width: 30px; /* Adjust size */
  height: 30px;
  transition: transform 0.3s ease;
}

#theme-toggle:hover {
  background-color: #003e5f;
  transform: scale(1.1);
}

#theme-toggle:hover {
  background-color: #003e5f;
  transform: scale(1.1);
}

#theme-toggle i {
  transition: transform 0.3s ease;
}

h1 {
  font-family: 'Raleway', serif; 
  font-weight: 700; 
  font-size: 2.5rem;
}
p {
  font-family: 'Georgia', serif;
  font-size: 1rem;
  font-style: italic;
}
button {
  background-color:#008cba;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
}
button:hover {
  background-color: #005f5f;
  transform: scale(1.1);
}


.artwork-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 20px;
}

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

/* TABLET (iPad) */
@media (max-width: 1024px) {
  .artwork-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* MOBILE */
@media (max-width: 600px) {
  .artwork-container {
    grid-template-columns: 1fr;
  }
}

/* Image styling */
.artwork-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.video-container iframe,
.comic-container img {
  max-width: 100%;
  border-radius: 10px;
}

.artwork-container img:hover,
.comic-container img:hover {
  transform: scale(1.05);
  transition: 0.3s ease-in-out;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

footer {
  background-color: black; /* Dark background */
  color: white; /* White text */
  text-align: center;
  padding: 20px 0;
  font-family: 'Arial', sans-serif;
}

.footer-container {
  max-width: 800px;
  margin: auto;
}

.social-links {
  margin: 10px 0;
}

.social-links a {
  color: white;
  font-size: 24px; /* Icon size */
  margin: 0 15px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
  color: #0077b5; /* LinkedIn blue */
  transform: scale(1.2);
}

/* Instagram icon hover color */
.social-links a:nth-child(2):hover {
  color: #E4405F; /* Instagram color */
}

/* Email icon hover color */
.social-links a:nth-child(3):hover {
  color: #D44638; /* Gmail red */
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.project-card {
  padding: 20px;
  border: 1px solid #333;
  border-radius: 12px;
  text-decoration: none;
  color: white;
  transition: 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: #aaa;
}
/* ===== PORTFOLIO GRID ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

/* EACH ITEM */
.portfolio-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* BUTTON */
.portfolio-item button {
  padding: 10px;
  background: #333;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 6px;
}

/* CARD (same visual size as button width) */
.portfolio-card {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1; /* 🔥 THIS fixes your problem */
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #333;
}

/* IMAGE */
.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* subtle desaturation */
  filter: saturate(75%) brightness(90%);
  transition: 0.3s;
}

/* HOVER */
.portfolio-card:hover img {
  filter: saturate(100%) brightness(100%);
  transform: scale(1.05);
}
.portfolio-card {
  display: block;
}
@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.portfolio-card::after {
  position: absolute;
  bottom: 10px;
  left: 10px;
  color: white;
  font-weight: bold;
}
/* Add breathing room between sections */
section {
  margin-bottom: 80px;
}

/* Extra space before footer */
footer {
  margin-top: 80px;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  aspect-ratio: 16 / 9;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: none;
}
/* FADE-IN ANIMATION */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInMove 1s ease forwards;
}

/* KEYFRAMES */
@keyframes fadeInMove {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fadeInMove 1s ease forwards;
  animation-delay: 0.3s;
}
.video-container img {
  width: 100%;
  border-radius: 10px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.video-container:hover img {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.home-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.home-link:hover {
  opacity: 0.7;
  transform: scale(1.03);
}

/* GRID LAYOUT */
.reels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

/* CARD */
.reel-card img {
  width: 100%;
  border-radius: 10px;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

/* HOVER EFFECT */
.reel-card:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}
.reel-wrapper {
  position: relative;
}

.insta-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 20px;
}

/* GRID: 4 thumbnails per row */
.reels-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 per row */
  gap: 25px; /* space between items */
  padding: 20px 0;
}

/* THUMBNAIL CONTAINER (forces aspect ratio) */
.reel-card {
  width: 100%;
  aspect-ratio: 4 / 5; /* or 1:1 for square thumbnails */
  overflow: hidden;
  border-radius: 12px;
}

/* IMAGE INSIDE */
.reel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* crops nicely */
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* HOVER EFFECT */
.reel-card:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.reels-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

/* Tablet */
@media (max-width: 900px) {
  .reels-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Phone */
@media (max-width: 500px) {
  .reels-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== PROFILE WRAPPER ===== */
.profile-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 30px auto;
  perspective: 1000px;
  cursor: pointer;
}

/* ===== INNER (FLIP CONTAINER) ===== */
.profile-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
  transform-origin: center center; /* 🔥 FIXES OFF-CENTER FLIP */
}

/* FLIP TRIGGER */
.profile-wrapper.active .profile-inner {
  transform: rotateY(180deg);
}

/* ===== IMAGES ===== */
.profile-img {
  position: absolute;
  inset: 0; /* 🔥 ensures perfect centering */
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  backface-visibility: hidden;
}

/* BACK SIDE */
.profile-img.back {
  transform: rotateY(180deg);
}

/* ===== SPARKLES ===== */
.sparkle {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 22px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  z-index: 10; /* 🔥 ensures they are ABOVE image */
}

/* animation trigger */

.profile-wrapper.active .sparkle {

  animation: sparkle-burst 0.9s ease-out forwards;

}

@keyframes sparkle-burst {

  0% {

    opacity: 0;

    transform: translate(-50%, -50%) scale(0);

  }

  30% {

    opacity: 1;

  }

  100% {

    transform: translate(

      calc(-50% + var(--x)),

      calc(-50% + var(--y))

    ) scale(1.4)rotate(180deg);

    opacity: 0;
  }
}

/* ANIMATION */
@keyframes sparkle-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.4);
    opacity: 0;
  }
}

.profile-wrapper:hover {
  filter: drop-shadow(0 0 15px rgba(255,255,255,0.5));
}
/* CONTAINER */
.comics-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  padding: 20px 0;
}

/* EACH COMIC */
.comic-item {
  width: 70%;
}

/* IMAGE */
.comic-item img {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* HOVER */
.comics-container img:hover {
  transition: transform 0.3s ease;
  transform: scale(1.02);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .comic-item {
    width: 80%;
  }
}

@media (max-width: 500px) {
  .comic-item {
    width: 95%;
  }
}

/* ===== TYPOGRAPHY FIX ===== */

body {

  text-align: left; /* 🔥 stop centering everything */

  max-width: 1400px;

  margin: auto;

}

h1 {

  font-size: 3rem;

  letter-spacing: -1px;

}

h2 {

  font-size: 1.8rem;

  margin-bottom: 20px;

}

p {

  font-style: normal; /* 🔥 removes “blog feeling” */

  opacity: 0.8;

  max-width: 600px;

}

/* ===== HERO SPACING ===== */

header {

  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 40px;

  margin-bottom: 80px;

}

.hero-text {

  max-width: 500px;

}

.page-title {
  text-align: center;
  margin-bottom: 50px;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Pinterest-style masonry layout */
.commissions-container {
  column-count: 3;
  column-gap: 24px;
  max-width: 1400px;
  margin: 30px auto;
  padding: 0 24px;
}

.commissions-container img {
  width: 100%;
  display: block;
  margin-bottom: 24px;
  border-radius: 14px;
  break-inside: avoid;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.commissions-container img:hover {
  transform: scale(1.02);
  filter: brightness(1.08);
}

/* iPad */
@media (max-width: 900px) {
  .commissions-container {
    column-count: 2;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .commissions-container {
    column-count: 1;
  }
}

/* ===== SCROLL INTRO HERO ===== */

.landing-hero {
  position: relative;
  height: 180vh; /* gives room for scroll animation */
  overflow: clip;
}

.landing-bg {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1;
  overflow: hidden;
}

.landing-bg img,
.landing-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name-layer {
  position: sticky;
  top: 0;
  height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: none;
}

.english-name {
  z-index: 3;
  margin-top: -100vh;
  animation: englishSlide both linear;
  animation-timeline: scroll();
  animation-range: 0 80vh;
}

.chinese-name {
  z-index: 2;
  margin-top: -100vh;
  animation: chineseSlide both linear;
  animation-timeline: scroll();
  animation-range: 20vh 110vh;
}

.english-name h1 {
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.chinese-name h2 {
  font-size: clamp(4rem, 13vw, 11rem);
  font-weight: 700;
  opacity: 0.55;
}
.english-name {
  animation-range: 0 70vh;
}

.chinese-name {
  animation-range: 30vh 110vh;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  top: 65vh;
  transform: translateX(-50%);
  z-index: 4;

  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  animation: fadeOutHint both linear;
  animation-timeline: scroll();
  animation-range: 0 45vh;
}

@keyframes englishSlide {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(-120vh);
    opacity: 0;
  }
}

@keyframes chineseSlide {
  from {
    transform: translateY(0);
    opacity: 0.55;
  }

  to {
    transform: translateY(-120vh);
    opacity: 0;
  }
}

@keyframes fadeOutHint {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.name-layer img {
  max-width: 120vw;   /* responsive */
  width: 1200px;      /* desktop size */
  height: auto;
  display: block;
  pointer-events: none;
}
/* ===== FULL-WIDTH LANDING PAGE FIX ===== */

.landing-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.landing-bg {
  width: 100vw;
}

.landing-bg img,
.landing-bg video {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
}

/* ===== FORCE REELS TO STAY 4 PER ROW ===== */

.reels-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 25px !important;
  align-items: start !important;
}

.reel-card {
  width: 100% !important;
  aspect-ratio: auto !important;
  overflow: visible !important;
  border-radius: 0 !important;
}

.reel-card a {
  display: block !important;
  width: 100% !important;
  aspect-ratio: 4 / 5 !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

.reel-card img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.reel-info {
  margin-top: 10px;
}

.reel-info h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.reel-info p {
  font-size: 0.8rem;
  margin: 0;
  opacity: 0.75;
}

/* Tablet */
@media (max-width: 900px) {
  .reels-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile */
@media (max-width: 500px) {
  .reels-grid {
    grid-template-columns: 1fr !important;
  }
}
/* ===== SELECTED WORK HOVER TITLES ===== */

.portfolio-card {
  position: relative;
  overflow: hidden;
}

.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.overlay-text {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.45);
  opacity: 0;

  transition: opacity 0.4s ease;
  z-index: 2;
}

.overlay-text span {
  color: white;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
}

.portfolio-card:hover .overlay-text {
  opacity: 1;
}

.portfolio-card:hover img {
  transform: scale(1.05);
  filter: brightness(0.75);
}

@media (max-width: 900px) {
  .overlay-text {
    opacity: 1;
    background: rgba(0, 0, 0, 0.25);
  }
}
/* ===== MOBILE PROFILE IMAGE FIX ===== */

.profile-wrapper {
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

.profile-img {
  aspect-ratio: 1 / 1;
}

/* Phone layout */
@media (max-width: 700px) {
  header,
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-text {
    width: 100%;
  }

  .profile-wrapper {
    width: 180px;
    height: 180px;
    min-width: 180px;
    min-height: 180px;
    margin: 25px auto 0;
  }
}
