html body.works-standalone { --works-detail-top: 156px; }
/* Portfolio details: scrolling media and a pinned, independently readable summary. */
html body.works-standalone .works-detail-snap {
    padding-top: var(--works-detail-top) !important;
    padding-bottom: 100px !important;
    overflow: visible !important;
    will-change: auto;
}
html body.works-standalone .works-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(28px, 3.5vw, 68px);
    width: calc(100% - clamp(24px, 3vw, 64px) * 2);
    max-width: 2040px;
    margin: 0 auto;
    padding: 0 !important;
    overflow: visible;
    transform: none !important;
}
html body.works-standalone .works-detail-gallery { min-width: 0; text-align: left; }
html body.works-standalone .works-detail-gallery :is(.works-image-wrapper, .video-container) {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 24px !important;
}
html body.works-standalone .works-detail-gallery .works-detail-img {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin-inline: 0 !important;
    border-radius: 16px;
    content-visibility: visible;
    contain-intrinsic-size: none;
}
html body.works-standalone .works-detail-gallery .works-detail-img + .works-detail-img { margin-top: 24px !important; }
html body.works-standalone .works-detail-summary {
    --preview-title-size: clamp(30px, 2.65vw, 46px);
    position: sticky;
    top: var(--works-detail-top);
    max-height: calc(100dvh - var(--works-detail-top) - 112px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #7775 transparent;
    overscroll-behavior-y: auto;
    min-width: 0;
    padding: 0 12px 12px 0;
    scroll-padding-block: 16px;
}
html body.works-standalone .works-detail-summary:focus-visible { outline: 2px solid #ff6e2e; outline-offset: 6px; }
html body.works-standalone .works-detail-summary-content { margin: 0 !important; padding: 0 !important; text-align: left; }
html body.works-standalone .works-detail-summary .works-detail-actions { justify-content: flex-start; margin: 22px 0 28px; }
html body.works-standalone .works-detail-summary .project-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    margin: 0 !important;
    width: 100%;
}
html body.works-standalone .works-detail-summary .project-detail-title { font-size: 17px !important; margin: 0 0 7px; }
html body.works-standalone .works-detail-summary .project-detail-body { font-size: 17px !important; line-height: 1.7; }
@media (max-width: 1100px) {
    html body.works-standalone .works-detail-snap { padding-top: 132px !important; padding-bottom: 72px !important; }
    html body.works-standalone .works-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; width: calc(100% - 40px); max-width: 820px; }
    html body.works-standalone .works-detail-summary { position: static; max-height: none; overflow: visible; padding: 0; grid-row: 1; --preview-title-size: clamp(30px, 5vw, 42px); }
    html body.works-standalone .works-detail-summary .project-detail-body { font-size: 17px !important; }
    html body.works-standalone .works-detail-gallery { grid-row: 2; }
}
/* Do not let the global horizontal overflow guard create a non-scrolling
   ancestor for position: sticky. Clip horizontally without a scroll container. */
html:has(body.works-standalone) { overflow-x: clip !important; }
html body.works-standalone { overflow-x: clip !important; overflow-y: visible !important; }
html body.works-standalone #app-container { overflow: visible !important; scroll-snap-type: none; }

