/* Portal CSS part: project landing, video watch page and the shared video player. */
/* Split from portal.css (Phase 6): linked straight after portal.css and the earlier portal-*.css parts, in this order, so the cascade is unchanged. */

/* ═══════════════════════════════════════════════════
   PROJECT LANDING (portal-project-landing.html)
═══════════════════════════════════════════════════ */

/* Page container — matches dashboard .page */
body.project-landing-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.project-landing-page .page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 48px 0;
  flex: 1;
  min-width: 0; /* flexbox overflow fix — lets the page column shrink to viewport on mobile */
}

.project-landing-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--text-dim);
}

.project-landing-masthead {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.project-landing-heading {
  display: grid;
  gap: 12px;
  max-width: 920px;
}

.project-landing-kicker {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
}

/* Back link */

/* Project title */
.project-landing-title {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  letter-spacing: var(--rf-type-heading-tracking);
  line-height: var(--rf-type-leading-1-1);
  color: rgba(var(--rf-tone-neutral-rgb), 0.9);
  max-width: 900px;
  margin-bottom: 0;
  --rf-type-heading-size: var(--rf-type-size-clamp-34px-4-8vw-58px);
}

.project-landing-description {
  max-width: 64ch;
  color: rgba(var(--cream-rgb), 0.62);
  font-size: var(--rf-type-size-15px, 15px);
  line-height: 1.65;
}

/* Milestone tracker */
.ms-client-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: var(--space-3) 0;
  margin: 24px 0 32px;
}

.ms-client-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  flex-shrink: 0;
}

.ms-client-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(var(--rf-tone-neutral-rgb), 0.15);
  background: rgba(var(--rf-tone-neutral-rgb), 0.04);
  color: var(--text-dim);
  font-size: var(--rf-type-size-12px, 12px);
  transition: all 0.2s ease;
}

.ms-client-step.ms-client-done .ms-client-dot {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
  box-shadow: 0 0 0 4px rgba(var(--orange-rgb),0.15);
}

.ms-client-step.ms-client-active .ms-client-dot {
  border-color: var(--orange);
  background: rgba(var(--orange-rgb),0.15);
  color: var(--orange);
}

.ms-client-label {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-11px, 11px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(var(--rf-tone-neutral-rgb), 0.45);
  text-align: center;
  white-space: nowrap;
}

.ms-client-step.ms-client-done .ms-client-label,
.ms-client-step.ms-client-active .ms-client-label {
  color: rgba(var(--rf-tone-neutral-rgb), 0.75);
}

@media (max-width: 768px) {
  .ms-client-label { display: none; }
}

.ms-client-line {
  flex: 1;
  height: 2px;
  background: rgba(var(--rf-tone-neutral-rgb), 0.12);
  margin-bottom: calc(var(--space-2) + 9px);
  min-width: var(--space-5);
}

.ms-client-line.ms-client-line-done {
  background: var(--orange);
}

/* Project landing "client room" layout */
.project-landing-room {
  display: grid;
  grid-template-columns: minmax(0, 690px) minmax(304px, 344px);
  justify-content: center;
  gap: 24px;
  align-items: start;
  margin-top: 28px;
}

.project-landing-primary,
.project-landing-rail {
  min-width: 0;
}

.project-landing-rail {
  display: grid;
  gap: 18px;
  align-content: start;
  position: sticky;
  top: 24px;
}

.project-room-panel {
  min-width: 0;
}

.project-landing-page .project-room-panel {
  position: relative;
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.1);
  border-radius: var(--radius-md);
  background:
    linear-gradient(160deg, rgba(var(--rf-tone-neutral-rgb), 0.055), rgba(var(--rf-tone-neutral-rgb), 0.018) 52%, color-mix(in srgb, var(--black) 8%, transparent)),
    rgba(var(--green-deep-rgb), 0.16);
  box-shadow:
    0 22px 60px color-mix(in srgb, var(--black) 22%, transparent),
    inset 0 1px 0 rgba(var(--rf-tone-neutral-rgb), 0.08);
  overflow: clip;
}

