:root {
  --forest-900: #064e3b;
  --forest-800: #065f46;
  --forest-700: #047857;
  --forest-600: #059669;
  --leaf-500: #10b981;
  --leaf-400: #34d399;
  --earth-800: #78350f;
  --sun-100: #fef3c7;
  --bg-white: #ffffff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  
  --shadow-organic: 0 10px 30px -5px rgba(6, 78, 59, 0.1);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body { background-color: var(--forest-900); color: var(--text-dark); overflow: hidden; height: 100vh; height: 100dvh; }

/* ── Background ────────────────────── */
.nature-bg {
  position: fixed; inset: 0; z-index: -2;
  background: url('assets/forest_bg.png') center/cover no-repeat;
  filter: brightness(0.6) contrast(1.1);
}
.nature-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(6, 78, 59, 0.5), rgba(6, 78, 59, 0.9));
}

.page-container {
  height: 100vh; height: 100dvh; overflow-y: auto;
  scroll-snap-type: y mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.page {
  min-height: 100vh; min-height: 100dvh; width: 100%; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; 
  justify-content: flex-start; /* Ensure growth happens downwards */
  padding: 8rem 2rem; position: relative; color: white;
  overflow-y: auto;
}
.page::-webkit-scrollbar { width: 0; } /* Hide scrollbar for cleaner look */


/* ── Page 1: Hero & Gallery ────────────────────── */
.hero-top { margin-bottom: 2rem; text-align: center; width: 100%; }
.typing-text {
  font-size: clamp(2.2rem, 8vw, 5rem); font-weight: 800;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4); min-height: 1.2em;
}

.gallery-container {
  display: flex; align-items: center; gap: 2rem; width: 100%; max-width: 1200px;
  position: relative;
}

.split-gallery {
  display: flex; gap: 10px; flex: 1; justify-content: center; align-items: center;
  height: 500px; width: 100%;
}

.split-square {
  width: 100%; max-width: 400px; height: 450px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border-radius: 20px; transition: var(--transition);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.1);
}

.split-square:nth-child(1) { background-position: 0% center; }
.split-square:nth-child(2) { background-position: 50% center; }
.split-square:nth-child(3) { background-position: 100% center; }

.pos-high { transform: translateY(-30px); }
.pos-low { transform: translateY(30px); }

.nav-arrow {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: white; width: 60px; height: 60px; border-radius: 50%;
  cursor: pointer; font-size: 1.5rem; transition: var(--transition);
  backdrop-filter: blur(10px); z-index: 5;
}
.nav-arrow:hover { background: var(--leaf-500); transform: scale(1.1); }

/* ── Page 2: Zig-Zag Projects ────────────────────── */
.zig-zag-container { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 4rem; }
.app-row { display: flex; gap: 2rem; align-items: stretch; }

.app-col.large { flex: 2; }
.app-col.small { flex: 1; }

.glass-card {
  background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(15px);
  padding: 2.5rem; border-radius: 30px; border: 1px solid rgba(255,255,255,0.1);
  min-height: 100%; display: flex; flex-direction: column; justify-content: flex-start;
  box-shadow: var(--shadow-organic);
  transition: var(--transition);
}

.glass-card h2 { font-size: 2rem; margin-bottom: 1.5rem; color: var(--leaf-400); }
.full-desc { font-size: 1.1rem; line-height: 1.6; opacity: 0.9; }
.brief-desc { font-weight: 600; margin-bottom: 2rem; color: var(--sun-100); }

.dynamic-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 1.25rem 2rem; background: var(--leaf-500); color: white;
  text-decoration: none; font-weight: 700; border-radius: 15px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}
.dynamic-btn:hover {
  background: white; color: var(--forest-900);
  border-radius: 40px; transform: scale(1.05) translateY(-5px);
}
.dynamic-btn:active { transform: scale(0.95); }

/* Integrated Documentation Styles */
.doc-toggle-btn {
  margin-top: 1rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--leaf-400);
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex; align-items: center; gap: 10px;
}
.doc-toggle-btn:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.doc-toggle-btn i { transition: transform 0.3s ease; }
.doc-toggle-btn.active i { transform: rotate(180deg); }

