/* ============================================
   GLOBAL STYLES & RESETS
   ============================================ */

/* Remove default browser padding/margin */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Bubble sans", sans-serif;
}

html,
body {
  width: 100%;
  /* overflow-x: hidden; Prevents unwanted horizontal scrolling */
}

html {
  scroll-behavior: smooth;
}

hr {
  border: 2px solid black;
}

/* ============================================
   LINK STYLING
   ============================================ */

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================
   SECTION & CONTAINER LAYOUT
   ============================================ */

section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */

.site-nav {
  position: sticky; /* Support for Safari */
  top: 0;
  z-index: 1000; /* Ensures the nav stays on top of all other elements */
  overflow: hidden;
  padding: 1rem;

  /* Glassmorphism effect */
  background: rgba(202, 202, 202, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(128, 128, 128, 0);

  width: 100%;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  color: #111;
  text-decoration: none;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #2563eb;
  transition: width 0.2s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.resume-link {
  padding: 0.4rem 0.8rem;
  border: 1px solid #2563eb;
  border-radius: 6px;
  color: #2563eb;
}

.resume-link:hover {
  background: #2563eb;
  color: white;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
  background-image: url(../media/heroBkg.png);
  background-size: cover;
  background-position: center center;
}

.hero-content {
  text-align: center;
  margin-top: auto;
  margin-bottom: auto;
  width: 500px;
  align-self: center;

  background-color: #f8fafc;
  opacity: 75%;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.hero-tagline {
  font-size: 1.25rem;
  color: #555;
}

/* ============================================
   REUSABLE PANELS
   ============================================ */

.panels {
  width: 100% !important;
  height: 400px;
  border: 4px solid black;
  margin-bottom: 5%;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  background-color: #1e1e1e;
  background-repeat: no-repeat;
}

.panels img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-top: 4px solid black;
  flex-grow: 1;
}

.panels p {
  padding: 15px;
  flex-shrink: 0;
  background-color: white;

  background-image: radial-gradient(#000 10%, transparent 11%);
  background-size: 10px 10px;
  background-position:
    0 0,
    5px 5px;
  background-attachment: local;

  background-color: rgba(255, 255, 255, 0.9);
  background-blend-mode: lighten;

  font-weight: 800;
  text-transform: uppercase;
}

.card-visual {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.5s ease;
}

.image-wrapper {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.5s ease;
}

.image-wrapper:hover img,
.image-wrapper:hover {
  transform: scale(1.05);
  transition: transform 0.5s ease;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease; /* Smooths the zoom */
}

/* ============================================
   ABOUT ME SECTION
   ============================================ */

.aboutMe-title {
  width: 30%;
  height: auto;
  border: 4px solid black;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;

  margin: auto;
  padding: 5%;
}

.aboutMe-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  grid-auto-rows: 400px;
  gap: 15px;
  width: 100%;
  margin: 2rem 0;

  background-color: #f0f0f0;
  padding: 10px;
  border: 4px solid black;
}

.aboutMe-cs {
  grid-column: 1;
  grid-row: 1;
}

.aboutMe-music {
  grid-column: 1;
  grid-row: 2;
}

.aboutMe-future {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* grid item layout + images */
.aboutMe-cs,
.aboutMe-music,
.aboutMe-future {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.aboutMe-cs,
.aboutMe-music,
.aboutMe-future img {
  height: 100%;
  margin: auto;
}

/* ============================================
   HOBBIES SECTION
   ============================================ */

.hobbies-title {
  width: 30%;
  height: auto;
  border: 4px solid black;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;

  margin: auto;
  margin-bottom: 5%;
  padding: 5%;
}

.hobbies-panel {
  display: grid;
  background-color: #f0f0f0;
  padding: 10px;
  border: 4px solid black;
}

/* grid layout */
.hobbies-grid {
  display: flex;
  height: 500px;
  border: 4px solid black;
  margin-bottom: 20px;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  background-color: black;
  gap: 2px;
}

.hobby-card {
  position: relative;
  height: 100%;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.panels,
.hobby-card {
  display: flex;
  flex-direction: column;
}

#hackCS-img {
  background-image: url(../media/hackCS.png);
  background-size: cover;
  background-position: 70%;
 
}

#music-img {
  background-image: url(../media/bass.png);
  background-size: cover;
  background-position: 85%;
 
}

#anime-img {
  background-image: url(../media/anime.png);
  background-size: cover;
  background-position: 50%;
}

#tntt-img {
  background-image: url(../media/tntt2.png);
  background-size: cover;
  background-position: left;
}

#muaLan-img {
  background-image: url(../media/muaLan2.png);
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}

