/* PORTFOLIO PAGE STYLES */

/* GLOBAL OVERFLOW PREVENTION */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

* {
  box-sizing: border-box;
}

/* COMPREHENSIVE MOBILE FIX */
.hero {
  max-width: 100%;
  overflow-x: hidden;
}

/* CONTAINER SAFETY */
.container {
  width: 100%;
  max-width: 100%;
}

/* IMAGE SAFETY */
img {
  max-width: 100%;
  height: auto;
}

/* HERO SECTION */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../assets/portfolio-hero.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  overflow: hidden;
  width: 100%;
}

.hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.hero-text {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero-text h1 {
  font-family: 'Butler Ultra Light', serif;
  font-size: 4rem;
  font-weight: 300;
  margin-bottom: 2rem;
  line-height: 1.2;
  color: white;
}

.hero-text p {
  font-size: 1.3rem;
  line-height: 1.6;
  color: white;
  margin-bottom: 0;
  font-weight: 300;
}

.scroll-arrow {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}

.scroll-arrow span {
  font-size: 2rem;
  color: white;
  opacity: 0.8;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .hero-text h1 {
    font-size: 3.5rem;
  }
  
  .hero-text p {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .hero {
    background-attachment: scroll;
    min-height: 100vh;
    padding: 0 20px;
  }
  
  .hero-text h1 {
    font-size: 2.8rem;
  }
  
  .hero-text p {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 100vh;
    padding: 0 15px;
  }
  
  .hero-text h1 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-text p {
    font-size: 1rem;
    line-height: 1.5;
  }
}

@media (max-width: 360px) {
  .hero-text h1 {
    font-size: 1.8rem;
  }
  
  .hero-text p {
    font-size: 0.95rem;
  }
}

/* LANDSCAPE ORIENTATION */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    background-attachment: scroll;
  }
  
  .hero-text h1 {
    font-size: 2.5rem;
  }
  
  .hero-text p {
    font-size: 1.1rem;
  }
}

/* ADDITIONAL MOBILE OPTIMIZATIONS */
@media (max-width: 320px) {
  /* Extra small screens optimization */
  .hero-text h1 {
    font-size: 1.6rem;
  }
  
  .hero-text p {
    font-size: 0.9rem;
  }
}

/* HIGH DPI / RETINA DISPLAY OPTIMIZATIONS */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* PORTFOLIO INTRODUCTION SECTION */
.portfolio-intro-section {
  padding: 100px 0 80px 0;
  background: white;
  text-align: center;
  margin-top: 50px;
}

.portfolio-intro-section .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px;
}

.portfolio-intro-section h2 {
  font-size: 3rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 40px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}


.portfolio-intro-section p {
  font-size: 1.3rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 25px;
  font-weight: 400;
}

.portfolio-intro-section p:last-child {
  margin-bottom: 0;
}

.portfolio-intro-section strong {
  font-weight: 700;
  color: #333;
}

.portfolio-intro-section em {
  font-style: italic;
  color: #666;
}

/* PORTFOLIO GRID SECTION */
.portfolio-grid-section {
  padding: 120px 0;
  background: white;
  width: 100%;
  overflow-x: hidden;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 1;
}