.project-landing-page .project-room-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--cream-rgb), 0.22), transparent);
  pointer-events: none;
}

.project-landing-page .project-room-panel > .section-label {
  margin: 0;
  padding: 18px 20px 14px;
}

.project-landing-page .project-room-deliverables {
  padding: 0 18px 20px;
}

.project-landing-page .project-room-deliverables > .section-label {
  padding-left: 0;
  padding-right: 0;
}

.project-landing-page .project-room-files > .section-label,
.project-landing-page .project-room-music > .section-label {
  border-bottom: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.06);
}

.project-landing-page .film-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

.project-landing-page .deliverable-card-primary {
  grid-column: 1 / -1;
}

.project-landing-page .deliverable-card-primary .film-thumb {
  min-height: 300px;
  margin-bottom: 14px;
}

.project-landing-page .deliverable-card-secondary {
  min-width: 0;
  padding: 12px 12px 13px;
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.1);
  border-radius: var(--radius-md);
  background: rgba(var(--rf-tone-neutral-rgb), 0.035);
}

.project-landing-page .deliverable-card-secondary .film-thumb {
  min-height: 0;
  margin-bottom: 10px;
}

.project-landing-page .deliverable-info {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
}

.project-landing-page .film-meta {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  line-height: var(--rf-type-leading-1-35, 1.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--cream-rgb), 0.34);
}

.film-thumb-format {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(var(--cream-rgb), 0.14);
  border-radius: var(--radius-pill);
  color: rgba(var(--cream-rgb), 0.45);
  background: color-mix(in srgb, var(--black) 12%, transparent);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.film-thumb-frame {
  position: absolute;
  inset: 21%;
  border: 1px solid rgba(var(--cream-rgb), 0.08);
  pointer-events: none;
}

.film-thumb-frame::after {
  content: "";
  position: absolute;
  inset: 31% 36%;
  border: 1px solid rgba(var(--cream-rgb), 0.08);
  border-radius: var(--radius-pill);
}

.film-thumb-camera {
  position: relative;
  z-index: 1;
  display: inline-grid;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: rgba(var(--cream-rgb), 0.34);
}

.film-thumb-camera svg {
  width: 100%;
  height: 100%;
}

/* Deliverable card actions — overlaid on thumbnail */
.deliverable-card-actions {
  display: flex;
  flex-wrap: wrap; /* buttons wrap to a second line on narrow screens instead of overflowing */
  gap: 8px;
  padding: 12px 0 0;
}

.deliverable-card-actions a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.deliverable-card-actions .watch-link {
  background: linear-gradient(180deg, rgba(255,210,120,0.5) 0%, var(--orange) 40%, var(--orange-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--orange-rgb), 0.25), inset 0 1px 0 rgba(255,235,160,0.4);
}
.deliverable-card-actions .watch-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(var(--orange-rgb), 0.34), inset 0 1px 0 rgba(255,235,160,0.5);
}
.deliverable-card-actions .review-link {
  background: rgba(var(--rf-tone-neutral-rgb), 0.1);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.15);
  color: rgba(var(--rf-tone-neutral-rgb), 0.8);
}
.deliverable-card-actions .review-link:hover {
  background: rgba(var(--rf-tone-neutral-rgb), 0.15);
  border-color: rgba(var(--rf-tone-neutral-rgb), 0.25);
}

/* Download — secondary action on video cards (Watch stays primary) */
.deliverable-card-actions .download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  background: rgba(var(--rf-tone-neutral-rgb), 0.1);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.15);
  color: rgba(var(--rf-tone-neutral-rgb), 0.8);
}
.deliverable-card-actions .download-link svg {
  flex: 0 0 auto;
  opacity: 0.85;
}
.deliverable-card-actions .download-link:hover {
  background: rgba(var(--rf-tone-neutral-rgb), 0.15);
  border-color: rgba(var(--rf-tone-neutral-rgb), 0.25);
  color: var(--white);
}