/* Consistent title-to-copy spacing, including projects with no external actions. */
html body.works-standalone .works-detail-summary-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
html body.works-standalone .works-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
html body.works-standalone .works-detail-heading h1 { flex: 1; min-width: 0; }
html body.works-standalone .works-detail-summary .works-detail-actions { margin: 0; }
html body.works-standalone .works-detail-bottom-actions { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
/* Heading tools share their dimensions; the external site action remains optional. */
html body.works-standalone .works-detail-heading-tools { display: flex; flex: 0 0 auto; align-items: flex-start; gap: 10px; }
html body.works-standalone :is(.works-detail-site-link, .works-detail-share) {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .25s ease;
}
html body.works-standalone .works-detail-site-link { background: #ff6e2e; color: #0b0b0b !important; }
html body.light-mode.works-standalone .works-detail-site-link { color: #fcfcfc !important; }
html body.works-standalone .works-detail-site-link:is(:hover, :focus-visible) { background: rgba(255,110,46,.8); }
html body.works-standalone :is(.works-detail-site-link, .works-detail-share) svg { display: block; color: inherit; }
html body.works-standalone .works-detail-site-link svg { transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
html body.works-standalone .works-detail-site-link:is(:hover, :focus-visible) svg { transform: translate(2px, -2px); }
html body.works-standalone .works-detail-share { color: #ff6e2e !important; background: #1f1f1f; }
html body.light-mode.works-standalone .works-detail-share { background: #f5f5f5; }
html body.works-standalone .works-detail-share:is(:hover, :focus-visible) { background: #292929; }
html body.light-mode.works-standalone .works-detail-share:is(:hover, :focus-visible) { background: #ebebeb; }
html body.works-standalone :is(.works-detail-site-link, .works-detail-share):focus-visible { outline: 2px solid #ff6e2e; outline-offset: 4px; }

html body.works-standalone .works-detail-bottom-actions .works-detail-action {
    min-height: 48px;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    transition: background-color .25s ease;
}
html body.works-standalone .works-detail-bottom-actions .works-detail-consult { background: #ff6e2e; border-color: transparent; color: #fff !important; }
html body.works-standalone .works-detail-bottom-actions .works-detail-consult:is(:hover, :focus-visible) { background: #ed6127; }
html body.works-standalone .works-detail-bottom-actions .works-detail-action-secondary { background: transparent; border: 1px solid #ff6e2e; color: #ff6e2e !important; }
html body.works-standalone .works-detail-bottom-actions .works-detail-action-secondary:is(:hover, :focus-visible) { background: #1f1f1f; border-color: #ff6e2e; color: #ff6e2e !important; }
html body.light-mode.works-standalone .works-detail-bottom-actions .works-detail-action-secondary:is(:hover, :focus-visible) { background: #f5f5f5; }
html body.works-standalone .works-detail-bottom-actions a:focus-visible { outline: 2px solid #ff6e2e; outline-offset: 4px; }

/* Full-width stationary fade, independent of the floating scroll label. */
html body.works-standalone #scroll-hint-overlay { left: 50% !important; display: flex !important; color: #fcfcfc !important; }
html body.light-mode.works-standalone #scroll-hint-overlay { color: #0b0b0b !important; }
html body.works-standalone::after {
    content: '';
    position: fixed;
    inset: auto 0 0;
    height: calc(170px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to bottom, transparent, #0b0b0b 76%);
    pointer-events: none;
    z-index: 119;
    opacity: 0;
    transition: opacity .25s ease;
}
html body.light-mode.works-standalone::after { background: linear-gradient(to bottom, rgba(252,252,252,0), #fcfcfc 76%); }
html body.works-standalone:has(#scroll-hint-overlay.visible)::after { opacity: 1; }
@media (max-width: 600px) {
    html body.works-standalone .works-detail-heading { gap: 12px; }
    html body.works-standalone .works-detail-heading-tools { gap: 8px; }
    html body.works-standalone :is(.works-detail-site-link, .works-detail-share) { width: 44px; height: 44px; flex-basis: 44px; }
    html body.works-standalone .works-detail-bottom-actions .works-detail-action { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    html body.works-standalone :is(.works-detail-site-link, .works-detail-share),
    html body.works-standalone .works-detail-site-link svg { transition: none; }
}

html body.works-standalone #scroll-hint-overlay.visible { opacity: 1 !important; visibility: visible !important; }
@media (max-width: 600px) {
    html body.works-standalone #scroll-hint-overlay { font-size: 12px; gap: 8px; }
    html body.works-standalone #scroll-hint-overlay .scroll-hint-chevron { width: 17px; height: 22px; flex-basis: 17px; }
}

/* Dark consultation label; light-mode label remains white. */
html body.works-standalone:not(.light-mode) .works-detail-bottom-actions .works-detail-consult { color: #0b0b0b !important; }
/* Phone-only refinements: do not alter desktop proportions or tool placement. */
@media (max-width: 768px) {
    html body.works-standalone .works-detail-heading { flex-direction: column; gap: 16px; }
    html body.works-standalone .works-detail-heading h1 { flex: none; }
    html body.works-standalone :is(.works-detail-site-link, .works-detail-share) { width: 40px; height: 40px; flex-basis: 40px; }
    html body.works-standalone :is(.works-detail-site-link, .works-detail-share) svg { width: 20px; height: 20px; }
    html body.works-standalone .works-detail-summary :is(.project-detail-title, .project-detail-body) { font-size: 16px !important; }
    html body.works-standalone .works-detail-bottom-actions .works-detail-action { font-size: 15px; min-height: 44px; padding: 12px 16px; }
}

/* Central play action stays legible over footage in both site themes. */
html body.works-standalone .works-video-player .works-video-play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(54px, 5vw, 72px);
    height: clamp(54px, 5vw, 72px);
    padding: 0;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 50%;
    background: rgba(11,11,11,.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff !important;
    cursor: pointer;
    transition: background-color .22s ease, border-color .22s ease;
}
html body.works-standalone .works-video-player .works-video-play svg {
    display: block;
    width: 30px;
    height: 30px;
    color: #fff !important;
}
html body.works-standalone .works-video-player .works-video-play:hover {
    background: #ff6e2e;
    border-color: #ff6e2e;
}
html body.works-standalone .works-video-player .works-video-play:focus-visible {
    outline: 3px solid #ff6e2e;
    outline-offset: 4px;
}
html body.works-standalone .works-video-player .works-video-play[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
    html body.works-standalone .works-video-player .works-video-play { transition: none; }
}