.portfolio-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.portfolio-item:hover img {
  transform: scale(1.05);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
  display: flex;
  align-items: flex-end;
  padding: 30px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-info h3 {
  font-family: 'Butler Ultra Light', serif;
  font-size: 1.5rem;
  font-weight: 300;
  color: white;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.portfolio-info p {
  color: #fff;
  opacity: 0.9;
}

/* CTA SECTION */
.cta-section {
  background: #000;
  padding: 100px 0;
  text-align: center;
  color: white;
}

.cta-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.cta-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  color: #fff;
}

.cta-subtitle {
  font-size: 1.4rem;
  margin-bottom: 3rem;
  opacity: 0.9;
  line-height: 1.6;
  font-weight: 300;
}

.cta-buttons {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid #fff;
  background-color: transparent;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.cta-btn:hover {
  background-color: #fff;
  color: #000;
}

/* CTA RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .cta-section {
    padding: 80px 0;
  }
  
  .cta-title {
    font-size: 2.8rem;
    margin-bottom: 1rem;
  }
  
  .cta-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .cta-btn {
    padding: 16px 35px;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .cta-section {
    padding: 60px 0;
  }
  
  .cta-title {
    font-size: 2.2rem;
  }
  
  .cta-subtitle {
    font-size: 1.1rem;
  }
  
  .cta-content {
    padding: 0 15px;
  }
}

/* PORTFOLIO GRID RESPONSIVE */
@media (max-width: 1024px) {
  .portfolio-intro-section {
    padding: 80px 0 60px 0;
  }
  
  .portfolio-intro-section .container {
    padding: 0 30px;
  }
  
  .portfolio-intro-section h2 {
    font-size: 2.5rem;
  }
  
  .portfolio-intro-section p {
    font-size: 1.2rem;
  }
  
  .portfolio-grid-section {
    padding: 100px 0;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 25px;
    padding: 0 30px;
    max-width: 700px;
  }
  
  .portfolio-overlay {
    padding: 25px;
  }
  
  .portfolio-info h3 {
    font-size: 1.3rem;
  }
}

@media (max-width: 768px) {
  .portfolio-intro-section {
    padding: 60px 0 40px 0;
  }
  
  .portfolio-intro-section .container {
    padding: 0 20px;
  }
  
  .portfolio-intro-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
  }
  
  .portfolio-intro-section p {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }
  
  .portfolio-grid-section {
    padding: 80px 0;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px;
    max-width: 600px;
  }
  
  .portfolio-overlay {
    padding: 20px;
  }
  
  .portfolio-info h3 {
    font-size: 1.2rem;
  }
  
  .portfolio-info p {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .portfolio-intro-section {
    padding: 50px 0 10px 0;
  }
  
  .portfolio-intro-section .container {
    padding: 0 15px;
  }
  
  .portfolio-intro-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
  }
  
  .portfolio-intro-section p {
    font-size: 1rem;
    margin-bottom: 18px;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(8, 1fr);
    gap: 20px;
    padding: 0 15px;
  }
  
  .portfolio-item {
    aspect-ratio: 4/3;
  }
  
  .portfolio-overlay {
    padding: 15px;
  }
  
  .portfolio-info h3 {
    font-size: 1.1rem;
  }
  
  .portfolio-info p {
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .portfolio-info h3 {
    font-size: 1rem;
  }
  
  .portfolio-info p {
    font-size: 0.75rem;
  }
}

/* PROJECT DETAIL SECTION */
.project-detail {
  padding: 0;
  background: #fff;
  min-height: 100vh;
}

.project-header {
  background: #000;
  color: white;
  padding: 3rem 0;
  position: relative;
}

.back-btn {
  background: transparent;
  border: 2px solid #fff;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 0 auto 2rem;
  display: block;
  font-family: inherit;
}

.back-btn:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
}

.project-title {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.project-title h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
}

.project-title p {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 300;
}

.project-content {
  padding: 0;
}

/* Project Overview Section */
.project-overview {
  padding: 4rem 2rem;
  border-bottom: 3px solid #000;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.overview-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #000;
  line-height: 1.2;
}

.project-meta {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f8f8;
  border-left: 4px solid #000;
}

.meta-item {
  font-size: 1rem;
  color: #333;
}

.before-after {
  display: grid;
  gap: 1.5rem;
}

.before-after-item {
  padding: 1.5rem;
  border: 2px solid #000;
  border-radius: 4px;
}

.before-after-item h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #000;
}

.before-after-item p {
  color: #444;
  line-height: 1.6;
  margin: 0;
}

.overview-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border: 3px solid #000;
  border-radius: 4px;
}

/* Strategy Section */
.strategy-section {
  padding: 4rem 2rem;
  border-bottom: 3px solid #000;
  background: #fafafa;
}

.strategy-section h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #000;
  text-align: center;
}

.strategy-section > p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #444;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.highlight-item {
  background: #fff;
  padding: 2rem;
  border: 2px solid #000;
  border-radius: 4px;
  text-align: center;
  transition: all 0.3s ease;
}

.highlight-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.highlight-item h4 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #000;
}

.highlight-item p {
  color: #555;
  line-height: 1.6;
  margin: 0;
}

/* Visual Gallery Section */
.visual-gallery {
  padding: 4rem 2rem;
  border-bottom: 3px solid #000;
}

.visual-gallery h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: #000;
  text-align: center;
}

.gallery-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-grid-small {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
}

.gallery-item-small {
  border: 2px solid #000;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 200px;
}

.gallery-item-small:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery-item-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery-large {
  display: flex;
  align-items: center;
}

.gallery-item-large {
  border: 2px solid #000;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.3s ease;
  width: 100%;
  height: 410px;
}

.gallery-item-large:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery-item-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Results Section */
.results-section {
  padding: 4rem 2rem;
  background: #000;
  color: #fff;
  text-align: center;
}

.results-section h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: #fff;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.result-card {
  background: #fff;
  color: #000;
  padding: 2.5rem 1.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(255, 255, 255, 0.1);
}

.result-stat {
  font-size: 3rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.result-desc {
  font-size: 1rem;
  color: #555;
  font-weight: 500;
  line-height: 1.4;
}

/* RESPONSIVE DESIGN FOR PROJECT DETAIL */
@media (max-width: 768px) {
  .project-header {
    padding: 2rem 0;
  }
  
  .project-title {
    padding: 0 1rem;
  }
  
  .project-title h1 {
    font-size: 2.5rem;
  }
  
  .project-overview {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1rem;
  }
  
  .overview-content h2 {
    font-size: 2rem;
  }
  
  .overview-image img {
    height: 300px;
  }
  
  .strategy-section,
  .visual-gallery,
  .results-section {
    padding: 2rem 1rem;
  }
  
  .highlights-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .gallery-grid-small {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  
  .gallery-item-small {
    height: 150px;
  }
  
  .gallery-item-large {
    height: 300px;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .result-stat {
    font-size: 2.5rem;
  }
}

/* SMOOTH TRANSITIONS */
.portfolio-grid-section,
.project-detail {
  transition: all 0.3s ease;
}

/* PORTFOLIO GRID ENHANCEMENT */
.portfolio-item {
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  border-color: #000;
}

.portfolio-item:active {
  transform: translateY(-2px);
}

.portfolio-overlay {
  background: rgba(0, 0, 0, 0.8);
}

.portfolio-info h3 {
  color: #fff;
  font-weight: 700;
}

.portfolio-info p {
  color: #fff;
  opacity: 0.9;
}
