/* ------------------
   Variables
------------------ */
:root {
  --black: #000;
  --white: #fff;
  --gray: #777;
}


/* ------------------
   Base
------------------ */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ------------------
   Layout
------------------ */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 2rem;
}

/* ------------------
   Header
------------------ */
.site-header {
  border-bottom: 1px solid #eee;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 600;
}

.nav a {
  margin-left: 2rem;
  font-size: 0.9rem;
}

/* ------------------
   Footer
------------------ */
.site-footer {
  border-top: 1px solid #eee;
  margin-top: 6rem;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--gray);
}

/* ==================
   Home Page
================== */
.home-hero {
  padding: 8rem 0 6rem;
}

.home-name {
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.home-title {
  margin-top: 1rem;
  font-size: 1.7rem;
  color: var(--gray);
  max-width: 600px;
}

/* =========================
   ABOUT PAGE – DESKTOP BASE
========================= */

.about {
  padding: 6rem 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: start;
}

/* Image column */
.about-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Intro block beside image */
.about-intro {
  margin-bottom: 2.5rem;
}

/* =========================
   ABOUT – TYPOGRAPHY (ALL SCREENS)
========================= */

/* Name */
.about-content h1 {
  font-size: 5.5rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

/* Subtitle (title under name) */
.about-subtitle {
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.5;
  color: #777;
  margin-top: 0.4rem;
  margin-bottom: 0; /* critical: prevents paragraph spacing */
}

/* Section titles */
.about-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 3rem 0 1rem;
}

/* Body text ONLY */
.about-body p {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.8;
  color: #444;
  margin-bottom: 1.25rem;
  max-width: 100%;
}



/* ==================
   Portfolio Grid
================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 4rem;
}

/* Portfolio Project Card */
.portfolio-grid .project-card {
  position: relative;
  height: 220px;
  overflow: hidden;
  display: block;
  text-decoration: none;
}

/* Portfolio Cover Image */
.portfolio-grid .project-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #eee;
  transition: opacity 0.4s ease;
}

/* Overlay */
.portfolio-grid .project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.726);
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Title + Subtitle (hidden by default) */
.portfolio-grid .project-card h2,
.portfolio-grid .project-card p {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  z-index: 2;
}

/* Title */
.portfolio-grid .project-card h2 {
  top: 40%;
  font-size: 1.4rem;
  font-weight: 600;
  color: #000000;
}

/* Hover Effects */
.portfolio-grid .project-card:hover .project-thumb {
  opacity: 0.35;
}

.portfolio-grid .project-card:hover::after {
  opacity: 1;
}

.portfolio-grid .project-card:hover h2,
.portfolio-grid .project-card:hover p {
  opacity: 1;
  transform: translateY(0);
}

/* ==================
   Project Page
================== */

.project {
  max-width: 1200px;
  margin: 0 auto;
}

.project-meta {
  color: var(--gray);
  margin-bottom: 3rem;
}

/* Project Images Container */
.project-images {
  max-width: 1200px;
  margin: 4rem auto;
}

/* Project Images (FULL WIDTH, NO CROPPING BUGS) */
.project-images img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 3rem;
}

/* Optional HERO image (first image only) */
.project-images img:first-child {
  height: 820px;
  object-fit: cover;
}

/* =========================
   PROJECT VIDEO – SAME WIDTH AS IMAGES
========================= */
.project-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin-bottom: 3rem; /* matches image spacing */
}

.project-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================
   LITE YOUTUBE EMBED – FIXED
========================= */

.lite-yt {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background-color: #000;
  cursor: pointer;
  overflow: hidden;
}

/* Thumbnail image (set via JS) */
.lite-yt .yt-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

/* Play button */
.lite-yt .yt-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 4rem;
  color: white;
  pointer-events: none;
}

/* Once activated, remove overlays */
.lite-yt.active {
  cursor: default;
}

.lite-yt.active .yt-thumb,
.lite-yt.active .yt-play {
  display: none;
}





