/* ===================== GLOBAL ===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #333;
  transition: background .3s, color .3s;
}

/* ===================== PRELOADER ===================== */
#preloader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#preloader span {
  width: 50px;
  height: 50px;
  border: 5px solid #e67e22;
  border-top: 5px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================== HEADER ===================== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: #111;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  z-index: 1000;
  transition: .3s;
}

header.scrolled {
  background: #000;
}

.logo {
  font-size: 1.4rem;
  font-weight: bold;
}

nav ul {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  list-style: none;
}

nav a {
  color: white;
  text-decoration: none;
}

nav a:hover {
  color: #e67e22;
}

/* ===================== SOCIAL ===================== */
.social-fixed {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.social-fixed img {
  width: 40px;
  height: 40px;
}

/* ===================== SECTIONS (FIXED) ===================== */
/* ❌ removed opacity:0 bug that caused blank page */
section {
  padding: 6rem 5%;
  min-height: auto;
}

/* optional animation (SAFE) */
section.show {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s ease;
}

/* ===================== HERO ===================== */
#home {
  background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.9)),
              url('images/hero.jpg') center/cover no-repeat;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100vh;
}

#home h1 {
  font-size: 3.5rem;
}

#home p {
  font-size: 1.3rem;
  margin: 1rem 0;
}

/* ===================== PORTFOLIO ===================== */
.portfolio-grid, .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.portfolio-btn img, .gallery img {
  width: 100%;
  border-radius: 15px;
  transition: transform .3s;
}

.portfolio-btn:hover img, .gallery img:hover {
  transform: scale(1.05);
}

/* ===================== LIGHTBOX ===================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
}

/* ===================== CONTACT ===================== */
.contact-wrap {
  max-width: 1100px;
  margin: 6rem auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.contact-form {
  background: #fff;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem 0;
  border: none;
  border-bottom: 2px solid #ddd;
  background: transparent;
  outline: none;
}

.contact-form button {
  width: 100%;
  padding: 1rem;
  border: none;
  background: #e67e22;
  color: white;
  border-radius: 30px;
  cursor: pointer;
}

/* ===================== FOOTER ===================== */
footer {
  background: #000;
  color: white;
  text-align: center;
  padding: 1.5rem;
}

/* ===================== DARK MODE ===================== */
body.dark {
  background: #121212;
  color: #f1f1f1;
}

body.dark header {
  background: #1e1e1e;
}

body.dark .contact-form {
  background: #1e1e1e;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .contact-wrap {
    grid-template-columns: 1fr;
  }
}