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

:root {
  --color-bg: #FAFAF7;
  --color-bg-alt: #F0EFEB;
  --color-text: #2D3436;
  --color-text-light: #636E72;
  --color-primary: #1B4965;
  --color-primary-light: #2A6F97;
  --color-accent: #E07A5F;
  --color-accent-light: #F2CC8F;
  --color-white: #FFFFFF;
  --color-border: #DFE6E9;
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --max-width: 1140px;
  --transition: 0.3s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ===== NAVIGATION ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
  transition: box-shadow var(--transition);
}
.nav.scrolled { box-shadow: var(--shadow-sm); }
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo {
  font-size: 1.25rem; font-weight: 700; color: var(--color-primary);
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--color-accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--color-text-light);
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--color-accent);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--color-primary); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--color-text); margin: 5px 0; transition: var(--transition); }

/* ===== HERO ===== */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: 6rem 0 4rem; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, var(--color-bg) 0%, #E8E4DD 50%, var(--color-bg-alt) 100%);
}
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0.15;
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.hero-content h1 {
  font-family: var(--font-heading); font-size: 3.2rem; font-weight: 800;
  line-height: 1.15; letter-spacing: -0.03em; color: var(--color-primary);
  margin-bottom: 1.25rem;
}
.hero-content h1 .accent { color: var(--color-accent); }
.hero-content .subtitle {
  font-size: 1.2rem; color: var(--color-text-light); margin-bottom: 2rem;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: 8px; font-weight: 600;
  font-size: 0.95rem; transition: all var(--transition); cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--color-primary); color: var(--color-white);
  border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-light); border-color: var(--color-primary-light); color: var(--color-white); }
.btn-outline {
  background: transparent; color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: var(--color-white); }

.hero-visual {
  display: flex; justify-content: center; align-items: center;
}
.hero-card {
  background: var(--color-white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2rem; max-width: 380px; width: 100%;
}
.hero-card .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.5rem; }
.stat { text-align: center; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--color-primary); }
.stat-label { font-size: 0.8rem; color: var(--color-text-light); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== SECTIONS ===== */
section { padding: 5rem 0; }
section:nth-child(even) { background: var(--color-bg-alt); }

.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header h2 {
  font-size: 2.25rem; font-weight: 800; color: var(--color-primary);
  margin-bottom: 0.75rem; letter-spacing: -0.02em;
}
.section-header p { color: var(--color-text-light); max-width: 560px; margin: 0 auto; font-size: 1.05rem; }
.section-label {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--color-accent); margin-bottom: 0.5rem;
}

/* ===== ABOUT ===== */
.about-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; align-items: start; }
.about-photo {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-white); font-size: 4rem; font-weight: 800;
  box-shadow: var(--shadow-md);
}
.about-text h3 { font-size: 1.5rem; color: var(--color-primary); margin-bottom: 1rem; }
.about-text p { margin-bottom: 1rem; color: var(--color-text-light); }
.about-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.tag {
  padding: 0.35rem 0.9rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  background: var(--color-white); color: var(--color-primary);
  border: 1px solid var(--color-border);
}

/* ===== PROJECTS ===== */
.project-card {
  background: var(--color-white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  margin-bottom: 3rem;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-layout { display: grid; grid-template-columns: 1fr 1fr; }
.project-layout.reverse { direction: rtl; }
.project-layout.reverse > * { direction: ltr; }
.project-img {
  position: relative; overflow: hidden; min-height: 340px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}
.project-img img { width: 100%; height: 100%; object-fit: cover; }
.project-badge {
  position: absolute; top: 1rem; left: 1rem;
  padding: 0.3rem 0.8rem; border-radius: 6px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--color-accent); color: var(--color-white);
}
.project-content { padding: 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.project-content h3 { font-size: 1.6rem; color: var(--color-primary); margin-bottom: 0.75rem; }
.project-content p { color: var(--color-text-light); margin-bottom: 1.25rem; }
.project-features { list-style: none; margin-bottom: 1.5rem; }
.project-features li {
  padding: 0.4rem 0; padding-left: 1.5rem; position: relative;
  font-size: 0.95rem; color: var(--color-text-light);
}
.project-features li::before {
  content: ''; position: absolute; left: 0; top: 0.75rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent);
}

/* ===== SCREENSHOT GALLERY ===== */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.gallery-item {
  border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform var(--transition);
}
.gallery-item:hover { transform: scale(1.03); }
.gallery-item img { width: 100%; height: 160px; object-fit: cover; object-position: top; }

/* ===== TECH STACK ===== */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.tech-card {
  background: var(--color-white); padding: 1.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform var(--transition);
}
.tech-card:hover { transform: translateY(-2px); }
.tech-card h4 {
  font-size: 1rem; color: var(--color-primary); margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.tech-card h4 .icon { font-size: 1.25rem; }
.tech-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tech-pill {
  padding: 0.25rem 0.65rem; border-radius: 4px; font-size: 0.78rem;
  background: var(--color-bg); color: var(--color-text-light); font-weight: 500;
}

/* ===== LINKS / CONNECT ===== */
.links-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.link-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--color-white); padding: 1.25rem 1.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: all var(--transition);
  text-decoration: none; color: var(--color-text);
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--color-primary); }
.link-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.link-icon.linkedin { background: #0A66C2; color: white; }
.link-icon.github { background: #24292E; color: white; }
.link-icon.etsy { background: #F1641E; color: white; }
.link-icon.email { background: var(--color-primary); color: white; }
.link-card h4 { font-size: 0.95rem; margin-bottom: 0.15rem; }
.link-card p { font-size: 0.8rem; color: var(--color-text-light); }

/* ===== FOOTER ===== */
.footer {
  background: var(--color-primary); color: rgba(255,255,255,0.7);
  padding: 2.5rem 0; text-align: center; font-size: 0.85rem;
}
.footer a { color: var(--color-accent-light); }
.footer a:hover { color: var(--color-accent); }

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.85); align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: var(--shadow-lg); }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  background: none; border: none; color: white; font-size: 2rem; cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero .container { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .hero-content h1 { font-size: 2.2rem; }
  .hero-content .subtitle { margin: 0 auto 2rem; }
  .hero-actions { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-card { max-width: 300px; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--color-bg);
    padding: 1rem 1.5rem; gap: 1rem; border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }
  .nav-toggle { display: block; }

  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 200px; margin: 0 auto; }

  .project-layout, .project-layout.reverse { grid-template-columns: 1fr; direction: ltr; }
  .project-img { min-height: 200px; }

  .section-header h2 { font-size: 1.75rem; }
  section { padding: 3rem 0; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.8rem; }
  .hero-card .stats { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
}
