/* =============================================
   Christine Jung Portfolio — project.css
   Shared styles for all project detail pages
   ============================================= */

/* ── Project Nav ── */
.project-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.project-nav.scrolled {
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-color: var(--border);
}

.project-nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.back-link::before {
  content: '\2190';
}

.nav-divider {
  width: 1px;
  height: 16px;
  background: var(--border-hi);
}

.project-nav-logo {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  transition: color 0.2s;
}

.project-nav-logo:hover {
  color: var(--accent);
}

.project-nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.project-nav-right a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.project-nav-right a:hover {
  color: var(--accent);
}

/* ── Project Hero ── */
.project-hero {
  padding: calc(var(--nav-h) + 5rem) 5% 4rem;
  border-bottom: 1px solid var(--border);
  max-width: 1240px;
  margin: 0 auto;
}

.project-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.project-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 2rem;
  max-width: 800px;
}

.project-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.project-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-label {
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.meta-value {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.meta-value strong {
  color: var(--text);
  font-weight: 400;
}

.project-awards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(124, 92, 191, 0.25);
  border-radius: 99px;
  color: var(--accent);
  background: var(--accent-bg);
}

.award-badge::before {
  content: '\2726';
  font-size: 0.6rem;
}

/* ── Hero Cover Image ── */
.project-cover {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

.project-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.project-cover-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

/* ── Project Content ── */
.project-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 5%;
}

/* About intro block — full width, no two-column */
.project-about {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.project-about-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.project-about-body h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.project-about-body p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1rem;
}

/* ── Case Study Sections ── */
.case-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.case-section:last-child {
  border-bottom: none;
}

.section-num {
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.case-section h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.875rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.case-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

.case-section h3:first-child {
  margin-top: 0;
}

/* FIXED: text spans full width — no max-width restriction */
.case-section p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.case-section ul {
  padding-left: 0;
  margin-bottom: 1.5rem;
}

.case-section li {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.6rem;
}

.case-section li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Two-column layout within case section */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.two-col-text p {
  max-width: 100%;
}

/* Challenge / Solution callout boxes */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
}

.callout-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.callout p {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0;
  line-height: 1.7;
}

/* Solution callout — slightly different accent */
.callout-solution {
  border-left-color: #4a9e7a;
}

.callout-solution .callout-label {
  color: #4a9e7a;
}

/* ── Image Gallery ── */
.gallery {
  display: grid;
  gap: 12px;
  margin: 2rem 0;
  background: none;
  border-radius: 0;
}

.gallery-1 { grid-template-columns: 1fr; }
.gallery-2 { grid-template-columns: 1fr 1fr; }
.gallery-3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery-2-1 { grid-template-columns: 2fr 1fr; }
.gallery-1-2 { grid-template-columns: 1fr 2fr; }

.gallery-item {
  position: relative;
  overflow: visible;
  background: none;
  display: flex;
  flex-direction: column;
}

/* Images in multi-column galleries match height via flex */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

.gallery-2 .gallery-item img,
.gallery-3 .gallery-item img,
.gallery-2-1 .gallery-item img,
.gallery-1-2 .gallery-item img {
  flex: 1;
  min-height: 0;
  object-fit: cover;
}

/* Caption — no background box, just clean text beneath */
/* Media beside body copy — keeps the clip secondary to the text */
.case-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin: 2rem 0;
}

.case-split-body p:first-child {
  margin-top: 0;
}

@media (max-width: 860px) {
  .case-split {
    grid-template-columns: 1fr;
  }
}

.gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  position: relative;
}

/* Video items aren't lightbox-able — drop the zoom affordance */
.gallery-item:has(video) {
  cursor: default;
}

.gallery-item:has(video)::after {
  display: none;
}

.gallery-item figcaption {
  padding: 0.6rem 0.25rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  background: none;
  border-top: none;
  flex-shrink: 0;
}

/* Natural-size gallery — no height forcing, images keep their aspect ratio */
.gallery-natural {
  align-items: start;
}

.gallery-natural .gallery-item img {
  flex: none;
  height: auto;
  object-fit: contain;
}

/* Placeholder when no image yet */
.img-placeholder {
  background: var(--surface-hi);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Horizontal Scroll Row ── */
.scroll-row {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
  margin: 2rem 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.scroll-row::-webkit-scrollbar {
  height: 4px;
}
.scroll-row::-webkit-scrollbar-track {
  background: transparent;
}
.scroll-row::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 2px;
}

.scroll-row .gallery-item {
  flex: 0 0 auto;
  width: 340px;
  scroll-snap-align: start;
  background: var(--surface);
}

.scroll-row .gallery-item img {
  width: 340px;
  height: 260px;
  object-fit: contain;
  background: var(--surface);
  display: block;
}

/* ── Video Embed ── */
.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: var(--surface-hi);
  border-radius: var(--radius);
  margin: 2rem 0;
}

.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-style: italic;
}

/* ── Spec Table (interaction model, etc.) ── */
.case-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.92rem;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.case-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.95rem 1.1rem;
  background: var(--surface-hi);
  border-bottom: 1px solid var(--border);
}

.case-table tbody td {
  padding: 0.95rem 1.1rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  line-height: 1.55;
}

