/* ============================================
   CodeGang Studio - Main Stylesheet
   Matching Figma Design Exactly
   ============================================ */

/* CSS Custom Properties */
:root {
  /* Colors */
  --color-primary: #EF7300;
  --color-primary-hover: #ff8a1f;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-text: #3a3a3a;
  --color-text-light: #666666;
  --color-bg: #c4c0b8; /* Warm gray/beige background color from design */
  
  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-bg-light: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-shadow: rgba(0, 0, 0, 0.15);
  --glass-blur: 4px;
  
  /* Phone glass - white tint */
  --phone-glass-bg: rgba(253, 253, 253, 0.25);
  --phone-glass-border: rgba(255, 255, 255, 0.7);
  --phone-glass-blur: 4px; 
  
  /* Typography */
  --font-primary: 'Space Mono', monospace;
  --font-secondary: 'Inter', sans-serif;
  
  /* Font Sizes */
  --font-size-base: 16px;
  --font-size-small: 16px;
  --font-size-smaller: 16px;
  --font-size-smallish: 14px;
  --font-size-medium: 20px;
  --font-size-default: 23px; /* Main font size used throughout */
  
  /* Font Weights */
  --font-weight-regular: 100;
  --font-weight-semibold: 100;
  
  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 40px;
  --spacing-xl: 20px;
  --spacing-xxl: 20px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-phone: 32px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-white);
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--color-bg);
  
  /* Desktop Background Image */
  background-image: url('../assets/images/background.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

/* Side Location Text - inside hero section, centered vertically, aligned left */
.side-text {
  position: absolute;
  left: 50px; /* Align with logo */
  top: 50%; /* Center vertically within hero section */
  z-index: 100;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  color: var(--color-white);
  letter-spacing: 1px;
  white-space: nowrap;
  transform: translateY(-300%) rotate(90deg); /* Center vertically, then rotate */
  transform-origin: left center;
}

.side-divider {
  opacity: 0.5;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 40px 40px;
}

.nav-container {
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 60px;
  width: auto;
}

/* Hamburger Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--color-white);
  transition: all var(--transition-fast);
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 50px;
}

.nav-menu a {
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  font-weight: var(--font-weight-regular);
  color: var(--color-white);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-menu a:hover {
  color: var(--color-primary);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 40px 60px;
  position: relative;
}

.hero-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

/* Phone Wrapper */
.phone-wrapper {
  perspective: 1200px;
  perspective-origin: center center;
}

/* Phone Screen - 258x560 aspect ratio from Figma */
.phone-screen {
  position: relative;
  width: 258px;
  height: 560px;
  background: var(--phone-glass-bg);
  backdrop-filter: blur(var(--phone-glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--phone-glass-blur)) saturate(150%);
  border: 1px solid var(--phone-glass-border);
  border-radius: var(--radius-phone);
  box-shadow: 
    0 30px 60px -15px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Glass Shine Effect */
.phone-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.15) 100%
  );
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.phone-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.phone-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.phone-logo {
  height: 34px;
  width: auto;
}

.phone-settings {
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.phone-settings:hover {
  opacity: 1;
}

.phone-settings svg {
  width: 20px;
  height: 20px;
}

.phone-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: left;
}

.phone-tagline {
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  font-weight: var(--font-weight-regular);
  color: var(--color-white);
  text-align: left;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.phone-footer {
  display: flex;
  justify-content: center;
  padding-bottom: 80px;
}

.phone-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-secondary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  background: var(--color-primary);
  padding: 10px 34px;
  border: none;
  border-radius: 40px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 20px rgba(239, 115, 0, 0.4);
}

.phone-button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(239, 115, 0, 0.5);
}

.phone-button svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.phone-button:hover svg {
  transform: translateX(3px);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.scroll-indicator span {
  font-family: var(--font-primary);
  font-size: var(--font-size-smallish);
  color: var(--color-white);
  opacity: 1;
  letter-spacing: 1px;
}

/* Section Labels */
.section-label {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 60px;
}

.section-label span {
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  color: var(--color-white);
  letter-spacing: 1px;
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--color-white);
  opacity: 0.3;
}

.section-label-left {
  padding-left: 40px;
  padding-right: 40px;
}

.section-label-right {
  padding-left: 40px;
  padding-right: 40px;
  justify-content: flex-end;
}

/* Projects Section */
.projects {
  padding: var(--spacing-xl) 0;
  min-height: 100vh;
}

/* Project Common Styles */
.project {
  padding: var(--spacing-xl) 40px;
  margin-bottom: var(--spacing-xl);
}

/* Project 1 - Scattered Layout */
.project-1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 120px;
}

.project-title-center {
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  font-weight: var(--font-weight-regular);
  color: var(--color-white);
  text-align: center;
  line-height: 1.4;
  letter-spacing: -0.5px;
  margin-top: 40px;
  margin-bottom: 20px;
}

.project-screenshots-scattered {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 25px; /* Precise gap between screens */
  max-width: 1400px;
  margin: 0 auto;
  z-index: 2;
  padding-bottom: 60px;
}

