/* ============================================
   BRILLION STUDIO - WORK DETAIL / CASE STUDY
   ============================================ */

.placeholder-label {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: var(--text-dim); font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; text-align: center; padding: 20px;
}
.nav-active { color: var(--accent) !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================
   S1: HERO
   ============================================ */
/* Hero is a solid surface (#222222 sampled from the MBP mockup bg).
   The mockup image renders at natural aspect, pinned to bottom-left at
   ~75% width, so its built-in cement-block "shelf" extends the surface
   visually. The bottom of the hero fades to black via .wd-hero__overlay
   so the page bleeds into the next section. Image still parallaxes. */
.wd-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #222222;
}
[data-theme="light"] .wd-hero { background: var(--bg); }

.wd-hero__bg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.wd-hero__bg-img {
  display: block;
  width: 100%;
  height: auto;
}

/* Bottom-fade scrim: hero stays #222222 up top, fades to near-black at the
   bottom so the seam into the next section is invisible. The image and
   .wd-hero__bg sit at z-index: 0; this overlay sits above them at z-index: 1;
   .wd-hero__content is at z-index: 2 so the H1 reads on top of the fade. */
.wd-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(34, 34, 34, 0) 0%,
    rgba(34, 34, 34, 0) 55%,
    rgba(11, 11, 11, 0.6) 80%,
    rgba(0, 0, 0, 0.95) 100%
  );
}
[data-theme="light"] .wd-hero__overlay {
  background: linear-gradient(
    to bottom,
    rgba(248, 246, 242, 0) 0%,
    rgba(248, 246, 242, 0) 55%,
    rgba(248, 246, 242, 0.6) 80%,
    rgba(248, 246, 242, 0.95) 100%
  );
}

.wd-hero__content {
  position: relative;
  z-index: 2;
  padding-top: clamp(80px, 11vh, 110px);
  padding-bottom: 64px;
  width: 100%;
}

/* Breadcrumb */
.wd-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 24px;
  /* Backplate so the breadcrumb reads on the cement-grey zone of the
     mockup behind it — also doubles as a clear "navigation chrome" tag
     distinct from the editorial H1 below. */
  align-self: flex-start;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  width: max-content;
  max-width: 100%;
  animation: fadeUp 0.5s ease both;
}
[data-theme="light"] .wd-breadcrumb {
  background: rgba(248, 246, 242, 0.6);
  border-color: var(--border);
  color: var(--text);
}

.wd-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.wd-breadcrumb a:hover { color: var(--accent); }

.wd-hero__title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 800px;
  margin-bottom: 48px;
  animation: fadeUp 0.6s ease 0.1s both;
}

/* Metrics bar — single row, horizontal scroll on overflow.
   Items never wrap; on narrow viewports the user swipes/scrolls horizontally. */
.wd-hero__metrics {
  display: flex;
  gap: 32px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: 32px;
  padding-bottom: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  animation: fadeUp 0.6s ease 0.25s both;
}
.wd-hero__metrics::-webkit-scrollbar { display: none; }
[data-theme="light"] .wd-hero__metrics {
  border-top-color: var(--border);
}

