/* Work page. #___gatsby prefixes outrank the old site-wide text and link rules. */
html { --wp-bg: #F4F5F6; --wp-text: #121315; --wp-muted: #52555A; --wp-line: #D8DADD; }
html.ch-theme-dark { --wp-bg: #08090A; --wp-text: #F3F4F5; --wp-muted: #A4A8AE; --wp-line: rgba(255, 255, 255, 0.13); }

#___gatsby .wp { overflow: clip; background: var(--wp-bg); color: var(--wp-text); text-align: left; }
#___gatsby .wp :is(h1, h2, strong, li):not(#wp) { color: var(--wp-text) !important; }
#___gatsby .wp p:not(#wp) { margin: 0; color: var(--wp-muted) !important; }
#___gatsby .wp ul:not(#wp) { margin: 0; padding: 0; list-style: none; }
#___gatsby .wp a:not(#wp) { z-index: auto !important; text-decoration: none; }
#___gatsby .wp :is(h1, h2):not(#wp) { margin: 0; font-weight: 800; }

/* ---------- hero ---------- */
.wp-hero { padding-top: 150px; padding-bottom: 60px; }
.wp-hero-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 0 clamp(20px, 5vw, 80px) 56px; }
#___gatsby .wp .wp-hero h1:not(#wp) { max-width: 8em; font-size: clamp(54px, 10vw, 150px); line-height: 0.9; letter-spacing: -0.045em; }
.wp-hero h1 em { font-style: normal; color: #F05526; }
#___gatsby .wp .wp-hero p:not(#wp) { max-width: 30ch; font-size: 17px; line-height: 1.55; }
.wp-rows { display: grid; gap: 14px; transform: rotate(-3deg) scale(1.04); }
.wp-row { display: flex; gap: 14px; width: max-content; will-change: transform; }
.wp-row img { width: clamp(220px, 27vw, 400px); aspect-ratio: 3 / 2; border-radius: 16px; object-fit: cover; }

/* ---------- sideways gallery ---------- */
.wp-side { position: relative; }
.wp-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
.wp-track { display: flex; gap: 28px; width: max-content; padding: 0 6vw; will-change: transform; }
.wp-intro { display: flex; flex-direction: column; justify-content: center; width: min(34vw, 420px); padding-right: 20px; }
.wp-intro span { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #F05526; }
#___gatsby .wp .wp-intro h2:not(#wp) { margin: 16px 0 30px; font-size: clamp(36px, 4.6vw, 68px); line-height: 1; letter-spacing: -0.035em; }
.wp-intro b { font-size: 54px; line-height: 1; animation: wp-nudge 1.4s ease-in-out infinite; }
@keyframes wp-nudge { 50% { transform: translateX(14px); } }
#___gatsby .wp a.wp-panel:not(#wp) { position: relative; flex: 0 0 min(76vw, 1060px); height: min(76vh, 640px); margin-top: 60px; border-radius: 28px; overflow: hidden; background: color-mix(in srgb, var(--c) 58%, #000); color: #FFFFFF; isolation: isolate; }
.wp-panel-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.wp-panel-media img { width: 118%; max-width: none; height: 100%; margin-left: -9%; object-fit: cover; translate: var(--x, 0px) 0; }
.wp-panel::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 38%, var(--c) 96%); }
.wp-ghost { position: absolute; left: 3%; top: 1%; font-family: "Cabinet Grotesk", sans-serif; font-size: clamp(60px, 9vw, 140px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; white-space: nowrap; color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.75); translate: var(--g, 0px) 0; pointer-events: none; }
.wp-panel-text { position: absolute; left: 36px; right: 36px; bottom: 30px; }
.wp-panel-text small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.wp-panel-text strong { display: block; margin: 8px 0 6px; font-family: "Cabinet Grotesk", sans-serif; font-size: clamp(34px, 4.4vw, 62px); line-height: 1; color: #FFFFFF; }
#___gatsby .wp .wp-panel-text strong:not(#wp) { color: #FFFFFF !important; }
.wp-panel-text > span { display: block; max-width: 56ch; font-size: 15.5px; line-height: 1.5; }
.wp-progress { position: absolute; left: 6vw; right: 6vw; bottom: 26px; height: 3px; border-radius: 3px; background: var(--wp-line); }
.wp-progress i { display: block; height: 100%; border-radius: 3px; background: #F05526; transform: scaleX(var(--done, 0)); transform-origin: left; }

/* ---------- stories ---------- */
.wp-stories { padding: clamp(90px, 12vw, 180px) clamp(20px, 5vw, 80px) 0; }
.wp-story { position: relative; display: grid; grid-template-columns: 8fr 4fr; align-items: center; gap: clamp(30px, 5vw, 80px); max-width: 1320px; margin: 0 auto clamp(110px, 16vw, 230px); }
.wp-story.is-flipped { grid-template-columns: 4fr 8fr; }
.wp-story.is-flipped .wp-story-text { order: -1; }
#___gatsby .wp a.wp-shot:not(#wp) { position: relative; display: block; aspect-ratio: 16 / 11; border-radius: 24px; overflow: hidden; background: var(--c); clip-path: inset(12% 12% 12% 12% round 24px); transition: clip-path 1s cubic-bezier(0.16, 1, 0.3, 1); }
#___gatsby .wp .wp-story.is-in a.wp-shot:not(#wp) { clip-path: inset(0 0 0 0 round 24px); }
.wp-shot img { position: absolute; left: 0; top: -12%; width: 100%; height: 124%; object-fit: cover; }
.wp-float { position: absolute; bottom: -70px; width: clamp(150px, 20vw, 300px); aspect-ratio: 4 / 3; border: 6px solid var(--wp-bg); border-radius: 20px; object-fit: cover; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.55); pointer-events: none; }
.wp-story .wp-float { left: 54%; }
.wp-story.is-flipped .wp-float { left: auto; right: 54%; }
.wp-story-text small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #F05526; }
#___gatsby .wp .wp-story-text h2:not(#wp) { margin: 12px 0 16px; font-size: clamp(38px, 4.6vw, 68px); line-height: 0.98; letter-spacing: -0.035em; }
#___gatsby .wp .wp-story-text p:not(#wp) { font-size: 16px; line-height: 1.6; }
#___gatsby .wp .wp-story-text a { display: inline-block; margin-top: 24px; padding-bottom: 4px; border-bottom: 2px solid #F05526; color: var(--wp-text); font-size: 15px; font-weight: 700; }

/* ---------- index ---------- */
.wp-index { position: relative; max-width: 1320px; margin: 0 auto; padding: 20px clamp(20px, 5vw, 80px) clamp(90px, 10vw, 150px); }
#___gatsby .wp .wp-index h2:not(#wp) { margin-bottom: 34px; font-size: clamp(32px, 4vw, 56px); letter-spacing: -0.03em; }
#___gatsby .wp .wp-index a { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 22px 0; border-top: 1px solid var(--wp-line); color: var(--wp-text); transition: padding 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.wp-index li:last-child a { border-bottom: 1px solid var(--wp-line); }
.wp-index strong { font-family: "Cabinet Grotesk", sans-serif; font-size: clamp(28px, 4.6vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; transition: color 0.2s; }
.wp-index a span { font-size: 14px; color: var(--wp-muted); text-align: right; }
#___gatsby .wp .wp-index a:hover { padding-left: 22px; }
#___gatsby .wp .wp-index a:hover strong:not(#wp) { color: #F05526 !important; }
.wp-preview { position: fixed; z-index: 40; left: 0; top: 0; width: 340px; aspect-ratio: 3 / 2; border-radius: 16px; object-fit: cover; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55); pointer-events: none; opacity: 0; transform: translate(-999px, -999px); transition: opacity 0.2s; }
.wp-preview.is-on { opacity: 1; }

/* "View" bubble over project images */
.wp-cursor { position: fixed; z-index: 50; left: 0; top: 0; display: grid; width: 84px; height: 84px; margin: -42px 0 0 -42px; place-items: center; border-radius: 50%; background: #F05526; color: #FFFFFF; font-size: 14px; font-weight: 800; pointer-events: none; opacity: 0; scale: 0.4; transition: opacity 0.2s, scale 0.3s cubic-bezier(0.34, 1.7, 0.5, 1); }
.wp-cursor.is-on { opacity: 1; scale: 1; }

/* ---------- small screens: no pinning, no pointer extras ---------- */
@media (max-width: 900px) {
    .wp-hero { padding-top: 120px; }
    .wp-side { height: auto !important; }
    .wp-stage { position: static; height: auto; display: block; }
    .wp-track { flex-direction: column; width: auto; padding: 60px 16px 0; transform: none !important; }
    .wp-intro { width: auto; }
    .wp-intro b, .wp-progress, .wp-cursor, .wp-preview { display: none; }
    #___gatsby .wp a.wp-panel:not(#wp) { flex: none; height: 460px; margin-top: 0; }
    .wp-panel-text { left: 22px; right: 22px; bottom: 22px; }
    .wp-story, .wp-story.is-flipped { grid-template-columns: minmax(0, 1fr); }
    .wp-story.is-flipped .wp-story-text { order: 0; }
    .wp-float { display: none; }
    .wp-story-text { translate: none !important; }
    .wp-index a span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .wp-side { height: auto !important; }
    .wp-stage { position: static; height: auto; overflow-x: auto; }
    .wp-track { transform: none !important; }
    .wp-intro b { animation: none; }
    #___gatsby .wp a.wp-shot:not(#wp) { clip-path: none; }
}

/* shade the top of each panel so the outline title reads on bright photos */
.wp-panel::after { background: linear-gradient(color-mix(in srgb, var(--c) 58%, #000) 0, transparent 34%, transparent 40%, color-mix(in srgb, var(--c) 58%, #000) 96%); }
/* tighter hero so the moving rows show on short screens */
@media (min-width: 901px) {
    .wp-hero { padding-top: 112px; }
    .wp-hero-head { padding-bottom: 36px; }
    #___gatsby .wp .wp-hero h1:not(#wp) { max-width: 14em; font-size: clamp(54px, min(8vw, 14vh), 130px); }
}

/* home page: a link to every project under the heading */
#___gatsby .wp .wp-intro a.wp-more:not(#wp) { align-self: flex-start; margin: -8px 0 26px; padding: 11px 22px; border: 1px solid var(--wp-line); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--wp-text); transition: background 0.2s, color 0.2s; }
#___gatsby .wp .wp-intro a.wp-more:not(#wp):hover { background: var(--wp-text); color: var(--wp-bg); }