.doc-expandable {
  max-height: 0; overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}
.doc-expandable.active {
  max-height: 1500px; opacity: 1;
  margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.doc-content-inner h4 { color: var(--leaf-400); margin-bottom: 1rem; font-size: 1.3rem; }
.doc-content-inner ul { list-style: none; padding: 0; }
.doc-content-inner li { margin-bottom: 0.8rem; padding-left: 1.5rem; position: relative; font-size: 0.95rem; line-height: 1.5; }
.doc-content-inner li::before { content: '→'; position: absolute; left: 0; color: var(--leaf-500); }

/* ── Page 4: Contacts ────────────────────── */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem;
  width: 100%; max-width: 1100px; align-items: center;
}

.contact-left { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-item {
  display: flex; align-items: center; gap: 20px; font-size: 1.1rem;
  background: rgba(255,255,255,0.05); padding: 1.2rem; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1); transition: var(--transition);
  text-decoration: none; color: inherit;
}
.contact-item:hover { background: rgba(255,255,255,0.1); transform: translateX(10px); }
.contact-item i { font-size: 1.8rem; color: var(--leaf-400); width: 40px; text-align: center; }

.address-box { margin-bottom: 1.5rem; }
.address-box h3 { font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--sun-100); }
.address-box p { opacity: 0.8; font-size: 1.1rem; line-height: 1.4; }

.map-container {
  border-radius: 30px; overflow: hidden; border: 4px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  position: relative; height: 300px;
}

.map-link-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 78, 59, 0.2);
  text-decoration: none; transition: var(--transition);
  opacity: 0;
}
.map-link-overlay:hover { opacity: 1; background: rgba(6, 78, 59, 0.6); }

.map-overlay-hint {
  background: white; color: var(--forest-900);
  padding: 0.8rem 1.5rem; border-radius: 50px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; transform: translateY(20px);
  transition: var(--transition); font-size: 0.9rem;
}
.map-link-overlay:hover .map-overlay-hint { transform: translateY(0); }

/* ── Hamburger Menu ────────────────────── */
.menu-toggle {
  position: fixed; top: 1.5rem; right: 1.5rem; z-index: 1001; cursor: pointer;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
  padding: 0.8rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2);
}

.hamburger-box { width: 25px; height: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.hamburger-box span { width: 100%; height: 3px; background: white; border-radius: 4px; transition: var(--transition); }

.menu-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.menu-overlay {
  position: fixed; inset: 0; background: rgba(6, 78, 59, 0.98);
  backdrop-filter: blur(20px); z-index: 1000; display: flex; align-items: center; justify-content: center;
  transform: translateY(-100%); transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}
.menu-overlay.active { transform: translateY(0); }

.menu-content { text-align: center; color: white; display: flex; flex-direction: column; gap: 3rem; padding: 2rem; }
.lang-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.lang-links button {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: white; padding: 0.75rem 1.5rem; border-radius: 50px; cursor: pointer; transition: var(--transition);
}
.lang-links button:hover { background: white; color: var(--forest-900); }

/* ── UI Elements ────────────────────── */
.scroll-indicator {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  animation: bounce 2s infinite; opacity: 0.6; pointer-events: none;
}
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0) translateX(-50%);} 40% {transform: translateY(-10px) translateX(-50%);} 60% {transform: translateY(-5px) translateX(-50%);} }

.mini-footer { margin-top: 3rem; opacity: 0.5; font-size: 0.8rem; text-align: center; }

/* ── RESPONSIVE ADAPTATION ────────────────────── */

/* Tablets & Smaller Laptops */
@media (max-width: 1024px) {
  .page { padding: 5rem 1.5rem; }
  .split-gallery { height: 400px; }
  .split-square { height: 350px; }
  .zig-zag-container { gap: 3rem; }
  .contact-grid { gap: 2rem; }
}