/* Processing pill — shown when a video's encode isn't ready yet */
.deliverable-processing {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-11px, 11px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--rf-tone-neutral-rgb), 0.55);
  background: var(--rf-tone-neutral-fill);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.14);
  border-radius: var(--rf-radius-md);
  padding: 8px 0;
}

/* Duration badge on thumbnail */
.film-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-11px, 11px);
  font-weight: 500;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--black) 65%, transparent);
  color: rgba(var(--rf-tone-neutral-rgb), 0.8);
  backdrop-filter: blur(4px);
}

/* Coming-soon label on empty deliverable cards */
.deliverable-coming-soon {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-11px, 11px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--rf-tone-neutral-rgb), 0.45);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.18);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}

/* Empty deliverable card — looks like a card, not a broken image */
.deliverable-card-empty .film-thumb {
  border: 1px solid rgba(var(--cream-rgb), 0.11);
  background:
    radial-gradient(circle at 52% 46%, rgba(var(--cream-rgb), 0.055), transparent 11rem),
    radial-gradient(circle at 74% 22%, rgba(var(--orange-rgb), 0.055), transparent 10rem),
    linear-gradient(135deg, rgba(var(--green-deep-rgb), 0.42) 0%, color-mix(in srgb, var(--black) 54%, transparent) 100%);
}

.deliverable-card-empty .film-thumb-empty {
  gap: 10px;
}

/* Deliverable card with content but no thumbnail — more intentional empty state */
.film-card:not(.deliverable-card-empty) .film-thumb-empty {
  background: linear-gradient(150deg, rgba(var(--rf-tone-neutral-rgb), 0.04) 0%, color-mix(in srgb, var(--black) 8%, transparent) 100%);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.12);
  border-radius: var(--radius-sm, 4px);
}

body.portal-page.project-landing-page .file-preview-modal {
  display: flex;
  width: min(1120px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  flex-direction: column;
}

.file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.08);
  flex-shrink: 0;
}

.file-preview-header h3 {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  color: var(--text-primary);
  --rf-type-heading-size: var(--rf-type-size-15px);
}

.file-preview-close {
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-preview-body {
  flex: 1;
  overflow: auto;
  padding: var(--space-5);
}

.file-preview-body iframe { width: 100%; height: 100%; min-height: 400px; border: none; }
.file-preview-body img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.file-preview-body video { width: 100%; max-height: 60vh; display: block; }

.docx-preview { font-size: var(--rf-type-size-14px, 14px); line-height: 1.7; color: var(--text-secondary); }

/* Project landing responsive */
@media (max-width: 639px) {
  .project-landing-page .page {
    padding: 58px 20px 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
  }
  .project-landing-page .film-grid { grid-template-columns: 1fr; }
  .project-landing-room {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
  }
  .project-landing-rail {
    position: static;
  }
  .project-landing-page .project-room-deliverables {
    padding: 0 14px 14px;
  }
  .project-landing-page .deliverable-card-primary .film-thumb,
  .project-landing-page .deliverable-card-secondary .film-thumb {
    min-height: 0;
  }
  .project-landing-page .project-room-panel > .section-label {
    padding: 16px 16px 12px;
  }
  .project-landing-page .project-room-deliverables > .section-label {
    padding-left: 0;
    padding-right: 0;
  }
  .project-landing-rail .resources-panel,
  .music-panel-body {
    padding-left: 14px;
    padding-right: 14px;
  }
  .music-summary {
    padding-left: 14px;
    padding-right: 14px;
  }
  .files-summary {
    padding-left: 14px;
    padding-right: 14px;
  }
  /* Milestone bar must not force page width on mobile.
     overflow-x:auto alone is not enough — as a flex item the bar keeps
     min-width:auto (its ~662px content floor), which it then imposes on
     landing-content → main.page → the whole page. min-width:0 lets the
     scroll container shrink below its content so steps scroll, not the page. */
  .ms-client-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    max-width: 100%;
  }
  /* Ensure deliverable action buttons wrap and stay tappable on phones */
  .deliverable-card-actions a {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* Project room redesign */
.project-landing-page .project-landing-masthead {
  max-width: 920px;
}

.project-landing-status {
  max-width: 58ch;
  margin: 2px 0 0;
  color: rgba(var(--cream-rgb), 0.76);
  font-size: var(--rf-type-size-17px, 17px);
  line-height: 1.55;
}

.project-landing-room {
  grid-template-columns: minmax(0, 720px) minmax(280px, 340px);
  gap: 40px;
  justify-content: center;
}

.project-landing-rail {
  gap: 20px;
}

.project-room-section {
  min-width: 0;
}

.project-room-section + .project-room-section {
  margin-top: 46px;
}

.project-landing-page .project-room-section > .section-label {
  margin-bottom: 16px;
}

.project-review-list {
  display: grid;
  gap: 18px;
}

.project-review-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--cream-rgb), 0.12);
  border-radius: var(--rf-radius-md);
  background: rgba(var(--cream-rgb), 0.035);
  box-shadow: 0 24px 70px color-mix(in srgb, var(--black) 24%, transparent);
}

