/* STYLE DESIGN SYSTEM FOR M.A.H PORTFOLIO */

:root {
  --bg-home: #ffffff; /* White background */
  --bg-project-left: #4C1924; /* Burgundy code #4C1924 */
  --bg-project-right: #ffffff; /* White background */
  
  --color-green: #1f4017; /* m.a.h brand green */
  
  --font-heading: 'Archivo Black', sans-serif;
  --font-body: 'Archivo Black', sans-serif;

  --color-text-dark: #1a1a1a;
  --color-text-light: #ffffff;
  --color-text-translucent: rgba(26, 26, 26, 0.04); /* m.a.h home watermark */
  
  --transition-premium: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-medium: 0.6s;
  --duration-long: 1s;
}

/* Base resets & styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none !important; /* Hide scrollbars Firefox */
  -ms-overflow-style: none !important; /* Hide scrollbars IE/Edge */
}

::-webkit-scrollbar {
  display: none !important; /* Hide scrollbars Chrome/Safari */
}

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

body {
  background-color: var(--bg-home);
  font-family: var(--font-body);
  color: var(--color-text-dark);
  overflow: hidden; /* Hide vertical and horizontal browser scrollbars */
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar for the description */
.project-desc-scroll::-webkit-scrollbar {
  width: 6px;
}
.project-desc-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}
.project-desc-scroll::-webkit-scrollbar-thumb {
  background: rgba(76, 25, 36, 0.2);
  border-radius: 3px;
}
.project-desc-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--bg-project-left);
}

/* Page Layout View System */
.view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: none;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 20;
}

#landing-view.active {
  display: flex;
}

#projects-view.active {
  display: block;
}

#project-view.active {
  display: block;
}

#contact-view.active {
  display: block;
}

/* ==========================================================================
   VIEW 1: LANDING PAGE & PROJECTS PAGE (3D Canvas + Header Navigation)
   ========================================================================== */

.green-dot {
  display: inline-block;
  width: 0.15em;
  height: 0.15em;
  background-color: var(--color-green);
  border-radius: 50%;
  margin: 0 0.18em; /* perfectly symmetric margins for characters */
  vertical-align: baseline; /* sits perfectly flat on the bottom text baseline of letters */
}

/* Landing Page Styles */
#landing-view {
  background-color: var(--bg-home);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.landing-header {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}

.nav-contact-link-two-lines {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.05rem;
  text-transform: lowercase;
  color: var(--color-text-dark);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
  letter-spacing: -0.02em;
  text-align: center; /* centered contact link */
  line-height: 1.15;
}

.nav-contact-link-two-lines:hover {
  color: var(--color-green);
}

.landing-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.landing-logo {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(4rem, 16vw, 344.31px); /* exactly matches 344.31 pt size */
  line-height: 0.9;
  margin-bottom: 20px;
  color: var(--color-text-dark);
  text-transform: lowercase;
  letter-spacing: -0.04em;
  user-select: none;
  transition: transform 0.5s var(--transition-premium);
}

.landing-logo:hover {
  transform: scale(1.03);
}

.landing-hint {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(26, 26, 26, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.landing-logo-container:hover .landing-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Projects Page Styles */
#projects-view {
  background-color: var(--bg-home);
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.projects-header {
  position: absolute;
  top: 40px;
  left: 6%;
  right: 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 30;
}

.header-logo-btn {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--color-text-dark);
  text-decoration: none !important;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.header-logo-btn:hover {
  color: var(--color-green);
  transform: scale(1.05);
}

.projects-header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}

#projects-contact-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Interactive Content (View 2) */
.projects-interactive-container {
  position: absolute;
  top: 100px; /* starts below header */
  left: 0;
  width: 100%;
  height: calc(100vh - 140px);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
}

.projects-content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 1300px;
  height: 100%;
}

.projects-slot-reel {
  position: relative;
  width: 800px;
  height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  perspective: 1000px; /* enables 3D cylinder roll */
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 12; /* sits on top of images */
  flex-shrink: 0;
}

.slot-item {
  position: absolute;
  width: 100%; /* fills parent slot container */
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.1rem, 2.6vw, 37pt); /* Half size of 74pt */
  line-height: 1.05;
  text-align: center;
  user-select: none;
  pointer-events: none;
  letter-spacing: -0.04em;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              color 0.3s ease,
              font-family 0.3s ease,
              font-weight 0.3s ease;
  will-change: transform, opacity;
}