/* Tablets (Portrait) */
@media (max-width: 768px) {
  .typing-text { font-size: 3.5rem; }
  .gallery-container { flex-direction: column; gap: 1rem; }
  .split-gallery { height: 300px; gap: 8px; }
  .split-square { height: 280px; border-radius: 15px; }
  .nav-arrow { width: 50px; height: 50px; font-size: 1.2rem; }
  
  .app-row { flex-direction: column; gap: 1.5rem; }
  .hamkor-row { flex-direction: column; } /* Keep same order on mobile for clarity */
  .app-col.large, .app-col.small { flex: none; width: 100%; }
  .glass-card { padding: 1.5rem; border-radius: 20px; }
  .glass-card h2 { font-size: 1.6rem; margin-bottom: 1rem; }
  
  .contact-grid { grid-template-columns: 1fr; }
  .contact-left { order: 2; }
  .contact-right { order: 1; }
  .map-container { height: 250px; }
}

/* Phones (Large & Small) */
@media (max-width: 480px) {
  .typing-text { font-size: 2.2rem; }
  .page { padding: 4rem 1rem; }
  
  .gallery-container { margin-top: 1rem; }
  .split-gallery { 
    height: 350px; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    justify-content: flex-start; 
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .split-gallery::-webkit-scrollbar { display: none; }
  .split-square { 
    height: 320px; 
    flex: 0 0 85%; 
    scroll-snap-align: center;
  }
  .pos-high, .pos-low { transform: none; } /* Disable stagger on very small screens for space */
  
  .dynamic-btn { width: 100%; padding: 1rem; font-size: 0.9rem; }
  .doc-toggle-btn { width: 100%; justify-content: center; }
  
  .contact-item { font-size: 1rem; padding: 1rem; }
  .contact-item i { font-size: 1.4rem; width: 30px; }
  
  .address-box h3 { font-size: 1.4rem; }
  .address-box p { font-size: 0.95rem; }
  
  .menu-content { gap: 2rem; }
  .lang-links button { padding: 0.6rem 1rem; font-size: 0.9rem; }
}

/* Fix for landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .page { min-height: auto; height: auto; scroll-snap-align: none; padding: 2rem 1rem; }
  .page-container { scroll-snap-type: none; }
  .split-gallery { display: flex; height: 200px; } /* Ensure it shows even in landscape */
  .split-square { height: 180px; }
  .hero-top { margin-bottom: 1rem; }
}
/* ── Download Overlay ───────────── */
#download-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0, 48, 24, 0.9); backdrop-filter: blur(15px);
    display: none; align-items: center; justify-content: center;
    color: white; text-align: center;
}
#download-overlay.active { display: flex; }
.dl-box { width: 90%; max-width: 400px; padding: 2.5rem; background: rgba(255,255,255,0.1); border-radius: 30px; border: 1px solid rgba(255,255,255,0.2); }
.dl-icon { font-size: 3rem; margin-bottom: 1.5rem; color: #4ade80; animation: dlBounce 1s infinite alternate; }
.dl-progress-bg { width: 100%; height: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; margin: 1.5rem 0 0.5rem; overflow: hidden; }
.dl-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #4ade80, #22c55e); transition: width 0.2s; }
@keyframes dlBounce { from { transform: translateY(0); } to { transform: translateY(-10px); } }

/* ── Analytics Section (Glassmorphism) ───────────── */
.analytics-section {
    padding: 4rem 2rem;
    margin: 4rem auto 2rem;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}
.analytics-section::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(74, 222, 128, 0.1) 0%, transparent 60%);
    z-index: 0; pointer-events: none;
}
.analytics-title {
    text-align: center; color: white; font-size: 2.5rem; font-weight: 800; margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2); position: relative; z-index: 1;
}
.analytics-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; position: relative; z-index: 1;
}
.stat-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 2.5rem 1.5rem; border-radius: 24px; text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative; overflow: hidden;
}
.stat-box::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.8), transparent);
    transform: scaleX(0); transition: transform 0.4s ease;
}
.stat-box:hover {
    transform: translateY(-10px); background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(74, 222, 128, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}
.stat-box:hover::after { transform: scaleX(1); }
.stat-icon { font-size: 3rem; color: #4ade80; margin-bottom: 1.5rem; filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.4)); }
.stat-number { font-size: 3.5rem; font-weight: 800; color: white; margin-bottom: 0.5rem; letter-spacing: -1px; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.stat-label { font-size: 1rem; color: rgba(255, 255, 255, 0.7); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
