/* ═══════════════════════════════════════════════════════════
   WORK SECTION — append to bottom of index.css
═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   WORK — BASE
───────────────────────────────────────── */
.work {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  color: var(--cream);
  padding: 60px 40px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Reuse scanlines + corner brackets from about */
.work-scanlines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 3px,
    rgba(255, 255, 255, 0.012) 4px
  );
  pointer-events: none;
  z-index: 0;
}

.work > * {
  position: relative;
  z-index: 2;
}

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
.work-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(240, 238, 219, 0.1);
}

.work-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.work-section-tag {
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.7;
}

.work-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 7vw, 90px);
  line-height: 0.9;
  color: var(--black);
  letter-spacing: 0.02em;
}

.work-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.work-subtitle {
  font-family: var(--font-body);
  font-size: 10px;
  line-height: 1.8;
  color: var(--black);
  text-align: right;
}

.work-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.work-count-num {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  color: var(--blue);
}

.work-count-label {
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 1;
  color: var(--blue);
}

/* ─────────────────────────────────────────
   PROJECT GRID
───────────────────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 300px;
  gap: 14px;
}

/* ─────────────────────────────────────────
   PROJECT CARD
───────────────────────────────────────── */
.proj-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  background-color: #1a1a1a;
  cursor: none;

  /* entrance */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    box-shadow 0.35s ease;
}

.proj-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.proj-card:hover {
  box-shadow:
    0 0 0 2px var(--yellow),
    0 20px 60px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

/* Large card spans 2 columns */
.proj-large {
  grid-column: span 2;
  grid-row: span 1;
}

.proj-large .proj-img {
  object-position: center 20%;
}

/* ─── Image wrapper ─── */
.proj-img-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.proj-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;

  /* Default: darkened */
  filter: brightness(0.8) saturate(0.8);
  transform: scale(1.04);
  transition:
    filter 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.proj-card:hover .proj-img {
  filter: brightness(0.85) saturate(1.1);
  transform: scale(1);
}

/* Placeholder shown when no image is set */
.proj-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #1a1a1a 0%, #222222 100%);
}

.proj-img[src]:not([src=""]) ~ .proj-placeholder {
  display: none;
}

.proj-ph-num {
  font-family: var(--font-display);
  font-size: 64px;
  color: rgba(240, 238, 219, 0.06);
  line-height: 1;
}

.proj-ph-hint {
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(240, 238, 219, 0.2);
}

/* ─── Overlay (always present, text fades) ─── */
.proj-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px;
  /* gradient darkens bottom for text legibility */
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0.75) 100%
  );
  pointer-events: none;
}

/* Meta row (top) */
.proj-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.proj-tag {
  font-family: var(--font-body);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--yellow);
  background: rgba(245, 200, 0, 0.12);
  border: 1px solid rgba(245, 200, 0, 0.25);
  padding: 4px 10px;
  border-radius: 100px;
}

.proj-year {
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(240, 238, 219, 0.35);
}

/* Bottom row (name + arrow) */
.proj-bottom {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.proj-index {
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(240, 238, 219, 0.3);
  line-height: 1;
  padding-bottom: 2px;
}

.proj-name {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: 0.04em;
  color: var(--cream);
  line-height: 1;
  flex: 1;

  /* Starts at normal position, shifts slightly on hover */
  transform: translateY(4px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.proj-card:hover .proj-name {
  transform: translateY(0);
}

.proj-arrow {
  font-size: 20px;
  color: var(--cream);
  line-height: 1;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition:
    opacity 0.3s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.proj-card:hover .proj-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

/* Color accent on left edge — cycles through brand colors */
.proj-card:nth-child(1)::after {
  --accent: var(--red);
}
.proj-card:nth-child(2)::after {
  --accent: var(--yellow);
}
.proj-card:nth-child(3)::after {
  --accent: var(--blue);
}
.proj-card:nth-child(4)::after {
  --accent: var(--green);
}
.proj-card:nth-child(5)::after {
  --accent: var(--red);
}
.proj-card:nth-child(6)::after {
  --accent: var(--yellow);
}

.proj-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--accent, var(--cream));
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.proj-card:hover::after {
  opacity: 1;
}

/* ─────────────────────────────────────────
   FOOTER LINE
───────────────────────────────────────── */
.work-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(240, 238, 219, 0.08);
}

.work-footer-label {
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--blue);
  opacity: 1;
}

.work-artstation-link {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--black);
  border-radius: 100px;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.work-artstation-link:hover {
  background-color: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
}

/* ─────────────────────────────────────────
   RESPONSIVE — TABLET
───────────────────────────────────────── */
@media (max-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 260px;
  }

  /* Reset large cards to single column on tablet */
  .proj-large {
    grid-column: span 2;
  }
}

/* ─────────────────────────────────────────
   RESPONSIVE — MOBILE
───────────────────────────────────────── */
@media (max-width: 768px) {
  .work {
    padding: 40px 16px;
    gap: 28px;
  }

  .work-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .work-header-right {
    align-items: flex-start;
  }

  .work-subtitle {
    text-align: left;
  }

  .work-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
    gap: 12px;
  }

  /* All cards full width on mobile */
  .proj-large {
    grid-column: span 1;
  }

  /* Always show arrow on mobile (no hover) */
  .proj-arrow {
    opacity: 1;
    transform: translate(0, 0);
  }

  /* Slightly brighten images on mobile (no hover state) */
  .proj-img {
    filter: brightness(0.9) saturate(0.9);
  }
}