.screenshot:hover {
  z-index: 10;
}

.screenshot-glass {
  /* Glass effect - backdrop-filter */
  background: rgba(255, 255, 255, 0.1); /* Semi-transparent background helps blur show */
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  border: 1px solid var(--phone-glass-border);
  border-radius: 28px;
  padding: 0;
  box-shadow: 
    9px 12px 11.7px 0px rgba(0, 0, 0, 0.25),
    0 30px 60px -15px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  width: 220px;
  height: 477px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.screenshot-glass img {
  display: block;
  width: 100%; /* Fit width */
  height: auto; /* Not height */
  position: relative;
  z-index: 1; /* Above the backdrop-filter effect */
  background: transparent; /* Ensure PNG transparency works */
}

/* Precise Staggered vertical positions (Inverted V) */
.screenshot-1 { margin-top: 240px; } /* Lowest */
.screenshot-2 { margin-top: 120px; } /* Midway */
.screenshot-3 { margin-top: 0; }     /* Highest (Center) */
.screenshot-4 { margin-top: 120px; } /* Midway */
.screenshot-5 { margin-top: 240px; } /* Lowest */

.project-description {
  font-family: var(--font-primary);
  font-size: var(--font-size-smaller);
  color: var(--color-white);
  text-align: center;
  line-height: 1.6;
  opacity: 0.8;
  max-width: 800px;
  margin-top: 10px;
  margin-bottom: 30px;

}

/* Project 2 - Row Layout */
.project-2 {
  padding-top: var(--spacing-xxl);
}

/* Project 2 container - centered layout */
.project-2 {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-info {
  flex: 0 0 0px;
}

/* Centered project info for both projects */
.project-info-centered {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 0 40px;
}

.project-title {
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  font-weight: var(--font-weight-regular);
  color: var(--color-white);
  line-height: 1.3;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.project-text {
  font-family: var(--font-primary);
  font-size: var(--font-size-smaller);
  color: var(--color-white);
  line-height: 1.7;
  margin-bottom: 20px;
  opacity: 0.8;
}

.project-screenshots-row {
  display: flex;
  gap: 20px;
  justify-content: center; /* Changed from flex-end to center */
}

.screenshot-solid {
  width: 220px;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
}

.screenshot-solid:hover {
  transform: translateY(-8px);
}

.screenshot-solid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 9px 12px 11.7px 0px rgba(0, 0, 0, 0.25); /* Exact drop shadow from Figma */
}

/* Contact Section */
.contact {
  padding: var(--spacing-xl) 40px var(--spacing-xxl);
  min-height: 80vh;
}

.contact-container {
  max-width: 500px;
  margin: 0 auto;
  padding-top: var(--spacing-lg);
}

.contact-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 25px 60px -20px var(--glass-shadow);
}

.contact-title {
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  font-weight: var(--font-weight-regular);
  color: var(--color-white);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.contact-subtitle {
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  color: var(--color-white);
  opacity: 0.7;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  color: var(--color-white);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: none;
  opacity: 0.8;
}

.form-input {
  width: 100%;
  font-family: var(--font-primary);
  font-size: var(--font-size-default);
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input::placeholder {
  color: var(--color-white);
  opacity: 0.4;
}

.form-input:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(239, 115, 0, 0.15);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-secondary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 32px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 20px rgba(239, 115, 0, 0.4);
  margin-top: 8px;
}

.form-button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(239, 115, 0, 0.5);
}

.form-button svg {
  transition: transform var(--transition-fast);
}

.form-button:hover svg {
  transform: translateX(3px);
}

/* Footer */
.footer {
  padding: 30px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Footer left - email is inline with copyright on desktop */

.footer-copyright {
  font-family: var(--font-primary);
  font-size: var(--font-size-medium);
  color: var(--color-white);
  opacity: 0.6;
}

.footer-email {
  font-family: var(--font-primary);
  font-size: var(--font-size-medium);
  color: var(--color-white);
  opacity: 0.6;
  text-decoration: none;
  transition: all var(--transition-fast);
  margin-left: 8px;
}

.footer-email:hover {
  color: var(--color-primary);
  opacity: 1;
}

.footer-social {
  display: flex;
  gap: 20px;
}

.social-link {
  color: var(--color-white);
  opacity: 0.6;
  transition: all var(--transition-fast);
}

.social-link:hover {
  color: var(--color-primary);
  opacity: 1;
}

.social-link svg {
  display: block;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Large Desktop */
@media (min-width: 1400px) {
  .screenshot-glass {
    width: 220px;
    height: 477px;
  }
  
  .screenshot-1,
  .screenshot-2,
  .screenshot-3,
  .screenshot-4,
  .screenshot-5 {
    width: 220px;
    height: 477px;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .side-text {
    display: none;
  }
  
  .phone-screen {
    width: 230px;
    height: 500px;
  }
  
  .phone-logo {
    height: 30px; /* Scales proportionally: 230/258 * 34 */
  }
  
  .phone-tagline {
    font-size: var(--font-size-default);
  }
  
  .screenshot-glass {
    width: 180px;
    height: 390px;
    border-radius: 23px; /* Proportionally scaled radius */
  }
  
  .screenshot-glass::before {
    border-radius: 23px; /* Match parent border-radius */
  }
  
  .screenshot-1,
  .screenshot-2,
  .screenshot-3,
  .screenshot-4,
  .screenshot-5 {
    width: 180px;
    height: 390px;
  }
  
  .screenshot-1 { margin-top: 60px; }
  .screenshot-2 { margin-top: 15px; }
  .screenshot-3 { margin-top: 0; }
  .screenshot-4 { margin-top: 30px; }
  .screenshot-5 { margin-top: 80px; }
  
  .project-content-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .project-info {
    flex: none;
    max-width: 400px;
  }
  
  .project-screenshots-row {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .screenshot-solid {
    width: 180px; /* Match screenshot-glass tablet size */
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav {
    padding: 15px 20px;
  }
  
  /* Show hamburger button on mobile */
  .nav-toggle {
    display: flex !important;
    position: relative;
    z-index: 1002;
  }
  
  .nav-toggle span {
    width: 28px;
    height: 3px;
    background-color: var(--color-primary); /* Orange color for visibility */
  }
  
  /* Hide menu by default, show when active */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(196, 192, 184, 0.98); /* Semi-transparent background matching body bg */
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 80px 40px 40px;
    gap: 30px;
    transition: right var(--transition-normal);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-menu li {
    width: 100%;
  }
  
  .nav-menu a {
    font-size: var(--font-size-default);
    display: block;
    width: 100%;
    padding: 10px 0;
  }
  
  .logo-img {
    height: 52px;
  }
  
  .hero {
    padding: 80px 20px 40px;
  }
  
  .phone-screen {
    width: 210px;
    height: 456px;
  }
  
  .phone-content {
    padding: 16px;
  }
  
  .phone-logo {
    height: 28px; /* Scales proportionally: 210/258 * 34 */
  }
  
  .phone-tagline {
    font-size: var(--font-size-default);
  }
  
  .phone-button {
    padding: 10px 20px;
    font-size: var(--font-size-smallish);
  }
  
  .section-label {
    margin-bottom: 40px;
  }
  
  .section-label-left,
  .section-label-right {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .project {
    padding: var(--spacing-lg) 20px;
  }
  
  .project-title-center {
    font-size: var(--font-size-default);
    margin-bottom: 30px;
  }
  
  .project-screenshots-scattered {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .screenshot-glass {
    width: 140px;
    height: 304px;
    border-radius: 18px; /* Proportionally scaled radius */
  }
  
  .screenshot-glass::before {
    border-radius: 18px; /* Match parent border-radius */
  }
  
  .screenshot {
    width: 140px !important;
    height: 304px !important;
    margin-top: 0 !important;
  }
  
  .screenshot:nth-child(5) {
    grid-column: span 2;
    max-width: 140px;
    margin: 0 auto !important;
  }
  
  .project-description {
    margin-top: 30px;
    font-size: var(--font-size-small);
  }
  
  .project-2 {
    padding-top: var(--spacing-lg);
  }
  
  .project-title {
    font-size: var(--font-size-medium);
  }
  
  .project-screenshots-row {
    gap: 12px;
  }
  
  .screenshot-solid {
    width: 140px; /* Match screenshot-glass mobile size */
  }
  
  .contact {
    padding: var(--spacing-lg) 20px;
  }
  
  .contact-glass {
    padding: 30px 24px;
  }
  
  .contact-title {
    font-size: var(--font-size-default);
  }
  
  .footer {
    padding: 20px;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .footer-left {
    align-items: center;
  }
  
  .footer-copyright {
    font-size: var(--font-size-medium);
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  /* Mobile background - fit to width */
  body {
    background-image: url('../assets/images/background-mobile.jpg');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
  }
  
  .phone-screen {
    width: 190px;
    height: 412px;
  }
  
  .phone-logo {
    height: 25px; /* Scales proportionally: 190/258 * 34 */
  }
  
  .phone-tagline {
    font-size: var(--font-size-default);
  }
  
  .screenshot-solid {
    width: 140px; /* Match screenshot-glass size */
  }
}

/* ============================================
   Animations & Effects
   ============================================ */

/* Smooth entrance animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.phone-screen {
  animation: fadeInUp 0.8s ease-out;
}

.scroll-indicator {
  animation: fadeIn 1s ease-out 0.5s both;
}

/* Removed animations from .screenshot - they break backdrop-filter */

.screenshot-solid {
  animation: fadeInUp 0.5s ease-out;
  animation-fill-mode: both;
}

.screenshot-solid:nth-child(1) { animation-delay: 0.1s; }
.screenshot-solid:nth-child(2) { animation-delay: 0.2s; }
.screenshot-solid:nth-child(3) { animation-delay: 0.3s; }
.screenshot-solid:nth-child(4) { animation-delay: 0.4s; }

.contact-glass {
  animation: fadeInUp 0.6s ease-out 0.2s;
  animation-fill-mode: both;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