.projects-image-wrapper {
  position: relative;
  width: 320px; /* adjusted rectangular size matching mockup */
  aspect-ratio: 1996 / 2735; /* vertical rectangular aspect ratio as seen in mockup */
  border-radius: 0px; /* completely square corners! */
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 11;
  margin-left: -140px; /* overlaps the text slot reel slightly on the right */
  flex-shrink: 0;
}

.projects-project-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ensures the entire cover image is visible without cropping */
  transition: opacity 0.5s ease;
}

/* ==========================================================================
   VIEW 3: PROJECT DETAILS PAGE (Three Column Layout)
   ========================================================================== */

#project-view {
  background-color: var(--bg-home);
  overflow: hidden;
  height: 100vh;
}

.project-detail-header {
  position: absolute;
  top: 45px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  justify-content: center;
}

.detail-back-logo-btn {
  background: none;
  border: none;
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem); /* exact match with header logos! */
  color: var(--color-text-dark);
  cursor: pointer;
  text-decoration: none !important;
  text-transform: lowercase;
  outline: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, color 0.3s ease;
}

.detail-back-logo-btn:hover {
  color: var(--color-green);
  transform: scale(1.05);
}

.project-detail-container {
  width: 100%;
  height: 100vh;
  padding: 100px 6% 30px 6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden; /* no page scroll */
  background-color: var(--bg-home);
  box-sizing: border-box;
}

.project-detail-title-wrapper {
  width: 100%;
  max-width: 1500px;
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 15px;
}

.project-detail-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 72pt; /* Reduced from 94pt as requested for a slightly smaller look */
  line-height: 0.95;
  text-align: center;
  color: var(--color-text-dark);
  text-transform: lowercase;
  letter-spacing: -0.05em;
  margin: 0;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr; /* four equal columns */
  grid-template-rows: 1fr 1.3fr; /* top half for text, bottom half for plans image */
  gap: 30px;
  width: 100%;
  max-width: 1500px;
  height: calc(100vh - 250px); /* fits viewport perfectly */
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Dummy column styling */
.detail-col-full, .detail-col-split {
  font-family: 'Archivo', sans-serif;
  font-weight: 200; /* Archivo Extralight */
  font-size: clamp(0.75rem, 0.9vw, 0.92rem);
  line-height: 1.5;
  color: rgba(26, 26, 26, 0.45); /* light grey placeholder text */
  text-align: justify;
  overflow: hidden;
  height: 100%;
}

.detail-col-full p, .detail-col-split p {
  margin-bottom: 12px;
}

.detail-col-1 {
  grid-column: 1;
  grid-row: 1 / span 2; /* spans full height */
}

.detail-col-2 {
  grid-column: 2;
  grid-row: 1 / span 2; /* spans full height */
}

.detail-col-3 {
  grid-column: 3;
  grid-row: 1 / span 2; /* spans full height */
  display: flex;
  flex-direction: column;
}

.detail-col-4 {
  grid-column: 4;
  grid-row: 1 / span 2; /* spans full height */
}

/* Active project description */
.detail-desc-text {
  font-family: 'Archivo', sans-serif; /* clean body text font, NOT bold/black! */
  font-weight: 500; /* medium weight, very clear and readable */
  font-size: clamp(0.75rem, 0.9vw, 0.92rem); /* identical to placeholder columns */
  line-height: 1.5;
  color: var(--color-text-dark); /* standard solid black text */
  text-align: justify; /* justified layout matching placeholder columns */
  width: 100%;
}

.detail-desc-text p {
  margin-bottom: 12px;
}

/* Slideshow Container positioned absolutely on top of columns 2 & 3 at the bottom */
.detail-plans-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 760px;
  height: clamp(300px, 45vh, 410px); /* responsive height to make the image look larger on bigger screens */
  overflow: hidden;
}

.plans-slideshow-container {
  width: auto; /* width shrinks to match the image aspect ratio exactly, revealing background text on the sides */
  max-width: 100%;
  height: 100%; /* occupies full height of container */
  aspect-ratio: 8000 / 5581; /* exact matches new details images aspect ratio */
  border-radius: 0px; /* square corners! */
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  position: relative;
  background-color: rgba(0, 0, 0, 0.03);
}

.plans-nav-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--color-text-dark);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25; /* sits above slide track */
  transition: background 0.3s ease, color 0.3s ease;
  outline: none;
}