.project-review-media {
  position: relative;
  min-height: 315px;
  background: color-mix(in srgb, var(--black) 24%, transparent);
}

.project-review-media img {
  width: 100%;
  height: 100%;
  min-height: 315px;
  object-fit: cover;
  display: block;
}

.project-review-file-icon {
  min-height: 315px;
  display: grid;
  place-items: center;
  color: rgba(var(--cream-rgb), 0.35);
}

.project-review-file-icon svg {
  width: 54px;
  height: 54px;
}

.project-review-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
}

.project-review-eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
}

.project-review-title {
  margin: 0;
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  line-height: var(--rf-type-leading-1-08);
  color: rgba(var(--rf-tone-neutral-rgb), 0.92);
  --rf-type-heading-size: var(--rf-type-size-clamp-25px-3vw-34px);
}

.project-review-meta {
  margin: 12px 0 0;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-11px, 11px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--cream-rgb), 0.42);
  line-height: 1.5;
}

.project-review-actions {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
}

.project-review-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(var(--cream-rgb), 0.16);
  border-radius: var(--rf-radius-md);
  color: rgba(var(--cream-rgb), 0.82);
  text-decoration: none;
  font-size: var(--rf-type-size-13px, 13px);
  font-weight: 650;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.project-review-action:hover {
  border-color: rgba(var(--cream-rgb), 0.28);
  color: rgba(var(--rf-tone-neutral-rgb), 0.96);
  background: rgba(var(--cream-rgb), 0.055);
}

.project-review-action-primary {
  color: #241006;
  border-color: rgba(var(--orange-rgb), 0.86);
  background: var(--orange);
}

.project-review-action-primary:hover {
  color: #180b03;
  border-color: rgba(238,151,82,0.95);
  background: #ee9651;
}

.project-review-empty {
  padding: 34px 0 40px;
  border-top: 1px solid rgba(var(--cream-rgb), 0.12);
  border-bottom: 1px solid rgba(var(--cream-rgb), 0.08);
}

.project-review-empty-title {
  margin: 0;
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  line-height: var(--rf-type-leading-1-1);
  color: rgba(var(--rf-tone-neutral-rgb), 0.9);
  --rf-type-heading-size: var(--rf-type-size-clamp-26px-4vw-38px);
}

.project-review-empty-status {
  max-width: 48ch;
  margin: 12px 0 0;
  color: rgba(var(--cream-rgb), 0.58);
  font-size: var(--rf-type-size-15px, 15px);
  line-height: 1.6;
}