.case-table tbody tr:last-child td {
  border-bottom: none;
}

.case-table tbody td:first-child {
  font-weight: 600;
  white-space: nowrap;
  width: 22%;
}

.case-table tbody td:nth-child(2) {
  width: 30%;
}

/* ── Tool parameter summary — groups side by side, stacking on narrow screens ── */
.tool-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.tool-spec-item {
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tool-spec-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.tool-spec-item p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .tool-spec-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .tool-spec-grid { grid-template-columns: 1fr; }
}

/* Small note under a figure, e.g. playback speed */
.media-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Tags row ── */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

/* ── Project Footer / Next ── */
.project-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 5%;
  max-width: 1240px;
  margin: 0 auto;
}

.project-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.back-to-work {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.back-to-work::before { content: '\2190'; }

.back-to-work:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.footer-copy-sm {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ── Image Lightbox ── */
.gallery-item {
  cursor: pointer;
}

.gallery-item img {
  position: relative;
}

/* Expand icon overlay */
.gallery-item::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

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

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close::before,
.lightbox-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.lightbox-close::before { transform: rotate(45deg); }
.lightbox-close::after { transform: rotate(-45deg); }

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-align: center;
  max-width: 600px;
  pointer-events: none;
}

/* ── Carousel (one image at a time with arrows) ── */
.carousel {
  position: relative;
  margin: 2rem 0;
  user-select: none;
}

.carousel-track {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-hi);
}

.carousel-slide {
  display: none;
  width: 100%;
  margin: 0;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  display: block;
  background: #4a4a4a;
  border-radius: var(--radius);
}

/* Slides that already sit on their own backdrop — no letterbox fill needed */
.carousel-plain .carousel-track {
  background: none;
}

.carousel-plain .carousel-slide img {
  height: auto;
  background: none;
}

.carousel-slide figcaption {
  padding: 0.6rem 0.25rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  text-align: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.carousel-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.carousel-prev { left: -20px; }
.carousel-next { right: -20px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.carousel-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

.carousel-dot:hover {
  border-color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .project-about {
    padding: 3rem 0;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .gallery-2,
  .gallery-3,
  .gallery-2-1,
  .gallery-1-2 {
    grid-template-columns: 1fr;
  }

  .gallery-2 .gallery-item img,
  .gallery-3 .gallery-item img,
  .gallery-2-1 .gallery-item img,
  .gallery-1-2 .gallery-item img {
    height: auto;
  }

  .project-meta-grid {
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .project-nav-right {
    display: none;
  }

  .project-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}
/* Recognition uses supplied monochrome artwork without CSS color filters. */
.recognition-list { margin-top: 1.75rem; }
.recognition-list h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .13em; color: var(--accent); margin-bottom: .65rem; }
.recognition-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.recognition-list li, .project-website { font-size: .9rem; line-height: 1.65; }
.recognition-list a, .project-website a, .recognition-logo a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 4px; }
.recognition-list a:hover, .project-website a:hover { color: var(--accent); }
.project-website { margin-top: 1rem; }
.recognition-logos { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 2.5rem; padding: 2rem; margin-top: 1.5rem; background: #fafafa; color: #333; border-radius: 12px; }
.recognition-logo { margin: 0; flex: 0 1 210px; text-align: center; }
.recognition-logo picture { display: flex; align-items: center; justify-content: center; height: 64px; }
.recognition-logo img { height: 40px; width: auto; max-width: 100%; object-fit: contain; }
.recognition-logo-ca img { height: 56px; }
.recognition-logo figcaption { font-size: .8rem; line-height: 1.5; margin-top: .8rem; }
.recognition-logos-kitchen { justify-content: flex-start; padding: 1.2rem; }
.recognition-logos-kitchen .recognition-logo { flex-basis: 310px; }
.recognition-logos-kitchen img { height: 32px; }
.ai-workflow { margin-top: 3rem; }
.ai-workflow h4 { font-size: clamp(1.3rem, 3vw, 1.8rem); line-height: 1.35; margin: .5rem 0 1rem; }
.ai-workflow-slide { display: block; width: 100%; height: auto; margin-top: 2rem; border-radius: 12px; }
.ai-workflow-mobile { display: none; }
@media (prefers-color-scheme: dark) {
  .recognition-logos { background: #202124; color: #f5f5f5; }
}
@media (max-width: 640px) {
  .recognition-logos { gap: 1.5rem; padding: 1.5rem 1rem; }
  .ai-workflow-slide { display: none; }
  .ai-workflow-mobile { display: block; }
  .ai-workflow-steps { list-style: decimal-leading-zero; padding-left: 2rem; }
  .ai-workflow-steps li { padding: .75rem; margin: .5rem 0; background: var(--surface-hi); border-radius: 8px; }
  .ai-workflow-steps li:last-child { background: var(--accent); color: white; }
  .ai-workflow-issues { display: grid; gap: 1rem; margin-top: 1.5rem; }
  .ai-workflow-issues > div { background: var(--surface-hi); padding: 1rem; border-radius: 8px; }
  .ai-workflow-issues h5 { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; }
  .ai-workflow-issues p { font-size: .95rem; margin-top: .5rem; }
}

.case-table-scroll { max-width: 100%; overflow-x: auto; }