.hobby-text {
  position: absolute;
  background: white;
  border: 3px solid black;
  padding: 10px 15px;
  font-weight: 800;
  text-transform: uppercase;
  z-index: 10;
  max-width: 250px;
  font-size: 0.9rem;
}

/* diagonal split variants */
.split-diagonal .coding {
  clip-path: polygon(0 0, 90% 0, 66% 100%, 0% 100%);
  z-index: 2;
  margin-right: -10%;
}

.split-diagonal .music {
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0% 100%);
  margin-left: -1px;
}

.coding .hobby-text {
  top: 20px;
  left: 20px;
}

.music .hobby-text {
  bottom: 20px;
  right: 20px;
}

.full-width .hobby-text {
  top: 20px;
  right: 40px;
  width: 100%;
  text-align: center;
}

.split-vertical .tntt {
  flex: 2;
}

.split-vertical .mua-lan {
 flex: 1;
}

.split-diagonal .coding {
  margin-right: -20%;
  z-index: 1;
}

.tntt .hobby-text {
  bottom: 20px;
  left: 20px;
}

.mua-lan .hobby-text {
  top: 10px;
  right: 5px;
}

/* halftone overlay */
.image-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.2) 1px,
    transparent 1px
  );
  background-size: 4px 4px;
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.image-wrapper:hover::after {
  opacity: 0.3;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================
   FOOTER SECTION
   ============================================ */

.site-footer {
  background: radial-gradient(circle at top right, #1e293b, #0f172a);
  color: #f8fafc;
  padding: 5rem 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeUp 0.6s ease-in;
}

.site-footer a {
  color: #e5e7eb;
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.site-footer a:hover {
  color: #38bdf8;
}

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

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* CTA Heading & Content */
.footer-cta h2 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.footer-sub {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 2rem;
  max-width: 500px;
}

/* CTA Button */
.cta-button {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: #2563eb;
  color: white !important; /* Override footer link color */
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.cta-button:hover {
  background: transparent;
  border-color: #2563eb;
  color: #2563eb !important;
  transform: translateY(-2px);
}

/* Footer Links Section */
.link-header {
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 1rem;
}

.footer-links a {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.2rem;
  transition: color 0.2s ease;
}

.footer-links i {
  width: 20px; /* Aligns icons vertically */
  font-size: 1.2rem;
}

.footer-about,
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a:first-child {
  font-weight: 500;
}

.footer-links a::before {
  content: "→ ";
  opacity: 0;
  transition: opacity 0.2s ease;
}

.footer-links a:hover::before {
  opacity: 1;
}

.footer-about h2 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

/* Footer Contact Info */
.footer-lead {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.footer-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.footer-role {
  font-size: 0.9rem;
  color: #94a3b8;
}

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

/* Footer Bottom */
.footer-bottom {
  max-width: 1000px;
  margin: 5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;

  font-size: 0.9rem;
  color: #64748b;
  width: 100%;
}

.footer-bottom a {
  display: block;
  margin-bottom: 0.5rem;
}

.footer-bottom a,
.footer-bottom p {
  display: inline-block;
  margin: 0;
  padding: 0;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom p,
.footer-bottom .backToTop {
  display: inline-flex;
  margin: 0;
  color: #64748b;
  white-space: rowrap;
}

.footer-bottom .backToTop:hover {
  color: #38bdf8;
}

.footer-bottom a:hover {
  color: #38bdf8;
}

.backToTop:hover {
  color: #38bdf8;
  text-decoration: none;
}

/* ============================================
   ANIMATIONS & EFFECTS
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   MOBILE RESPONSIVE (CONSOLIDATED)
   ============================================ */
@media (max-width: 768px) {
  /* Navigation */
  .site-nav {
    padding: 0.5rem;
  }
  .nav-links {
    gap: 1rem;
    font-size: 0.8rem;
    justify-content: center;
  }

  /* About Me Section */
  .aboutMe-panel {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .aboutMe-cs,
  .aboutMe-music,
  .aboutMe-future {
    grid-column: 1;
    grid-row: auto;
    height: 300px;
  }

  /* Hobbies Section */
  .hobbies-grid {
    flex-direction: column;
    height: auto;
  }
  .hobby-card {
    height: 300px;
    clip-path: none !important;
    margin-right: 0 !important;
  }

  .hobby-text {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 3px solid black;
    margin-top: 0;
    max-width: 80%;
    width: auto;
  }

  /* Disable hover zoom on touch */
  .image-wrapper:hover img {
    transform: none;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .footer-sub {
    margin: 0 auto 2rem;
  }
  .footer-links a {
    justify-content: center;
  }
}