.planned-output-list {
  display: grid;
  border-top: 1px solid rgba(var(--cream-rgb), 0.1);
}

.planned-output-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(var(--cream-rgb), 0.08);
}

.planned-output-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.planned-output-title {
  color: var(--text-primary);
  font-weight: var(--rf-type-heading-weight);
  line-height: var(--rf-type-leading-1-3);
  --rf-type-heading-size: var(--rf-type-size-15px);
}

.planned-output-meta,
.planned-output-state {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--cream-rgb), 0.38);
}

.planned-output-state {
  flex: 0 0 auto;
  color: rgba(var(--cream-rgb), 0.48);
}

.project-room-music,
.project-room-files {
  border-top: 1px solid rgba(var(--cream-rgb), 0.1);
}

.project-room-music .music-panel,
.project-room-files .files-panel {
  background: transparent;
}

.project-room-music .music-summary,
.project-room-files .files-summary {
  min-height: 68px;
  padding: 18px 0;
}

.project-room-music .music-summary-title,
.project-room-files .files-summary-title {
  font-weight: var(--rf-type-heading-weight);
  --rf-type-heading-size: var(--rf-type-size-20px);
}

.project-room-music .music-summary-chevron,
.project-room-files .files-summary-chevron {
  border-color: rgba(var(--cream-rgb), 0.16);
}

.project-room-music .music-panel-body,
.project-landing-rail .resources-panel {
  padding: 0 0 18px;
}

.project-landing-rail .music-track {
  border-top-color: rgba(var(--cream-rgb), 0.07);
}

.project-landing-rail .resource-tab {
  border-radius: var(--rf-radius-md);
  background: transparent;
  border-color: rgba(var(--cream-rgb), 0.11);
}

.project-landing-rail .resource-row {
  border-radius: var(--rf-radius-md);
  background: transparent;
  border-color: rgba(var(--cream-rgb), 0.08);
}

@media (max-width: 820px) {
  .project-review-card {
    grid-template-columns: 1fr;
  }

  .project-review-copy {
    padding: 22px;
  }
}

@media (max-width: 639px) {
  .project-landing-status {
    font-size: var(--rf-type-size-15px, 15px);
  }

  .project-landing-room {
    gap: 34px;
  }

  .project-room-section + .project-room-section {
    margin-top: 36px;
  }

  .project-review-media,
  .project-review-media img,
  .project-review-file-icon {
    min-height: 190px;
  }

  .planned-output-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .project-room-music .music-summary,
  .project-room-files .files-summary {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ═══════════════════════════════════════════════════
   VIDEO WATCH PAGE (portal-project.html)
═══════════════════════════════════════════════════ */

.watch-container {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: var(--space-10);
  width: 100%;
}

.view-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: 0 var(--space-2);
}

.portal-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-11px, 11px);
  color: var(--text-dim);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}

.portal-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.portal-breadcrumb a:hover { color: var(--orange); }

.view-player-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
  background: var(--black);
  position: relative;
  box-shadow: 0 20px 60px color-mix(in srgb, var(--black) 60%, transparent);
}

.view-meta {
  padding: 0 var(--space-2);
}

.view-title {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  letter-spacing: var(--rf-type-heading-tracking);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  line-height: var(--rf-type-leading-1-15);
  --rf-type-heading-size: var(--rf-type-size-28px);
}

.view-description {
  font-size: var(--rf-type-size-13px, 13px);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-5);
  max-width: 680px;
}

.portal-selector-label {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-9px, 9px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}

.portal-format-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.view-controls-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.portal-version-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.portal-version-note {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ─── Watch page V6 overrides ─── */

body.watch-page.portal-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.watch-page .page {
  flex: 1;
}

body.watch-page .watch-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px var(--space-10);
  width: 100%;
}