.wd-hero__metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.wd-hero__metric-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wd-hero__metric-row {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.wd-hero__metric-val {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.wd-hero__metric-prefix,
.wd-hero__metric-suffix {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  letter-spacing: 0.01em;
}

.wd-hero__metric-prefix { margin-right: 2px; }
.wd-hero__metric-suffix { margin-left: 4px; }

.wd-hero__metric-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.wd-hero__visit {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.wd-hero__visit:hover { opacity: 0.7; }

/* ============================================
   S2: PROJECT REEL STRIP
   Project-filtered iPhone tiles built by window.PhoneTile.
   Reuses .reels__viewport / .reels__track / .reels__tile from styles.css.
   ============================================ */
.wd-reels {
  padding: 100px 0;
  background: var(--bg-surface);
  overflow: hidden;
}

.wd-reels__label { color: var(--accent); margin-bottom: 32px; }

/* ============================================
   S3: PROJECT OVERVIEW
   ============================================ */
.wd-overview {
  padding: 100px 0;
}

.wd-overview__grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
}

.wd-overview__logo {
  margin-bottom: 32px;
}

.wd-overview__logo-img {
  height: 28px;
  width: auto;
  filter: invert(1) hue-rotate(180deg);
}
[data-theme="light"] .wd-overview__logo-img {
  filter: none;
}

.wd-overview__desc {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.wd-overview__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wd-overview__tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
}

/* ============================================
   S4: IMAGE GALLERY
   ============================================ */
.wd-gallery {
  padding: 40px 0 100px;
}

.wd-gallery__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.wd-gallery__item {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.4s ease, border-color 0.3s ease;
}

.wd-gallery__item:hover {
  transform: scale(1.015);
  border-color: var(--accent);
}

.wd-gallery__item--large {
  grid-column: span 1;
  min-height: 320px;
}

.wd-gallery__item--wide {
  min-height: 180px;
}

/* When the item carries a real image (renderGallery hydrated it), drop the
   dashed placeholder treatment so the image reads cleanly edge to edge. */
.wd-gallery__item:has(.wd-gallery__img) {
  background: var(--bg-surface);
  border-style: solid;
  border-color: transparent;
}

.wd-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================
   S5: BACKGROUND & CHALLENGE
   ============================================ */
.wd-story {
  padding: 120px 0;
  background: var(--bg-surface);
}

.wd-story__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.wd-story__text {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
}

.wd-story__block {
  margin-bottom: 64px;
}

.wd-story__heading {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.wd-story__block p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
}

.wd-story__images {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.wd-story__img {
  width: 100%;
  height: 300px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ============================================
   S6: THE SOLUTION
   ============================================ */
.wd-solution {
  padding: 120px 0;
}

.wd-solution__label {
  color: var(--accent);
}

.wd-solution__title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 12px;
}

.wd-solution__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 64px;
}

.wd-solution__step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.wd-solution__step:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.wd-solution__step-num {
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-dim);
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.wd-solution__step h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.wd-solution__step p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

.wd-solution__img {
  width: 100%;
  height: 300px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 48px;
}

/* ============================================
   S7: THE RESULTS
   ============================================ */
.wd-results {
  padding: 120px 0;
  background: var(--bg-surface);
}

.wd-results__label { color: var(--accent); }

.wd-results__title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 12px;
}

.wd-results__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  margin-top: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.wd-results__stat { min-width: 0; }

.wd-results__stat-row {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.wd-results__stat-val {
  font-size: clamp(40px, 4.4vw, 56px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.wd-results__stat-prefix,
.wd-results__stat-suffix {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.wd-results__stat-prefix { margin-right: 2px; }
.wd-results__stat-suffix { margin-left: 4px; }

.wd-results__stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.wd-results__quote {
  margin-top: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
}

.wd-results__quote p {
  font-size: 22px;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 20px;
}

.wd-results__quote cite {
  font-size: 14px;
  font-style: normal;
  color: var(--text-muted);
}

/* ============================================
   S8: EMBEDDED PREVIEWS
   ============================================ */
.wd-embeds {
  padding: 120px 0;
}

.wd-embeds__title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 48px;
}

.wd-embeds__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.wd-embeds__frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.wd-embeds__frame-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.wd-embeds__frame-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.wd-embeds__frame-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
  letter-spacing: 0.04em;
}

.wd-embeds__frame-body {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   S9: MORE PROJECTS
   ============================================ */
.wd-more {
  padding: 120px 0;
  background: var(--bg-surface);
}

.wd-more__title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 48px;
}

.wd-more__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.wd-more__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.wd-more__card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.wd-more__card-img {
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--bg-surface);
}

.wd-more__card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.4s ease;
}

.wd-more__card:hover .wd-more__card-photo {
  transform: scale(1.03);
}

.wd-more__card-info {
  padding: 20px;
}

.wd-more__card-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.wd-more__card-info span {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ============================================
   S10: CTA
   ============================================ */
.wd-cta {
  position: relative;
  padding: 120px 0;
  text-align: center;
  overflow: hidden;
}

.wd-cta__content { position: relative; z-index: 2; }

.wd-cta__content h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 12px;
}

.wd-cta__content .section-sub { margin: 16px auto 0; max-width: 480px; }
.wd-cta__content .btn { margin-top: 32px; }

@keyframes float3d {
  0%, 100% { transform: perspective(600px) rotateX(10deg) rotateY(-10deg) translateY(0); }
  50%      { transform: perspective(600px) rotateX(12deg) rotateY(-8deg) translateY(-12px); }
}

.wd-cta__floating-shape {
  position: absolute; z-index: 0;
  width: 300px; height: 200px;
  top: 50%; left: 50%;
  margin-top: -140px; margin-left: -200px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  opacity: 0.2;
  animation: float3d 6s ease-in-out infinite;
}

.wd-cta__floating-shape--alt {
  width: 200px; height: 150px;
  margin-left: 40px; margin-top: -60px;
  animation-delay: -3s; opacity: 0.12;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .wd-hero__metrics { gap: 24px; }
  .wd-solution__steps { grid-template-columns: repeat(2, 1fr); }
  .wd-results__stats { grid-template-columns: repeat(2, 1fr); gap: 40px; }
  .wd-embeds__grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Mobile/tablet stack: H1 + metrics on top, mockup full-width at the
     bottom in normal flow (no overlap). overflow:hidden no longer needed
     since image isn't absolutely positioned past the box. */
  .wd-hero {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .wd-hero__metrics { gap: 16px; }
  .wd-hero__metric { min-width: 100px; }
  .wd-hero__content {
    order: 1;
    padding-top: clamp(96px, 12vh, 120px);
    padding-bottom: 32px;
  }
  .wd-hero__bg {
    order: 2;
    position: relative;
    inset: auto;
    width: 100%;
    transform: none !important;     /* parallax disabled in stacked mode */
  }
  .wd-hero__bg-img { width: 100%; height: auto; }
  /* Scrim fades the bottom edge of the image, not the content above it. */
  .wd-hero__overlay {
    top: auto;
    bottom: 0;
    height: 25%;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.95) 100%
    );
  }

  .wd-reels { padding: 60px 0; }

  .wd-overview__grid { grid-template-columns: 1fr; gap: 32px; }

  .wd-gallery__grid { grid-template-columns: 1fr; }
  .wd-gallery__item--large { grid-column: span 1; }

  .wd-story__grid { grid-template-columns: 1fr; gap: 40px; }
  .wd-story__text { position: relative; top: auto; }

  .wd-solution__steps { grid-template-columns: 1fr; }

  .wd-results__stats { grid-template-columns: 1fr; gap: 32px; }
  .wd-results__quote { padding: 32px; }
  .wd-results__quote p { font-size: 18px; }

  .wd-more__grid { grid-template-columns: 1fr; }

  .wd-cta__floating-shape { width: 200px; height: 140px; }
}
