/* ============================================
   PORTFOLIO SHOWCASE — App Store Style
   ============================================ */

/* --- Custom Properties (Light Mode Default) --- */
:root {
  /* Background */
  --bg-primary: #ffffff;
  --bg-secondary: #f2f2f7;
  --bg-tertiary: #e5e5ea;
  --bg-card: rgba(255, 255, 255, 0.8);

  /* Text */
  --text-primary: #000000;
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-tertiary: rgba(0, 0, 0, 0.25);

  /* Accent — Apple blue */
  --accent: #007aff;
  --accent-hover: #0056b3;

  /* Glass */
  --glass-bg: rgba(0, 0, 0, 0.04);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-bg-hover: rgba(0, 0, 0, 0.08);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.72);

  /* Shadows */
  --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.08);
  --shadow-screenshot: 0 16px 48px rgba(0, 0, 0, 0.15);

  /* Spacing */
  --section-padding: 80px 0;
  --container-max: 1080px;
  --nav-height: 52px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-icon: 22.37%;

  /* Transition */
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.15s ease;
}

/* --- Dark Mode Override --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-card: rgba(28, 28, 30, 0.8);
    
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-tertiary: rgba(255, 255, 255, 0.25);
    
    --accent: #0a84ff;
    --accent-hover: #409cff;
    
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg-hover: rgba(255, 255, 255, 0.1);
    --nav-bg-scrolled: rgba(0, 0, 0, 0.72);
    
    --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.4);
    --shadow-screenshot: 0 16px 48px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 106.25%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.47059;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 22px;
}

/* --- Section --- */
.section {
  padding: var(--section-padding);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.5;
}

/* --- Fade-in Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--transition), backdrop-filter var(--transition);
  border-bottom: 0.5px solid transparent;
}

.navbar.scrolled {
  background: var(--nav-bg-scrolled);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--glass-border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

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

.nav-home {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.nav-home:hover {
  color: var(--text-primary);
}

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

.nav-logo:hover {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

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

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2px;
}

.lang-btn {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn.active {
  background: var(--accent);
  color: white;
}

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

.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

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

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

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

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.mobile-menu a:hover {
  color: var(--accent);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 40px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.hero-eyebrow svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-title .gradient {
  background: linear-gradient(135deg, var(--accent), #5e5ce6, #bf5af2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-top: 0.5px solid var(--glass-border);
  border-bottom: 0.5px solid var(--glass-border);
  margin: 0 auto;
  max-width: 700px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   APP GRID
   ============================================ */
.apps-section {
  padding: 60px 0 80px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}

/* --- App Card --- */
.app-card {
  background: var(--bg-card);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: rgba(10, 132, 255, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 0;
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-icon);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-header-text {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.app-tagline {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: 2px;
}

/* Card Body */
.card-body {
  padding: 14px 20px 0;
  flex: 1;
}

.app-description {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tech Stack */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px 0;
}

.tech-pill {
  padding: 3px 10px;
  background: var(--glass-bg);
  border: 0.5px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tech-pill.highlight {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.25);
  color: var(--accent);
}

/* Screenshot Preview */
.card-screenshot {
  padding: 16px 0 0;
}

.screenshots-scroll-container {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 0 20px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
}

.screenshots-scroll-container::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.screenshot-wrapper {
  flex: 0 0 calc(50% - 6px); /* Show roughly 2 screenshots per row */
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  scroll-snap-align: start;
  border: 0.5px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.screenshot-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}

.app-card:hover .screenshot-wrapper img {
  transform: scale(1.03);
}

/* No screenshot placeholder */
.screenshot-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px 20px;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  transform: scale(1.02);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 0.5px solid var(--glass-border);
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--accent-hover);
}

.btn svg {
  width: 14px;
  height: 14px;
}

/* Card link overlay for detail page */
.card-detail-link {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}

.card-detail-link:hover {
  color: var(--accent);
}

.card-detail-link svg {
  width: 12px;
  height: 12px;
}

/* ============================================
   FEATURED APP (Lumina — first card)
   ============================================ */
.app-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.app-card.featured .card-left {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.app-card.featured .card-header {
  padding: 0;
}

.app-card.featured .card-body {
  padding: 14px 0 0;
}

.app-card.featured .app-description {
  -webkit-line-clamp: 5;
}

.app-card.featured .tech-stack {
  padding: 14px 0 0;
}

.app-card.featured .card-footer {
  padding: 20px 0 0;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 16px;
}

.featured-badge svg {
  width: 12px;
  height: 12px;
}

.app-card.featured .card-right {
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.06), rgba(94, 92, 230, 0.06));
  overflow: hidden;
}

.app-card.featured .screenshots-scroll-container {
  padding: 0 28px 20px;
  width: 100%;
}

.app-card.featured .screenshot-wrapper {
  flex: 0 0 calc(45%);
  aspect-ratio: 9 / 19.5; /* iPhone aspect ratio */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-screenshot);
}

/* ============================================
   SKILLS SECTION
   ============================================ */
.skills-section {
  padding: 60px 0;
  border-top: 0.5px solid var(--glass-border);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.skill-group {
  background: var(--bg-card);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.skill-group-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.skill-item::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ============================================
   CONTACT CTA
   ============================================ */
.cta-section {
  padding: 80px 0;
  text-align: center;
  border-top: 0.5px solid var(--glass-border);
}

.cta-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.cta-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

.cta-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cta-links .btn {
  padding: 12px 24px;
  font-size: 0.88rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 0.5px solid var(--glass-border);
  padding: 24px 0;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

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

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-card.featured {
    grid-template-columns: 1fr;
  }

  .app-card.featured .card-right {
    padding: 0 28px 28px;
  }

  .app-card.featured .screenshot-wrapper {
    max-height: 300px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-bar {
    gap: 20px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  :root {
    --section-padding: 48px 0;
    --nav-height: 48px;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 40px);
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .app-card.featured {
    grid-template-columns: 1fr;
  }

  .app-card.featured .card-left {
    padding: 20px;
  }

  .app-card.featured .card-right {
    padding: 0 20px 20px;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stats-bar {
    gap: 16px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .card-header {
    padding: 16px 16px 0;
  }

  .card-body {
    padding: 10px 16px 0;
  }

  .tech-stack {
    padding: 10px 16px 0;
  }

  .card-screenshot {
    padding: 12px 16px 0;
  }

  .card-footer {
    padding: 12px 16px 16px;
  }

  .cta-title {
    font-size: 1.6rem;
  }
}
