/* Shared editorial palette and type roles for every active portfolio page. */
html[data-cup-portfolio-theme],
body[data-cup-portfolio-theme] {
  --portfolio-paper: #f8f5ed;
  --portfolio-ink: #443d32;
  --portfolio-muted: #695e53;
  --portfolio-line: #443d3229;
  --portfolio-serif: 'Cup PS Times', Georgia, serif;
  --portfolio-sans: 'Cup Helvetica Neue', 'Helvetica Neue', Arial, sans-serif;
  --portfolio-title-size: clamp(43px, 5.2vw, 100px);
  --portfolio-heading-size: clamp(30px, 3.3vw, 58px);
  --portfolio-heading-leading: 1.05;
  --portfolio-subheading-size: clamp(23px, 2.3vw, 36px);
  --portfolio-copy-size: clamp(16px, 1.5vw, 21px);
  --portfolio-meta-size: 14px;
  --portfolio-eyebrow-size: 12px;
  --portfolio-text: var(--portfolio-ink);
  --portfolio-secondary: var(--portfolio-muted);
  --paper: var(--portfolio-paper) !important;
  --cup-paper: var(--portfolio-paper) !important;
  --ink: var(--portfolio-ink) !important;
  --cup-ink: var(--portfolio-ink) !important;
  --muted: var(--portfolio-muted) !important;
  --cup-muted: var(--portfolio-muted) !important;
  --cup-line: var(--portfolio-line) !important;
  --sans: var(--portfolio-sans) !important;
  --serif: var(--portfolio-serif) !important;
  --slim-canvas: var(--portfolio-paper) !important;
  --slim-plate: var(--portfolio-paper) !important;
  --slim-muted: var(--portfolio-muted) !important;
  --assistant-ink: var(--portfolio-ink) !important;
  --assistant-muted: var(--portfolio-muted) !important;
  --assistant-rule: var(--portfolio-line) !important;
  --showcase-ink: var(--portfolio-ink) !important;
  --showcase-muted: var(--portfolio-muted) !important;
  --showcase-line: var(--portfolio-line) !important;
  background: var(--portfolio-paper) !important;
  color: var(--portfolio-ink) !important;
  color-scheme: light;
}

body[data-cup-portfolio-theme] {
  font: 400 var(--portfolio-copy-size)/1.5 var(--portfolio-sans) !important;
}

/* Inverse text belongs to the film surface, not the surrounding page. */
body[data-cup-portfolio-theme] :where(
  .beyond-hero, .beyond-player, .dior-player, .estate-player,
  .beyond-preview-play, .showcase-devices button[aria-pressed="true"]
) {
  --portfolio-text: var(--portfolio-paper);
  --portfolio-secondary: var(--portfolio-paper);
  color: var(--portfolio-paper) !important;
}

body[data-cup-portfolio-theme] h1 {
  max-inline-size: 100%;
  font: 400 var(--portfolio-title-size)/.99 var(--portfolio-serif) !important;
  letter-spacing: -.035em !important;
  color: var(--portfolio-text) !important;
  text-wrap: balance;
  overflow-wrap: break-word;
}
body[data-cup-portfolio-theme] :where(h1, h2, h3) :where(em, i) {
  font-family: inherit !important;
  font-style: normal !important;
}
body[data-cup-portfolio-theme] h2 {
  font: 400 var(--portfolio-heading-size)/var(--portfolio-heading-leading) var(--portfolio-serif) !important;
  letter-spacing: normal !important;
  color: var(--portfolio-text) !important;
  overflow-wrap: break-word;
}
body[data-cup-portfolio-theme] :where(h3, .skin-study-name, .skin-projects-link, .assistant-examples dt) {
  font: 400 var(--portfolio-subheading-size)/1.12 var(--portfolio-serif) !important;
  letter-spacing: normal !important;
  color: var(--portfolio-text) !important;
}
body[data-cup-portfolio-theme] :where(p, dd, .assistant-facts dt):not(:where(
  .assistant-banner-copy p, .assistant-banner-caption, .light-wordmark *
)) {
  font: 400 var(--portfolio-copy-size)/1.5 var(--portfolio-sans) !important;
  letter-spacing: normal !important;
  color: var(--portfolio-text) !important;
}
body[data-cup-portfolio-theme] a { color: var(--portfolio-text) !important; }

