/* ============================================
   Aamineez Calligraphy Portfolio
   Apple-inspired minimal aesthetic
   ============================================ */

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

:root {
  --color-bg: #fbfbfd;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-border: #d2d2d7;
  --color-surface: #ffffff;
  --color-overlay: rgba(0, 0, 0, 0.85);
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max-width: 1200px;
  --spacing-unit: 8px;
}

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

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

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

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 32px;
}

.site-nav a {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* --- Hero --- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 120px 24px 80px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--color-text);
}

.hero-subtitle {
  margin-top: 16px;
  font-size: clamp(16px, 2.5vw, 21px);
  font-weight: 400;
  color: var(--color-text-secondary);
  letter-spacing: -0.01em;
}

/* --- Gallery --- */
.gallery-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 120px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.gallery-item {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.gallery-item-img-wrap {
  overflow: hidden;
  background: #f5f5f7;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-item-img-wrap img {
  transform: scale(1.03);
}

.gallery-item-info {
  padding: 16px 20px 20px;
}

.gallery-item-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.gallery-item-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Placeholder state for items without real images */
.gallery-item-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--color-border);
  user-select: none;
}

/* --- About --- */
.about-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.about-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 100px 24px;
  text-align: center;
}

.about-inner h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.about-inner p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* --- Footer --- */
.site-footer {
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox[hidden] {
  display: flex;
  pointer-events: none;
}

.lightbox.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.lightbox.is-active .lightbox-img {
  opacity: 1;
  transform: scale(1);
}

.lightbox-caption {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  text-align: center;
  max-width: 500px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: var(--font-body);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: #ffffff;
}

.lightbox-close {
  top: 20px;
  right: 24px;
  font-size: 32px;
  line-height: 1;
  padding: 8px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  line-height: 1;
  padding: 16px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero {
    padding: 80px 20px 60px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
  }

  .gallery-section {
    padding: 0 16px 80px;
  }

  .header-inner {
    padding: 14px 16px;
  }

  .site-nav {
    gap: 24px;
  }

  .about-inner {
    padding: 70px 20px;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 36px;
    padding: 12px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* --- Animations --- */
.gallery-item {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger gallery items */
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
