:root {
  --bg-base-1: #1b1b1b;
  --bg-base-2: #131313;
  --panel-bg: rgba(255, 255, 255, 0.035);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-border-soft: rgba(255, 255, 255, 0.06);

  --text: #d7d7d7;
  --muted: rgba(255, 255, 255, 0.62);

  --radius-lg: 14px;
  --gap: 14px;

  --shadow-soft:
    0 0 0 1px var(--panel-border),
    inset 0 0 0 1px var(--panel-border-soft);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      1100px 700px at 90% 8%,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.04) 18%,
      rgba(255, 255, 255, 0) 55%
    ),
    radial-gradient(
      900px 500px at 20% 0%,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0) 60%
    ),
    linear-gradient(160deg, var(--bg-base-1) 0%, var(--bg-base-2) 72%);
  overflow-x: hidden;
}

.project-page {
  width: 100%;
  padding: 28px;

  --palette-1: #563412;
  --palette-2: #fff4ea;
  --palette-3: #a47148;

  --palette-1-text: #f7efe8;
  --palette-2-text: #2a211a;
  --palette-3-text: #fff8f2;
}

.project-shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(4px);
}

.card-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  box-shadow: var(--shadow-soft);
}

.project-header {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 18px;
}

.project-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.project-description {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.project-header-right {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.project-meta-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
}

.project-meta-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 700;
}

.project-meta-value {
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  text-align: right;
}

.project-palette {
  display: grid;
  gap: var(--gap);
  margin-top: 8px;
}

.palette-item {
  min-height: 64px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow-soft);
}

.palette-1 {
  background: var(--palette-1);
  color: var(--palette-1-text);
}

.palette-2 {
  background: var(--palette-2);
  color: var(--palette-2-text);
}

.palette-3 {
  background: var(--palette-3);
  color: var(--palette-3-text);
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.gallery-item {
  min-height: 250px;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.gallery-item--wide {
  min-height: 250px;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.025);
}

/* ================= LIGHTBOX ================= */

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(6px);
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  width: min(96vw, 1500px);
  height: min(90vh, 950px);
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 18px;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: transform 0.16s ease, background 0.16s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 0.16);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  font-size: 28px;
  line-height: 1;
  z-index: 5;
}

.lightbox-nav {
  position: static;
  width: 56px;
  height: 56px;
  font-size: 34px;
  line-height: 1;
  justify-self: center;
}

.lightbox-prev {
  grid-column: 1;
}

.lightbox-content {
  grid-column: 2;
}

.lightbox-next {
  grid-column: 3;
}

/* mobilos kattintási zónák */
.lightbox-edge {
  display: none;
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  .project-page {
    padding: 18px;
  }

  .project-header {
    grid-template-columns: 1fr;
  }

  .project-header-right {
    max-width: 420px;
  }

  .lightbox-dialog {
    width: min(98vw, 1280px);
    height: min(88vh, 860px);
    grid-template-columns: 60px minmax(0, 1fr) 60px;
    gap: 12px;
  }

  .lightbox-nav {
    width: 48px;
    height: 48px;
    font-size: 30px;
  }

  .lightbox-close {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    font-size: 26px;
  }
}

/* ===== Mobile ===== */
@media (max-width: 680px) {
  .project-page {
    padding: 10px;
  }

  .project-shell {
    padding: 12px;
    border-radius: 16px;
  }

  .project-meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .project-meta-value {
    text-align: left;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

  .gallery-item,
  .gallery-item--wide {
    min-height: auto;
  }

  .lightbox-dialog {
    width: 100vw;
    height: 100vh;
    top: 0;
    transform: none;
    display: block;
    padding: 12px;
  }

  .lightbox-content {
    width: 100%;
    height: 100%;
    border-radius: 16px;
  }

  .lightbox-close {
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    background: rgba(25, 25, 25, 0.75);
  }

  .lightbox-nav {
    display: none;
  }

  .lightbox-edge {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22%;
    z-index: 4;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  .lightbox-edge--left {
    left: 0;
  }

  .lightbox-edge--right {
    right: 0;
  }
}