:root {
    --crimson: #7A0000;
    --crimson-light: #9a1010;
    --crimson-dark: #550000;
    --white: #ffffff;
    --off-white: #f5f0eb;
    --light-gray: #e8e2d9;
    --dark: #1a1a1a;
    --text-mid: #4a4a4a;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body { font-family: 'Montserrat', sans-serif; background: var(--off-white); color: var(--dark); overflow-x: hidden; }

.search-wrap svg { color: var(--crimson); flex-shrink: 0; }

/* HERO */
  .page-hero {
    margin-top: 90px; height: 320px;
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  .page-hero .hero-bg {
    position: absolute; inset: 0;
    background-image: url('../images/img_04.jpg');
    background-size: cover;
    background-position: center 40%;
    filter: blur(3px) brightness(0.85);
    transform: scale(1.05);
  }
  .page-hero::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(10, 5, 5, 0.62);
    z-index: 1;
  }
  .page-hero::after {
    content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
    height: 60px; background: var(--off-white);
    clip-path: ellipse(55% 100% at 50% 100%);
    z-index: 2;
  }
  .hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900; color: #ffffff;
    text-align: center; position: relative; z-index: 3;
    text-shadow: 0 2px 30px rgba(0,0,0,0.8), 0 0 60px rgba(0,0,0,0.5);
    letter-spacing: 0.02em;
  }
  .hero-title span { display: block; width: 60px; height: 3px; background: rgba(255,255,255,0.6); margin: 18px auto 0; border-radius: 2px; }

  /* PROJECTS SECTION */
  .projects-section { max-width: 1300px; margin: 0 auto; padding: 60px 40px 100px; }

  .section-intro {
    text-align: center; margin-bottom: 64px;
    background: linear-gradient(135deg, #1a0000 0%, var(--crimson-dark) 40%, var(--crimson) 80%, #b52020 100%);
    padding: 48px 40px; border-radius: 8px;
    box-shadow: 0 12px 50px rgba(122,0,0,0.3);
    position: relative; overflow: hidden;
  }
  .section-intro::before {
    content: ''; position: absolute; inset: 0;
    background-image:
      radial-gradient(ellipse at 10% 50%, rgba(255,255,255,0.06) 0%, transparent 50%),
      radial-gradient(ellipse at 90% 50%, rgba(255,255,255,0.04) 0%, transparent 50%),
      repeating-linear-gradient(-45deg, transparent, transparent 25px, rgba(255,255,255,0.02) 25px, rgba(255,255,255,0.02) 50px);
  }
  .section-intro::after {
    content: '"''"'; position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
    font-family: 'Playfair Display', serif; font-size: 12rem; color: rgba(255,255,255,0.04);
    line-height: 1; pointer-events: none;
  }
  .section-intro p {
    font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase;
    color: rgba(255,255,255,0.6); font-weight: 600; margin-bottom: 12px; position: relative; z-index: 1;
  }
  .section-intro h2 {
    font-family: 'Playfair Display', serif; font-size: 2.8rem;
    color: #ffffff; font-weight: 700; position: relative; z-index: 1;
    text-shadow: 0 2px 20px rgba(0,0,0,0.35);
    letter-spacing: 0.02em;
  }
  .section-intro h2::after {
    content: ''; display: block; width: 70px; height: 3px;
    background: rgba(255,255,255,0.45); margin: 16px auto 0; border-radius: 2px;
  }

  /* PROJECT CARDS GRID */
  .projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 36px; }

  .project-card {
    background: var(--white); border-radius: 4px; overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    transition: transform 0.4s cubic-bezier(0.25,0.8,0.25,1), box-shadow 0.4s;
    cursor: pointer;
  }
  .project-card:hover { transform: translateY(-8px); box-shadow: 0 20px 48px rgba(122,0,0,0.16); }

  .card-image-wrap { position: relative; height: 260px; overflow: hidden; }
  .card-image-wrap img.main-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
  .project-card:hover .card-image-wrap img.main-img { transform: scale(1.07); }

  .thumb-strip { position: absolute; bottom: 10px; right: 10px; display: flex; gap: 6px; }
  .thumb-strip img { width: 52px; height: 38px; object-fit: cover; border: 2px solid var(--white); border-radius: 2px; cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
  .thumb-strip img:hover { transform: scale(1.12); border-color: var(--crimson); }

  .card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(85,0,0,0.75) 0%, transparent 55%); opacity: 0; transition: opacity 0.4s; }
  .project-card:hover .card-overlay { opacity: 1; }

  .card-body { padding: 24px 26px 28px; border-top: 3px solid var(--crimson); }
  .card-body h3 { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--crimson); font-weight: 700; margin-bottom: 8px; }
  .card-body p { font-size: 0.78rem; color: var(--text-mid); line-height: 1.7; letter-spacing: 0.02em; }
  .card-tag { display: inline-block; margin-top: 14px; padding: 4px 12px; background: rgba(122,0,0,0.06); border: 1px solid rgba(122,0,0,0.18); border-radius: 20px; font-size: 0.68rem; letter-spacing: 0.1em; font-weight: 600; color: var(--crimson); text-transform: uppercase; }

  /* FOOTER */
  footer { background: var(--crimson-dark); color: rgba(255,255,255,0.6); text-align: center; padding: 32px 20px; font-size: 0.75rem; letter-spacing: 0.06em; }
  footer strong { color: var(--white); }

  /* ANIMATIONS */
  @keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
  .project-card { opacity: 0; animation: fadeUp 0.6s ease forwards; }
  .project-card:nth-child(1) { animation-delay: 0.05s; }
  .project-card:nth-child(2) { animation-delay: 0.12s; }
  .project-card:nth-child(3) { animation-delay: 0.19s; }
  .project-card:nth-child(4) { animation-delay: 0.26s; }
  .project-card:nth-child(5) { animation-delay: 0.33s; }
  .project-card:nth-child(6) { animation-delay: 0.40s; }
  .project-card:nth-child(7) { animation-delay: 0.47s; }
  .project-card:nth-child(8) { animation-delay: 0.54s; }
  .project-card:nth-child(9) { animation-delay: 0.61s; }
  .project-card:nth-child(10) { animation-delay: 0.68s; }
  .project-card:nth-child(11) { animation-delay: 0.75s; }

  @media (max-width: 680px) {
    .projects-grid { grid-template-columns: 1fr; }
    .search-wrap input { width: 110px; }
    header { padding: 0 16px; }
    .projects-section { padding: 40px 20px 80px; }
  }

  /* ── LIGHTBOX ── */
  .lightbox-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.92);
    align-items: center; justify-content: center;
    animation: lbFadeIn 0.25s ease;
  }
  .lightbox-overlay.active { display: flex; }
  @keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }

  .lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: lbZoomIn 0.3s cubic-bezier(0.25,0.8,0.25,1);
  }
  @keyframes lbZoomIn { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }

  .lightbox-img {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    display: block;
  }

  .lightbox-caption {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    text-align: center;
  }
  .lightbox-tag {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
    text-align: center;
  }

  /* Thumbnails inside lightbox */
  .lightbox-thumbs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .lightbox-thumbs img {
    width: 68px;
    height: 50px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
  }
  .lightbox-thumbs img:hover,
  .lightbox-thumbs img.active { border-color: #fff; transform: scale(1.08); }

  .lightbox-close {
    position: fixed;
    top: 20px; right: 24px;
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    z-index: 9100;
  }
  .lightbox-close:hover { background: rgba(122,0,0,0.7); border-color: var(--crimson); }

  /* Arrow buttons */
  .lightbox-prev, .lightbox-next {
    position: fixed;
    top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    z-index: 9100;
  }
  .lightbox-prev { left: 16px; }
  .lightbox-next { right: 16px; }
  .lightbox-prev:hover, .lightbox-next:hover { background: rgba(122,0,0,0.7); border-color: var(--crimson); }

  /* Make card images look clickable */
  .card-image-wrap { cursor: zoom-in; }
  .zoom-hint {
    position: absolute;
    bottom: 10px; left: 10px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
  }
  .project-card:hover .zoom-hint { opacity: 1; }