@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500;600&display=swap');

/* --- DESIGN TOKENS --- */
:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --bg-base: #f3f4f6;       /* Warm light gray */
  --bg-card: #ffffff;       /* Pure white */
  --bg-modal: #ffffff;
  
  --text-primary: #111827;   /* Charcoal black */
  --text-secondary: #4b5563; /* Medium gray */
  --text-muted: #9ca3af;     /* Light gray */
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);
  
  --color-accent: #10b981;  /* Emerald Green */
  --color-primary: #111827;
  
  --shadow-card: 0 10px 40px -10px rgba(0, 0, 0, 0.08), 
                  0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-active: 0 30px 80px -20px rgba(0, 0, 0, 0.18), 
                    0 2px 6px rgba(0, 0, 0, 0.03);
  --shadow-modal: 0 40px 100px -20px rgba(0, 0, 0, 0.25);
  
  --transition-smooth: 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  --hover-delta: 0;
}

/* --- RESET & GLOBAL STYLE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  overflow: hidden; /* Prevent page scrolls, internal scrolling only */
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- HEADER NAVBAR --- */
.navbar {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  z-index: 10;
}

.nav-container {
  width: 100%;
  padding: 0 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-dots {
  display: flex;
  gap: 16px;
}

.nav-dot {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  padding: 4px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-dot:hover, .nav-dot.active {
  color: var(--text-primary);
  font-weight: 700;
}

.nav-dot.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 4px;
  height: 4px;
  background-color: var(--text-primary);
  border-radius: 50%;
  transform: translateX(-50%);
}

/* --- STACK LAYOUT VIEWPORT --- */
.stack-container-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  position: relative;
  z-index: 5;
  min-height: 0;
}

.stack-container {
  position: relative;
  width: 100%;
  max-width: 780px;
  height: 580px;
  perspective: 1000px;
}

/* --- THE STACK CARDS --- */
.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
  pointer-events: none; /* Only active card should accept clicks */
  opacity: 0;
  transform: translate3d(0, 0, -100px) scale(0.8) rotate(0deg);
  transition: transform var(--transition-smooth), 
              opacity var(--transition-smooth), 
              box-shadow var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-active);
}

/* 3D Stacking Classes - Stacking cards leftward offset */
.card.active {
  z-index: 10;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1) rotate(calc(var(--hover-delta) * 0.8deg));
  box-shadow: var(--shadow-active);
}

.card.stacked-1 {
  z-index: 9;
  opacity: 0.98;
  pointer-events: auto; /* let user click background cards to swap them */
  transform: translate3d(calc(-35px - var(--hover-delta) * 85px), 0, -10px) scale(0.97) rotate(calc(-1.5deg + var(--hover-delta) * 2deg));
}

.card.stacked-2 {
  z-index: 8;
  opacity: 0.94;
  pointer-events: auto;
  transform: translate3d(calc(-70px - var(--hover-delta) * 170px), 0, -20px) scale(0.94) rotate(calc(-3deg + var(--hover-delta) * 4deg));
}

.card.stacked-3 {
  z-index: 7;
  opacity: 0.88;
  pointer-events: auto;
  transform: translate3d(calc(-105px - var(--hover-delta) * 255px), 0, -30px) scale(0.91) rotate(calc(-4.5deg + var(--hover-delta) * 6deg));
}

.card.stacked-back {
  z-index: 1;
  opacity: 0;
  transform: translate3d(calc(-140px - var(--hover-delta) * 340px), 0, -40px) scale(0.88) rotate(calc(-6deg + var(--hover-delta) * 8deg));
}

/* Card exit animation (slide out to bottom-right and fade) */
.card.slide-out {
  transform: translate3d(150px, 80px, 0) scale(0.9) rotate(8deg);
  opacity: 0;
  pointer-events: none;
  z-index: 11;
}

/* --- CARD INTERNALS --- */
.card-body {
  padding: 48px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* --- CARD 1: INTRO DETAILS --- */
.intro-card-body {
  justify-content: center;
  gap: 80px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--color-accent);
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-accent);
  border-radius: 50%;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.5); opacity: 0; }
}

.intro-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
}

.card-description {
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 400;
  max-width: 580px;
}

.card-action-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* --- BANNER IMAGES ON CARDS --- */
.card-banner {
  width: 100%;
  height: 220px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* Card 1 – Courtyard tree: pull slightly upward to show full canopy & pool */
#card-intro .card-banner img {
  object-position: center 35%;
}

/* Card 4 – Alpine lake: keep twilight horizon & villa reflection in frame */
#card-projects .card-banner img {
  object-position: center 30%;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px 48px;
  color: white;
}

.banner-overlay h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.banner-overlay p {
  font-size: 0.95rem;
  opacity: 0.85;
}

/* --- CARD 2 & 3 BODY --- */
.card-text-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.card-paragraph {
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.55;
}

.card-footer-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-detail {
  background-color: var(--text-primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15);
}

.btn-detail:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.25);
  background-color: #000000;
}

/* --- CARD 3: JOURNEY SECTION --- */
.track-record-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.track-record-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background-color: rgba(0, 0, 0, 0.01);
}

.track-icon {
  width: 40px;
  height: 40px;
  background-color: var(--text-primary);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-details h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.track-details p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- CARD 4: PROJECTS SHOWCASE --- */
.projects-card-body {
  gap: 24px;
  justify-content: flex-start;
}

.projects-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 8px;
  max-height: 380px;
}

/* Custom Scrollbar for inner card scrolling */
.projects-list-scroll::-webkit-scrollbar {
  width: 5px;
}
.projects-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.projects-list-scroll::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