.plans-nav-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  color: var(--color-green);
}

.plans-nav-btn.prev-btn {
  left: 0;
}

.plans-nav-btn.next-btn {
  right: 0;
}

.plans-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.plans-carousel-item {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.plans-carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ensures technical plan drawings are fully visible and not cropped */
}

/* ==========================================================================
   PAGE LOADER / OVERLAY TRANSITIONS
   ========================================================================== */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-green);
  z-index: 100;
  transform: translateY(-100%);
  pointer-events: none;
}

.page-loader.active {
  animation: slideLoader 1.2s cubic-bezier(0.85, 0, 0.15, 1) forwards;
}

@keyframes slideLoader {
  0% {
    transform: translateY(-100%);
  }
  40%, 60% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100%);
  }
}


/* ==========================================================================
   RESPONSIVE DESIGN (Adaptive layout)
   ========================================================================== */

@media (max-width: 1024px) {
  .project-detail-title {
    font-size: 3.5rem;
  }
  
  .project-card {
    width: 260px;
  }
}

@media (max-width: 768px) {
  #project-view {
    flex-direction: column;
  }
  
  .panel-left {
    width: 100%;
    height: 50%;
    transform: translateY(-100%);
  }
  
  .panel-right {
    width: 100%;
    height: 50%;
    transform: translateY(100%);
    padding: 30px;
  }
  
  #project-view.active .panel-left,
  #project-view.active .panel-right {
    transform: translateY(0);
  }

  .vertical-logo-container {
    left: 20px;
    top: 20px;
    transform: none;
  }
  
  .vertical-logo-btn {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 1.6rem;
  }
  
  .vertical-logo-btn:hover {
    transform: scale(1.05);
  }
  
  .carousel-outer-wrapper {
    width: 80%;
    height: 70%;
  }

  .project-detail-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
  }

  .project-desc-scroll {
    max-height: 30vh;
  }
}

/* ==========================================================================
   VIEW 4: CONTACT PAGE
   ========================================================================== */

#contact-view {
  background-color: #ffffff;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.contact-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.contact-left {
  width: 45%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8%;
  background-color: #ffffff;
}

.contact-main-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 67px;
  line-height: 1.0;
  color: var(--color-green);
  text-transform: lowercase;
  text-align: right;
  letter-spacing: -0.04em;
}

.contact-right {
  width: 55%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 5%;
  background-color: #ffffff;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  max-width: 500px;
}

.contact-name {
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  line-height: 1.1;
  color: var(--color-text-dark);
  letter-spacing: -0.03em;
}

