/* ========================================
   MasterCraft Namještaj - Modern Stylesheet
   ======================================== */

:root {
  --primary: #1A1A2E;
  --primary-light: #2D2D44;
  --accent: #4F46E5;
  --accent-light: #6366F1;
  --accent-glow: rgba(79,70,229,0.15);
  --dark: #0F0F1A;
  --text: #2E2E3A;
  --text-light: #6B7280;
  --text-muted: #9CA3AF;
  --bg: #FAFAFA;
  --bg-alt: #F3F4F6;
  --white: #FFFFFF;
  --surface: #E5E7EB;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --header-height: 72px;
  --font-heading: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; color: var(--primary); }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin-bottom: 1rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,70,229,0.3);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}
.btn-dark {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-dark:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn-white {
  background: var(--white);
  color: var(--accent);
  border-color: var(--white);
  font-weight: 700;
}
.btn-white:hover {
  background: var(--bg);
  transform: translateY(-2px);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: transparent;
  transition: all var(--transition);
}
.header.scrolled {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}
.header.scrolled .logo { color: var(--primary); }
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  font-family: var(--font-heading);
}
.nav { display: flex; gap: 32px; align-items: center; }
.nav a {
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
  font-size: 0.9rem;
}
.nav a:hover { color: var(--white); }
.header.scrolled .nav a { color: var(--text-light); }
.header.scrolled .nav a:hover { color: var(--primary); }
.header-cta { display: flex; align-items: center; gap: 16px; }
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--white);
  transition: all var(--transition);
  border-radius: 1px;
}
.header.scrolled .menu-toggle span { background: var(--primary); }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + 40px) 0 80px;
  position: relative;
  overflow: hidden;
  background: var(--primary);
}
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-content { color: var(--white); }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(79,70,229,0.15);
  border: 1px solid rgba(79,70,229,0.3);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.hero-content h1 { color: var(--white); margin-bottom: 20px; }
.hero-content h1 .highlight {
  background: linear-gradient(135deg, var(--accent-light), #818CF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-content > p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 36px;
  max-width: 480px;
  line-height: 1.8;
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.hero-image::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 1;
}
.hero-image img {
  width: 100%;
  height: 520px;
  object-fit: cover;
}
.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.hero-stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
}
.hero-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sections */
.section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-header p {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 16px auto 0;
}
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  border: 1px solid var(--surface);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.service-card-img {
  height: 200px;
  overflow: hidden;
}
.service-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.service-card:hover .service-card-img img { transform: scale(1.05); }
.service-card-body { padding: 24px; }
.service-card-body h3 { margin-bottom: 8px; }
.service-card-body p { font-size: 0.88rem; color: var(--text-light); margin-bottom: 0; line-height: 1.6; }

/* About */
.about { background: var(--white); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-image img { width: 100%; height: 420px; object-fit: cover; }
.about-content h2 { margin-bottom: 20px; }
.about-content > p { color: var(--text-light); margin-bottom: 24px; line-height: 1.8; }
.about-features { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.about-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
}
.about-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,15,26,0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}
.gallery-item:hover::after { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Process */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.process-card {
  text-align: center;
  padding: 32px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface);
  transition: all var(--transition);
}
.process-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.process-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.process-card h3 { margin-bottom: 8px; }
.process-card p { font-size: 0.88rem; color: var(--text-light); margin-bottom: 0; }

/* CTA */
.cta {
  padding: 100px 0;
  background: var(--primary);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  border-radius: 50%;
}
.cta .container { position: relative; z-index: 1; }
.cta h2 { color: var(--white); margin-bottom: 16px; }
.cta p { color: rgba(255,255,255,0.6); font-size: 1.1rem; margin-bottom: 36px; max-width: 500px; margin-left: auto; margin-right: auto; }

/* Contact */
.contact { background: var(--bg-alt); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
.contact-info > p { color: var(--text-light); margin-bottom: 32px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.contact-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1.1rem;
}
.contact-item-text h4 { font-size: 0.9rem; margin-bottom: 2px; }
.contact-item-text p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0; }
.contact-form {
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  font-family: var(--font-body);
  background: var(--bg);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  color: var(--text);
  transition: all var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.contact-form .btn { width: 100%; justify-content: center; }

/* Footer */
.footer {
  background: var(--dark);
  padding: 40px 0 24px;
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer a { color: var(--accent-light); transition: color var(--transition); }
.footer a:hover { color: var(--white); }

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

/* Responsive */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav.open a { color: var(--text); }
  .menu-toggle { display: flex; }
  .header-cta .btn { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-image img { height: 320px; }
  .hero-stats { gap: 24px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-image { order: -1; }
  .about-image img { height: 260px; }
  .about-features { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-content { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .cta { padding: 60px 0; }
}