/* =====================================================
   MOBILE & TABLET FIXES (≤ 1024px)
===================================================== */
@media (max-width: 1024px) {

  body {
    font-size: 15px;
  }

  .container {
    padding: 1.25rem;
  }

  /* ---------- Header ---------- */
  .site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    font-size: 1rem;
  }

  /* Hide desktop nav */
  .nav {
    display: none;
  }

  /* ---------- Hamburger Button ---------- */
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }

  .menu-toggle span {
    width: 26px;
    height: 2px;
    background: #000;
    display: block;
  }

  /* ---------- Home Hero ---------- */
  .home-hero {
    padding: 4rem 0 3rem;
  }

  .home-name {
    font-size: 2.4rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
  }

  .home-title {
    font-size: 1rem;
    max-width: 100%;
    margin-top: 1rem;
  }

  /* ---------- Fullscreen Mobile Menu ---------- */
  .mobile-menu {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
  }

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

/* Close (X) button – top left */
.menu-close {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}


  /* Menu links */
  .mobile-nav {
    display: flex;
    flex-direction: column;
    margin-top: 4rem;
  }

  .mobile-nav a {
    padding: 1.5rem 2rem;
    font-size: 1rem;
    border-top: 1px solid #eee;
  }
}

/* =====================================================
   DESKTOP SAFETY (≥ 1025px)
===================================================== */
@media (min-width: 1025px) {
  .menu-toggle,
  .mobile-menu {
    display: none;
  }
}

/* =====================================================
   ABOUT PAGE – MOBILE FIX (≤ 767px)
===================================================== */
@media (max-width: 767px) {

  .about {
    padding: 4rem 0;
  }

  /* Mobile grid: image + intro, then full-width body */
  .about-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
  }

  /* Image (bigger, left) */
  .about-image {
    max-width: 180px;
  }

  .about-image img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* CRITICAL FIX:
     Flatten content so children become grid items */
  .about-content {
    display: contents;
  }

  /* Name + title beside image */
  .about-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Body text goes FULL WIDTH below */
  .about-body {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
  }

  /* Paragraph spacing */
  .about-content p {
    margin-bottom: 1.25rem;
  }

  /* Slightly scale text for mobile */
  .about-content h1 {
    font-size: 1.3rem;
  }

  .about-subtitle {
    font-size: 0.55rem;
  }
}

/* =====================================================
   PORTFOLIO – MOBILE GRID (2 COLUMNS, CLEAN HOVER)
===================================================== */
@media (max-width: 767px) {

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-top: 2.5rem;
  }

  /* Natural card sizing */
  .portfolio-grid .project-card {
    height: auto;
  }

  /* Keep horizontal thumbnail ratio */
  .portfolio-grid .project-thumb {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
  }

  /* Overlay stays hidden by default */
  .portfolio-grid .project-card::after {
    opacity: 0;
  }

  /* Title — centered & smaller */
  .portfolio-grid .project-card h2 {
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;          /* FIXED size */
    font-weight: 600;
    padding: 0 0.75rem;
    line-height: 1.3;
    opacity: 0;
  }

  /* Hover / tap behavior */
  .portfolio-grid .project-card:hover::after,
  .portfolio-grid .project-card:hover h2 {
    opacity: 1;
    transform: translateY(-50%);
  }
}

/* =====================================================
   PROJECT PAGE – MOBILE FIXES
===================================================== */
@media (max-width: 767px) {

  /* Fix oversized project title */
  .project h1 {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  /* Fix oversized first image on mobile */
  .project-images img:first-child {
    height: auto;
    object-fit: contain;
  }
}



/* =========================
   GLOBAL HEADER CLICK FIX
========================= */

/* Header always above page content */
.site-header {
  position: relative;
  z-index: 100;
}

/* Explicitly lift the hamburger button */
.menu-toggle {
  position: relative;
  z-index: 200;
}

/* Push portfolio grid below header in stacking order */
.portfolio-grid {
  position: relative;
  z-index: 1;
}

/* Never allow overlays to catch taps */
.portfolio-grid .project-card::after {
  pointer-events: none;
}

/* =========================
   MOBILE MENU CLICK FIX (REAL FIX)
========================= */

/* When menu is hidden, it must NOT block clicks */
.mobile-menu {
  pointer-events: none;
}

/* When menu is open, allow interaction */
.mobile-menu.active {
  pointer-events: auto;
}