.contact-details-group {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.contact-label {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.1rem;
  color: var(--color-text-dark);
  letter-spacing: -0.01em;
}

.contact-value {
  font-family: 'Archivo', sans-serif;
  font-weight: 300; /* Archivo Light */
  font-size: 1.05rem;
  color: rgba(26, 26, 26, 0.7);
  text-decoration: none;
  transition: color 0.3s ease, padding-left 0.3s ease;
  display: inline-block;
  width: fit-content;
}

.contact-value:hover {
  color: var(--color-green);
  padding-left: 5px;
}

.contact-footer {
  position: absolute;
  bottom: 40px;
  left: 40px;
  z-index: 30;
}

.contact-back-btn {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  color: var(--color-text-dark);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.contact-back-btn:hover {
  color: var(--color-green);
  transform: translateX(-4px);
}


/* ==========================================================================
   CUSTOM CURSOR & CLICK RIPPLE
   ========================================================================== */

/* Custom Cursor Active State (triggered by JS mousemove) */
.custom-cursor-active, 
.custom-cursor-active a, 
.custom-cursor-active button, 
.custom-cursor-active .project-card, 
.custom-cursor-active .header-logo-btn, 
.custom-cursor-active .vertical-logo-btn {
  cursor: none !important;
}

.custom-cursor-active .custom-cursor {
  display: block;
}

.custom-cursor {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--color-green);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.2s cubic-bezier(0.25, 1, 0.5, 1),
              height 0.2s cubic-bezier(0.25, 1, 0.5, 1),
              background-color 0.2s ease,
              border 0.2s ease;
  will-change: transform;
}

.custom-cursor.hover {
  width: 24px;
  height: 24px;
  background-color: rgba(31, 64, 23, 0.05);
  border: 2px solid var(--color-green);
  border-radius: 50%;
}

.click-ripple {
  position: fixed;
  border: 2px solid var(--color-green);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  animation: ripple-out 0.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes ripple-out {
  0% {
    width: 0px;
    height: 0px;
    opacity: 1;
  }
  100% {
    width: 80px;
    height: 80px;
    opacity: 0;
  }
}


/* ==========================================================================
   ADDITIONAL MOBILE OPTIMIZATIONS (SIMULATOR COMPATIBLE)
   ========================================================================== */

@media (max-width: 768px) {
  /* Contact page mobile styles */
  .contact-container {
    flex-direction: column;
    padding: 80px 24px 60px 24px;
    overflow-y: auto;
    height: 100vh;
  }
  
  .contact-left {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    padding-right: 0;
    margin-bottom: 30px;
  }
  
  .contact-main-title {
    text-align: left;
    font-size: 3rem;
  }
  
  .contact-right {
    width: 100%;
    height: auto;
    padding-left: 0;
  }
  
  .contact-card {
    gap: 30px;
  }
  
  .contact-name {
    font-size: 2.2rem;
  }
  
  .contact-footer {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: 40px;
    padding-bottom: 20px;
  }
  
  /* Projects Page mobile styles */
  .projects-header {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  #projects-logo-btn {
    position: static;
    transform: none;
    font-size: 1.4rem; /* normal size on mobile, matching landing scale */
  }
  
  #projects-contact-btn {
    display: none !important; /* hidden in projects view on mobile */
  }
  
  /* Landing page mobile styles */
  .landing-header {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }
  
  .landing-logo {
    font-size: clamp(3.5rem, 18vw, 6.5rem);
  }
  
  .landing-hint {
    font-size: 0.8rem;
    opacity: 0.6; /* always display subtly on mobile */
    transform: none;
  }
  
  /* Projects Page mobile styles */
  .projects-interactive-container {
    top: 90px;
    height: calc(100vh - 130px);
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .projects-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    gap: 15px;
  }
  
  .projects-slot-reel {
    position: relative;
    width: 100%;
    height: 240px; /* shorter height on mobile */
    order: 1; /* slots on top */
  }
  
  .slot-item {
    font-size: clamp(0.95rem, 4.5vw, 1.45rem) !important; /* beautifully sized for mobile */
    max-width: 290px;
    line-height: 1.15;
  }
  
  .projects-image-wrapper {
    position: relative;
    right: auto;
    width: 140px;
    max-width: 140px;
    aspect-ratio: 1996 / 2735; /* vertical rectangular aspect ratio */
    margin: 0 auto !important; /* centers it perfectly on mobile */
    order: 2; /* image below */
  }
  
  /* Project Details Page mobile styles */
  .project-detail-header {
    top: 20px;
  }
  
  .project-detail-container {
    padding: 70px 24px 20px 24px;
    justify-content: flex-start;
    gap: 15px;
    overflow-y: auto; /* Allows the entire container to scroll naturally */
    height: 100vh;
  }
  
  .project-detail-title {
    font-size: 2.8rem; /* smaller title for mobile */
    margin-bottom: 5px;
  }
  
  .project-detail-grid {
    display: flex;
    flex-direction: column;
    height: auto; /* Allow grid to grow naturally with its contents */
    gap: 20px;
  }
  
  /* Hide filler columns on mobile */
  .detail-col-1, .detail-col-2, .detail-col-4 {
    display: none !important;
  }
  
  .detail-col-3 {
    display: block !important;
    width: 100%;
    overflow-y: visible; /* Let description text flow naturally */
  }
  
  .detail-desc-text {
    font-size: 0.76rem !important; /* smaller active description text on mobile */
    text-align: center; /* centered text on mobile detail */
  }
  
  .detail-plans-container {
    position: relative; /* flow naturally below description */
    left: auto;
    transform: none;
    bottom: auto;
    width: 100%;
    height: auto;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .plans-slideshow-container {
    max-width: 300px;
    aspect-ratio: 8000 / 5581;
    height: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }

  /* Disable Custom Cursor on Mobile */
  .custom-cursor {
    display: none !important;
  }
  
  .custom-cursor-active, 
  .custom-cursor-active a, 
  .custom-cursor-active button, 
  .custom-cursor-active .project-card, 
  .custom-cursor-active .header-logo-btn, 
  .custom-cursor-active .vertical-logo-btn {
    cursor: auto !important;
  }
}