/* Wider player with cinematic shadow */
body.watch-page .view-player-container {
  border-radius: var(--rf-radius-md);
  overflow: hidden;
  background: var(--black);
  box-shadow: 0 16px 48px color-mix(in srgb, var(--black) 50%, transparent);
  margin-bottom: 24px;
}

/* Watch page header — back link + review link */
.watch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-top: 24px;
}

.review-text-link {
  font-family: var(--font-body);
  font-size: var(--rf-type-size-12px, 12px);
  font-weight: 500;
  color: rgba(var(--orange-rgb), 0.7);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color 0.15s ease;
}
.review-text-link:hover { color: var(--orange); }

/* Title below player */
body.watch-page .view-title {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  letter-spacing: var(--rf-type-heading-tracking);
  margin-bottom: 16px;
  --rf-type-heading-size: var(--rf-type-size-24px);
}

/* Format pills row — no label */
body.watch-page .portal-format-selector {
  margin-bottom: 16px;
}

/* Download button — subtle ghost */

/* Controls row */
.watch-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

/* ═══════════════════════════════════════════════════
   VIDEO PLAYER (shared portal-project + review)
═══════════════════════════════════════════════════ */

.player-wrap {
  position: relative;
  background: var(--black);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.player-wrap.player-aspect-1-1  { aspect-ratio: 1/1; }
.player-wrap.player-aspect-9-16 { aspect-ratio: 9/16; max-height: 80vh; }
.player-wrap.player-aspect-4-5  { aspect-ratio: 4/5; }

.player-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.player-big-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: opacity 0.2s ease;
}

.player-big-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(var(--orange-rgb),0.90);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(var(--orange-rgb),0.40), 0 2px 8px color-mix(in srgb, var(--black) 50%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.player-big-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(var(--orange-rgb),0.50), 0 4px 12px color-mix(in srgb, var(--black) 50%, transparent);
}

.player-big-play-btn svg {
  width: 28px;
  height: 28px;
  fill: white;
  margin-left: 4px;
}

.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, color-mix(in srgb, var(--black) 80%, transparent) 0%, transparent 100%);
  padding: var(--space-3) var(--space-4);
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.player-wrap:hover .player-controls { opacity: 1; }
body.review-page.portal-page .player-wrap:focus-within .player-controls { opacity: 1; }

.player-progress {
  height: 4px;
  background: rgba(var(--rf-tone-neutral-rgb), 0.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  margin-bottom: var(--space-2);
  transform-origin: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.player-progress:hover { background: rgba(var(--rf-tone-neutral-rgb), 0.28); transform: scaleY(1.5); }

.player-progress-filled {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  position: relative;
  pointer-events: none;
}

.player-progress-filled::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--black) 50%, transparent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.player-progress:hover .player-progress-filled::after { opacity: 1; }

.comment-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.timeline-comment-hint {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  color: rgba(var(--rf-tone-neutral-rgb), 0.3);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
#progress:hover .timeline-comment-hint,
.player-progress:hover .timeline-comment-hint {
  opacity: 1;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
}

.player-btn {
  background: transparent;
  border: none;
  color: rgba(var(--rf-tone-neutral-rgb), 0.75);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.player-btn:hover {
  color: white;
  background: rgba(var(--rf-tone-neutral-rgb), 0.1);
}

.player-btn svg { width: 18px; height: 18px; fill: currentColor; }

.player-volume-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.player-volume {
  width: 60px;
  height: 3px;
  background: rgba(var(--rf-tone-neutral-rgb), 0.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.player-volume-filled {
  height: 100%;
  background: rgba(var(--rf-tone-neutral-rgb), 0.7);
  border-radius: 2px;
  pointer-events: none;
}

.player-spacer { flex: 1; }

.player-time {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.player-speed-btn {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-11px, 11px);
  padding: 4px 8px;
  color: var(--text-secondary);
}