.project-showcase-item {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px 40px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: all var(--transition-fast);
  margin-bottom: 24px;
}

.project-showcase-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-color: var(--text-muted);
}

.project-showcase-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.project-showcase-details h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 8px 0 12px 0;
  letter-spacing: -0.5px;
}

.project-showcase-details p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.btn-showcase-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  background-color: var(--text-primary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-showcase-link:hover {
  background-color: #000000;
  transform: translateY(-1px);
}

.project-showcase-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  padding-left: 28px;
  border-left: 1px solid var(--border-color);
}

.tech-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #f3f4f6;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- CARD 5: CONTACT --- */
.contact-card-body {
  justify-content: flex-start;
  gap: 32px;
}

.contact-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-links-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-invitation {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.coordinate-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.coordinate-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.coordinate-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.coordinate-value:hover {
  text-decoration: underline;
}

.minimal-contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.minimal-contact-form input, .minimal-contact-form textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  background-color: rgba(0, 0, 0, 0.01);
  transition: all var(--transition-fast);
}

.minimal-contact-form input:focus, .minimal-contact-form textarea:focus {
  background-color: white;
  border-color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.minimal-contact-form textarea {
  height: 80px;
  resize: none;
}

.btn-submit {
  background-color: var(--text-primary);
  color: white;
  border: none;
  width: 100%;
  justify-content: center;
  border-radius: 12px;
  padding: 12px;
}

.btn-submit:hover {
  background-color: #000000;
}

.form-status {
  font-size: 0.8rem;
  font-weight: 600;
  display: none;
}
.form-status.success {
  display: block;
  color: var(--color-accent);
}
.form-status.error {
  display: block;
  color: #ef4444;
}

/* --- DETAIL OVERLAY MODALS (FULL PAGE OVERHAUL) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background-color: #e4e4e7; /* Match screenshot light warm gray */
  display: flex;
  align-items: flex-start; /* Allow scroll from top on small viewports */
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  min-height: 100vh;
  box-sizing: border-box;
  background: transparent;
  padding: 80px 10% 60px 10%;
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(0.94) translateY(60px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.4s ease, 
              visibility 0.4s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}

.modal-overlay.open .modal-content.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.08s, 
              opacity 0.6s ease 0.08s, 
              visibility 0.6s 0.08s;
}

.modal-close {
  position: fixed; /* Keep close button visible when scrolling */
  top: 48px;
  right: 64px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #d4d4d8; /* Zinc 300 button background */
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  z-index: 110;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: #a1a1aa; /* Zinc 500 */
  transform: scale(1.05);
}

.modal-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.modal-inner .meta-label {
  color: #ea580c; /* Orange tag color from screenshot */
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 3px;
  display: block;
}

.modal-title {
  font-size: 5.5rem;
  font-weight: 800;
  letter-spacing: -2.5px;
  line-height: 1.05;
  color: #111827;
  margin-bottom: 24px;
}

.modal-body-text {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  margin-bottom: 40px;
}

.modal-body-text p {
  font-size: 1.55rem;
  line-height: 1.65;
  color: #27272a; /* Zinc 800 */
  max-width: 960px;
  font-weight: 400;
}

.modal-subheading {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 24px;
  color: #111827;
}

.specialties-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.specialties-list li {
  font-size: 1.3rem;
  padding-left: 20px;
  position: relative;
  color: #27272a;
}

.specialties-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #ea580c;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 1000px;
  margin: auto auto 0 auto;
}

.info-grid-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-grid-col .meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #71717a;
  text-transform: uppercase;
}

.info-grid-col p {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

/* --- FOOTER --- */
.footer {
  width: 100%;
  padding: 32px 0;
  z-index: 10;
}

.footer-container {
  width: 100%;
  padding: 0 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--text-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-fast);
}

.logo-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  background-color: #000000;
}

.copyright-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-center {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex: 1;
}

.footer-socials a {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-socials {
  display: flex;
  gap: 24px;
}

.footer-socials a:hover {
  text-decoration: underline;
}

.footer-right {
  display: flex;
  gap: 20px;
  flex: 1;
  justify-content: flex-end;
}

.footer-legal-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-legal-link:hover {
  color: var(--text-primary);
}

/* --- RESPONSIVE LAYOUTS --- */
@media (max-width: 768px) {
  html {
    overflow-y: auto; /* Allow scrolling on small screens */
  }
  body {
    min-height: auto;
  }
  .navbar {
    height: 60px;
  }
  .nav-container {
    padding: 0 24px;
  }
  .stack-container-wrapper {
    padding: 20px 16px;
  }
  .stack-container {
    height: 480px;
  }
  .card-body {
    padding: 24px;
  }
  .intro-card-body {
    gap: 32px;
  }
  .card-title {
    font-size: 2.1rem;
  }
  .card-description {
    font-size: 1rem;
  }
  .contact-card-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-container {
    flex-direction: column;
    gap: 24px;
    padding: 0 24px;
    text-align: center;
  }
  .footer-left {
    flex-direction: column;
    gap: 8px;
  }
  .modal-content {
    padding: 24px;
    margin: 16px;
    border-radius: 24px;
  }
  .modal-title {
    font-size: 1.75rem;
  }
  .modal-info-grid {
    gap: 20px;
  }
  /* Offset stack translations slightly smaller on mobile */
  .card.stacked-1 { transform: translate3d(-15px, 0, -8px) scale(0.98) rotate(-1deg); }
  .card.stacked-2 { transform: translate3d(-30px, 0, -16px) scale(0.96) rotate(-2deg); }
  .card.stacked-3 { transform: translate3d(-45px, 0, -24px) scale(0.94) rotate(-3deg); }
}