body[data-cup-portfolio-theme] :where(
  button, summary, .cup-portfolio-back, .projects-back, .case-credit,
  .beyond-watch span,
  .case-intro-link, .showcase-action, .showcase-live, .corner-control,
  .beyond-quiet-link, .beyond-contact, .beyond-related-category,
  .project-credits, .project-credits li, .beyond-credits, .beyond-credits li,
  .credits, .photo-case-viewer-top p, .photo-case-viewer-caption,
  .fashion-viewer-top p, .fashion-viewer-caption,
  .jewellery-viewer-top p, .jewellery-viewer-caption,
  .estate-player-header p, .dior-player-header p, .showcase-foot p,
  .cgi-pipeline, .cgi-object-controls, .cgi-object-controls span,
  .beyond-production-note, #detail-category,
  .cartier-stills-credit, .estate-credit, .estate-image-credits, .skin-study-note,
  .owala-disclosure, .after-colophon > p,
  .photo-case-more-action, .fashion-more-action, .jewellery-more-action,
  .concept-more > summary > span + span, .after-more > summary > span + span
) {
  font: 400 var(--portfolio-meta-size)/1.5 var(--portfolio-sans) !important;
  letter-spacing: normal !important;
  color: var(--portfolio-text) !important;
}
body[data-cup-portfolio-theme] figcaption:not(:has(h2, h3, p)):not(.light-wordmark),
body[data-cup-portfolio-theme] :where(
  .photo-case-viewer-caption, .fashion-viewer-caption, .jewellery-viewer-caption,
  .cgi-pipeline, .beyond-production-note, .showcase-foot p,
  .cartier-stills-credit, .estate-credit, .estate-image-credits, .skin-study-note,
  .owala-disclosure, .after-colophon > p
) {
  font: 400 var(--portfolio-meta-size)/1.5 var(--portfolio-sans) !important;
  letter-spacing: normal !important;
  color: var(--portfolio-secondary) !important;
}

body[data-cup-portfolio-theme] :where(
  .case-intro-kicker, .site-case-kicker, .art-kicker, .cgi-category,
  .after-eyebrow, .beyond-eyebrow, .photo-case-eyebrow,
  .fashion-eyebrow, .jewellery-eyebrow, .campaign-eyebrow,
  .dior-eyebrow, .estate-eyebrow, .assistant-eyebrow,
  .light-index, .skin-eyebrow, .kicker, .directory-kind, .project-category
) {
  font: 400 var(--portfolio-eyebrow-size)/1.4 var(--portfolio-sans) !important;
  letter-spacing: .08em !important;
  color: var(--portfolio-secondary) !important;
}

/* These existing display roles use links, spans or paragraphs. */
body[data-cup-portfolio-theme] :where(
  .beyond-signature, .assistant-transcript p,
  .photo-case-more-title, .fashion-more-title, .jewellery-more-title,
  .concept-more > summary > span:first-child,
  .after-more > summary > span:first-child, .skin-archive-action,
  .case-next, .campaign-next > a
) {
  font: 400 var(--portfolio-heading-size)/var(--portfolio-heading-leading) var(--portfolio-serif) !important;
  letter-spacing: normal !important;
  color: var(--portfolio-text) !important;
}
body[data-cup-portfolio-theme] .beyond-player-header h2 {
  font: 400 24px/1.2 var(--portfolio-serif) !important;
}
body[data-cup-portfolio-theme] .directory-list a {
  font: 400 clamp(22px, 1.75vw, 30px)/1.2 var(--portfolio-serif) !important;
  color: var(--portfolio-ink) !important;
}

/* Neutral page surfaces share the same paper, including photo viewers. */
body[data-cup-portfolio-theme] :where(
  .photo-case-viewer, .fashion-viewer, .jewellery-viewer, .project-detail,
  .cup-portfolio-back, .case-header .case-link, .projects-header,
  .music-toggle, .menu-transition-cover
) {
  background-color: var(--portfolio-paper) !important;
  color: var(--portfolio-ink) !important;
}
body[data-cup-portfolio-theme] :where(
  .photo-case-viewer, .fashion-viewer, .jewellery-viewer, .project-detail
)::backdrop { background: var(--portfolio-paper) !important; }
html[data-cup-portfolio-theme].menu-arrival body::after {
  background: var(--portfolio-paper) !important;
}
body[data-cup-portfolio-theme] .surface-light {
  background: radial-gradient(ellipse at var(--light-x, 28%) var(--light-y, 42%), #f8f5ed, #f8f5ed00 52%) !important;
}
body[data-cup-portfolio-theme] .showcase-devices button[aria-pressed="true"] {
  background-color: var(--portfolio-ink) !important;
  color: var(--portfolio-paper) !important;
}

@media (max-width: 760px) {
  html[data-cup-portfolio-theme], body[data-cup-portfolio-theme] {
    --portfolio-title-size: clamp(38px, 10.5vw, 62px);
    --portfolio-heading-size: clamp(30px, 7.7vw, 36px);
    --portfolio-heading-leading: 1.12;
    --portfolio-subheading-size: clamp(24px, 6.2vw, 30px);
    --portfolio-copy-size: 18px;
  }
  body[data-cup-portfolio-theme] h2 { line-height: 1.12 !important; }
}
