/* A shared material frame for real portfolio content.  Art stays in the frame,
   and the image, playable preview and all foreground controls remain intact. */
.cinematic-preview :is(#build .build-card, #timeline .timeline-card, #contact .contact-copy) {
  isolation: isolate;
  position: relative;
  border: 1px solid rgb(175 210 199 / 35%);
  background: linear-gradient(145deg, #18383b 0%, #122e33 29%, #10252b 75%, #152d31 100%);
  box-shadow: inset 0 1px 0 rgb(239 244 226 / 15%), 0 9px 22px rgb(24 49 48 / 13%);
}

/* Three related scales form one attached facet cluster, rather than particles. */
.cinematic-preview :is(#build .card-visual, #build .media-trigger) {
  position: relative;
  overflow: visible;
  margin-top: 24px;
  margin-bottom: 8px;
  border: 2px solid rgb(171 205 193 / 55%);
  border-radius: 13px;
  background: #0b1b21;
  box-shadow: inset 0 1px 0 rgb(255 248 223 / 35%), 0 5px 11px rgb(3 16 20 / 29%);
}
.cinematic-preview #build :is(.card-visual img, .media-trigger .preview-poster) {
  border-radius: 11px;
}
.cinematic-preview #build :is(.card-visual, .media-trigger)::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -2px;
  border: 1px solid rgb(232 226 203 / 85%);
  border-radius: inherit;
  box-shadow: inset 1px 1px 0 rgb(175 225 213 / 28%);
  opacity: var(--scene-enter, 0);
  pointer-events: none;
}
.cinematic-preview #build :is(.card-visual, .media-trigger)::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -20px;
  right: 8px;
  width: 50px;
  height: 16px;
  clip-path: polygon(0 100%, 19% 4%, 38% 100%, 49% 39%, 60% 100%, 68% 62%, 76% 100%, 100% 100%);
  background: linear-gradient(120deg, #304d53 0%, #a8cdc2 17%, #f5e6c8 27%, #648789 38%, #eadcc6 49%, #80a6a1 60%, #e9dcc8 68%, #527575 78%);
  transform: translateX(var(--scene-shift, 0px));
  pointer-events: none;
}

/* The playable poster receives the same frame; the native button and player
   keep their original hit area, label, media and controls. */
.cinematic-preview #build .media-trigger {
  display: grid;
  padding: 0;
  color: #f7eed8;
}
.cinematic-preview #build .media-trigger .preview-cue {
  z-index: 3;
  border: 1px solid rgb(191 223 211 / 55%);
  border-radius: 9px;
  background: #10262e;
  color: #f7eed8;
  box-shadow: 0 3px 8px rgb(3 12 16 / 30%);
}
.cinematic-preview #build .media-trigger:focus-visible {
  outline: 3px solid #bcece0;
  outline-offset: 3px;
}

/* Career is text-dense: retain the solid reading plane and use a smaller,
   quieter echo at the upper edge rather than art behind the words. */
.materials-ready .cinematic-preview #timeline-track > .timeline-card::after {
  content: "";
  display: block;
  position: absolute;
  top: 3px;
  right: 12px;
  bottom: auto;
  left: auto;
  width: 40px;
  height: 12px;
  border-radius: 0;
  clip-path: polygon(0 100%, 19% 4%, 38% 100%, 49% 39%, 60% 100%, 68% 62%, 76% 100%, 100% 100%);
  background: linear-gradient(120deg, #38585b 0%, #a3c3b8 17%, #e9ddc3 27%, #638785 38%, #e4d6bd 49%, #83a8a1 60%, #dfd6c4 68%, #527272 78%);
  box-shadow: none;
  transform: translateX(var(--scene-shift, 0px));
  opacity: .7;
  pointer-events: none;
}

.cinematic-preview :is(#build .build-card, #timeline .timeline-card) h3 {
  color: var(--fg-strong, #f3e6cd);
  line-height: 1.25;
  text-wrap: balance;
}
.cinematic-preview #build .build-card :is(.card-kicker, .card-note),
.cinematic-preview #timeline .timeline-card :is(p, summary, li) {
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.cinematic-preview :is(#build .status-chip, #timeline .timeline-date) {
  letter-spacing: .025em;
}
.cinematic-preview #timeline .material-detail > summary {
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.cinematic-preview :is(#build .build-card, #timeline .timeline-card, #contact .contact-copy) :is(a, summary):focus-visible {
  outline: 3px solid #bcece0;
  outline-offset: 3px;
  border-radius: 3px;
}

/* A calm surround for the real preview video, without a decorative layer over it. */
.cinematic-preview .card-video {
  border: 1px solid rgb(175 210 199 / 48%);
  border-radius: 15px;
  padding: 16px;
  background: #10252d;
  box-shadow: 0 20px 45px rgb(3 13 17 / 35%), inset 0 1px 0 rgb(247 237 215 / 18%);
}
.cinematic-preview .card-video #card-video-slot {
  overflow: hidden;
  border: 1px solid rgb(175 210 199 / 35%);
  border-radius: 10px;
  background: #0b111a;
}
.cinematic-preview .card-video video { display: block; }
.cinematic-preview .card-video #card-video-close {
  margin-top: 12px;
  padding: 0 16px;
  border: 1px solid #d7e5d5;
  border-radius: 8px;
  background: #e8d9b8;
  color: #10252b;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cinematic-preview .card-video #card-video-close:focus-visible {
  outline: 3px solid #bcece0;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .cinematic-preview #build :is(.card-visual, .media-trigger)::before { opacity: 0; }
  .cinematic-preview #build :is(.card-visual, .media-trigger)::after,
  .materials-ready .cinematic-preview #timeline-track > .timeline-card::after { transform: none; }
}
@media (forced-colors: active) {
  .cinematic-preview #build :is(.card-visual, .media-trigger)::before,
  .cinematic-preview #build :is(.card-visual, .media-trigger)::after,
  .materials-ready .cinematic-preview #timeline-track > .timeline-card::after { display: none; }
  .cinematic-preview :is(#build .build-card, #timeline .timeline-card, #contact .contact-copy) { box-shadow: none; }
}
@media print {
  .cinematic-preview #build :is(.card-visual, .media-trigger)::before,
  .cinematic-preview #build :is(.card-visual, .media-trigger)::after,
  .materials-ready .cinematic-preview #timeline-track > .timeline-card::after { display: none !important; }
  .cinematic-preview :is(#build .build-card, #timeline .timeline-card, #contact .contact-copy) {
    color: #111 !important;
    background: #fff !important;
    border-color: #aaa !important;
    box-shadow: none !important;
  }
}
